:root {
  color-scheme: light;
  --canvas: #eff2f4;
  --paper: #fcfdfd;
  --ink: #192633;
  --muted: #526270;
  --line: #d9e0e5;
  --night: #17222d;
  --night-inner: #21303e;
  --orange: #f38b59;
  --rust: #a63e22;
  --green: #246453;
  --steel: #426a86;
  --radius: 13px;
  --body: "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --number: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  font-family: var(--body);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.55;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #1674a8; outline-offset: 3px; }
:where(h1, h2, h3, p, dl, dd) { margin: 0; }
svg.icon { width: 21px; height: 21px; flex-shrink: 0; display: block; }
.skip { position: fixed; z-index: 9; top: 12px; left: 12px; background: white; padding: 10px; transform: translateY(-200%); }
.skip:focus { transform: none; }

.shell { min-height: 100dvh; }
.rail { position: fixed; inset: 0 auto 0 0; width: 211px; padding: 30px 17px 22px; background: var(--night); color: #e8eff5; display: flex; flex-direction: column; z-index: 2; }
.brand { display: inline-flex; align-items: center; gap: 13px; width: fit-content; margin-left: 7px; text-decoration: none; }
.brand strong { display: block; font: 800 15px/1.2 var(--number); white-space: nowrap; letter-spacing: .015em; }
.brand small { display: block; margin-top: 4px; color: #b2c2cf; font-size: 12px; font-weight: 600; white-space: nowrap; }
.brand-mark { display: inline-flex; align-items: center; gap: 3px; padding: 0 3px; transform: skewX(-18deg); }
.brand-mark i { background: var(--orange); width: 5px; height: 19px; }
.brand-mark i:first-child { height: 12px; }
.brand-mark i:last-child { height: 26px; }
.main-nav { display: grid; gap: 6px; margin-top: 55px; }
.nav-link { position: relative; display: flex; gap: 13px; align-items: center; padding: 13px 12px; min-height: 47px; border-radius: 7px; color: #b9c8d5; text-decoration: none; font-size: 14px; font-weight: 650; }
.nav-link:hover { background: #263746; color: #fff; }
.nav-link[aria-current="page"] { color: #fff; background: #2b3c4b; }
.nav-link[aria-current="page"]::before { position: absolute; content: ""; width: 3px; height: 23px; background: var(--orange); border-radius: 2px; top: calc(50% - 11.5px); left: 0; }
.nav-link[aria-current="page"] svg { color: var(--orange); }
.rail-footer { margin-top: auto; border-top: 1px solid #3b4a59; padding: 17px 8px 0; }
.rail-footer small { display: block; color: #9daebb; font-size: 12px; margin-top: 6px; }
.agreed-label { display: inline-flex; align-items: center; gap: 7px; color: #e6edf3; font-size: 12px; font-weight: 650; }
.agreed-label i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--orange); }
.mobile-brand { display: none; }

.main { margin-left: 211px; max-width: 1570px; padding: 31px clamp(25px, 3.2vw, 56px) 48px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 21px; }
.page-header h1 { font-size: clamp(26px, 2.8vw, 38px); font-weight: 850; letter-spacing: -.055em; line-height: 1.3; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-date { color: var(--muted); font-size: 13px; font-weight: 650; white-space: nowrap; }
.control, .button, .icon-button { min-height: 44px; border-radius: 7px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: 14px; line-height: 1.35; font-weight: 750; padding: 9px 13px; }
.control, .button.ghost, .icon-button { border-color: var(--line); background: var(--paper); }
.control:hover, .button.ghost:hover, .icon-button:hover { background: #e7edf1; }
.icon-button { width: 44px; padding: 0; position: relative; }
.badge-count { position: absolute; right: -5px; top: -5px; font: 800 11px/16px var(--number); min-width: 17px; height: 17px; padding: 0 3px; border-radius: 9px; background: var(--rust); color: white; border: 1px solid var(--paper); }
.button.primary { background: var(--orange); color: #241b17; }
.button.primary:hover { background: #ffad83; }
.button.dark { background: var(--night-inner); color: #fff; }
.button.dark:hover { background: #354b60; }
.button.danger { background: #f9eee9; color: var(--rust); border-color: #ead0c5; }
.button.danger:hover { background: #f4ded3; }
.button.text { background: transparent; border-color: transparent; color: #294f6b; }
.button.text:hover { background: #e9eff4; }
.button:disabled { opacity: .5; cursor: default; }
.control svg, .button svg { width: 18px; height: 18px; }
.vehicle-control { white-space: nowrap; }
.vehicle-control-short { display: none; }

.vehicle-hero { isolation: isolate; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.13fr); overflow: hidden; min-height: 358px; margin-bottom: 22px; border-radius: var(--radius); background: var(--night); color: #f8fafc; }
.hero-info { position: relative; z-index: 1; padding: 30px 0 28px 34px; align-self: center; }
.hero-model { font: 750 15px/1.3 var(--number); color: #c6d4df; letter-spacing: .065em; }
.hero-info h2 { margin: 7px 0 4px; font-size: clamp(31px, 3.45vw, 57px); line-height: 1.17; letter-spacing: -.07em; overflow-wrap: anywhere; }
.hero-spec { color: #bccbd7; font-size: 14px; font-weight: 550; }
.odometer { margin-top: 21px; }
.odometer dt { color: #bdccd7; font-size: 13px; }
.odometer dd { display: flex; align-items: baseline; gap: 8px; line-height: 1; }
.odometer strong { font: 800 clamp(36px, 4.25vw, 63px)/1.06 var(--number); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.odometer small { color: #c5d2dd; font: 700 17px var(--number); }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.hero-actions .ghost { background: #202f3d; color: #eef4f9; border-color: #4b5d6e; }
.hero-actions .ghost:hover { background: #365064; }
.hero-art { position: relative; min-width: 0; display: grid; place-items: center; padding: 12px 22px 12px 1px; }
.hero-art::before { content: ""; position: absolute; width: 88%; aspect-ratio: 2; bottom: 7%; right: 8%; background: radial-gradient(ellipse, #0a1018 1%, transparent 70%); opacity: .9; }
.hero-art::after { content: ""; position: absolute; z-index: -1; inset: 0 0 0 9%; background-image: linear-gradient(to right, #7b9fb91a 1px, transparent 1px), linear-gradient(to bottom, #7b9fb91a 1px, transparent 1px); background-size: 31px 31px; mask-image: linear-gradient(90deg, transparent, #000 30%, #000 86%, transparent); }
.hero-code { position: absolute; color: transparent; -webkit-text-stroke: 1px #627f95; font: 800 clamp(90px, 14vw, 205px)/1 var(--number); transform: skewX(-11deg); top: 8%; left: -4%; letter-spacing: -.07em; user-select: none; }
.hero-art img { position: relative; display: block; max-width: 95%; max-height: 326px; width: min(100%, 425px); height: auto; object-fit: contain; filter: drop-shadow(0 16px 12px #080c13a8); }
.hero-picture-label { position: absolute; right: 17px; bottom: 13px; color: #b7c9d8; font-size: 12px; border-bottom: 1px solid #617887; padding-bottom: 3px; }
.hero-picture-label::before { content: ""; display: inline-block; width: 12px; height: 1px; margin-right: 6px; vertical-align: middle; background: var(--orange); }

.dashboard-grid, .detail-grid { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); gap: 19px; align-items: start; }
.dashboard-grid > .panel { height: 100%; }
.section-gap { margin-top: 20px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 11px; }
.panel-head h2 { display: flex; align-items: center; gap: 9px; font-size: 17px; line-height: 1.38; letter-spacing: -.025em; font-weight: 750; }
.panel-head h2 svg { color: var(--steel); }
.panel-head .button.text { padding: 5px 7px; min-height: 37px; white-space: nowrap; }
.panel-intro { padding: 0 18px 15px; color: var(--muted); font-size: 14px; }
.list { margin: 0; padding: 0 18px; list-style: none; }
.list-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; min-height: 66px; border-top: 1px solid var(--line); }
.list-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 6px; display: grid; place-items: center; color: #365a73; background: #eaf0f4; }
.list-icon svg { width: 19px; height: 19px; }
.list-title { flex: 1; min-width: 0; }
.list-title strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.list-title small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.list-row time { font-variant-numeric: tabular-nums; }
.list-value { text-align: right; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; font-family: var(--number); }
.list-amount { min-width: 68px; }
.list-foot { padding: 9px 18px 14px; color: var(--muted); font-size: 13px; }
.status { white-space: nowrap; display: inline-block; padding: 3px 8px; border-radius: 4px; color: #314c62; background: #e8eff4; font-size: 12px; font-weight: 800; line-height: 1.5; }
.status.soon, .status.late { color: #8c321b; background: #fbe8dd; }
.status.good { color: #1d5b4a; background: #e4f1eb; }
.status.closed { color: #576573; background: #e9edf0; }
.empty { padding: 15px 0 20px; color: var(--muted); font-size: 14px; }
.panel > .empty { padding-inline: 18px; }
.money-body { padding: 0 18px 17px; }
.amount { font: 800 clamp(30px, 3.4vw, 49px)/1.06 var(--number); letter-spacing: -.052em; font-variant-numeric: tabular-nums; }
.amount span { font-size: .64em; padding-right: 3px; }
.supplement { margin-top: 5px; color: var(--muted); font-size: 13px; }
.spending-chart { display: flex; gap: 8px; align-items: stretch; margin-top: 13px; border-bottom: 1px solid #cfdae3; }
.chart-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 66px; position: relative; padding-bottom: 20px; }
.bar { width: min(85%, 29px); height: var(--height); min-height: 2px; border-radius: 3px 3px 0 0; background: #a6bac9; transition: height .2s ease; }
.chart-col.active .bar { background: #cf6338; }
.chart-col small { position: absolute; bottom: 0; font-size: 12px; font-weight: 650; color: var(--muted); }
.chart-col.active small { color: var(--rust); }
.money-body .chart-col { height: 105px; }
.home-metrics { display: flex; gap: 12px; justify-content: space-between; padding-top: 9px; color: var(--muted); font-size: 13px; }
.home-metrics strong { color: var(--ink); font: 800 16px var(--number); white-space: nowrap; }

.page-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 15px; }
.active-vehicle { display: flex; align-items: center; gap: 8px; margin: -8px 0 15px; color: var(--muted); font-size: 14px; font-weight: 700; }
.active-vehicle svg { width: 18px; height: 18px; color: var(--steel); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #e5ebef; }
.tabs button { border: 0; background: transparent; min-height: 37px; padding: 5px 12px; border-radius: 5px; color: #405465; font-size: 14px; font-weight: 700; }
.tabs button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px #142a431f; }
.tabs button:hover { color: #101b25; }
.list-expanded .list-row { flex-wrap: wrap; }
.list-expanded .list-title { flex-basis: 150px; }
.row-actions { display: flex; gap: 6px; }
.row-actions .button { min-height: 39px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; }
.stat { padding: 15px 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.stat dt { font-size: 14px; color: var(--muted); }
.stat dd { margin-top: 3px; font: 800 clamp(23px, 3vw, 40px)/1.17 var(--number); letter-spacing: -.052em; font-variant-numeric: tabular-nums; }
.stat dd small { font-size: .52em; letter-spacing: 0; margin-left: 3px; }
.cost-chart { padding: 0 18px 18px; }
.cost-chart .chart-col { height: 150px; }
.cost-legend { padding: 0 18px 16px; }
.cost-line { display: grid; grid-template-columns: 63px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.cost-line b { font-family: var(--number); font-variant-numeric: tabular-nums; }
.cost-track { height: 5px; background: #e3eaee; border-radius: 3px; }
.cost-track i { display: block; height: 100%; width: var(--share); background: var(--steel); border-radius: inherit; }
.cost-line:first-child .cost-track i { background: #ce623c; }

.pit-banner { border-radius: var(--radius); padding: 22px clamp(18px, 3vw, 35px); background: var(--night); color: #f7fafc; margin-bottom: 18px; }
.pit-banner h2 { font-size: clamp(23px, 4vw, 36px); margin-bottom: 5px; }
.pit-banner p { color: #c9d6e2; font-size: 14px; }
.pit-banner .button { margin-top: 15px; }
.field-area { padding: 5px 18px 18px; }
.booking-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.booking-grid button { min-height: 40px; background: white; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font: 750 17px var(--number); }
.booking-grid button[aria-pressed="true"] { color: white; background: #304c62; border-color: #304c62; }
.booking-grid button:disabled { cursor: default; opacity: .45; }
.booking-grid button:hover:not(:disabled, [aria-pressed="true"]) { background: #e8f0f5; }

dialog { inset: 0; width: min(510px, calc(100% - 30px)); max-height: calc(100dvh - 30px); border: 1px solid #c5d1dc; border-radius: 14px; padding: 0; background: var(--paper); color: var(--ink); box-shadow: 0 20px 65px #19263347; }
dialog::backdrop { background: #101b29a3; }
.dialog-head { position: sticky; z-index: 1; top: 0; padding: 14px 20px; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -.035em; }
.dialog-content { padding: 16px 20px 21px; }
.dialog-content > .list { padding: 0; }
.dialog-content > .panel-intro { padding: 0 0 14px; }
.dialog-content > .button { margin-top: 12px; }
.form { display: grid; gap: 13px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 11px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .form-label { font-size: 14px; font-weight: 750; }
.field input:not([type="checkbox"]), .field select, .field textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #bfcbd5; border-radius: 6px; background: #fff; color: var(--ink); padding: 8px 10px; font-size: 16px; }
.field select { appearance: none; padding-right: 31px; background: white linear-gradient(45deg, transparent 50%, #526270 50%) calc(100% - 16px) 50% / 5px 5px no-repeat; background-image: linear-gradient(45deg, transparent 50%, #526270 50%), linear-gradient(135deg, #526270 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; }
.field textarea { resize: vertical; min-height: 75px; }
.field small, .form-note { color: var(--muted); font-size: 13px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: #284f69; }
.form-error { color: var(--rust); font-size: 14px; font-weight: 650; min-height: 0; }
.form-error:empty { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 3px; }
.choice { display: flex; align-items: center; width: 100%; min-height: 52px; margin-bottom: 7px; gap: 9px; text-align: left; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: white; padding: 9px 11px; }
.choice:hover { background: #edf2f5; }
.choice[aria-pressed="true"] { border-color: #7894a8; background: #edf4f8; }
.choice strong { flex: 1; font-size: 15px; overflow-wrap: anywhere; }
.choice small { color: var(--muted); white-space: nowrap; }
.vehicle-notes { margin-top: 12px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.vehicle-notes p { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: 14px; }
.toast { position: fixed; z-index: 4; display: grid; justify-content: center; align-items: center; inset: auto 20px 20px auto; max-width: calc(100% - 40px); width: max-content; border-radius: 8px; background: var(--night); color: #fff; font-size: 14px; padding: 11px 14px; box-shadow: 0 8px 22px #15213034; transition: opacity .15s ease; }
.toast:empty { opacity: 0; pointer-events: none; }

@media (max-width: 1070px) {
  .rail { width: 185px; padding-inline: 12px; }
  .main { margin-left: 185px; }
  .brand { gap: 10px; }
  .brand strong { font-size: 14px; }
  .hero-info { padding-left: 24px; }
  .hero-art { padding-right: 14px; }
  .dashboard-grid, .detail-grid { gap: 12px; }
  .panel-head, .list, .money-body { padding-inline: 13px; }
}

@media (max-width: 840px) {
  .rail { position: fixed; top: auto; width: 100%; padding: 0 0 env(safe-area-inset-bottom); border-top: 1px solid #3b4a59; }
  .rail > .brand, .rail-footer { display: none; }
  .main-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; gap: 0; }
  .nav-link { justify-content: center; flex-direction: column; min-height: 58px; gap: 4px; padding: 6px 2px; border-radius: 0; white-space: nowrap; }
  .nav-link[aria-current="page"]::before { top: 0; left: calc(50% - 13px); width: 26px; height: 2px; }
  .main { margin: 0 auto; padding: 0 20px calc(81px + env(safe-area-inset-bottom)); }
  .mobile-brand { display: flex; align-items: center; justify-content: space-between; margin: 0 -20px 17px; padding: 10px 17px; color: white; background: var(--night); }
  .mobile-brand .brand { margin: 0; }
  .mobile-brand .brand small { margin-top: 2px; }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
}

@media (max-width: 630px) {
  .main { padding-inline: 13px; }
  .mobile-brand { margin-inline: -13px; padding-inline: 14px; }
  .page-header { margin-bottom: 13px; align-items: center; }
  .page-header h1 { font-size: clamp(23px, 5.9vw, 33px); }
  .header-date { display: none; }
  .header-actions { gap: 7px; }
  .header-actions .control { padding: 5px 8px; }
  .header-actions .control svg:first-child { display: none; }
  .vehicle-hero { min-height: 0; display: block; margin-bottom: 14px; }
  .hero-info { padding: 16px 13px 14px; }
  .hero-info h2 { font-size: clamp(23px, 7vw, 43px); white-space: normal; }
  .hero-spec { font-size: 13px; }
  .hero-art { position: absolute; width: 55%; inset: 62px 0 53px auto; grid-template-rows: minmax(0, 1fr); padding: 2px 9px 0 0; }
  .hero-art img { height: 100%; max-width: 100%; width: min(100%, 260px); object-position: right center; }
  .hero-art::after { inset: -18px 0 -6px; }
  .hero-code { font-size: clamp(58px, 18vw, 116px); left: -2%; top: 2%; }
  .hero-picture-label { display: none; }
  .odometer { margin-top: 19px; }
  .odometer strong { font-size: clamp(29px, 8.2vw, 49px); }
  .odometer small { font-size: 13px; }
  .hero-actions { margin-top: 25px; }
  .hero-actions .button { padding-inline: 9px; }
  .dashboard-grid, .detail-grid { grid-template-columns: 1fr; gap: 13px; }
  .section-gap { margin-top: 13px; }
  .list-row { gap: 8px; }
  .list-title small { font-size: 12px; }
  .nav-link { font-size: 12px; }
  .panel-head { padding-top: 11px; }
  .money-body .chart-col { height: 78px; }
  .row-actions .button { padding: 6px 8px; font-size: 13px; }
  .stat-grid { gap: 5px; }
  .stat { padding: 9px 6px; }
  .stat dt { font-size: 12px; }
  .stat dd { font-size: clamp(18px, 5.4vw, 33px); }
  .stat dd small { margin-left: 2px; }
  .dialog-head { padding-inline: 14px; }
  .dialog-content { padding-inline: 14px; }
}

@media (max-width: 370px) {
  .page-header { gap: 6px; }
  .header-actions .control { font-size: 12px; }
  .page-header h1 { font-size: 20px; white-space: nowrap; }
  .header-actions .control { padding-inline: 6px; }
  .header-actions .message-button { min-width: 54px; padding-inline: 3px; }
  .header-actions .message-label { font-size: 9.5px; letter-spacing: 0; }
  .vehicle-control span { display: none; }
  .vehicle-control .vehicle-control-short { display: inline; }
  .tabs button { padding-inline: 7px; }
  .panel-head h2 { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Sign-in and app controls */
:root {
  --canvas: #edf1f3;
  --night: #142230;
  --night-inner: #23394b;
  --orange: #ff9a70;
}

.entry { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.entry-wrap { width: min(940px, 100%); min-height: 486px; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); background: var(--paper); border: 1px solid #c9d4db; border-radius: 16px; overflow: hidden; }
.entry-content { display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 5vw, 54px); }
.entry-content .brand { margin: 0 0 34px; }
.entry-content .brand small { color: var(--muted); }
.entry-content .brand-mark i { background: #c65a34; }
.entry-content h1, .entry-message h1 { font-size: clamp(24px, 3.2vw, 35px); letter-spacing: -.055em; margin-bottom: 12px; line-height: 1.26; }
.entry-content .form > p { max-width: 34ch; color: var(--muted); }
.entry-content .form > .form-error { color: var(--rust); }
.entry-content .button { width: 100%; margin-top: 5px; }
.entry-photo { display: grid; place-items: center; isolation: isolate; background: var(--night); position: relative; padding: 20px; overflow: hidden; }
.entry-photo::before { position: absolute; content: ""; inset: 0; z-index: -1; background-image: linear-gradient(to right, #c2d6e118 1px, transparent 1px), linear-gradient(to bottom, #c2d6e118 1px, transparent 1px); background-size: 32px 32px; }
.entry-photo span { position: absolute; top: 13%; color: transparent; -webkit-text-stroke: 1px #7391a6; font: 800 clamp(88px, 18vw, 193px)/1 var(--number); transform: skewX(-11deg); letter-spacing: -.08em; }
.entry-photo img { position: relative; width: min(100%, 390px); max-height: 360px; object-fit: contain; filter: drop-shadow(0 15px 12px #0008); }
.entry-message { background: var(--paper); padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); }
.entry-message .button { margin-top: 12px; }
.mobile-tools, .toolbar-actions { display: flex; align-items: center; gap: 9px; }
.mobile-tools .icon-button { background: #26394b; color: white; border-color: #4b6275; }
.empty-garage { padding: clamp(24px, 4vw, 60px); border-radius: var(--radius); background: var(--night); color: white; }
.empty-garage h2 { font-size: clamp(28px, 4vw, 45px); }
.empty-garage p { color: #d6e3ec; }
.empty-garage .button { margin-top: 18px; }
.vehicle-hero { border-bottom: 3px solid #547188; }
.pit-banner { border-left: 4px solid var(--orange); }

@media (max-width: 840px) {
  .desktop-account { display: none; }
}
@media (max-width: 630px) {
  .entry { padding: 12px; }
  .entry-wrap { grid-template-columns: minmax(0, 1fr); }
  .entry-content .brand { margin-bottom: 19px; }
  .entry-photo { min-height: 190px; max-height: 270px; }
  .entry-photo img { max-height: 220px; }
  .entry-photo span { font-size: clamp(94px, 32vw, 145px); }
}


/* ピット：クイックメニューとお預かり整備の2本立て */
.pit-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.pit-options .pit-banner { margin-bottom: 0; display: flex; flex-direction: column; align-items: flex-start; }
.pit-options .pit-banner .button { margin-top: auto; }
.pit-options .pit-banner p:not(.pit-kicker) { margin-bottom: 15px; }
.pit-kicker { color: var(--orange) !important; font: 800 12px/1.4 var(--number) !important; letter-spacing: .08em; margin-bottom: 4px; }
.pit-work { border-left-color: #7fa3bd; }
/* 買取・下取り（ホームページの査定フォームへ）。2つの受付の下に横長で置く */
.pit-options .pit-sell { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; gap: 18px; border-left-color: #c9a45a; }
.pit-options .pit-sell .button { margin-top: 0; flex: 0 0 auto; }
.pit-sell h2 { font-size: clamp(20px, 3vw, 28px); }
.pit-options .pit-sell p:not(.pit-kicker) { margin-bottom: 6px; }
.pit-sell small { color: #9fb2c3; font-size: 12px; }
.consult-symptom { white-space: pre-line; display: -webkit-box !important; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.thumbs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.thumbs img { width: 48px; height: 48px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); background: #eaf0f4; }

/* お預かり整備のご相談フォーム */
.consult-vehicle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #f4f7f9; }
.consult-vehicle .icon { width: 22px; height: 22px; color: #365a73; flex: 0 0 22px; }
.consult-vehicle strong { display: block; font-size: 15px; }
.consult-vehicle small { color: var(--muted); font-size: 13px; }
.radio-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.radio { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; border: 1px solid #bfcbd5; border-radius: 6px; background: #fff; font-size: 14px; cursor: pointer; }
.radio:has(input:checked) { border-color: #304c62; background: #edf4f8; font-weight: 750; }
.radio input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: #284f69; margin: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.photo-grid:empty { display: none; }
.photo-grid figure { position: relative; margin: 0; aspect-ratio: 1; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.photo-remove { position: absolute; top: 3px; right: 3px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #142230d9; color: #fff; cursor: pointer; }
.photo-remove .icon { width: 15px; height: 15px; }
.photo-pick { position: relative; justify-self: start; cursor: pointer; }
.photo-pick[hidden] { display: none; }
.photo-pick:focus-within { outline: 2px solid #4f7fa3; outline-offset: 2px; }
.photo-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

@media (max-width: 840px) {
  .pit-options { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 13px; }
  .pit-options .pit-sell { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 630px) {
  .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .radio-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* 店舗（smile-ops）からの次のメンテナンスの提案 */
.proposal-block { margin: 0 18px 4px; border: 1px solid #f1c7b0; border-radius: 8px; background: #fff7f2; }
.proposal-block .list { padding: 0 12px; }
.proposal-block .list-row:first-child { border-top-color: #f1d9cb; }
.proposal-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px 2px; color: #8c321b; font-size: 13px; font-weight: 800; }
.proposal-head .icon { width: 16px; height: 16px; }
.dialog-content > .proposal-head { padding: 0 0 4px; }
.dialog-content > .proposal-head + .list { padding: 0; margin-bottom: 10px; }
.status.proposal { color: #8c321b; background: #fbe8dd; }
.section-after { margin-bottom: 20px; }
@media (max-width: 1070px) { .proposal-block { margin-inline: 13px; } }
@media (max-width: 630px) { .section-after { margin-bottom: 13px; } }
.proposal-block .status.proposal { display: none; }

/* 来店リクエスト（V68 と同じ3ステップ） */
.booking-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 13px; min-width: 0; }
.booking-form fieldset[hidden] { display: none; }
.booking-form legend { font-size: 17px; font-weight: 800; margin-bottom: 4px; padding: 0; }
.booking-form legend:focus { outline: none; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 4px; padding: 0; list-style: none; }
.steps li { padding: 8px 4px; border-radius: 6px; background: #eef2f5; color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; }
.steps li[aria-current] { background: #304c62; color: #fff; }
.menu-list { display: grid; gap: 7px; }
.menu-choice { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 9px 11px; border: 1px solid #bfcbd5; border-radius: 7px; background: #fff; cursor: pointer; }
.menu-choice:has(input:checked) { border-color: #304c62; background: #edf4f8; }
.menu-choice input { width: 19px; height: 19px; flex: 0 0 19px; accent-color: #284f69; margin: 0; }
.menu-choice strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.menu-choice small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.booking-total { font-size: 14px; font-weight: 800; color: #243d52; font-variant-numeric: tabular-nums; }
.booking-total:empty, .step-error:empty { display: none; }
.step-error { color: var(--rust); font-size: 14px; font-weight: 700; }
.booking-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.booking-grid > .form-note { grid-column: 1 / -1; }
.review-items { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.review-items li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.review-items li span:last-child { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.review-facts { display: grid; gap: 6px; margin: 10px 0 0; }
.review-facts div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; font-size: 14px; }
.review-facts dt { color: var(--muted); }
.review-facts dd { margin: 0; font-weight: 750; }
@media (max-width: 630px) { .booking-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.two-stroke-guide { display: grid; gap: 8px; padding: 14px; border: 1px solid #f1c7b0; border-radius: 8px; background: #fff7f2; font-size: 14px; }
.two-stroke-guide[hidden], .booking-form [data-menus][hidden] { display: none; }
.two-stroke-guide .button { justify-self: start; }

/* 会員ランク（smile-ops の判定結果） */
.member-card { display: grid; gap: 4px; margin-bottom: 16px; padding: 14px 18px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); border-left: 4px solid #8a9aa8; }
.member-card.rank-1 { border-left-color: #a7b4c0; }
.member-card.rank-2 { border-left-color: #c9a24a; }
.member-card.rank-3 { border-left-color: var(--night); }
.member-kicker { color: var(--muted); font: 800 11px/1.3 var(--number); letter-spacing: .1em; }
.member-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.member-main strong { font-size: 19px; letter-spacing: -.02em; }
.member-main span { font-size: 14px; font-weight: 700; color: #243d52; }
.member-card small { color: var(--muted); font-size: 12px; }
.member-coupons { margin: 4px 0; padding: 0; list-style: none; }
.member-coupons li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
@media (max-width: 630px) { .member-card { margin-bottom: 12px; padding: 12px 14px; } }
.proposal-due { padding: 9px 11px; border-radius: 6px; background: #fff7f2; border: 1px solid #f1c7b0; font-size: 14px; }
.repair-running .list-icon { color: #8c321b; background: #fbe8dd; }

/* 部品・用品（STORES の限定公開の商品） */
.parts-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.parts-intro p { flex: 1 1 320px; }
.part-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.part-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.part-photo { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #eef2f5; color: #9aabb9; }
.part-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.part-photo .icon { width: 44px; height: 44px; }
.part-body { display: flex; flex: 1; flex-direction: column; gap: 7px; padding: 13px 14px 15px; }
.part-body h3 { font-size: 16px; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.part-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.part-badges:empty { display: none; }
.part-badge { padding: 2px 7px; border-radius: 4px; background: #e8eff4; color: #314c62; font-size: 11px; font-weight: 800; }
.part-badge.member { background: #fbe8dd; color: #8c321b; }
.part-badge.sample { background: #e9edf0; color: #576573; }
.part-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; margin: 0; font-size: 13px; }
.part-facts dt { color: var(--muted); }
.part-facts dd { margin: 0; overflow-wrap: anywhere; }
.part-summary { color: #3c4c5a; font-size: 13px; }
.part-buy { margin-top: auto; justify-content: center; }
.part-buy[aria-disabled="true"] { opacity: .65; cursor: default; }
.part-note { color: var(--muted); font-size: 11px; }
@media (max-width: 630px) {
  .part-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .part-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); }
  .part-photo { aspect-ratio: auto; min-height: 104px; height: 100%; align-self: stretch; }
  .part-photo .icon { width: 32px; height: 32px; }
  .part-body { padding: 11px 12px 12px; gap: 6px; }
  .part-body h3 { font-size: 15px; }
  .part-buy { min-height: 40px; padding-inline: 10px; font-size: 13px; }
}

/* お知らせと通知 */
.notice-list { padding: 0; margin-bottom: 12px; }
.notice-list .list-row { min-height: 0; align-items: flex-start; }
.notice-list .unread strong::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--rust); vertical-align: middle; }
.push-box { display: grid; gap: 6px; margin: 12px 0 4px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.push-box strong { font-size: 14px; }
.push-status { color: var(--muted); font-size: 13px; }
.push-error { color: var(--rust); font-size: 13px; }
.push-error:empty { display: none; }
.push-box .button { justify-self: start; }

/* メッセージ（店舗⇄お客様） */
.message-button { position: relative; width: auto; min-width: 64px; height: 54px; padding: 4px 8px 3px; flex-direction: column; gap: 1px;
  border-color: var(--night); background: var(--night); color: #fff; }
.message-button:hover { background: #26394b; }
.message-button .icon { width: 25px; height: 25px; }
.message-label { font-size: 10.5px; font-weight: 800; line-height: 1.2; letter-spacing: .02em; white-space: nowrap; }
.message-button[aria-current="page"] { border-color: var(--orange); background: var(--night); box-shadow: inset 0 0 0 1px var(--orange); }
.messages-intro { padding: 0 0 12px; }
.message-list { display: grid; gap: 14px; margin: 0 0 18px; padding: 0; list-style: none; }
.message { display: grid; gap: 4px; max-width: min(560px, 88%); }
.message.store { justify-self: start; }
.message.mine { justify-self: end; justify-items: end; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.message-meta time { font-weight: 500; }
.message-bubble { display: grid; gap: 6px; padding: 11px 13px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); font-size: 14px; }
.message.store .message-bubble { border-top-left-radius: 3px; }
.message.mine .message-bubble { border-top-right-radius: 3px; background: #e9f1f7; border-color: #cfdde8; }
.message-body { white-space: pre-line; overflow-wrap: anywhere; }
.message-quote { padding-left: 8px; border-left: 3px solid #b7c6d2; color: var(--muted); font-size: 12px; }
.message-files { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.message-pdf { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #243d52; font-size: 13px; font-weight: 700; text-decoration: none; max-width: 100%; }
.message-pdf span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-pdf .icon { width: 16px; height: 16px; flex: 0 0 16px; }
.message-photo img { display: block; width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.message-reply { justify-self: start; min-height: 32px; padding: 4px 6px; font-size: 13px; }
.message-form { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.message-replying { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 6px; background: #eef2f5; font-size: 13px; }
.urgent-check { color: #8c321b; font-weight: 700; }
/* 上のボタンがメッセージの分だけ増えたので、スマホでは「車両を選ぶ」を「車両」にして見出しを1行に保つ */
@media (max-width: 480px) {
  .vehicle-control span { display: none; }
  .vehicle-control .vehicle-control-short { display: inline; }
  .header-actions { gap: 6px; }
  /* メッセージのボタンを大きくした分、見出し（「ピットサービス」など7文字まで）を1行に保つ */
  .page-header h1 { font-size: 21px; white-space: nowrap; }
  .header-actions .message-button { min-width: 58px; padding-inline: 4px; }
}

/* チャット「ピットクルー」 */
.crew-button { position: fixed; right: 18px; bottom: 22px; z-index: 20; display: inline-flex; align-items: center; gap: 7px; min-height: 48px;
  padding: 10px 16px; border: 0; border-radius: 24px; background: var(--night); color: #fff; font-size: 14px; font-weight: 800;
  box-shadow: 0 8px 24px #14223055; cursor: pointer; }
.crew-button .crew-bob { flex: 0 0 auto; margin-left: -8px; }
/* 目立たせる（ホームページの PITオペレーターと同じ動き）：光の輪が広がる（点滅）・目の光が明るくなる・ふわふわ浮いて、ときどき首をふる。
   チャットを開いているあいだと、動きを減らす設定の人には動かさない */
.crew-bob { position: relative; display: block; border-radius: 50%; }
.crew-ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.crew-dot { position: absolute; top: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%; background: #6cc39a; border: 2px solid var(--night); }
.crew-button .crew-avatar { border-radius: 50%; transition: transform .25s; }
.crew-button:hover .crew-avatar { transform: rotate(-6deg) translateY(-2px); }
@media (prefers-reduced-motion: no-preference) {
  .crew-bob { animation: crew-move 6s ease-in-out infinite; }
  .crew-ring { animation: crew-ripple 1.8s ease-out infinite; }
  .crew-button .crew-avatar { animation: crew-glow 1.8s ease-in-out infinite; }
  body:has(#dialog[open]) .crew-bob, body:has(#dialog[open]) .crew-ring, body:has(#dialog[open]) .crew-button .crew-avatar { animation: none; }
}
@keyframes crew-ripple {
  0% { box-shadow: 0 0 0 0 rgba(243, 139, 89, .85); }
  70% { box-shadow: 0 0 0 16px rgba(243, 139, 89, 0); }
  100% { box-shadow: 0 0 0 0 rgba(243, 139, 89, 0); }
}
@keyframes crew-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(224, 176, 74, 0)); }
  50% { filter: drop-shadow(0 0 10px rgba(224, 176, 74, .95)); }
}
@keyframes crew-move {
  0%, 100% { transform: translateY(0) rotate(0); }
  20% { transform: translateY(-6px) rotate(0); }
  40% { transform: translateY(0) rotate(0); }
  60% { transform: translateY(-6px) rotate(0); }
  66% { transform: translateY(-6px) rotate(-10deg); }
  72% { transform: translateY(-6px) rotate(9deg); }
  78% { transform: translateY(-4px) rotate(-6deg); }
  84% { transform: translateY(-2px) rotate(3deg); }
  90% { transform: translateY(0) rotate(0); }
}
.crew-avatar { display: block; }
.crew-avatar .crew-eyes { transform-box: fill-box; transform-origin: center; animation: crew-blink 5s infinite; }
.crew-avatar.thinking .crew-eyes { animation: crew-think 1.1s ease-in-out infinite; }
@keyframes crew-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.15); } }
@keyframes crew-think { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .crew-avatar .crew-eyes { animation: none; } }
.crew-bot { grid-template-columns: 34px minmax(0, 1fr); column-gap: 8px; align-items: start; }
.crew-said { display: grid; gap: 4px; min-width: 0; }
.crew-said .message-meta { letter-spacing: .06em; }
.crew-note { margin-bottom: 10px; }
.text-link { display: inline; min-height: 0; padding: 0; border: 0; background: none; color: #1f5a85; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
/* 最初の吹き出し（アバターから） */
.crew-hello { position: fixed; right: 18px; bottom: 82px; z-index: 20; display: flex; align-items: flex-start; gap: 2px; max-width: 260px;
  padding: 10px 4px 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 8px 24px #14223040; }
.crew-hello::after { content: ""; position: absolute; right: 117px; bottom: -7px; width: 12px; height: 12px; background: var(--paper);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.crew-hello-text { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 700; line-height: 1.6; text-align: left; cursor: pointer; }
.crew-hello-close { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; margin-top: -4px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.crew-hello-close .icon { width: 16px; height: 16px; }
.crew-hello.appear { animation: crew-hello-in .45s ease-out .6s both; }
@keyframes crew-hello-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .crew-hello.appear { animation: none; } }
.crew-list { max-height: 48vh; overflow-y: auto; margin-bottom: 12px; padding-right: 2px; }
.crew-list .message { max-width: 92%; }
.crew-go { justify-self: start; min-height: 36px; font-size: 13px; }
.crew-form { padding: 0; border: 0; }
@media (max-width: 840px) {
  .crew-button { bottom: calc(70px + env(safe-area-inset-bottom)); right: 12px; min-height: 0; padding: 0; border-radius: 50%; background: none; box-shadow: none; }
  .crew-button .crew-bob { margin: 0; }
  .crew-button .crew-avatar { width: 54px; height: 54px; box-shadow: 0 8px 22px #14223066; }
  .crew-hello { right: 12px; bottom: calc(136px + env(safe-area-inset-bottom)); max-width: min(260px, calc(100vw - 24px)); }
  .crew-hello::after { right: 22px; }
  .crew-button .crew-label { display: none; }
}
/* 右下のボタンがページのいちばん下の中身に重ならないように */
.shell:has(.crew-button) .main { padding-bottom: 90px; }
@media (max-width: 840px) {
  .shell:has(.crew-button) .main { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
}

/* 緊急のメッセージ：聞く項目と、送ったあとの受付の案内 */
.urgent-check { padding: 10px 12px; border: 1px solid #e3b9a6; border-radius: 7px; background: #fff6f1; font-weight: 750; }
.urgent-fields { display: grid; gap: 12px; margin: 0; padding: 12px; border: 1px solid #e3b9a6; border-radius: 7px; background: #fffaf7; min-width: 0; }
.urgent-fields[hidden] { display: none; }
.urgent-fields legend { padding: 0 4px; font-size: 13px; font-weight: 800; color: var(--rust); }
.urgent-safety { font-size: 13px; color: #7a3b1f; }
.urgent-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.urgent-choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.urgent-choices .radio { min-height: 42px; padding: 7px 8px; font-size: 13.5px; }
/* 「走れますか」は3つを1行に収めるため、丸を隠して札のように選ぶ（選んだものは枠と太字で分かる） */
.urgent-choices.three .radio { position: relative; justify-content: center; padding-inline: 6px; white-space: nowrap; }
.urgent-choices.three .radio input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.urgent-choices.three .radio:has(input:checked) { border-width: 2px; }
.urgent-choices.three .radio:has(input:focus-visible) { outline: 2px solid #4f7fa3; outline-offset: 2px; }
.urgent-receipt { display: grid; gap: 6px; margin: 0 0 18px; padding: 13px 14px; border: 1px solid #e3b9a6; border-left: 4px solid var(--rust); border-radius: 8px; background: #fff6f1; font-size: 14px; }
.urgent-receipt strong { display: flex; align-items: center; gap: 6px; color: #7a3b1f; }
.urgent-receipt strong .icon { width: 18px; height: 18px; flex: 0 0 18px; }
.urgent-receipt ul { margin: 0; padding-left: 1.2em; color: var(--muted); font-size: 13px; }
@media (max-width: 630px) {
  .urgent-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .urgent-choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* アプリの使い方（ヘルプ） */
.help-intro { margin-bottom: 14px; }
.help-sections { display: grid; gap: 14px; }
.help-section { padding: 6px 16px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.help-section h2 { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 16px; }
.help-section h2 .icon { width: 20px; height: 20px; color: #365a73; }
.help-item { border-top: 1px solid var(--line); }
.help-item:first-of-type { border-top: 0; }
.help-item summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 8px 0; font-size: 14.5px; font-weight: 750; cursor: pointer; list-style: none; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: "+"; flex: 0 0 auto; color: var(--muted); font-size: 18px; font-weight: 500; }
.help-item[open] summary::after { content: "−"; }
.help-item p { padding: 0 0 12px; color: #33495b; font-size: 14px; line-height: 1.75; }
.help-link { justify-content: flex-start; width: 100%; margin: 4px 0 10px; }

/* はじめての設定（ホーム画面への追加と通知）と、通知がオフの間の案内 */
.setup-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin: 0 0 20px; padding: 18px 20px; border: 2px solid var(--rust); border-left-width: 7px; border-radius: var(--radius); background: #fff1ea; }
.setup-banner-icon { position: relative; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--rust); color: #fff; }
.setup-banner-icon .icon { width: 28px; height: 28px; }
.setup-banner-text strong { display: block; color: #7a2a12; font-size: 19px; line-height: 1.4; letter-spacing: -.01em; }
.setup-banner-text p { margin-top: 4px; color: #5b3423; font-size: 15px; line-height: 1.6; font-weight: 650; }
.setup-banner-text .push-error:empty { display: none; }
.setup-banner-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.setup-banner-actions .button { min-height: 50px; padding-inline: 18px; font-size: 15.5px; white-space: nowrap; }
/* 点滅：枠の光・地の色・ベルのまわりの波を、1.6秒ごとにゆっくり（光の点滅で気分が悪くならない速さ）。動きを減らす設定の端末とダイアログを開いている間は止める */
@keyframes setup-flash { 0%, 100% { background: #fff1ea; box-shadow: 0 0 0 0 rgba(166, 62, 34, 0); } 50% { background: #ffd9c8; box-shadow: 0 0 0 5px rgba(166, 62, 34, .28); } }
@keyframes setup-ring { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes setup-bell { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } }
.setup-banner-icon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--rust); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .setup-banner { animation: setup-flash 1.6s ease-in-out infinite; }
  .setup-banner-icon::after { animation: setup-ring 1.6s ease-out infinite; }
  .setup-banner-icon .icon { animation: setup-bell 1.6s ease-in-out infinite; transform-origin: 50% 15%; }
  body:has(#dialog[open]) .setup-banner, body:has(#dialog[open]) .setup-banner-icon::after, body:has(#dialog[open]) .setup-banner-icon .icon { animation: none; }
}
/* 「通知を受け取る」：押したくなるように、色がオレンジ→赤みのオレンジへ変わりながら少しふくらみ、光の筋が横切る */
.setup-banner .button.primary { position: relative; overflow: hidden; background: linear-gradient(135deg, #ff9a5c, #e8542a); color: #fff; box-shadow: 0 4px 12px rgba(200, 70, 30, .35); text-shadow: 0 1px 1px rgba(90, 30, 10, .35); }
.setup-banner .button.primary .icon { color: #fff; }
.setup-banner .button.primary:hover { background: linear-gradient(135deg, #ffad73, #f0623a); }
.setup-banner .button.primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-20deg); pointer-events: none; opacity: 0; }
@keyframes setup-cta { 0%, 100% { transform: scale(1); filter: hue-rotate(0deg) saturate(1); box-shadow: 0 4px 12px rgba(200, 70, 30, .35); } 50% { transform: scale(1.05); filter: hue-rotate(-12deg) saturate(1.25); box-shadow: 0 6px 20px rgba(220, 60, 20, .55); } }
@keyframes setup-shine { 0%, 55% { left: -60%; opacity: 0; } 60% { opacity: 1; } 95% { left: 120%; opacity: 1; } 100% { left: 120%; opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .setup-banner .button.primary { animation: setup-cta 1.6s ease-in-out infinite; }
  .setup-banner .button.primary::after { animation: setup-shine 3.2s ease-in-out infinite; }
  .setup-banner .button.primary:hover, .setup-banner .button.primary:focus-visible { animation-play-state: paused; }
  body:has(#dialog[open]) .setup-banner .button.primary, body:has(#dialog[open]) .setup-banner .button.primary::after { animation: none; }
}
.setup-intro { padding: 0 0 14px; }
.setup-warning { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 15px 16px; border: 2px solid var(--rust); border-radius: var(--radius); background: #fff1ea; }
.setup-warning > .icon { flex: 0 0 26px; width: 26px; height: 26px; color: var(--rust); }
.setup-warning strong { display: block; color: #7a2a12; font-size: 16px; line-height: 1.5; }
.setup-warning p { margin-top: 4px; color: #5b3423; font-size: 13.5px; }
.setup-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.setup-step { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.setup-step > p { color: #33495b; font-size: 14px; }
.setup-head { display: flex; align-items: center; gap: 10px; }
.setup-head h2 { flex: 1; font-size: 18px; letter-spacing: -.02em; }
.setup-num { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: var(--night-inner); color: #fff; font-family: var(--number); font-size: 18px; font-weight: 800; }
.setup-state { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.setup-state .icon { width: 14px; height: 14px; }
.setup-state.done { background: #e3f1ec; color: var(--green); }
.setup-state.todo { background: #fdebe2; color: var(--rust); }
.setup-now { display: grid; gap: 8px; padding: 12px; border-radius: 8px; background: #f4f7f9; font-size: 14px; }
.setup-now.done { display: flex; align-items: center; gap: 6px; background: #e3f1ec; color: var(--green); font-weight: 750; }
.setup-now.done .icon { width: 18px; height: 18px; flex: 0 0 18px; }
.setup-now .button { justify-self: start; }
.setup-now .push-error:empty { display: none; }
.setup-device { border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.setup-device summary { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 8px 12px; font-size: 14.5px; font-weight: 750; cursor: pointer; list-style: none; }
.setup-device summary::-webkit-details-marker { display: none; }
.setup-device summary::after { content: "+"; color: var(--muted); font-size: 18px; font-weight: 500; }
.setup-device[open] summary::after { content: "−"; }
.setup-howto { margin: 0; padding: 0 14px 12px 34px; display: grid; gap: 7px; color: #33495b; font-size: 14px; line-height: 1.65; }
.setup-howto b, .setup-step > p b { color: var(--ink); }
.setup-foot { display: flex; justify-content: center; margin-top: 18px; }
@media (max-width: 630px) {
  .setup-banner { grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; padding: 16px 14px; }
  .setup-banner-icon { width: 48px; height: 48px; }
  .setup-banner-icon .icon { width: 25px; height: 25px; }
  .setup-banner-text strong { font-size: 18px; }
  .setup-banner-text p { font-size: 14.5px; }
  .setup-banner-actions { grid-column: 1 / -1; justify-content: stretch; }
  .setup-banner-actions .button { flex: 1; min-height: 52px; }
  .setup-step { padding: 14px 13px; }
  .setup-head h2 { font-size: 16.5px; }
}
