/* Fiyat Yönetimi · Elektraweb — design system and layout. No build step. */

/* ------------------------------------------------------------------ tokens */
:root {
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  --bg: #fafafa;
  --panel: #ffffff;
  --sidebar: #f5f5f6;
  --subtle: #f4f4f5;
  --subtle-2: #ececee;
  --hover: rgba(24, 24, 27, .045);
  --press: rgba(24, 24, 27, .08);
  --line: #e7e7ea;
  --line-2: #d9d9de;
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #8a8a93;
  --text-4: #b4b4bb;

  --accent: #d81e26;          /* Elektraweb red, a touch deeper than the logo for text contrast */
  --accent-hover: #bf161e;
  --accent-ink: #ffffff;
  --accent-soft: #fdeeee;
  --accent-line: #f6c6c8;
  --logo: #ed2024;

  --pos: #0b7a53;   --pos-bg: #e6f4ee;   /* cheaper / good */
  --neg: #b4460c;   --neg-bg: #fcefe6;   /* pricier / above */
  --par: #52525b;   --par-bg: #f0f0f2;
  --info: #2557d6;  --info-bg: #eaf0fd;
  --warn: #a15c07;  --warn-bg: #fdf3e2;
  --err: #c81e1e;   --err-bg: #fdecec;

  --heat-hi: 216 30 38;   /* rgb triplets for tints */
  --heat-lo: 11 122 83;
  --own-bg: #fff7f7;
  --own-line: #f3c9cb;
  --weekend: rgba(24, 24, 27, .022);
  --badge-bg: #eef0ff;  --badge-ink: #4338ca;

  --chart-own: #d81e26;
  --chart-avg: #71717a;
  --chart-sug: #2557d6;
  --chart-band: rgba(113, 113, 122, .14);
  --chart-grid: #ececee;

  --shadow-xs: 0 1px 1px rgba(16, 16, 20, .04);
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, .06), 0 1px 1px rgba(16, 16, 20, .03);
  --shadow-md: 0 2px 6px rgba(16, 16, 20, .06), 0 10px 24px -6px rgba(16, 16, 20, .10);
  --shadow-lg: 0 12px 32px -8px rgba(16, 16, 20, .22), 0 2px 6px rgba(16, 16, 20, .06);
  --ring: 0 0 0 2px var(--panel), 0 0 0 4px rgba(216, 30, 38, .45);

  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px;
  --sb-w: 248px;
  --tb-h: 56px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --is-dark: 1; }
}
:root[data-theme="dark"], :root:not([data-theme="light"]):where(.sys-dark) { --is-dark: 1; }

/* Dark palette: applied by the OS preference unless the user picked light, or by data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0e; --panel: #131316; --sidebar: #0f0f12; --subtle: #1a1a1e; --subtle-2: #222227;
    --hover: rgba(255, 255, 255, .05); --press: rgba(255, 255, 255, .09);
    --line: #232328; --line-2: #2f2f36;
    --text: #ededf0; --text-2: #a8a8b0; --text-3: #74747e; --text-4: #4e4e57;
    --accent: #ff4f57; --accent-hover: #ff6a71; --accent-ink: #1a0506; --accent-soft: rgba(255, 79, 87, .12); --accent-line: rgba(255, 79, 87, .35);
    --pos: #4fd19b; --pos-bg: rgba(79, 209, 155, .12); --neg: #ffa36b; --neg-bg: rgba(255, 163, 107, .12);
    --par: #b4b4bc; --par-bg: rgba(255, 255, 255, .06); --info: #86a8ff; --info-bg: rgba(134, 168, 255, .12);
    --warn: #f0b75b; --warn-bg: rgba(240, 183, 91, .12); --err: #ff7a7a; --err-bg: rgba(255, 122, 122, .12);
    --heat-hi: 255 99 105; --heat-lo: 79 209 155; --heat-a: .075;
    --own-bg: rgba(255, 79, 87, .06); --own-line: rgba(255, 79, 87, .28);
    --weekend: rgba(255, 255, 255, .025);
    --badge-bg: rgba(129, 140, 248, .16); --badge-ink: #a5b4fc;
    --chart-own: #ff4f57; --chart-avg: #a1a1aa; --chart-sug: #86a8ff; --chart-band: rgba(161, 161, 170, .16); --chart-grid: #222227;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5); --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
    --ring: 0 0 0 2px var(--panel), 0 0 0 4px rgba(255, 79, 87, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c0e; --panel: #131316; --sidebar: #0f0f12; --subtle: #1a1a1e; --subtle-2: #222227;
  --hover: rgba(255, 255, 255, .05); --press: rgba(255, 255, 255, .09);
  --line: #232328; --line-2: #2f2f36;
  --text: #ededf0; --text-2: #a8a8b0; --text-3: #74747e; --text-4: #4e4e57;
  --accent: #ff4f57; --accent-hover: #ff6a71; --accent-ink: #1a0506; --accent-soft: rgba(255, 79, 87, .12); --accent-line: rgba(255, 79, 87, .35);
  --pos: #4fd19b; --pos-bg: rgba(79, 209, 155, .12); --neg: #ffa36b; --neg-bg: rgba(255, 163, 107, .12);
  --par: #b4b4bc; --par-bg: rgba(255, 255, 255, .06); --info: #86a8ff; --info-bg: rgba(134, 168, 255, .12);
  --warn: #f0b75b; --warn-bg: rgba(240, 183, 91, .12); --err: #ff7a7a; --err-bg: rgba(255, 122, 122, .12);
  --heat-hi: 255 99 105; --heat-lo: 79 209 155; --heat-a: .075;
  --own-bg: rgba(255, 79, 87, .06); --own-line: rgba(255, 79, 87, .28);
  --weekend: rgba(255, 255, 255, .025);
  --badge-bg: rgba(129, 140, 248, .16); --badge-ink: #a5b4fc;
  --chart-own: #ff4f57; --chart-avg: #a1a1aa; --chart-sug: #86a8ff; --chart-band: rgba(161, 161, 170, .16); --chart-grid: #222227;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5); --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
  --ring: 0 0 0 2px var(--panel), 0 0 0 4px rgba(255, 79, 87, .55);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 13.5px/1.45 var(--font); letter-spacing: -.003em;
  font-feature-settings: 'cv11', 'ss01', 'tnum' 0;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.018em; }
h2 { font-size: 15px; line-height: 22px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 13.5px; line-height: 20px; font-weight: 600; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
code, kbd { font-family: var(--mono); font-size: .9em; }
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px;
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--panel);
  font: 500 10.5px/1 var(--font); color: var(--text-3);
}
.num, .tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1, 'cv11'; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 14px; height: 14px; }
svg.i.lg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ loading bar */
.busy-bar { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 100; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .2s; }
.busy-bar::after { content: ''; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: busy 1.1s var(--ease) infinite; }
html.loading .busy-bar { opacity: 1; transition-delay: .15s; }
@keyframes busy { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ------------------------------------------------------------------ buttons & inputs */
.btn {
  --h: 32px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--h); padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); color: var(--text);
  font-weight: 500; font-size: 13px; white-space: nowrap; box-shadow: var(--shadow-xs);
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s, transform .06s;
  -webkit-tap-highlight-color: transparent; text-decoration: none; user-select: none;
}
.btn:hover { background: var(--subtle); }
.btn:active { transform: translateY(.5px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(216, 30, 38, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover:not([disabled]) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover:not([disabled]) { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--err); }
.btn.danger:hover:not([disabled]) { background: var(--err-bg); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.btn.danger-solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn.warn-outline { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, var(--line-2)); }
.btn.warn-outline:hover:not([disabled]) { background: var(--err-bg); }
.btn.sm { --h: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.xs { --h: 24px; padding: 0 8px; font-size: 12px; border-radius: var(--r-sm); }
.btn.lg { --h: 40px; padding: 0 16px; font-size: 14px; }
.btn.icon { width: var(--h); padding: 0; }
.btn[aria-busy="true"] { color: transparent !important; position: relative; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--text-3) transparent var(--text-3) var(--text-3); animation: spin .7s linear infinite; }
.btn.primary[aria-busy="true"]::after { border-color: #fff transparent #fff #fff; }
.spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.input, .select {
  height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel);
  color: var(--text); box-shadow: var(--shadow-xs); min-width: 0; transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--text-4); }
.input:hover, .select:hover { border-color: color-mix(in srgb, var(--text-3) 50%, var(--line-2)); }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.input[aria-invalid="true"] { border-color: var(--err); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 6.5l3 3 3-3' fill='none' stroke='%238a8a93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
.select option { background: var(--panel); color: var(--text); }
input[type="date"].input { font-variant-numeric: tabular-nums; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-3); }
.error-text { font-size: 12.5px; color: var(--err); }

/* Segmented control */
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r); background: var(--subtle); border: 1px solid var(--line); }
.seg button, .seg label {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  color: var(--text-2); font-weight: 500; font-size: 12.5px; white-space: nowrap; cursor: pointer; transition: background .12s, color .12s;
}
.seg button:hover, .seg label:hover { color: var(--text); }
.seg [aria-pressed="true"], .seg [aria-checked="true"], .seg label:has(input:checked) { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; cursor: pointer; }

/* Tags, badges, dots */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--subtle); color: var(--text-2); white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.pos { background: var(--pos-bg); color: var(--pos); }
.tag.neg { background: var(--neg-bg); color: var(--neg); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.err { background: var(--err-bg); color: var(--err); }
.tag.info { background: var(--info-bg); color: var(--info); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); flex: none; }
.dot.ok { background: var(--pos); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); }
.dot.live { background: var(--pos); box-shadow: 0 0 0 0 color-mix(in srgb, var(--pos) 50%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.badge { display: inline-flex; align-items: center; height: 15px; padding: 0 4px; border-radius: 4px; background: var(--badge-bg); color: var(--badge-ink); font-size: 10px; font-weight: 600; letter-spacing: .01em; }
.own-tag { display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 600; }
.stars { color: #e5a00d; font-size: 10px; letter-spacing: .5px; }
.rt { display: inline-flex; align-items: center; height: 15px; padding: 0 4px; border-radius: 4px; background: var(--subtle-2); color: var(--text-2); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Thumbnails (hotel images with initials fallback) */
.thumb { position: relative; flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: 6px; background: linear-gradient(135deg, var(--subtle-2), var(--subtle)); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line); }
.thumb i { font-style: normal; font-weight: 600; font-size: 10px; letter-spacing: .02em; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.xs { width: 20px; height: 20px; border-radius: 5px; } .thumb.xs i { font-size: 8.5px; }
.thumb.sm { width: 24px; height: 24px; }
.thumb.md { width: 36px; height: 36px; border-radius: 8px; } .thumb.md i { font-size: 12px; }
.thumb.lg { width: 48px; height: 48px; border-radius: 10px; } .thumb.lg i { font-size: 15px; }

/* Skeletons */
.sk { display: inline-block; height: 10px; width: 100%; max-width: 64px; border-radius: 4px; background: linear-gradient(90deg, var(--subtle) 0%, var(--subtle-2) 50%, var(--subtle) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; vertical-align: middle; }
.sk.block { display: block; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ------------------------------------------------------------------ app shell */
.app { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.sidebar {
  display: flex; flex-direction: column; min-height: 0; background: var(--sidebar); border-right: 1px solid var(--line);
  padding: calc(12px + var(--safe-t)) 10px calc(10px + var(--safe-b)) calc(10px + var(--safe-l));
}
.sb-head { display: flex; align-items: center; gap: 8px; padding: 2px 6px 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; flex: 1; }
.brand img { width: 26px; height: 26px; }
.brand-t { display: grid; line-height: 1.15; }
.brand-t b { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.brand-t span { font-size: 11px; color: var(--text-3); }
.sb-close { display: none; }
.sb-label { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.sb-scroll { flex: 1; overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.set-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.set-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r); background: transparent; text-align: left;
  color: var(--text-2); min-height: 40px; text-decoration: none;
}
.set-item:hover { background: var(--hover); color: var(--text); }
.set-item[aria-current="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.set-item .si-t { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.set-item .si-n { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-item .si-s { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-new { margin-top: 4px; justify-content: flex-start; width: 100%; color: var(--text-2); height: 34px; }
.sb-sk { display: grid; gap: 8px; padding: 8px; }
.sb-foot { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 8px; }
.sb-link { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px; border-radius: var(--r); color: var(--text-2); text-decoration: none; font-weight: 500; border: 0; background: transparent; width: 100%; }
.sb-link:hover { background: var(--hover); color: var(--text); }
.sb-link[aria-current="page"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.sb-link .sb-meta { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-weight: 400; display: inline-flex; align-items: center; gap: 6px; }
.user-btn .avatar { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700; flex: none; }
.user-btn .ub-t { display: grid; text-align: left; line-height: 1.2; min-width: 0; }
.user-btn .ub-t b { font-weight: 500; font-size: 12.5px; color: var(--text); }
.user-btn .ub-t span { font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.user-btn { height: 44px; }

.main-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.scrim { display: none; }

/* Top bar */
.topbar {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: var(--tb-h); padding: 10px 20px; padding-top: calc(10px + var(--safe-t));
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  z-index: 20; flex-wrap: nowrap;
}
.tb-menu, .tb-title, .tb-filter-btn { display: none; }
.tb-filters { display: flex; align-items: center; gap: 8px; flex: none; }
.tb-sep { width: 1px; height: 20px; background: var(--line); flex: none; }
.tb-spacer { flex: 1; min-width: 8px; }
.tb-page { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.range-btn { gap: 8px; font-variant-numeric: tabular-nums; }
.range-btn .rb-n { color: var(--text-3); font-weight: 400; }
.pill-select { position: relative; display: inline-flex; align-items: center; }
.pill-select .select { height: 32px; font-weight: 500; font-size: 13px; padding-left: 30px; }
.pill-select svg { position: absolute; left: 10px; pointer-events: none; color: var(--text-3); }
.freshness { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); white-space: nowrap; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.freshness b { font-weight: 500; color: var(--text-2); }
.freshness .stale-n { color: var(--warn); font-weight: 500; }
.freshness .fr-t { overflow: hidden; text-overflow: ellipsis; }
.refresh-group { display: inline-flex; flex: none; }
.refresh-group .btn.primary:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.refresh-group .btn.primary.more { border-top-left-radius: 0; border-bottom-left-radius: 0; width: 28px; padding: 0; border-left-color: rgba(255, 255, 255, .25); }
.refresh-btn { min-width: 148px; position: relative; overflow: hidden; }
.refresh-btn .rb-progress { position: absolute; inset: auto 0 0 0; height: 2px; background: rgba(255, 255, 255, .35); transform-origin: left; transform: scaleX(0); transition: transform .4s var(--ease); }
.refresh-btn.running svg { animation: spin 1s linear infinite; }
.job-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; overflow: hidden; pointer-events: none; }
.job-bar .fill { height: 100%; width: 0; background: var(--accent); transition: width .45s var(--ease), opacity .3s; }

/* Popovers & menus */
.popover {
  position: fixed; z-index: 60; min-width: 220px; max-width: calc(100vw - 24px); padding: 6px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--panel); box-shadow: var(--shadow-lg); animation: pop .14s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; color: var(--text); font-size: 13px; text-decoration: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); box-shadow: none; }
.menu-item svg { color: var(--text-3); }
.menu-item.danger { color: var(--err); } .menu-item.danger svg { color: var(--err); }
.menu-item .mi-k { margin-left: auto; display: inline-flex; gap: 3px; }
.menu-sep { height: 1px; background: var(--line); margin: 6px -6px; }
.menu-label { padding: 6px 10px 4px; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.range-pop { padding: 12px; width: 300px; display: grid; gap: 12px; }
.range-pop .presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.range-pop .presets .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.range-pop .dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range-pop .dates .input { width: 100%; }

/* ------------------------------------------------------------------ main view */
.view:focus, .view:focus-visible { box-shadow: none; }
.view { flex: 1; overflow: auto; min-height: 0; overscroll-behavior: contain; scroll-padding-top: 16px; }
.page { max-width: 1480px; margin: 0 auto; padding: 20px 24px calc(40px + var(--safe-b)); display: grid; gap: 16px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .ph-t { display: grid; gap: 2px; min-width: 0; flex: 1; }
.page-head .ph-sub .ps + .ps::before { content: '·'; margin-right: 8px; color: var(--text-4); }
.page-head .ph-sub .ph-fresh:empty { display: none !important; }
.page-head .ph-sub { display: flex; align-items: center; gap: 0 8px; color: var(--text-3); font-size: 12.5px; flex-wrap: wrap; }
.page-head h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-own { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ph-actions { display: flex; align-items: center; gap: 8px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 48px; flex-wrap: wrap; }
.card-head h2 { font-size: 13.5px; }
.card-head .ch-sub { color: var(--text-3); font-size: 12px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }

/* Banners */
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); font-size: 13px; box-shadow: var(--shadow-xs); }
.banner .b-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--subtle); color: var(--text-2); }
.banner.info .b-ic { background: var(--info-bg); color: var(--info); }
.banner.warn .b-ic { background: var(--warn-bg); color: var(--warn); }
.banner.err .b-ic { background: var(--err-bg); color: var(--err); }
.banner .b-t { flex: 1; min-width: 0; display: grid; gap: 1px; }
.banner .b-t b { font-weight: 600; }
.banner .b-t span { color: var(--text-2); font-size: 12.5px; }
.banner .b-a { display: flex; gap: 6px; flex: none; }

/* Overview cards */

/* Chart */
.chart-card .card-body { padding: 8px 8px 8px 0; }
.chart-wrap { position: relative; height: 260px; }
.chart-wrap svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-wrap .axis text { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-wrap .grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart-wrap .we-band { fill: var(--weekend); }
.chart-wrap .band { fill: var(--chart-band); }
.chart-wrap .l-avg { fill: none; stroke: var(--chart-avg); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart-wrap .l-sug { fill: none; stroke: var(--chart-sug); stroke-width: 2; }
.chart-wrap .l-own { fill: none; stroke: var(--chart-own); stroke-width: 2.25; }
.chart-wrap .p-own { fill: var(--chart-own); stroke: var(--panel); stroke-width: 2; }
.chart-wrap .cross { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 2 2; }
.chart-wrap .hl { stroke: var(--panel); stroke-width: 2; }
.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 0; border-top: 2px solid; }
.legend .sw.own { border-color: var(--chart-own); }
.legend .sw.sug { border-color: var(--chart-sug); }
.legend .sw.avg { border-top-style: dashed; border-color: var(--chart-avg); }
.legend .sw.band { height: 10px; border: 0; border-radius: 2px; background: var(--chart-band); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chart-avg) 30%, transparent); }
.tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 180px; padding: 10px 12px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); font-size: 12px; display: grid; gap: 4px; transition: opacity .1s;
}
.tip .t-h { font-weight: 600; font-size: 12.5px; margin-bottom: 2px; }
.tip .t-r { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.tip .t-r b { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.tip .t-r .sw { width: 8px; height: 8px; border-radius: 2px; }
.chart-empty { height: 260px; display: grid; place-items: center; color: var(--text-3); font-size: 13px; text-align: center; }

/* ------------------------------------------------------------------ price matrix */
.matrix-card { overflow: hidden; }
.matrix-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.matrix-scroll { overflow-x: auto; overflow-y: hidden; position: relative; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: thin; }
.matrix { border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 100%; }
.matrix th, .matrix td { padding: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.matrix thead th { position: sticky; top: 0; z-index: 3; background: var(--panel); height: 44px; border-bottom: 1px solid var(--line-2); font-weight: 500; }
.matrix th.date { min-width: 64px; padding: 0 8px; text-align: right; color: var(--text-2); }
.matrix th.date .dow { display: block; font-size: 11px; color: var(--text-3); font-weight: 500; text-transform: none; }
.matrix th.date .dom { display: block; font-size: 12px; color: var(--text); }
.matrix th.date.we .dow { color: var(--accent); }
.matrix th.date.today .dom::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-right: 5px; vertical-align: 2px; }
.matrix .hotel {
  position: sticky; left: 0; z-index: 2; background: var(--panel); text-align: left; min-width: 240px; max-width: 280px; width: 260px;
  padding: 0 8px 0 16px; border-right: 1px solid var(--line); font-weight: 400;
}
.matrix thead .hotel { z-index: 4; }
.matrix .corner { vertical-align: bottom; padding-bottom: 7px; }
.matrix .corner-t { display: block; font-size: 12px; color: var(--text); }
.matrix .corner-s { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; }
.hcell { display: flex; align-items: center; gap: 10px; height: 44px; min-width: 0; }
.hmeta { display: grid; min-width: 0; flex: 1; line-height: 1.2; gap: 1px; }
.hmeta .n { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.hmeta .hs { display: flex; align-items: center; gap: 5px; height: 15px; }
.matrix .rm { opacity: 0; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); display: grid; place-items: center; flex: none; transition: opacity .12s; }
.matrix .rm svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.matrix tr:hover .rm, .matrix .rm:focus-visible { opacity: 1; }
.matrix .rm:hover { background: var(--err-bg); color: var(--err); }
.matrix td.c { text-align: right; padding: 0 10px; height: 44px; min-width: 64px; position: relative; cursor: pointer; color: var(--text); }
.matrix tbody.hotels td.c:hover { box-shadow: inset 0 0 0 1px var(--line-2); background-color: var(--hover); }
.matrix td.c:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 0; outline: none; z-index: 1; }
.matrix td.c.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.matrix .we { background-image: linear-gradient(var(--weekend), var(--weekend)); }
.matrix .price { display: inline-flex; align-items: center; gap: 5px; }
.matrix .dash { color: var(--text-4); }
.matrix td.stale .v { color: var(--text-3); }
.matrix td.stale::after { content: ''; position: absolute; top: 7px; right: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--warn); opacity: .8; }
.matrix .erricon { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--err-bg); color: var(--err); font-weight: 700; font-size: 11px; }
.matrix td.pending .sk { width: 40px; }
.matrix td.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { from { background-color: var(--info-bg); } }
.matrix tr.own .hotel, .matrix tr.own td { background-color: var(--own-bg); }
.matrix tr.own .hotel { box-shadow: inset 3px 0 0 var(--accent); }
.matrix tr.own td.c { font-weight: 600; }
.matrix tr.own td.c.above { color: var(--neg); }
.matrix tr.own td.c.below { color: var(--pos); }
.matrix tr.own td, .matrix tr.own th { border-bottom-color: var(--own-line); }
.matrix tbody.summary th, .matrix tbody.summary td { height: 34px; background: var(--subtle); color: var(--text-2); border-bottom-color: var(--line); }
.matrix tbody.summary td.c { cursor: default; font-size: 12px; }
.matrix tbody.summary .hotel { background: var(--subtle); }
.matrix tbody.summary tr.first th, .matrix tbody.summary tr.first td { border-top: 1px solid var(--line-2); }
.matrix tbody.summary .sl { font-size: 12px; font-weight: 500; color: var(--text-2); }
.matrix tbody.summary .sh { margin-left: 6px; font-size: 11px; color: var(--text-3); }
.matrix tbody.summary tr.suggested td, .matrix tbody.summary tr.suggested th { color: var(--text); font-weight: 600; }
.matrix tbody.summary tr.suggested .sl { color: var(--chart-sug); }
.matrix .avail.zero { color: var(--err); }
.matrix .delta { display: inline-flex; height: 18px; align-items: center; padding: 0 5px; border-radius: 4px; font-weight: 600; font-size: 11.5px; }
.matrix .delta.above { color: var(--neg); background: var(--neg-bg); }
.matrix .delta.below { color: var(--pos); background: var(--pos-bg); }
.matrix .delta.par { color: var(--par); background: var(--par-bg); }
.matrix tbody.summary tr:last-child th, .matrix tbody.summary tr:last-child td { border-bottom: 0; }

/* Edit row ("Yeni fiyat") */
.matrix tr.edit th, .matrix tr.edit td { background: color-mix(in srgb, var(--info-bg) 60%, var(--panel)); border-bottom-color: var(--line-2); height: 52px; }
.matrix tr.edit .hotel { box-shadow: inset 3px 0 0 var(--info); }
.matrix tr.edit td.e { padding: 4px 6px; text-align: right; cursor: default; }
.ecell { display: grid; justify-items: end; gap: 3px; }
.ecell input[type="number"] { width: 76px; height: 26px; padding: 0 6px; text-align: right; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); font-variant-numeric: tabular-nums; font-size: 12.5px; -moz-appearance: textfield; }
.ecell input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.ecell input[type="number"]:focus { border-color: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }
.ecell .ec-d { font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-3); height: 12px; display: flex; align-items: center; gap: 4px; }
.ecell .ec-d.up { color: var(--neg); } .ecell .ec-d.down { color: var(--pos); }
.ecell.off input[type="number"] { opacity: .45; }
.edit-head { display: grid; gap: 3px; }
.edit-head .eh-t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; color: var(--info); }
.edit-head .eh-s { font-size: 11px; color: var(--text-3); }
.edit-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--info-bg) 45%, var(--panel)); font-size: 12.5px; }
.edit-bar .select { height: 28px; font-size: 12.5px; }
.edit-bar .eb-note { color: var(--text-2); }

/* Legend under the matrix */

/* Per-night list (phones, or "Liste" view) */
.nights { display: grid; gap: 10px; padding: 12px; }
.night { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.night summary { list-style: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; min-height: 56px; }
.night summary::-webkit-details-marker { display: none; }
.night .n-date { display: grid; justify-items: center; width: 40px; line-height: 1.1; }
.night .n-date b { font-size: 17px; font-weight: 600; }
.night .n-date span { font-size: 11px; color: var(--text-3); }
.night.we .n-date span { color: var(--accent); }
.night .n-mid { display: grid; gap: 2px; min-width: 0; }
.night .n-own { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.night .n-mkt { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.night .n-right { display: grid; justify-items: end; gap: 2px; }
.night .n-sug { font-size: 11px; color: var(--text-3); }
.night .n-sug b { color: var(--chart-sug); font-size: 14px; font-variant-numeric: tabular-nums; }
.n-month { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 6px 4px 0; text-transform: capitalize; }
.night.today { border-color: var(--accent-line); }
.night .n-band { grid-column: 1 / -1; height: 4px; margin: 2px 0 2px; border-radius: 2px; background: var(--subtle-2); position: relative; }
.night .n-band i { position: absolute; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--chart-own); border: 2px solid var(--panel); transform: translateX(-50%); }
.night .n-band u { position: absolute; top: 0; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--chart-avg) 60%, transparent); }
.night ul { list-style: none; margin: 0; padding: 0 0 4px; border-top: 1px solid var(--line); }
.night li { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 44px; border-bottom: 1px solid var(--line); cursor: pointer; }
.night li:last-child { border-bottom: 0; }
.night li .ln { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.night li .lv { font-variant-numeric: tabular-nums; font-weight: 500; }
.night li.own .ln { font-weight: 600; }
.night .n-edit { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--info-bg) 50%, var(--panel)); }
.night .n-edit input[type="number"] { width: 110px; height: 40px; font-size: 15px; text-align: right; }

/* ------------------------------------------------------------------ empty / onboarding */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 24px; }
.empty .e-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--subtle); color: var(--text-2); margin-bottom: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.empty p { color: var(--text-2); max-width: 440px; }
.empty .btn { margin-top: 6px; }
.onboard { max-width: 760px; margin: 6vh auto 0; display: grid; gap: 24px; padding: 0 4px; }
.onboard-hero { display: grid; gap: 10px; justify-items: start; }
.onboard-hero .logo-bloom { width: 48px; height: 48px; padding: 8px; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line); }
.onboard-hero h1 { font-size: 26px; line-height: 32px; letter-spacing: -.025em; }
.onboard-hero p { color: var(--text-2); font-size: 14.5px; max-width: 560px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { padding: 16px; display: grid; gap: 6px; align-content: start; }
.steps li .s-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--subtle); color: var(--text-2); font-size: 12px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.steps li.cur .s-n { background: var(--accent); color: #fff; box-shadow: none; }
.steps li p { color: var(--text-2); font-size: 12.5px; }
.onboard-cta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ dialogs, sheets, drawer */
dialog:not([open]) { display: none !important; }
dialog { padding: 0; border: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(10, 10, 12, .38); backdrop-filter: blur(2px); }
.modal {
  width: min(480px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow-lg);
  margin: auto; animation: modal .18s var(--ease);
}
.modal.wide { width: min(640px, calc(100vw - 32px)); }
@keyframes modal { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-body { padding: 20px; display: grid; gap: 12px; }
.modal-body h2 { font-size: 16px; }
.modal-actions { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--subtle); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.modal-actions .spacer { flex: 1; }
.modal .x { position: absolute; right: 12px; top: 12px; }
.confirm-list { max-height: 44vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.confirm-list table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.confirm-list th, .confirm-list td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.confirm-list th:first-child, .confirm-list td:first-child { text-align: left; }
.confirm-list thead th { position: sticky; top: 0; background: var(--subtle); font-weight: 500; color: var(--text-2); font-size: 12px; }
.confirm-list tr:last-child td { border-bottom: 0; }
.confirm-list .up { color: var(--neg); } .confirm-list .down { color: var(--pos); }
.confirm-list .res-ok { color: var(--pos); font-weight: 600; } .confirm-list .res-err { color: var(--err); font-weight: 500; white-space: normal; text-align: left; }
.callout { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); font-size: 12.5px; line-height: 1.45; }
.callout.warn { background: var(--warn-bg); color: color-mix(in srgb, var(--warn) 70%, var(--text)); }
.callout.err { background: var(--err-bg); color: var(--err); }
.callout.ok { background: var(--pos-bg); color: var(--pos); }
.callout.info { background: var(--info-bg); color: color-mix(in srgb, var(--info) 75%, var(--text)); }
.callout svg { flex: none; margin-top: 1px; }

/* Drawer (offers) */
.drawer {
  position: fixed; inset: 0 0 0 auto; height: 100%; width: min(440px, 100vw); margin: 0; border-left: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slidein .22s var(--ease);
}
.drawer[open] { display: flex; }
.drawer::backdrop { background: rgba(10, 10, 12, .22); backdrop-filter: none; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
.dr-head { display: flex; gap: 12px; padding: 16px 16px 14px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; padding-top: calc(16px + var(--safe-t)); }
.dr-head .dh-t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.dr-head h2 { font-size: 15px; line-height: 20px; }
.dr-head .dh-s { color: var(--text-3); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dr-nav { display: flex; gap: 2px; }
.dr-body { flex: 1; overflow: auto; padding: 16px 20px calc(20px + var(--safe-b)); display: grid; gap: 18px; align-content: start; }
.dr-price { display: grid; gap: 4px; }
.dr-price .dp-v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 34px; }
.dr-price .dp-s { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.dr-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.dr-stats > div { padding: 8px 10px; display: grid; gap: 1px; border-right: 1px solid var(--line); }
.dr-stats > div:last-child { border-right: 0; }
.dr-stats span { font-size: 11px; color: var(--text-3); }
.dr-stats b { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dr-sec { display: grid; gap: 8px; }
.dr-sec > h3 { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: none; }
.dr-sec > h3 .faint { font-weight: 400; margin-left: auto; }
.offers { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.offers li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.offers li:last-child { border-bottom: 0; }
.offers li.best { background: color-mix(in srgb, var(--pos-bg) 50%, var(--panel)); }
.offers .site-ic { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.offers .o-t { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.offers .o-t b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offers .o-t span { font-size: 11.5px; color: var(--text-3); }
.offers .o-p { font-weight: 600; font-variant-numeric: tabular-nums; }
.offers a.o-go { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; color: var(--text-3); }
.offers a.o-go:hover { background: var(--hover); color: var(--text); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 12.5px; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* Command palette */
.palette {
  width: min(640px, calc(100vw - 32px)); margin: 12vh auto auto; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; max-height: min(620px, 76vh); overflow: hidden; animation: modal .16s var(--ease);
}
.pal-head { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); min-height: 54px; }
.pal-head svg { color: var(--text-3); }
.pal-head input { flex: 1; height: 54px; border: 0; background: transparent; font-size: 15px; outline: none; min-width: 0; }
.pal-head input::placeholder { color: var(--text-3); }
.pal-head input:focus-visible { box-shadow: none; }
.pal-mode { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-2); background: var(--subtle); }
.pal-mode .spacer { flex: 1; }
.pal-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.pal-group { padding: 8px 10px 4px; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r); cursor: pointer; min-height: 40px; }
.pal-item[aria-selected="true"] { background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); }
.pal-item .pi-t { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.pal-item .pi-n { font-weight: 500; display: flex; align-items: center; gap: 6px; min-width: 0; }
.pal-item .pi-n span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .pi-s { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.pal-item .pi-r { display: grid; justify-items: end; gap: 2px; flex: none; }
.pal-item .pi-price { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pal-item .pi-price b { color: var(--text); font-weight: 600; }
.pal-item .pi-ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--subtle); color: var(--text-2); flex: none; }
.pal-item .added { color: var(--pos); font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.pal-note { padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 13px; display: grid; gap: 6px; justify-items: center; }
.pal-foot { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); background: var(--subtle); flex-wrap: wrap; }
.pal-foot .spacer { flex: 1; }
.pal-foot span { display: inline-flex; align-items: center; gap: 5px; }
.pal-sk { display: flex; align-items: center; gap: 12px; padding: 10px; }

/* Bottom sheet (filters on phones) */
.sheet {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; margin: 0; border-radius: 16px 16px 0 0; background: var(--panel); border-top: 1px solid var(--line);
  box-shadow: var(--shadow-lg); padding: 8px 16px calc(16px + var(--safe-b)); animation: sheetin .24s var(--ease); max-height: 92dvh; overflow: auto;
}
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 10px; }
.sheet .sh-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet .sh-body { display: grid; gap: 16px; }
.sheet .sh-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@keyframes sheetin { from { transform: translateY(40px); opacity: .4; } }

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 90; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: var(--r-lg); background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.4; animation: toastin .2s var(--ease);
}
:root[data-theme="dark"] .toast { background: #26262b; color: var(--text); border: 1px solid var(--line-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #26262b; color: var(--text); border: 1px solid var(--line-2); } }
.toast .t-ic { flex: none; margin-top: 1px; }
.toast.success .t-ic { color: #4fd19b; } .toast.error .t-ic { color: #ff7a7a; } .toast.info .t-ic { color: #86a8ff; }
.toast .t-m { flex: 1; min-width: 0; }
.toast .t-a { background: transparent; border: 0; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.toast .t-x { background: transparent; border: 0; color: inherit; opacity: .55; padding: 0; width: 18px; height: 18px; display: grid; place-items: center; }
.toast.out { animation: toastout .18s var(--ease) forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastout { to { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------------ settings */
.settings { max-width: 920px; }
.s-sec { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-top: 1px solid var(--line); }
.s-sec:first-of-type { border-top: 0; padding-top: 4px; }
.s-sec > header { display: grid; gap: 4px; align-content: start; }
.s-sec > header p { color: var(--text-3); font-size: 12.5px; }
.s-sec .card-body { display: grid; gap: 16px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-grid.three { grid-template-columns: 1fr; }
.choice.disabled { cursor: not-allowed; opacity: .6; background: var(--subtle); }
.choice-why { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-style: normal; color: var(--warn); }
.choice {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  cursor: pointer; background: var(--panel); transition: border-color .12s, box-shadow .12s, background .12s;
}
.choice:hover { border-color: color-mix(in srgb, var(--text-3) 60%, var(--line-2)); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.choice input { grid-row: span 2; margin-top: 2px; }
.choice b { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.choice span { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.secret { display: flex; gap: 8px; align-items: center; }
.secret .input { flex: 1; }
.saved-key { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 6px 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--subtle); font-family: var(--mono); font-size: 12.5px; }
.saved-key .spacer { flex: 1; }
.test-result { display: grid; gap: 8px; }
.test-result .kv { padding: 10px 12px; border-radius: var(--r); background: var(--subtle); }
.meter-row { display: grid; gap: 6px; }
.meter-row .m { height: 8px; border-radius: 4px; background: var(--subtle-2); overflow: hidden; }
.meter-row .m > span { display: block; height: 100%; background: var(--pos); border-radius: 4px; }
.meter-row .m.low > span { background: var(--warn); }
.ext-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.ext-steps b { color: var(--text); font-weight: 600; }
.savebar {
  position: sticky; bottom: calc(12px + var(--safe-b)); z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; margin-top: 8px;
  border-radius: var(--r-lg); background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); animation: toastin .2s var(--ease);
}
.savebar .spacer { flex: 1; }
.savebar .btn.ghost { color: inherit; opacity: .8; }
.savebar .btn.ghost:hover { background: rgba(127, 127, 127, .2); }

/* ------------------------------------------------------------------ responsive */
.ph-fresh { display: none; align-items: center; gap: 6px; }
@media (max-width: 860px) { .ph-fresh { display: inline-flex; } .freshness { display: none; } }

/* Tablet: sidebar becomes a drawer */
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 70; transform: translateX(-102%); transition: transform .24s var(--ease);
    box-shadow: var(--shadow-lg); visibility: hidden;
  }
  .app.nav-open .sidebar { transform: none; visibility: visible; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(10, 10, 12, .38); animation: fade .2s; }
  .sb-close { display: inline-flex; }
  .tb-menu { display: inline-flex; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .page { padding: 16px 16px calc(32px + var(--safe-b)); }
  .s-sec { grid-template-columns: 1fr; gap: 12px; }
}
@keyframes fade { from { opacity: 0; } }

@media (max-width: 860px) {
  .tb-filters { display: none; }
  .tb-filter-btn { display: inline-flex; }
  .tb-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; border: 0; background: transparent; padding: 0 4px; height: 40px; text-align: left; border-radius: var(--r); }
  .tb-title .tt-t { display: grid; min-width: 0; line-height: 1.2; }
  .tb-title .tt-t b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tb-title .tt-t span { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tb-spacer { display: none; }
  .steps { grid-template-columns: 1fr; }
}

/* Phones */
@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar { gap: 4px; padding: calc(8px + var(--safe-t)) calc(8px + var(--safe-r)) 8px calc(8px + var(--safe-l)); min-height: 56px; }
  .refresh-btn { min-width: 0; }
  .refresh-btn .rb-label { display: none; }
  .refresh-group .btn.primary.more { display: none; }
  .refresh-group .btn.primary:first-child { border-radius: var(--r); width: 40px; padding: 0; }
  .btn { --h: 40px; }
  .btn.sm { --h: 36px; }
  .btn.xs { --h: 32px; }
  .input, .select { height: 44px; font-size: 16px; }
  .pill-select .select { height: 44px; }
  .seg button, .seg label { height: 36px; }
  .page { padding: 12px 12px calc(28px + var(--safe-b)); gap: 12px; }
  .page-head h1 { display: none; }
  .page-head { flex-wrap: nowrap; }
  .page-head .ph-sub .ph-own, .page-head .ph-sub .ps-src { display: none; }
  .page-head .ph-sub .ph-own + .ps::before { content: none; }
  .legend { gap: 6px 12px; font-size: 11.5px; }
  .ph-actions .btn .bl { display: none; }
  .ph-actions .btn { width: 40px; padding: 0; }
  .chart-wrap, .chart-empty { height: 200px; }
  .strip { font-size: 12.5px; gap: 4px 12px; }
  .strip .sdiv { display: none; }
  .card-head { padding: 10px 12px; }
  .matrix-card { --hc: 128px; --cw: 60px; }
  .matrix .hotel { padding: 0 6px 0 10px; }
  .matrix .hotel .thumb { display: none; }
  .matrix .hotel .hs .stars { display: none; }
  .matrix th.date, .matrix td.c { padding: 0 8px; }
  .matrix .rm { display: none; }
  .banner { flex-wrap: wrap; }
  .banner .b-a { width: 100%; }
  .banner .b-a .btn { flex: 1; }
  .modal { width: calc(100vw - 24px); }
  .modal-body { padding: 16px; }
  .modal-actions { padding: 12px 16px calc(12px + var(--safe-b)); }
  .modal-actions .btn { flex: 1; }
  .modal-actions .spacer { display: none; }
  .palette { width: 100vw; height: 100dvh; max-height: none; margin: 0; border-radius: 0; border: 0; padding-top: var(--safe-t); }
  .pal-head input { font-size: 16px; }
  .pal-foot .keys { display: none; }
  .pal-item { min-height: 56px; }
  .drawer {
    inset: auto 0 0 0; width: 100%; height: 94dvh; max-height: 94dvh; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0;
    animation: sheetin .24s var(--ease);
  }
  .drawer .dr-head { padding-top: 16px; }
  .drawer .grab { display: block; }
  .dr-stats { grid-template-columns: repeat(2, 1fr); }
  .dr-stats > div:nth-child(2) { border-right: 0; }
  .dr-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .offers li { min-height: 52px; }
  .choice-grid, .form-grid { grid-template-columns: 1fr; }
  .toasts { left: 12px; right: 12px; width: auto; bottom: calc(12px + var(--safe-b)); }
  .onboard { margin-top: 12px; }
  .onboard-hero h1 { font-size: 22px; line-height: 28px; }
  .sb-link, .set-item { min-height: 44px; }
  .sb-meta kbd { display: none; }
  .matrix-tools .bl { display: none; }
  .savebar { flex-wrap: wrap; }
  .s-sec .seg { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .s-sec .seg button { justify-content: center; }
  .s-sec .card-body > *, .s-sec .field { min-width: 0; }
}
.drawer .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 8px auto 0; flex: none; }
@media (min-width: 641px) { .drawer .grab { display: none; } }

@media (pointer: coarse) and (min-width: 641px) {
  .matrix .rm { opacity: 1; }
}
@media (pointer: coarse) {
  .set-item, .sb-link, .menu-item { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print {
  .sidebar, .topbar, .toasts, .matrix-tools, .busy-bar { display: none !important; }
  body { overflow: visible; }
  .app { display: block; height: auto; }
  .view { overflow: visible; }
}

/* ------------------------------------------------------------------ sign-in */
#auth-root { height: 100vh; height: 100dvh; overflow: auto; }
.auth {
  min-height: 100%; display: grid; place-items: center; align-content: center; gap: 16px; padding: calc(24px + var(--safe-t)) 16px calc(24px + var(--safe-b));
  background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%), var(--bg);
}
.auth-card { width: min(440px, 100%); display: grid; gap: 20px; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow-md); animation: modal .24s var(--ease); }
.auth-card.center { justify-items: center; text-align: center; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { width: 40px; height: 40px; }
.auth-brand div { display: grid; line-height: 1.2; }
.auth-brand b { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.auth-brand span { font-size: 12px; color: var(--text-3); }
.auth-main { display: grid; gap: 10px; }
.auth-main h1 { font-size: 22px; line-height: 28px; letter-spacing: -.02em; }
.auth-main p { color: var(--text-2); font-size: 13.5px; }
.auth-steps { list-style: none; margin: 4px 0 0; padding: 12px; display: grid; gap: 8px; border-radius: var(--r-lg); background: var(--subtle); border: 1px solid var(--line); }
.auth-steps li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.auth-steps li b { color: var(--text); }
.auth-steps li em { font-style: normal; }
.auth-steps li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 11.5px; font-weight: 600; color: var(--text-2); flex: none; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-alt { display: grid; gap: 14px; }
.auth-form { display: grid; gap: 10px; }
.auth-more summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; color: var(--text-2); font-weight: 500; min-height: 32px; border-radius: var(--r-sm); }
.auth-more summary::-webkit-details-marker { display: none; }
.auth-more summary svg { transition: transform .15s; }
.auth-more[open] summary svg { transform: rotate(90deg); }
.auth-more .auth-form { padding: 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--subtle); }
.auth-who { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--subtle); }
.auth-who .avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.auth-who div { display: grid; line-height: 1.3; }
.auth-who span { color: var(--text-3); font-size: 12.5px; }
.auth-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.auth-wait { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.auth-foot { color: var(--text-3); font-size: 12px; }
@media (max-width: 640px) {
  .auth { place-items: stretch; align-content: start; grid-template-columns: minmax(0, 1fr); }
  .auth-card { padding: 20px; border-radius: var(--r-lg); }
  .auth-actions .btn { flex: 1; white-space: normal; height: auto; min-height: 44px; }
}
.saved-key .btn, .saved-key .tag { font-family: var(--font); }
@media (pointer: coarse) { .kbd-hint { display: none !important; } }
.secret .input { min-width: 0; width: 100%; }
.auth-card > *, .auth-alt > *, .auth-form > * { min-width: 0; }

/* ------------------------------------------------------------------ v2.1: calmer dashboard (table first) */
.page { gap: 14px; }
.d-banners { display: grid; gap: 8px; }
.d-banners:empty { display: none; }
.card { box-shadow: none; }
.page-head h1 { font-size: 19px; }
.page-head .ph-sub { font-size: 12px; }

/* Summary strip: one quiet line, no boxes. */
.strip { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: 0 2px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 22px; }
.strip .si b { color: var(--text); font-weight: 600; }
.strip .sm2 { color: var(--text-3); }
.strip .sd.pos { color: var(--pos); } .strip .sd.neg { color: var(--neg); } .strip .sd.par { color: var(--text-3); }
.strip .sdiv { width: 1px; height: 14px; background: var(--line-2); }

/* Inline prompt (no data yet). */
.inline-prompt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); padding: 2px 2px; }
.inline-prompt svg { color: var(--info); }

/* Price table: the page scrolls, header and hotel column stick. */
.matrix-card { --hc: 236px; --cw: 62px; overflow: clip; }
.matrix-card .card-head { border-bottom: 0; min-height: 44px; padding: 10px 16px 6px; }
.matrix-card .card-head .ch-sub { font-size: 12px; }
.help-btn { width: 22px !important; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 600; color: var(--text-3); border: 1px solid var(--line-2) !important; margin-left: 2px; }
.mx-head { position: sticky; top: 0; z-index: 6; overflow: hidden; background: var(--panel); }
.mx-head .matrix thead th { position: static; }
.mx-head .matrix .hotel { position: sticky; left: 0; }
.matrix { table-layout: fixed; width: max(100%, calc(var(--hc) + var(--n, 14) * var(--cw))); }
.matrix col.col-h { width: var(--hc); }
.matrix .hotel { width: auto; min-width: 0; max-width: none; }
.matrix th.date, .matrix td.c { min-width: 0; }
.matrix thead.sr-head th { height: 0 !important; padding-top: 0; padding-bottom: 0; border: 0; line-height: 0; font-size: 0; visibility: hidden; }
.matrix th, .matrix td { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.matrix thead th { height: 40px; border-bottom: 1px solid var(--line); }
.matrix td.c { color: var(--text-2); height: 42px; }
.hcell { height: 42px; }
.matrix td.c.min .v { color: var(--text); font-weight: 600; }
.matrix tr.own td.c { color: var(--text); }
.matrix tr.own .hotel, .matrix tr.own td { background-color: color-mix(in srgb, var(--own-bg) 70%, var(--panel)); }
.matrix .we { background-image: linear-gradient(color-mix(in srgb, var(--weekend) 80%, transparent), color-mix(in srgb, var(--weekend) 80%, transparent)); }
.matrix th.date.we .dow { color: var(--text-2); font-weight: 600; }
.matrix tbody.summary th, .matrix tbody.summary td { background: color-mix(in srgb, var(--subtle) 60%, var(--panel)); height: 32px; }
.matrix tbody.summary .hotel { background: color-mix(in srgb, var(--subtle) 60%, var(--panel)); }
.matrix td.rownote { text-align: left; padding: 0 12px; cursor: pointer; color: var(--text-3); font-size: 12px; font-style: italic; }
.matrix td.rownote .rn { display: inline-block; position: sticky; left: calc(var(--hc) + 12px); white-space: nowrap; }
.matrix td.rownote.err { color: var(--text-2); font-style: normal; }
.matrix td.rownote.err .rn::before { content: '!'; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 8px; border-radius: 50%; background: var(--err-bg); color: var(--err); font-weight: 700; font-size: 10.5px; font-style: normal; vertical-align: 1px; }
.matrix tbody.hotels td.rownote:hover { background-color: var(--hover); box-shadow: none; }

/* Legend popover */
.popover.lp { width: 340px; padding: 10px 12px; }
.legend-pop { display: grid; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.legend-pop .lp-r { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; }
.legend-pop .lp-r.faint { grid-template-columns: 1fr; }
.legend-pop .lp-k { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-3); }
.legend-pop .pos-t { color: var(--pos); } .legend-pop .neg-t { color: var(--neg); }
.legend-pop .sw-stale { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.legend-pop .erricon { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--err-bg); color: var(--err); font-weight: 700; font-size: 11px; }

/* Chart: collapsed under the table */
.chart-card { display: grid; gap: 8px; }
.chart-toggle { display: inline-flex; align-items: center; gap: 8px; justify-self: start; height: 32px; padding: 0 8px; border: 0; border-radius: var(--r); background: transparent; color: var(--text-2); font-weight: 500; font-size: 13px; }
.chart-toggle:hover { background: var(--hover); color: var(--text); }
.chart-toggle .faint { font-weight: 400; font-size: 12px; }
.chart-body .card-head { border-bottom: 0; padding: 8px 16px 0; min-height: 0; }
.chart-wrap, .chart-empty { height: 220px; }

/* Top bar: range + one filter button + refresh, quiet freshness */
.filt-btn { border: 1px solid var(--line-2) !important; color: var(--text) !important; font-variant-numeric: tabular-nums; gap: 6px; background: var(--panel) !important; }
.filt-btn:hover { background: var(--subtle) !important; }
.popover.filt { width: 280px; padding: 12px; }
.filt-pop { display: grid; gap: 10px; }
.filt-pop .dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filt-pop .select { width: 100%; }
.freshness { font-size: 12px; cursor: default; }
.freshness .fr-t { color: var(--text-3); }
.view-toggle { display: none; }
@media (max-width: 640px) {
  .matrix-card { --hc: 132px; --cw: 62px; }
  .matrix td.rownote .rn { max-width: calc(100vw - var(--hc) - 64px); white-space: normal; line-height: 1.35; }
  .view-toggle { display: inline-flex; }
  .matrix-card .card-head { padding: 10px 12px 6px; }
  .chart-wrap, .chart-empty { height: 200px; }
}

.matrix .delta { background: transparent !important; padding: 0; font-weight: 500; }
.matrix td.c { padding: 0 8px; }
.matrix td.c .badge { position: absolute; top: 4px; left: 4px; height: 13px; padding: 0 3px; font-size: 9px; }
.matrix td.stale::after { opacity: .45; }

/* ------------------------------------------------------------------ v2.2: compact overview cards + chart back on top */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.kpi { position: relative; display: grid; gap: 4px; align-content: start; padding: 12px 14px; min-height: 0; height: 102px; overflow: hidden; }
.kpi .k-l { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.kpi .k-l svg { color: var(--text-3); width: 13px; height: 13px; }
.kpi .k-v { font-size: 21px; line-height: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.kpi .k-v small { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 3px; }
.kpi .k-s { margin-top: auto; font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.kpi .k-s b { color: var(--text-2); font-weight: 500; }
.kpi .delta-chip { height: 18px; font-size: 11.5px; padding: 0 5px; }
.kpi .spark { position: absolute; right: 12px; top: 30px; width: 64px; height: 26px; color: var(--chart-sug); }
.kpi .meter { height: 5px; border-radius: 3px; background: var(--subtle-2); overflow: hidden; }
.kpi .meter > span { display: block; height: 100%; border-radius: 3px; background: var(--pos); }
.kpi .ch-hotel { display: flex; align-items: center; gap: 8px; min-width: 0; height: 26px; }
.kpi .ch-hotel .n { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .rank-dots { display: flex; gap: 3px; }
.kpi .rank-dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--subtle-2); }
.kpi .rank-dots i.me { background: var(--accent); }
.chart-card { display: block; }
.chart-body .card-head { padding: 8px 12px 0 8px; min-height: 40px; border-bottom: 0; }
.chart-card:not(.open) .chart-body .card-head { padding-bottom: 8px; }
.chart-toggle { gap: 8px; }
.chart-toggle b { color: var(--text); font-weight: 600; font-size: 13.5px; }
.chart-toggle .faint { font-size: 12px; font-weight: 400; }
.chart-body .card-body { padding: 4px 8px 8px 0; }
.chart-wrap, .chart-empty { height: 270px; }
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpis .kpi { grid-column: span 2; }
  .kpis .kpi:nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi, .kpis .kpi:nth-child(n+4) { grid-column: span 1; }
  .kpis .kpi:last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .kpis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; margin: 0 -12px; padding: 0 12px 4px; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpi { flex: 0 0 64%; scroll-snap-align: start; height: 96px; }
  .chart-wrap, .chart-empty { height: 210px; }
  .chart-body .legend { display: none; }
}
.matrix td.c.hint::after { content: ''; position: absolute; top: 7px; right: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--info); opacity: .7; }
.delta-chip { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta-chip.pos { background: var(--pos-bg); color: var(--pos); }
.delta-chip.neg { background: var(--neg-bg); color: var(--neg); }
.delta-chip.par { background: var(--par-bg); color: var(--par); }
.kpi .delta-chip { height: 18px; font-size: 11.5px; padding: 0 5px; }
