:root {
  color-scheme: only light;
  --ink: #192f3d;
  --muted: #53636d;
  --line: #d0d7d9;
  --soft: #eff2f3;
  --paper: #ffffff;
  --accent: #193f55;
  --accent-hover: #102e40;
  --gold: #806125;
  --error: #ad2631;
  --radius: 8px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: #f4f3ef;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); font-size: 14px; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #397a9b; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 16px; padding: 10px 16px; background: var(--paper); z-index: 10; transform: translateY(-180%); border: 1px solid var(--accent); border-radius: var(--radius); }
.skip-link:focus { transform: none; }
.topbar, .page { max-width: 1240px; margin-inline: auto; }
.topbar { min-height: 80px; padding-block: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #c7cfce; }
.brand { min-width: 0; display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; letter-spacing: -.4px; }
.brand-mark { display: block; width: 44px; height: 44px; flex: 0 0 44px; object-fit: contain; }
.topbar-tools { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.environment { font-size: 12px; color: var(--muted); padding: 4px 10px; border-left: 2px solid var(--gold); }
.language-select { width: auto; min-width: 132px; min-height: 44px; padding: 8px 48px 8px 12px; font-size: 14px; background-color: var(--paper); }
.page-heading { padding: 32px 0 28px; }
h1 { margin: 0; font-size: 32px; font-weight: 650; letter-spacing: -.9px; line-height: 1.25; }
.intro { max-width: 64ch; color: var(--muted); margin: 10px 0 0; font-size: 14px; line-height: 1.7; }
.required-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0,1fr) 320px; align-items: start; gap: 28px; }
.workspace > form, .entry-fields { min-width: 0; }
.entry-fields { margin: 0; padding: 0; border: 0; }
.section { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-bottom: 28px; }
.section-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 26px; }
.section-number { padding-top: 2px; font-size: 14px; font-weight: 650; color: var(--gold); font-variant-numeric: tabular-nums; }
.section-heading h2, .summary-card h2, .job-panel h2 { font-size: 19px; font-weight: 650; line-height: 1.4; letter-spacing: -.3px; margin: 0 0 5px; }
.section-heading p { margin: 0; font-size: 13px; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 20px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field label, .route-label, .route-stop-heading label { color: var(--ink); font-size: 13px; font-weight: 650; }
.optional { font-weight: 400; color: var(--muted); }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 48px; padding: 11px 12px; border: 1px solid #93a1a8; border-radius: var(--radius); background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.5; transition: border-color 320ms var(--ease-out), box-shadow 320ms var(--ease-out), background-color 320ms var(--ease-out); }
textarea { resize: vertical; min-height: 88px; }
input:hover, select:hover, textarea:hover { border-color: #526a79; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background-color: #fcfeff; outline: 0; box-shadow: 0 0 0 3px #d6e6ed; }
.field:focus-within > label { color: var(--accent); }
input::placeholder, textarea::placeholder { color: #65747d; opacity: 1; font-weight: 400; }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=date] { -webkit-appearance: none; appearance: none; }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border: 1.5px solid var(--error); background-color: #fff5f5; box-shadow: 0 0 0 2px #f6dce0; }
input[aria-invalid=true]:focus, select[aria-invalid=true]:focus, textarea[aria-invalid=true]:focus { box-shadow: 0 0 0 3px #f0c9ce; }
.route-field[aria-invalid=true] > .route-panel { border-color: var(--error); background: #fff5f5; }
.field-error-shake { animation: field-shake 380ms ease-out; }
.field-help { margin: 2px 0 0; font-size: 12px; line-height: 1.65; color: var(--muted); }
.field-error { margin: 0; font-size: 13px; line-height: 1.5; color: var(--error); }
.required { color: var(--gold); }
.group-divider { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 2px 0; }
.button { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 15px; border: 1px solid transparent; border-radius: var(--radius); font-size: 13px; font-weight: 650; line-height: 1.5; transition: background-color 300ms var(--ease-out), border-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out), transform 220ms var(--ease-out); }
.button:active:not(:disabled) { transform: scale(.98); }
.button-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 3px #193f5514; }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); }
.button-secondary { background: var(--paper); border-color: #93a1a8; color: var(--ink); }
.button-secondary:hover:not(:disabled) { background: #edf3f6; border-color: var(--accent); }
.button-text { background: transparent; color: var(--muted); padding: 8px 10px; }
.button-text:hover:not(:disabled) { color: var(--ink); background: #e6ecef; }
.button-danger:hover:not(:disabled) { color: var(--error); background: #fcebee; }
.services-section { background: transparent; border: 0; padding: 0; }
.services-section > .section-heading { margin: 0 0 14px; }
.count-badge { margin-left: auto; white-space: nowrap; color: var(--muted); font-size: 12px; padding: 3px 0 3px 12px; border-left: 1px solid #bfcacb; }
.catalog-status { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.service-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.service-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: #edf1f2; border-bottom: 1px solid var(--line); }
.service-top h3 { margin: 0; font-size: 15px; font-weight: 650; white-space: nowrap; }
.service-actions { display: flex; gap: 2px; }
.service-actions .button { font-size: 12px; }
.service-body { padding: 24px; }
.service-body .field-grid { gap: 20px; }
.attendance-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.extras { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.extras-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.extras-heading h4 { margin: 0; font-size: 14px; font-weight: 650; }
.extras-heading .button { font-size: 13px; }
.extras-empty { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.extra-row { padding: 18px; margin-top: 12px; border-left: 3px solid #b4a37f; background: #f6f6f2; }
.extra-row .field-grid { gap: 16px; }
.extra-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.checkbox-label { min-height: 44px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.checkbox-label input { width: 20px; height: 20px; min-width: 20px; min-height: 20px; margin: 0; accent-color: var(--accent); box-shadow: none; }
.exclusion-hint { margin: 6px 0 0; font-size: 12px; color: #715019; }
.add-service { width: 100%; background: #f9faf9; }
.add-service > span:first-child { font-size: 21px; font-weight: 400; line-height: 1; }
.add-service > span[data-i18n] { font-size: 13px; font-weight: 650; line-height: 1.5; }
#service-limit { margin-top: 10px; }
.summary-column { position: sticky; top: 24px; }
.summary-card { padding: 24px; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); box-shadow: 0 8px 24px #263f4d08; }
.summary-description { margin: 10px 0 20px; min-height: 38px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.totals { margin: 0; }
.totals > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; font-size: 13px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals .total-line { display: block; margin-top: 14px; padding: 18px 0 0; border-top: 1px solid var(--line); }
.total-line dt { color: var(--ink); font-size: 13px; font-weight: 650; }
.total-line dd { font-size: 30px; letter-spacing: -.8px; line-height: 1.5; }
.generate-button { width: 100%; margin-top: 20px; justify-content: space-between; min-height: 48px; white-space: nowrap; }
.summary-footnote { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.exclusion-note { margin-top: 16px; padding: 14px; border-left: 3px solid #ad8537; background: #faf5e9; color: #72521b; font-size: 12px; }
.note-label { display: block; font-weight: 650; }
.exclusion-note > strong { display: block; margin-top: 3px; font-size: 17px; font-variant-numeric: tabular-nums; }
.exclusion-note p { margin: 6px 0 0; }
.template-note { display: flex; gap: 12px; padding: 20px 3px; color: var(--muted); }
.template-note strong { font-size: 13px; font-weight: 650; }
.template-note p { font-size: 12px; line-height: 1.65; margin: 4px 0 0; }
.document-icon { display: block; flex-shrink: 0; width: 23px; height: 29px; border: 1.5px solid #6c7f88; border-radius: 3px; position: relative; margin-top: 2px; }
.document-icon:after { content: ""; position: absolute; left: 5px; right: 5px; top: 9px; height: 1px; background: #6c7f88; box-shadow: 0 5px #6c7f88, 0 10px #6c7f88; }
.error-summary { margin-bottom: 24px; padding: 18px 20px; border: 1px solid #d48c95; border-left: 4px solid var(--error); border-radius: var(--radius); background: #fff5f5; color: #8b202b; }
.error-summary p { margin: 0 0 7px; font-weight: 650; }
.error-summary ul { margin: 7px 0 0; padding-left: 20px; }
.error-summary li { margin-top: 4px; }
.error-summary a { color: inherit; }
.job-panel { margin-top: 20px; padding: 24px; border: 1px solid #b6c7be; border-left: 3px solid #376f56; border-radius: var(--radius); background: #f4f8f5; scroll-margin-top: 24px; }
.job-symbol { margin-bottom: 12px; font-size: 24px; color: #245b44; }
.spinner { display: block; width: 54px; height: 4px; border-radius: 2px; background: linear-gradient(90deg,#cad8d0 25%,#376f56 50%,#cad8d0 75%); background-size: 200% 100%; animation: progress 1.3s ease-in-out infinite; }
.job-panel p { font-size: 13px; color: #315b48; margin: 8px 0 16px; }
.job-panel .button { width: 100%; margin-top: 7px; }
.job-panel .job-file { font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.job-panel .field-help { font-size: 12px; margin: 12px 0 0; }
.job-panel.failed { background: #fff5f5; border-color: #dba6ad; border-left-color: var(--error); }
.job-panel.failed p { color: #8b3440; }
.footer { margin: 8px 0 32px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.recommendations:empty { display: none; }
.recommendations { border-left: 3px solid #85a7b6; padding: 5px 0 5px 12px; }
.recommendations p { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.recommendation-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.recommendation-buttons .button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.field select[data-pick] { background-color: #f1f4f5; font-size: 14px; }
.route-summary-text { margin: 5px 0 12px; overflow-wrap: anywhere; font-weight: 500; }
.route-panel { padding: 18px; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #f3f6f7; }
.route-stop { margin-bottom: 18px; }
.route-stop-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.route-stop-heading:has(> .sr-only:only-child) { display: none; }
.route-manual { margin-bottom: 10px; }
.route-stop > select { background-color: #fff; }
.route-field, .field { scroll-margin-top: 20px; }

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 48px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 23px center, right 18px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.date-input-wrap { display: flex; position: relative; min-width: 0; }
.date-input-wrap > input { padding-right: 58px; }
.date-input-wrap > input::-webkit-calendar-picker-indicator { display: none; }
.calendar-toggle { position: absolute; top: 0; right: 1px; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--accent); transition: background-color 300ms var(--ease-out), transform 220ms var(--ease-out); }
.calendar-toggle::before { content: ""; width: 17px; height: 17px; border: 1.5px solid currentColor; border-radius: 3px; background: linear-gradient(currentColor,currentColor) center 4px / 100% 1.5px no-repeat; }
.calendar-toggle:hover:not(:disabled), .calendar-toggle[aria-expanded=true] { background-color: #e4eef3; }
.calendar-toggle:active:not(:disabled) { transform: scale(.94); }
.calendar-popover { position: fixed; z-index: 100; width: 340px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; padding: 14px; border: 1px solid #b9c6cc; border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 12px 36px #193f5526, 0 2px 6px #193f5514; transform-origin: top center; }
.calendar-popover.is-open { animation: calendar-open 380ms var(--ease-out) both; }
.calendar-popover.is-closing { pointer-events: none; animation: calendar-close 220ms ease-in both; }
.calendar-heading { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 6px; margin-bottom: 12px; }
.calendar-heading h2, .calendar-heading h3 { margin: 0; font-size: 16px; font-weight: 650; line-height: 1.5; text-align: center; }
.calendar-nav, .calendar-day { min-width: 0; min-height: 44px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; transition: background-color 280ms var(--ease-out), color 280ms var(--ease-out), box-shadow 280ms var(--ease-out), transform 200ms var(--ease-out); }
.calendar-nav { width: 44px; padding: 0; font-size: 23px; line-height: 1; }
.calendar-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.calendar-grid th { height: 32px; padding: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.calendar-grid td { padding: 0; text-align: center; }
.calendar-day { display: block; width: 100%; padding: 0; }
.calendar-nav:hover:not(:disabled), .calendar-day:hover:not(:disabled) { background-color: #eaf1f5; }
.calendar-day.is-today { box-shadow: inset 0 0 0 1px #8098a5; font-weight: 650; }
.calendar-day.is-selected, .calendar-day[aria-selected=true] { color: #fff; background-color: var(--accent); font-weight: 650; box-shadow: none; }
.calendar-day.is-selected:hover { background-color: var(--accent-hover); }
.calendar-day:active:not(:disabled), .calendar-nav:active:not(:disabled) { transform: scale(.94); }
.calendar-popover.is-selecting .calendar-day.is-selected { animation: calendar-select 200ms var(--ease-out); }
.calendar-day:focus-visible { outline-offset: -3px; }
.calendar-actions { display: flex; justify-content: space-between; gap: 8px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.calendar-actions > button { flex: 1; min-width: 0; min-height: 44px; padding: 8px 4px; border: 1px solid #93a1a8; border-radius: var(--radius); background: var(--paper); color: var(--ink); font-size: 12px; font-weight: 600; transition: background-color 280ms var(--ease-out), transform 200ms var(--ease-out); }
.calendar-actions > button:hover:not(:disabled) { background-color: #eaf1f5; }
.calendar-actions > button:active:not(:disabled) { transform: scale(.97); }
.calendar-day.is-other-month:not(.is-selected) { color: #65747d; }
@keyframes calendar-open { from { opacity: 0; transform: translateY(-7px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes calendar-close { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-4px) scale(.99); } }
@keyframes calendar-select { 0% { transform: scale(.9); } 70% { transform: scale(1.04); } 100% { transform: scale(1); } }
@media (forced-colors: active) {
  select { -webkit-appearance: auto; appearance: auto; background-image: none; padding-right: 12px; }
  .calendar-day.is-selected { color: HighlightText; background-color: Highlight; forced-color-adjust: none; }
  .calendar-popover { border-color: CanvasText; }
}

@keyframes field-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes progress { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (max-width: 1290px) {
  .topbar, .page { margin-inline: 24px; }
}
@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(0,1fr) 295px; gap: 20px; }
  .section { padding: 22px; }
  .services-section { padding: 0; }
  .summary-card, .job-panel { padding: 20px; }
  .service-body { padding: 20px; }
  .service-body .field-grid { gap: 18px 16px; }
  .generate-button { padding-inline: 11px; font-size: 12px; }
}
@media (max-width: 850px) {
  .workspace { display: flex; flex-direction: column; gap: 0; }
  .workspace > form, .summary-column { width: 100%; }
  .summary-column { position: static; }
  .summary-description { min-height: 0; }
  .generate-button { font-size: 14px; }
  .totals .total-line { display: flex; align-items: center; }
  .template-note { padding-block: 18px; }
}
@media (max-width: 600px) {
  .topbar, .page { margin-inline: 16px; }
  .topbar { min-height: 72px; padding-block: 14px; gap: 8px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .topbar-tools { gap: 0; }
  .environment { display: none; }
  .language-select { min-width: 128px; font-size: 16px; padding-inline: 10px 48px; }
  .page-heading { padding: 25px 0 22px; }
  h1 { font-size: 27px; letter-spacing: -.5px; }
  .intro { font-size: 13px; margin-top: 8px; }
  .required-note { margin-top: 10px; }
  .section { padding: 20px 18px; margin-bottom: 24px; }
  .services-section { padding: 0; }
  .section-heading { gap: 9px; margin-bottom: 22px; }
  .section-heading h2 { font-size: 18px; }
  .section-heading p { font-size: 12px; }
  .count-badge { padding-left: 8px; font-size: 11px; }
  .field-grid, .attendance-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .field-wide, .attendance-grid, .group-divider { grid-column: 1; }
  .field-grid > div[aria-hidden=true]:empty:not(.group-divider) { display: none; }
  .service-top { padding: 8px 12px; gap: 4px; }
  .service-top h3 { font-size: 14px; }
  .service-actions .button { font-size: 12px; padding-inline: 8px; }
  .service-body { padding: 20px 18px; }
  .service-body .field-grid { gap: 20px; }
  .field select[data-pick] { font-size: 16px; }
  .extra-row { padding: 16px 12px; margin-inline: -3px; }
  .extra-bottom { align-items: flex-start; gap: 4px; }
  .checkbox-label { font-size: 12px; }
  .route-panel { padding: 14px 12px; }
  .route-field > .button, .route-panel > .button { width: 100%; }
  .summary-card, .job-panel { padding: 22px 20px; }
  .total-line dd { font-size: 28px; }
  .footer { margin-top: 8px; }
}
@media (max-width: 360px) {
  .topbar, .page { margin-inline: 12px; }
  .brand { font-size: 14px; gap: 6px; }
  .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
  .language-select { min-width: 126px; }
  .service-top { flex-wrap: wrap; }
  .service-actions { margin-left: auto; }
  .count-badge { display: none; }
}
@media (pointer: coarse) {
  input, textarea, select, .field select[data-pick] { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .button:active:not(:disabled), .calendar-toggle:active:not(:disabled), .calendar-day:active:not(:disabled), .calendar-nav:active:not(:disabled), .calendar-actions > button:active:not(:disabled) { transform: none; }
  .spinner { background: #376f56; }
}
