/* U2-1: 色の値は :root に集約。旧クラスを保持。 */
:root {
  --car-row-mobile-photo-width:130px; --car-photo-mobile-ratio:4/3;
  --photo-control-circle-size:36px;
  --photo-control-circle-active:#e5e7eb;
  --sold-out-photo-grayscale:1; --sold-out-photo-opacity:0.65;

  --booking-background:#ffffff; --booking-soft:#f4f5f6;
  --booking-remaining:#d32f2f;
  --booking-card-line:var(--line); --booking-card-shadow:0 1px 3px rgba(0,0,0,.06);
  --booking-category-edge-shadow:linear-gradient(to right,var(--clear),var(--booking-soft));

  --photo-control-touch-width:24px; --booking-step-mobile-font:11px;
  --category-edge-width:24px; --category-edge-shadow:linear-gradient(to right,var(--clear),var(--surface-alt));

  --photo-control-mobile-width:28px; --photo-control-background:rgba(255,255,255,0.8);
  --filter-choice-size:20px; --photo-dialog-width:900px; --photo-dialog-height:70vh; --photo-dialog-max-width:95vw;
  --search-filter-width:240px; --car-result-photo-width:140px; --car-result-offer-width:180px;
  --car-photo-width: 180px; --car-photo-mobile-width: 100px; --car-offer-width: 200px; --touch-target: 44px;

  font-family: "Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;
  --primary: #3f57d9; --primary-hover: var(--primary); --primary-soft: #e8edff;
  --hover: #3348bb; --accent: var(--primary); --success: #216344; --success-soft: #e9f4ed;
  --warning: #77500c; --warning-soft: #fbf6e4; --warning-line: #d9b73a; --required: #a83a3a; --danger: #a62e36; --danger-soft: #fcebed;
  --text: rgba(0,0,0,0.87); --muted: #5b6b76; --line: #e5e7eb; --input-line: #627b8c;
  --background: #f5f8ff; --surface: #ffffff; --surface-alt: #edf0fa;
  --chrome-bg: #2d3e50; --chrome-text: #ffffff; --chrome-muted: #cbd5e1; --chrome-active: #43576d;
  --ota: #5d428d; --ota-soft: #f0ebf8; --web: #205e9a; --web-soft: #e9f1fa;
  --focus: #3f57d9; --backdrop: #152a3b80; --clear: transparent;
  --font-xs: 12px; --font-sm: 14px; --font-md: 16px; --font-lg: 24px; --font-xl: 32px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --radius-sm: 8px; --radius: 10px; --shadow: 0 3px 14px rgba(63,87,217,.07);
  color: var(--text); background: var(--background); font-size: var(--font-sm); line-height: 1.6;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
}
a {
    color: var(--primary);
}
header {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.brand {
    font-size: 19px;
    font-weight: 700;
    text-decoration: none;
}
header form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.shell {
    display: grid;
    grid-template-columns: 220px minmax(0,1fr);
}
nav {
    background: var(--chrome-bg);
    padding: 10px 12px;
    min-height: calc(100vh - 80px);
}
nav a {
    display: block;
    padding: 9px 12px;
    text-decoration: none;
    border-radius: 5px;
    color: var(--chrome-text);
}
nav a[aria-current] {
    background: var(--accent);
    color: var(--surface);
}
.nav-label {
    font-size: 12px;
    font-weight: bold;
    color: var(--chrome-muted);
    margin: 18px 12px 4px;
}
main {
    min-width: 0;
    padding: 24px;
}
h1 {
    font-size: 24px;
    margin: 0 0 20px;
}
h2 {
    font-size: 19px;
    margin: 24px 0 12px;
}
button,input,select,textarea {
    font: inherit;
    min-height: 40px;
    border: 1px solid var(--input-line);
    border-radius: 5px;
    padding: 8px 10px;
    max-width: 100%;
}
button {
    background: var(--accent);
    color: var(--surface);
    border-color: var(--accent);
    cursor: pointer;
}
button.secondary {
    background: var(--surface);
    color: var(--primary);
}
button:disabled {
    opacity: .5;
    cursor: default;
}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}
.toolbar {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}
input[type=checkbox] {
    min-height: 22px;
    width: 22px;
}
textarea {
    min-height: 90px;
    width: 100%;
}
.scroll {
    max-width: 100%;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    margin: 12px 0;
}
table {
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
    width: 100%;
    font-variant-numeric: tabular-nums;
}
th,td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
thead th {
    background: var(--surface-alt);
}
td.num {
    text-align: right;
}
table.matrix th:first-child {
    position: sticky;
    left: 0;
    background: var(--surface-alt);
    z-index: 2;
    min-width: 150px;
}
.matrix td {
    text-align: right;
    min-width: 78px;
}
.stop,.negative,.error {
    background: var(--danger-soft)!important;
    color: var(--danger);
}
.caution {
    background: var(--warning-soft)!important;
    color: var(--warning);
}
.muted {
    color: var(--muted);
    background: var(--background);
}
.sat {
    background: var(--web-soft);
}
.sun,.holiday {
    background: var(--danger-soft);
}
.notice {
    padding: 12px 16px;
    border-radius: 5px;
    background: var(--warning-soft);
    margin-bottom: 16px;
}
.empty {
    padding: 28px;
    text-align: center;
    background: var(--surface);
}
.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
}
.form-actions {
    grid-column: 1/-1;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 18px;
    border-radius: 7px;
    margin: 12px 0;
}
.bar {
    display: block;
    font-size: 12px;
    white-space: normal;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 5px;
    margin: 2px 0;
    text-align: left;
    min-height: 32px;
    width: 100%;
}
.bar.suspension {
    background: var(--warning-soft);
    color: var(--warning);
}
.calendar-track {
    position: relative;
    min-height: 54px;
}
.timeline {
    display: grid;
    min-width: max-content;
}
.timeline-label {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--surface-alt);
    padding: 10px;
    border-bottom: 1px solid var(--line);
}
.calendar-day {
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    min-width: 88px;
    padding: 6px;
}
.calendar-heading {
    padding: 4px 12px;
    font-size: 12px;
    line-height: 14px;
    white-space: nowrap;
}
.calendar-date {
    overflow: hidden;
    text-overflow: ellipsis;
}
.calendar-total {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    font-variant-numeric: tabular-nums;
}
.calendar-lane {
    display: grid;
    position: relative;
    border-bottom: 1px solid var(--line);
    background-image: linear-gradient(to right,var(--line) 1px,var(--clear) 1px);
    background-size: 88px 100%;
    min-height: 50px;
}
.calendar-lane .bar {
    z-index: 1;
    margin: 3px 0;
}
.calendar-empty {
    position: absolute;
    inset: 0;
    display: grid;
}
.calendar-empty button {
    border: 0;
    border-radius: 0;
    opacity: 0;
    background: var(--clear);
}
.calendar-empty button:focus-visible,.calendar-empty button:hover {
    opacity: 1;
    background: var(--primary-soft);
    color: var(--primary);
}
.group-label {
    font-weight: bold;
}
.login {
    max-width: 440px;
    margin: 70px auto;
    background: var(--surface);
    padding: 30px;
    border-radius: 10px;
}
.login label {
    font-size: 15px;
}
.login input {
    width: 100%;
}
dialog {
    border: 1px solid var(--input-line);
    border-radius: 8px;
    width: min(700px,94vw);
    max-height: 90vh;
    overflow: auto;
}
dialog::backdrop {
    background: var(--backdrop);
}
pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.api-doc {
    font-size: 14px;
    line-height: 1.7;
}
#menu-toggle {
    display: none;
}
#feedback:empty {
    display: none;
}
.secret {
    font-size: 18px;
    overflow-wrap: anywhere;
    background: var(--warning-soft);
    padding: 16px;
}
details {
    margin: 18px 0;
}
summary {
    cursor: pointer;
    padding: 10px;
}
@media(max-width:760px) {
    header {
        padding: 10px;
        gap: 8px;
        position: relative;
    }
    .brand {
        font-size: 16px;
    }
    header span {
        font-size: 12px;
    }
    header .store-form {
        order: 4;
        width: 100%;
    }
    .shell {
        display: block;
    }
    nav {
        display: none;
        min-height: 0;
    }
    nav.open {
        display: block;
    }
    main {
        padding: 16px 10px;
    }
    #menu-toggle {
        display: block;
    }
    #menu-toggle span {
        display: none;
    }
    .grid-form {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    h1 {
        font-size: 21px;
    }
    .toolbar>* {
        max-width: 100%;
    }
    .login {
        margin: 25px 10px;
    }
    th,td {
        padding: 9px 10px;
    }
}
.scroll:has(.matrix) {
    max-height: 72vh;
}
.matrix thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}
.matrix thead th:first-child {
    z-index: 4;
}
.matrix td,
.matrix thead th:not(:first-child) {
    min-width: 44px;
    width: 44px;
    height: 32px;
    padding: 0;
    text-align: center;
    vertical-align: middle;
}
.matrix thead th:not(:first-child) {
    padding: 4px;
    font-size: 12px;
}
.matrix small {
    display: block;
}
.stock-cell {
    display: block;
    width: 100%;
    min-height: 32px;
    height: 32px;
    padding: 0 4px;
    border: 0;
    border-radius: 0;
    background: var(--clear);
    color: inherit;
}
.stock-cell:focus-visible {
    outline-offset: -3px;
}
.outside {
    background: var(--surface-alt) !important;
    color: var(--muted) !important;
}
.excluded {
    background-color: var(--surface-alt);
    color: var(--muted);
}
.calendar-lane {
    display: block;
    min-height: 36px;
}
.calendar-lane .bar {
    position: absolute;
    height: 32px;
    min-height: 32px;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.calendar-shade {
    position: absolute;
    inset: 0;
    display: grid;
    pointer-events: none;
}
.calendar-lane .bar.clipped-start {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-left: 17px;
}
.calendar-lane .bar.clipped-end {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding-right: 17px;
}
.bar-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bar-start,.bar-end {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}
.bar-start {
    left: 2px;
}
.bar-end {
    right: 2px;
}
.row-actions {
    display: flex;
    gap: 4px;
}

/* U1 共通部品 */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--primary); text-underline-offset: 4px; }
button,input,select,textarea { font: inherit; max-width: 100%; }
button,.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: var(--space-2) var(--space-4); border: 1px solid var(--primary); border-radius: var(--radius-sm); background: var(--primary); color: var(--surface); font-weight: 650; text-decoration: none; cursor: pointer; }
button:hover,.button:hover { background: var(--hover); color: var(--surface); }
.secondary { background: var(--surface); color: var(--primary-hover); border-color: var(--input-line); }
.secondary:hover { background: var(--primary-soft); color: var(--primary); }
.danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.small { min-height: 36px; padding: var(--space-1) var(--space-3); font-size: var(--font-xs); }
button:disabled,button:disabled:hover { background: var(--surface-alt); color: var(--muted); border-color: var(--line); cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input,select,textarea { min-height: 44px; border: 1px solid var(--input-line); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); color: var(--text); background: var(--surface); }
input[type=checkbox],input[type=radio] { width: 20px; min-height: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex-shrink: 0; }
label,.field { display: flex; flex-direction: column; gap: var(--space-2); font-weight: 600; }
.check { flex-direction: row; align-items: center; font-weight: 400; }
[aria-invalid=true] { border: 2px solid var(--danger); }
.required { color: var(--required); font-size: var(--font-xs); }
.field-error { color: var(--danger); font-size: var(--font-xs); }
.field-error { margin: 0; }
header { min-height: 80px; padding: var(--space-4) var(--space-6); display: flex; align-items: center; gap: var(--space-6); background: var(--chrome-bg); color: var(--chrome-text); border-bottom: 1px solid var(--chrome-bg); }
.brand { font-size: var(--font-md); font-weight: 800; text-decoration: none; letter-spacing: .04em; color: var(--chrome-text); }
.brand small { color: var(--chrome-muted); }
.store-form { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.store-form label { flex-direction: row; align-items: center; white-space: nowrap; }
.store-form select { width: auto; background: var(--chrome-bg); color: var(--chrome-text); border-color: var(--chrome-muted); }
.store-form .tag { background: var(--chrome-active); color: var(--chrome-text); }
header .store-form button,header form[action="/logout"] button { background: var(--clear); border-color: var(--chrome-muted); color: var(--chrome-text); }
header .store-form button:hover,header form[action="/logout"] button:hover { background: var(--chrome-active); }
.header-status { color: var(--chrome-text); font-size: var(--font-xs); }
.shell { display: grid; grid-template-columns: 224px minmax(0,1fr); }
nav { background: var(--chrome-bg); color: var(--chrome-text); padding: var(--space-4) var(--space-3); border-right: 1px solid var(--chrome-bg); }
nav a,nav .nav-unavailable { display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); text-decoration: none; color: var(--chrome-text); }
nav .nav-unavailable { color: var(--chrome-muted); }
nav a:hover { background: var(--chrome-active); }
nav a[aria-current=page] { background: var(--chrome-active); color: var(--chrome-text); font-weight: 750; border-left: 4px solid var(--chrome-text); }
.nav-label { font-size: var(--font-xs); font-weight: 750; color: var(--chrome-muted); margin: var(--space-6) var(--space-3) var(--space-2); }
nav .nav-label:first-child { margin-top: var(--space-2); }
#menu-toggle { display: none; background: var(--chrome-bg); color: var(--chrome-text); border-color: var(--chrome-muted); }
#menu-toggle:hover { background: var(--chrome-active); }
header :focus-visible,nav :focus-visible { outline-color: var(--chrome-text); }
main { min-width: 0; padding: var(--space-8); max-width: 1600px; width: 100%; margin: 0 auto; }
.skip { position: absolute; left: var(--space-2); top: -100px; z-index: 20; background: var(--surface); padding: var(--space-3); }
.skip:focus { top: var(--space-2); }
h1,h2,h3,p { margin-top: 0; }
h1,h2,h3,legend { font-weight: 700; letter-spacing: .02em; }
h1 { font-size: var(--font-lg); line-height: 1.4; margin-bottom: var(--space-2); letter-spacing: .02em; }
h2 { font-size: var(--font-md); margin-bottom: var(--space-4); }
h3 { font-size: var(--font-sm); }
.eyebrow { font-size: var(--font-xs); letter-spacing: .12em; color: var(--primary-hover); font-weight: 750; margin-bottom: var(--space-2); }
.muted,small { color: var(--muted); }
small { font-size: var(--font-xs); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.page-head p { margin-bottom: 0; }
.toolbar,.form-actions,.legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.toolbar { margin-bottom: var(--space-4); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-6); box-shadow: var(--shadow); min-width: 0; margin-bottom: var(--space-4); }
.tiles { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.tile { margin: 0; padding: var(--space-5); border-top: 4px solid var(--primary); }
.tile.warning { border-top-color: var(--warning); }
.tile p { color: var(--muted); margin-bottom: var(--space-2); }
.tile strong { font-size: var(--font-xl); line-height: 1.3; font-variant-numeric: tabular-nums; }
.tile small { margin-left: var(--space-2); }
.two-col { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(240px,1fr); gap: var(--space-6); align-items: start; }
.tabs { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--line); margin-bottom: var(--space-5); }
.tabs a { padding: var(--space-3) 0; text-decoration: none; color: var(--muted); }
.tabs a[aria-current=page] { color: var(--primary-hover); border-bottom: 3px solid var(--primary); font-weight: 700; }
.schedule { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.schedule:last-child { border-bottom: 0; }
.schedule time { font-size: var(--font-md); font-weight: 750; }
.schedule p { margin: var(--space-2) 0 0; }
.tag { display: inline-flex; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); font-size: var(--font-xs); font-weight: 700; background: var(--surface-alt); color: var(--muted); }
.success { color: var(--success); background: var(--success-soft); }
.caution { color: var(--warning); background: var(--warning-soft); }
.error,.negative,.stop { color: var(--danger); background: var(--danger-soft); }
.manual { color: var(--primary-hover); background: var(--primary-soft); }
.ota { color: var(--ota); background: var(--ota-soft); }
.web { color: var(--web); background: var(--web-soft); }
.notice { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); border: 1px solid currentColor; margin-bottom: var(--space-4); }
.notice p:last-child { margin: 0; }
.scroll { max-width: 100%; overflow: auto; max-height: 65vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: var(--font-sm); }
th,td { padding: var(--space-3); text-align: left; border-bottom: 1px solid var(--line); }
thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-alt); }
tbody tr:nth-child(even) { background: var(--surface-alt); }
.num,td.num { text-align: right; }

.bar { display: block; text-align: left; min-height: 32px; padding: var(--space-1) var(--space-2); border: 1px solid currentColor; border-radius: var(--radius-sm); margin: var(--space-1) 0; font-size: var(--font-xs); text-decoration: none; overflow-wrap: anywhere; }
.bar.suspension { color: var(--warning); background: var(--warning-soft); border-style: dashed; }
.calendar-note { margin-top: var(--space-3); }
.reservation-layout { display: grid; grid-template-columns: minmax(0,1fr) 288px; gap: var(--space-6); align-items: start; }
.grid-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-4); }
fieldset { border: 0; margin: 0 0 var(--space-4); min-width: 0; }
legend { float: left; width: 100%; padding: 0; font-size: var(--font-md); font-weight: 750; margin-bottom: var(--space-5); }
fieldset > div { clear: both; }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: var(--space-2); border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-hover); }
.full { grid-column: 1 / -1; }
.summary { position: sticky; top: var(--space-6); }
dl { margin: 0; }
.summary dl > div { display: flex; justify-content: space-between; gap: var(--space-3); margin: var(--space-3) 0; }
dd { margin: 0; font-variant-numeric: tabular-nums; }
.total { border-top: 1px solid var(--line); padding-top: var(--space-4); font-weight: 750; }
.total dd { font-size: var(--font-lg); color: var(--primary-hover); }
.summary .button { width: 100%; margin-top: var(--space-4); }
.part-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-4); }
.swatches { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.swatches .tag { padding: var(--space-3); }
.demo-foot { border-top: 1px solid var(--line); padding-top: var(--space-5); margin-top: var(--space-6); font-size: var(--font-xs); color: var(--muted); }
@media (max-width:1100px) {
  .shell { grid-template-columns: 192px minmax(0,1fr); }
  main { padding: var(--space-6); }
  .tiles { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .two-col,.reservation-layout { grid-template-columns: minmax(0,1fr); }
  .summary { position: static; }
  .header-status { display: none; }
}
@media (max-width:800px) {
  header { flex-wrap: wrap; gap: var(--space-3); padding: var(--space-4); }
  #menu-toggle { display: inline-flex; }
  .store-form { margin: 0; width: 100%; }
  .store-form label { flex: 1; }
  .store-form select { flex: 1; min-width: 0; }
  .shell { display: block; }
  nav { display: none; border-bottom: 1px solid var(--line); }
  nav.open { display: block; }
  main { padding: var(--space-5) var(--space-4); }
  .page-head { align-items: start; flex-direction: column; }
  .grid-form,.part-grid { grid-template-columns: minmax(0,1fr); }
  .card { padding: var(--space-4); }
  .tile { padding: var(--space-4); }
  .tabs { gap: var(--space-4); }
}
@media (prefers-reduced-motion:no-preference) { button,.button { transition: background .15s; } }

.notice.caution { border-color: var(--line); border-left: 4px solid var(--warning-line); }
.swatches .accent-sample { border-left: 4px solid var(--accent); }

.group-toggle { justify-content: flex-start; white-space: normal; text-align: left; width: 100%; padding: var(--space-1) 0; border: 0; border-radius: 0; background: var(--clear); color: var(--primary); font-size: var(--font-sm); font-weight: 700; }

.vehicle-timeline { display: grid; grid-template-columns: repeat(14,100px); grid-template-rows: repeat(2,minmax(40px,auto)); min-height: 80px; background: repeating-linear-gradient(to right,var(--clear) 0,var(--clear) 99px,var(--line) 99px,var(--line) 100px); }
.vehicle-timeline .bar { margin: 4px; align-self: start; }
.summary .coverage { align-items: baseline; }
.summary .coverage dt { flex-shrink: 0; }
.summary dd { white-space: nowrap; }
.summary .coverage dd { white-space: normal; }
.schedule-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); align-items: center; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.vehicle-timeline .bar-short { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 既存画面のクラス互換と本番のレイアウト */
header { position: relative; flex-wrap: wrap; }
header form { display: flex; align-items: center; gap: var(--space-2); }
header .brand { color: var(--chrome-text); }
header .store-form { margin-left: auto; }
header .header-status { display: inline-flex; }
nav { min-height: calc(100vh - 80px); }
nav a[aria-current] { background: var(--chrome-active); color: var(--chrome-text); }
nav a { overflow-wrap: anywhere; }
.toolbar { align-items: end; }
.toolbar > *, .grid-form > *, .schedule > *, header > * { min-width: 0; }
.grid-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); }
.scroll { margin: var(--space-3) 0; }
table { white-space: nowrap; }
.empty { background: var(--surface); color: var(--muted); }
.muted { background: var(--clear); }
.sat { background: var(--web-soft); }
.sun,.holiday { background: var(--danger-soft); }
.notice { background: var(--warning-soft); }
.notice.error { background: var(--danger-soft); }
.notice.success { background: var(--success-soft); }
.error:empty { display: none; }
.media-name { color: inherit; font-size: var(--font-xs); margin-left: var(--space-1); }
.schedule p { overflow-wrap: anywhere; }
.schedule-actions .tag:empty { min-width: 64px; min-height: 24px; border: 1px dashed var(--input-line); }
#content > p { overflow-wrap: anywhere; }
.calendar-scroll { max-height: 72vh; position: relative; }
.timeline > .calendar-heading { position: sticky; top: 0; z-index: 4; min-height: 100px; background: var(--surface-alt); }
.timeline > .timeline-label.calendar-heading { z-index: 6; }
.timeline-label { z-index: 3; background: var(--surface); }
.timeline > .group-label { background: var(--surface-alt); }
.calendar-day.today,.calendar-shade .today { border-left: 3px solid var(--primary); }
.calendar-date { font-weight: 700; }
.calendar-lane { background-image: linear-gradient(to right,var(--line) 1px,var(--clear) 1px); }
.calendar-lane .bar { border: 1px solid currentColor; padding: 2px 6px; text-align: left; line-height: 1.2; }
.calendar-lane .bar .media-name { display: block; font-size: 10px; line-height: 1; margin: 0; }
.bar.manual { background: var(--primary-soft); color: var(--primary); }
.bar.web { background: var(--web-soft); color: var(--web); }
.bar.ota { background: var(--ota-soft); color: var(--ota); }
.bar.unclassified { background: var(--surface-alt); color: var(--muted); }
.bar.suspension { background: var(--warning-soft); color: var(--warning); border-style: dashed; }
.bar.suspension.shuttle,.tag.shuttle { background: var(--muted); color: var(--surface); border-style: solid; }
.bar:hover { filter: brightness(.97); }
.group-toggle:hover { background: var(--primary-soft); color: var(--primary); }
.calendar-empty button { color: var(--primary); }
.calendar-empty button:disabled { visibility: hidden; }
.reservation-layout { grid-template-columns: minmax(0,1fr) 288px; }
.reservation-layout .reservation-editor { display: block; border: 0; background: var(--clear); padding: 0; min-width: 0; }
.reservation-layout .reservation-editor > fieldset { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-4); margin: 0 0 var(--space-4); }
.reservation-editor legend { float: left; grid-column: 1 / -1; margin-bottom: 0; }
.reservation-editor > fieldset > fieldset { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-4); border-top: 1px solid var(--line); padding: var(--space-4) 0 0; }
.reservation-editor > fieldset > div, .reservation-editor .catalog-editor { grid-column: 1 / -1; min-width: 0; }
.reservation-editor input:not([type=checkbox]), .reservation-editor select, .reservation-editor textarea { width: 100%; min-width: 0; }
.reservation-editor label:has(input[type=checkbox]) { flex-direction: row; flex-wrap: wrap; align-items: center; }
.reservation-editor .field-error { flex-basis: 100%; }
.reservation-layout .summary { top: var(--space-6); overflow-wrap: anywhere; }
.reservation-layout .summary p { border-bottom: 1px solid var(--line); padding-bottom: var(--space-3); }
.reservation-layout .summary strong { display: block; color: var(--primary); font-size: var(--font-md); }
/* U2-2 で共用する一覧の形 */
.list-filters { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: end; }
.list-filters > label { flex: 1 1 180px; min-width: 0; }
.list-filters input,.list-filters select { width: 100%; }
.list-table-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.list-table-head h2 { margin: 0; }
.row-actions { display: flex; gap: var(--space-2); }
.tag.published,.tag.enabled { background: var(--success-soft); color: var(--success); }
.tag.unpublished,.tag.stopped { background: var(--surface-alt); color: var(--muted); }
@media (max-width:1100px) {
  .reservation-layout { grid-template-columns: minmax(0,1fr); }
  .reservation-layout .summary { position: static; }
}
@media (max-width:800px) {
  header .store-form { margin-left: 0; }
  nav { min-height: 0; }
  .reservation-layout .reservation-editor > fieldset,
  .reservation-editor > fieldset > fieldset { grid-template-columns: minmax(0,1fr); }
  .list-filters { flex-direction: column; align-items: stretch; }
  .list-filters > label { flex-basis: auto; }
  .page-head .button { width: 100%; }
}
.calendar-empty button { min-height: 0; height: 100%; padding: 0; }
/* U2-2 一覧カードと編集フォーム */
.list-results,.list-editor { min-width: 0; margin-bottom: var(--space-5); }
.list-editor:empty { display: none; }
.list-scroll { max-width: 100%; overflow-x: auto; }
.list-results td { padding-block: var(--space-1); }
.list-results .row-actions { flex-wrap: nowrap; width: max-content; }
.list-results .row-actions > button { flex-shrink: 0; }
.list-results td button.small { white-space: nowrap; }
.text-button { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: var(--clear); color: var(--primary); font-weight: inherit; line-height: inherit; text-align: left; white-space: nowrap; text-decoration: none; }
.text-button:hover { background: var(--clear); color: var(--primary); text-decoration: underline; }
.tag.in-use { background: var(--primary-soft); color: var(--primary); }
.tag.unused { background: var(--line); color: var(--text); }
.list-editor h2 { scroll-margin-top: var(--space-5); }
.list-editor .catalog-editor { min-width: 0; }
.list-editor input,.list-editor select,.list-editor textarea { max-width: 100%; }
.page-head .button { flex-shrink: 0; }
.catalog-section { grid-column: 1 / -1; border-bottom: 1px solid var(--line); padding-bottom: var(--space-3); }

/* U2-3 在庫表・取り込み・設定・API説明 */
.tag.warning { color: var(--warning); background: var(--warning-soft); }
.import-status-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.matrix .is-today { box-shadow: inset 3px 0 var(--primary); }
.matrix thead th:first-child { z-index: 4; }
.api-doc { font-size: var(--font-md); line-height: 1.8; min-width: 0; }
.api-doc pre { font: inherit; margin-block: var(--space-4); }
.api-doc .scroll { max-width: 100%; margin-block: var(--space-4); }
.api-doc table { font-size: var(--font-sm); }

.store-settings-editor { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-4); }
.store-settings-editor label { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.store-settings-editor input,.store-settings-editor select,.store-settings-editor textarea { width: 100%; min-width: 0; }
.store-settings-editor > fieldset,.store-settings-editor > .catalog-wide { grid-column: 1 / -1; min-width: 0; }
@media (max-width: 800px) {
    .store-settings-editor { grid-template-columns: minmax(0,1fr); }
}

/* ST1: 確かめ用の画面だけに出す帯。 */
:root {
  --staging-background: #fff3cd;
  --staging-text: #493600;
}
.staging-banner {
  background: var(--staging-background);
  color: var(--staging-text);
  padding: 12px 16px;
  text-align: center;
  font-weight: bold;
}

/* S1: 予約スケジュール専用（承認済み見本に合わせる） */
.schedule-main { --filters-height: 110px; width: 100%; min-width: 0; max-width: 1080px; overflow-wrap: anywhere; }
/* 共通CSSは変えず、余白・枠を含めた幅を親の内側に収める。 */
.schedule-main,.schedule-main * { box-sizing: border-box; }
.schedule-main > * { min-width: 0; max-width: 100%; }
.schedule-filters,.schedule-day,.schedule-event-list,.schedule-event,.schedule-event-link { min-width: 0; max-width: 100%; }
/* スマホでは選択と日付を1行、キャンセルと今日ボタンを次の1行にする。 */
.schedule-filters.card { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.65fr); align-items: center; gap: 6px 8px; padding: 8px; margin-bottom: 0; border-radius: 0 0 10px 10px; background: #fff; box-shadow: 0 3px 8px #0002; }
.schedule-filters label { min-width: 0; max-width: 100%; }
.schedule-filters select,.schedule-filters input { font-size: 16px; padding: 8px 4px; }
.schedule-filters .schedule-check { width: max-content; grid-column: 1 / -1; grid-row: 2; min-height: 44px; white-space: nowrap; gap: 4px; font-size: 15px; }
.schedule-date-jump { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; margin: 0; }
.schedule-date-jump label { flex: 1 1 0; }
.schedule-date-jump input[type=date] { width: 100%; min-width: 0; max-width: 100%; }
.schedule-date-jump button { flex-shrink: 0; min-width: 44px; padding: 8px 4px; }
.schedule-today-button { grid-column: 2; grid-row: 2; justify-self: end; min-height: 44px; }
.schedule-range { margin: 16px 0 8px; color: #4b5965; }
.schedule-paging { display: flex; justify-content: center; padding: 16px 0; }
.schedule-day { margin-bottom: 24px; background: #fff; border: 1px solid #d6dfe7; border-radius: 10px; scroll-margin-top: var(--filters-height); }
.schedule-day-heading { position: sticky; top: var(--filters-height); z-index: 10; border-radius: 9px 9px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; padding: 12px 16px; background: #edf0fa; color: #263746; scroll-margin-top: var(--filters-height); }
.schedule-day-heading.today { background: #00508f; color: #fff; }
.schedule-today-mark { padding: 1px 8px; background: #fff; color: #00508f; border-radius: 4px; font-size: 15px; }
.schedule-day-heading.saturday { color: #00508f; }
.schedule-day-heading.sunday,.schedule-day-heading.holiday { color: #9b2837; background: #fff0f1; }
.schedule-day-heading:focus { outline-offset: -3px; }
.schedule-day-count { margin-left: auto; font-size: 15px; font-weight: 500; }
.schedule-event-list { margin: 0; padding: 0; list-style: none; }
.schedule-event + .schedule-event { border-top: 1px solid #d6dfe7; }
.schedule-event-link { display: grid; grid-template-columns: minmax(58px,max-content) minmax(0,1fr); gap: 12px; padding: 16px; color: #263746; text-decoration: none; overflow-wrap: anywhere; }
.schedule-event-link:hover { background: #f0f6fb; }
.schedule-event-link:focus-visible { outline-offset: -3px; }
.schedule-event-time { align-self: start; white-space: nowrap; font-size: 20px; line-height: 1.6; font-weight: 750; font-variant-numeric: tabular-nums; }
.schedule-event-detail { min-width: 0; }
.schedule-event-extra,.schedule-event-title strong { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; }
.schedule-event-title strong { min-width: 0; max-width: 100%; }
.schedule-event-phrase { min-width: 0; max-width: 100%; word-break: keep-all; overflow-wrap: anywhere; }
.schedule-event-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.schedule-event-title > *,.schedule-event-extra > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.schedule-event-kind { white-space: nowrap; font-weight: 750; color: #00508f; }
.schedule-event-kind.return { color: #525d67; }
.schedule-event-dot { display: inline-block; width: 10px; height: 10px; margin-right: 5px; background: #00508f; border: 2px solid #00508f; border-radius: 50%; }
.schedule-event-kind.return .schedule-event-dot { background: #fff; border-color: #626c76; }
.schedule-event-detail p { margin: 4px 0 0; }
.schedule-event-extra { color: #4b5965; }
.schedule-memo-mark { display: inline-block; font-size: 15px; color: #5c4209; background: #fff2ce; border: 1px solid #8a6518; border-radius: 4px; padding: 0 6px; text-decoration: none; }
.schedule-event-id { display: block; margin-top: 4px; text-align: right; color: #4b5965; font-size: 15px; }
.schedule-event.cancelled .schedule-event-content,.schedule-event.cancelled .schedule-event-time { text-decoration: line-through; }
.schedule-cancel-mark { color: #9b2837; font-weight: 700; }
.schedule-empty-day { margin: 0; padding: 20px 16px; color: #4b5965; }

.schedule-main { font-size: 15px; color: #263746; --primary: #00508f; --hover: #003c6b; --focus: #00508f; }
.schedule-main button { font-size: 15px; }
.schedule-main button,.schedule-main select,.schedule-main input:not([type=checkbox]),.schedule-event-link { min-height: 44px; }
.schedule-filters .schedule-check { display: flex; flex-direction: row; align-items: center; justify-self: start; }
.schedule-store { display: block; font-size: 15px; font-weight: 400; }
.schedule-date-jump label { display: block; }
.schedule-filters select { width: 100%; min-width: 0; }
.schedule-update { margin: 0; color: #9b2837; font-size: 15px; grid-column: 1 / -1; }
.schedule-update:empty { display: none; }
.schedule-event-link:focus-visible { outline: 3px solid #00508f; }
.schedule-day-heading.today { background: #00508f; color: #fff; }
@media (max-width: 800px) {
  .schedule-event-link { padding: 14px 12px; gap: 8px; grid-template-columns: minmax(58px,max-content) minmax(0,1fr); }
  .schedule-event-id { text-align: left; }
  .schedule-day-heading { padding: 12px; }
}
@media (min-width: 1101px) {
  .schedule-filters.card { grid-template-columns: minmax(140px,1fr) minmax(240px,1.5fr) auto auto; padding: 12px; gap: 12px; }
  .schedule-filters .schedule-check { grid-column: 3; grid-row: 1; }
  .schedule-date-jump { grid-column: 2; grid-row: 1; }
  .schedule-today-button { grid-column: 4; grid-row: 1; }
}
