:root {
  color-scheme: light;
  --paper: #f8faf9;
  --ink: #152521;
  --muted: #51605c;
  --line: #d7dfda;
  --petrol: #124e48;
  --reserve: #855017;
  --glass: rgb(248 250 249 / 94%);
  font: 100%/1.45 -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
[hidden], .symbols { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}
button:active { transform: translateY(1px); }
:focus-visible { outline: 3px solid #277c72; outline-offset: 3px; }
svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: #c5e2d8; }
header { position: sticky; top: 0; z-index: 3; padding-top: env(safe-area-inset-top); }
header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--glass); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line);
}
.bar, main { width: min(1160px, calc(100% - 2.25rem)); margin-inline: auto; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 58px; gap: 1rem; }
.brand, .profile-wrap, .profile, nav, nav button, .location, .summary, .tools, .list-nav, .segments, .filter-btn, .search, .sheet-bar, .variant, .primary, .secondary {
  display: flex; align-items: center;
}
.brand { gap: .65rem; }
.brand img { width: 49px; height: 30px; object-fit: contain; }
.brand > span { border-left: 1px solid #c6d0ca; padding-left: .65rem; font-weight: 630; letter-spacing: -.045em; }
.profile-wrap { position: relative; gap: .5rem; }
.profile { gap: 8px; min-width: 44px; min-height: 44px; font-weight: 600; font-size: .875rem; }
.profile svg { width: 12px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #31534a; background: #dce8df; font-size: .75rem; font-weight: 650; }
.demo { font-size: .71rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
#profile-name { display: none; }
nav {
  position: fixed; bottom: 0; inset-inline: 0; justify-content: center; gap: 6px; background: var(--glass);
  border-top: 1px solid var(--line); backdrop-filter: blur(22px);
  padding: 6px max(12px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
nav button { min-height: 48px; flex: 1; max-width: 172px; justify-content: center; gap: 7px; color: var(--muted); font-size: .875rem; font-weight: 580; border-radius: 12px; }
nav button[aria-current] { color: var(--petrol); background: #e1eee7; }
#nav-count { color: inherit; background: #0000000c; padding: 1px 6px; border-radius: 7px; font-size: .72rem; }
.popover { position: absolute; right: 0; top: 48px; z-index: 2; background: white; padding: .8rem; width: min(252px, 85vw); box-shadow: 0 8px 40px #163c302a; border-radius: 16px; }
.popover h3, .popover p { margin: .3rem .5rem .5rem; }
.popover h3 { font-size: 1rem; }
.popover p { color: var(--muted); font-size: .8rem; margin-top: .7rem; }
.person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px; border-radius: 10px; text-align: left; font-weight: 550; }
.person small { display: block; font-weight: 400; color: var(--muted); }
.person[aria-pressed=true] { background: #edf3ef; }
main { padding: 24px 0 calc(82px + env(safe-area-inset-bottom)); }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 21px; }
h1 { font-size: clamp(2.35rem, 7vw, 3.75rem); line-height: 1.04; letter-spacing: -.048em; font-weight: 660; }
.location { font-size: .8rem; color: var(--muted); gap: 6px; margin-top: 6px; }
.location svg { width: .95rem; }
.summary { flex-wrap: wrap; justify-content: end; gap: 4px .8rem; color: var(--muted); font-size: .78rem; }
.summary b, #nav-count, #result-count, .badge, .price, .specs dd { font-variant-numeric: tabular-nums; }
.summary b { color: var(--ink); font-weight: 650; }
.summary { display:grid; grid-template-columns:1.25fr 1fr 1fr; gap:8px; margin-bottom:24px; }
.metric { display:grid; gap:4px; align-content:center; padding:12px 14px; background:#edf2ef; border-radius:12px; }
.metric:first-child { background:var(--petrol); color:#fff; }
.metric strong { font-size:clamp(1.6rem,5vw,2.25rem); line-height:1; font-weight:650; letter-spacing:-.035em; font-variant-numeric:tabular-nums; }
.metric span { font-size:.78rem; line-height:1.2; }
#sync-status { max-width:27ch; color:var(--muted); text-align:right; font-size:.78rem; }
#source-note { background:#eaf1ef; padding:12px 16px; border-radius:12px; margin:-8px 0 16px; font-size:.85rem; }
#source-note button { text-decoration:underline; text-underline-offset:3px; color:var(--petrol); min-height:32px; font-weight:600; }
.model-line { display:flex; align-items:center; gap:12px; margin-top:12px; }
.model-line label { font-weight:600; font-size:.875rem; }
.model-line select { flex:1; min-width:0; }
#filters label:has(input) { display:flex; gap:8px; align-items:center; min-height:44px; }
.tools { gap: 8px; }
.search, .filter-btn, select { border: 1px solid #cdd6d0; border-radius: 12px; background: white; }
.search { height: 48px; padding: 0 12px; gap: 8px; flex: 1; min-width: 0; color: var(--muted); }
.search:focus-within { outline: 2px solid var(--petrol); outline-offset: 1px; }
.search input { width: 100%; min-width: 0; background: none; border: 0; outline: none; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.filter-btn { height: 48px; padding: 0 10px; gap: 5px; font-size: .82rem; font-weight: 590; }
.filter-btn.filtered, .filter-btn[aria-expanded=true] { background: #e6f0eb; color: var(--petrol); }
kbd { display: none; }
#filters { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; padding: 12px 0 0; }
#filters label, .unit-select { display: grid; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--muted); }
select { padding: 8px; font-size: 1rem; min-height: 44px; color: var(--ink); }
.text-btn { min-height: 44px; padding-inline: .3rem; color: var(--petrol); text-decoration: underline; text-underline-offset: 3px; }
.list-nav { justify-content: space-between; gap: .4rem; margin: 12px 0 14px; }
.segments { gap: 2px; }
.segments button { min-height: 44px; padding: 0 .65rem; border-radius: 10px; font-size: .84rem; color: var(--muted); font-weight: 560; }
.segments button[aria-pressed=true] { color: white; background: var(--ink); }
#result-count { font-size: .76rem; color: var(--muted); text-align: right; }
#list { display: grid; grid-template-columns: minmax(0,1fr); }
.row { display:grid; grid-template-columns:56px minmax(0,1fr) auto; align-items:center; gap:12px; min-width:0; padding:12px 4px; text-align:left; border-bottom:1px solid var(--line); }
.thumb {
  width:56px; height:64px; display:grid; place-items:center; position:relative; overflow:hidden;
  background:#e9eeeb; border-radius:10px; color:#516d63;
}
.thumb img { object-fit: contain; width: 75%; height: 83%; position: absolute; filter: drop-shadow(1px 5px 5px #21322916); }
.row-text, .row-foot { padding-inline: 2px; }
.row-text { min-width: 0; }
.row strong { display: block; font-size: 1rem; line-height: 1.22; letter-spacing: -.028em; }
.row small { display: block; font-size: .77rem; line-height: 1.45; color: var(--muted); margin-top: 2px; }
.row small.owner { display:flex; align-items:center; gap:4px; color:var(--reserve); font-weight:650; }
.owner svg { width:13px; height:13px; }
.balance { text-align:center; min-width:52px; padding:6px 8px; background:#e0eee6; color:#205840; border-radius:10px; }
.balance b,.balance span { display:block; line-height:1.15; }
.balance b { font-size:1.5rem; font-weight:670; font-variant-numeric:tabular-nums; }
.balance span { font-size:.75rem; }
.balance.none { color:var(--muted); background:#eceeeb; }
.row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; }
.price { font-size: .85rem; font-weight: 620; }
.badge { color: #225e47; font-size: .74rem; font-weight: 550; display: inline-flex; align-items: center; gap: 5px; }
.badge::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.held { color: var(--reserve); }
#list.reservations { grid-template-columns: 1fr; gap: 0; }
.reservations .row { grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 4px; border-radius: 0; border-bottom: 1px solid var(--line); }
.reservations .thumb { width: 52px; height: 58px; border-radius: 8px; }
.reservations .row-foot { justify-self: end; }
.empty { grid-column: 1/-1; text-align: center; padding: 36px 12px; border-block: 1px solid var(--line); color: var(--muted); }
.empty strong { display: block; color: var(--ink); }
#detail-host { display: none; }
.detail { background: white; overflow: hidden; }
.stage {
  height: clamp(130px, 22dvh, 200px); position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 68% 135%, var(--glow), var(--tint) 52%, #282d2c 100%); color: white;
}
.stage img { position: absolute; width: 72%; height: 125%; top: 13%; right: 7%; object-fit: contain; transform: rotate(-6deg); filter: drop-shadow(0 8px 12px #0004); }
.stage span { position: absolute; left: 16px; top: 13px; z-index: 1; font-weight: 600; font-size: .78rem; background: #252b29b3; padding: 3px 9px; border-radius: 6px; }
.detail-info { padding: 18px 20px max(18px, env(safe-area-inset-bottom)); }
.detail-info h2 { font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.04em; line-height: 1.12; }
.variant { gap: 7px; color: var(--muted); font-size: .9rem; margin-top: 4px; }
.swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--chip); border: 1px solid #0002; }
.specs { display: flex; justify-content: space-between; gap: 10px; padding: 13px 0; margin: 12px 0; border-block: 1px solid var(--line); }
.specs div:last-child { text-align: end; }
.specs dt { font-size: .77rem; color: var(--muted); }
.specs dd { font-weight: 630; font-size: 1.02rem; }
.unit-select select { width: 100%; background: var(--paper); }
.actions { margin-top: 14px; display: grid; gap: 4px; }
.primary, .secondary { min-height: 47px; justify-content: center; gap: 8px; font-size: .94rem; font-weight: 620; border-radius: 12px; }
.primary { background: var(--petrol); color: white; }
.primary svg { width: 16px; }
.secondary { background: #f1f5f3; color: var(--petrol); }
.notice { font-size: .85rem; color: var(--muted); margin: 8px 0; }
.notice.held { color: var(--reserve); }
.source-label { display:block; margin-top:8px; color:var(--muted); overflow-wrap:anywhere; }
.hold-panel { display:flex; align-items:start; gap:8px; padding:12px; background:#f7eddb; color:#71440d; border-radius:10px; }
.hold-panel strong,.hold-panel span { display:block; }
.hold-panel small,.hold-panel span,[data-reserve]>small { font-size:.78rem; }
.hold-panel strong { font-size:1.05rem; }
[data-reserve] { display:grid; gap:6px; }
[data-reserve]>small { color:var(--muted); }
[data-reserve] .primary { margin-top:6px; }
input[type=datetime-local],#gate input,#team-form input { min-width:0; width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:white; font:inherit; font-size:1rem; min-height:46px; }
#gate { min-height:100svh; display:grid; place-items:center; padding:24px; background:linear-gradient(135deg,#f4f8f6,#e9eee9); }
.login-panel { width:min(100%,380px); padding:32px; background:white; border-radius:20px; box-shadow:0 12px 56px #163c3012; }
.login-panel h1 { font-size:2.1rem; margin:32px 0 8px; }
.login-panel p,#team-form p { font-size:.9rem; color:var(--muted); }
#login-form,#team-form,#login-form label,#team-form label { display:grid; gap:8px; }
#login-form,#team-form { gap:16px; }
#login-form { margin-top:24px; }
#login-form label,#team-form label { font-size:.85rem; font-weight:580; }
#team-form { padding:24px; }
#pdv-form { display:grid; gap:16px; padding:24px; }
#pdv-form label { display:grid; gap:8px; font-size:.85rem; font-weight:580; }
#pdv-form input { min-height:46px; border:1px solid var(--line); border-radius:10px; padding:8px 12px; font-size:1rem; }
#pdv-form p,#pdv-result { font-size:.9rem; color:var(--muted); }
#team-result { white-space:pre-wrap; overflow-wrap:anywhere; user-select:all; }
.error,#login-error { color:#86392a; font-size:.85rem; }
button:disabled { opacity:.6; cursor:wait; }
dialog {
  position: fixed; inset: auto 0 0; margin: 0 auto; padding: 0; border: 0; width: min(100%, 540px); max-width: 100%; max-height: 94dvh;
  border-radius: 20px 20px 0 0; color: var(--ink); background: white; overscroll-behavior: contain;
}
dialog::backdrop { background: #11252363; }
body:has(dialog[open]) { overflow: hidden; }
.sheet-bar { position: sticky; top: 0; z-index: 2; background: white; justify-content: space-between; padding: 4px 10px 4px 20px; font-weight: 610; font-size: .88rem; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
#toast { position: fixed; z-index: 5; bottom: calc(70px + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%,8px); opacity: 0; pointer-events: none; width: max-content; max-width: 92vw; border-radius: 12px; background: var(--ink); color: white; padding: 10px 16px; font-size: .875rem; transition: transform .18s ease-out, opacity .18s ease-out; }
#toast.visible { transform: translate(-50%,0); opacity: 1; }
footer { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .73rem; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 14px; }
@media (max-width: 480px) {
  .metric { padding:12px 8px; }
  .row-foot { align-items: start; flex-direction: column; }
}
@media (max-width: 360px) {
  .bar, main { width: calc(100% - 1.5rem); }
  .segments button { padding-inline: .5rem; }
  .filter-btn span { display: none; }
  .filter-btn { min-width: 46px; justify-content: center; }
}
@media (min-width: 741px) {
  .bar, main { width: min(1160px, calc(100% - 4rem)); }
  main { padding-top: clamp(24px, 4vw, 52px); padding-bottom: 26px; }
  .intro { margin-bottom: 26px; }
  .summary { gap: 12px; }
  .metric { padding:16px 24px; }
  .summary b { font-size: 1.15rem; }
  .bar { min-height: 70px; justify-content: start; gap: 3rem; }
  .brand img { width: 58px; height: 36px; }
  .brand > span { font-size: 1.22rem; }
  nav { position: static; background: none; backdrop-filter: none; border: 0; padding: 0; gap: 5px; }
  nav button { min-height: 44px; padding: 0 14px; }
  .profile-wrap { margin-left: auto; gap: 12px; }
  #profile-name, kbd { display: inline; }
  kbd { border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-family: inherit; font-size: .8rem; line-height: 1.4; }
  .workspace { display: grid; grid-template-columns: minmax(0,1.37fr) minmax(290px,1fr); align-items: start; gap: clamp(24px,3vw,46px); }
  #detail-host { display: block; position: sticky; top: 82px; }
  .detail { border: 1px solid var(--line); border-radius: 20px; }
  .detail-info { padding: 22px; }
  .stage { height: clamp(185px,16vw,245px); }
  #list { gap:0; }
  .row[aria-pressed=true] .thumb { outline: 2px solid var(--petrol); outline-offset: -2px; }
  #toast { bottom: 22px; }
}
@media (min-width: 1100px) {
  .row { grid-template-columns:64px minmax(0,1fr) auto; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .bar, main { width: min(1160px, calc(100% - 2 * max(18px, env(safe-area-inset-left), env(safe-area-inset-right)))); }
  .stage { height: 100px; }
  #detail-host { position: static; }
}
@media (hover: hover) and (pointer: fine) {
  .row:hover .thumb { outline: 1px solid #78978b; outline-offset: -1px; }
  .person:hover, .segments button:not([aria-pressed=true]):hover { background: #eaf1ed; }
  .primary:hover { background: #1a6058; }
}
@media (prefers-reduced-motion: no-preference) {
  @starting-style { dialog[open] { opacity: 0; transform: translateY(12px); } }
  dialog[open] { transition: transform .18s ease-out, opacity .18s ease-out; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  header::before, nav { background: var(--paper); backdrop-filter: none; }
}
