/* ============ tokens ============ */
/* "Rose & plum": warm cream light theme (default) and a deep plum night theme. */
:root {
  --radius: 14px;
  --radius-lg: 22px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: Fraunces, 'Iowan Old Style', Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --warn: #d48a1a;
  --warn-soft: rgba(212, 138, 26, .13);
}
[data-theme='light'] {
  color-scheme: light;
  --accent: #c2477a;
  --accent-2: #8e3b8a;
  --accent-ink: #a8366a;
  --accent-soft: rgba(194, 71, 122, .11);
  --accent-glow: rgba(194, 71, 122, .45);
  --down: #2f8f6f;
  --down-soft: rgba(47, 143, 111, .12);
  --up: #d64550;
  --up-soft: rgba(214, 69, 80, .1);
  --bg: #fbf6f3;
  --bg-elev: #fffdfb;
  --surface: #ffffff;
  --surface-2: #f8f1ee;
  --surface-3: #efe4e0;
  --border: #eedfd9;
  --border-strong: #e0cbc4;
  --text: #2b1d2a;
  --text-2: #6b5767;
  --text-3: #9c8796;
  --shadow: 0 1px 2px rgba(80, 30, 60, .04), 0 14px 34px -20px rgba(120, 40, 80, .28);
  --glow: radial-gradient(900px 520px at 8% -12%, rgba(236, 140, 170, .22), transparent 60%), radial-gradient(760px 460px at 105% 0%, rgba(176, 123, 216, .14), transparent 62%), radial-gradient(600px 400px at 50% 110%, rgba(255, 200, 170, .16), transparent 60%);
  --img-bg: #fff;
}
[data-theme='dark'] {
  color-scheme: dark;
  --accent: #ec6fa0;
  --accent-2: #b07bd8;
  --accent-ink: #f4a3c3;
  --accent-soft: rgba(236, 111, 160, .14);
  --accent-glow: rgba(236, 111, 160, .5);
  --down: #4cc49a;
  --down-soft: rgba(76, 196, 154, .13);
  --up: #ff7a85;
  --up-soft: rgba(255, 122, 133, .12);
  --bg: #140e16;
  --bg-elev: #1a131d;
  --surface: #1d1520;
  --surface-2: #251b29;
  --surface-3: #302334;
  --border: #33263a;
  --border-strong: #463450;
  --text: #f7eef4;
  --text-2: #c2adbd;
  --text-3: #8d7889;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 14px 34px -18px rgba(0, 0, 0, .75);
  --glow: radial-gradient(900px 520px at 8% -12%, rgba(236, 111, 160, .16), transparent 60%), radial-gradient(760px 460px at 105% 0%, rgba(176, 123, 216, .12), transparent 62%);
  --img-bg: #fff;
}

/* ============ base ============ */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  background-image: var(--glow); background-attachment: fixed; min-height: 100vh;
  -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.boot { display: grid; place-items: center; height: 100vh; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.grad-text { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ============ controls ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: all .15s var(--ease);
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 22px -10px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.22); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--up); }
.btn.danger.solid { background: var(--up); color: #fff; border: 0; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }

.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--bg-elev); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
select.input { width: auto; padding-right: 32px; cursor: pointer; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-2); transition: all .15s; }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip .n { font-size: 11px; opacity: .7; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; line-height: 18px; white-space: nowrap; }
.pill.down { color: var(--down); background: var(--down-soft); }
.pill.up { color: var(--up); background: var(--up-soft); }
.pill.flat { color: var(--text-2); background: var(--surface-2); }
.pill.accent { color: var(--accent-ink); background: var(--accent-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }

.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { height: 28px; min-width: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* ============ auth / landing ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.auth-hero { position: relative; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; overflow: hidden; border-right: 1px solid var(--border); }
.auth-hero h1 { font-family: var(--serif); font-size: clamp(40px, 4.6vw, 64px); line-height: 1.02; letter-spacing: -0.025em; margin: 0 0 18px; font-weight: 600; font-variation-settings: 'SOFT' 100; }
.auth-hero .lead { color: var(--text-2); font-size: 17px; max-width: 470px; margin: 0; }
.mock { margin-top: 36px; max-width: 470px; padding: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); animation: rise .6s var(--ease); }
.mock .row { display: flex; align-items: center; gap: 12px; }
.mock .thumb { width: 46px; height: 46px; border-radius: 10px; background: linear-gradient(135deg, #ffd6e4, #e9d5ff); display: grid; place-items: center; color: #8e3b8a; }
.mock svg.chart { width: 100%; height: 90px; margin-top: 12px; }
.feature-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 560px; }
.feature-list div { font-size: 13px; color: var(--text-2); }
.feature-list b { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.feature-list svg { color: var(--accent); }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 390px; animation: rise .35s var(--ease); }
.auth-card h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.auth-card form { display: grid; gap: 14px; margin-top: 26px; }
.auth-card .alt { margin-top: 20px; text-align: center; color: var(--text-2); }
.auth-card .alt a { color: var(--accent); font-weight: 600; }
.err { color: var(--up); font-size: 13px; min-height: 0; }
.err:empty { display: none; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 30px; width: 30px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; border-radius: 7px; }
.pw-wrap .input { padding-right: 42px; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
.logo img { width: 28px; height: 28px; }

/* ============ app shell ============ */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 62px; display: flex; align-items: center; gap: 22px; }
.nav { display: flex; gap: 2px; }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 9px; font-weight: 500; color: var(--text-2); transition: .15s; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.on { color: var(--text); background: var(--surface-2); }
.nav .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--up); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.topbar .spacer { flex: 1; }
.topbar .right { display: flex; align-items: center; gap: 8px; position: relative; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 0; color: #fff; font-weight: 700; font-size: 13px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.dropdown { position: absolute; top: 46px; right: 0; width: 230px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); animation: pop .15s var(--ease); z-index: 50; }
.dropdown .head { padding: 10px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown .head b { display: block; }
.dropdown .head span { font-size: 12px; color: var(--text-3); word-break: break-all; }
.dropdown button, .dropdown a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; cursor: pointer; text-align: left; font-size: 13px; color: var(--text-2); }
.dropdown button:hover, .dropdown a:hover { background: var(--surface-2); color: var(--text); }

main.page { max-width: 1240px; margin: 0 auto; padding: 30px 24px 80px; animation: fade .25s; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-family: var(--serif); font-size: 34px; letter-spacing: -0.02em; font-weight: 600; }
.page-head .sub-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--text-2); }
.page-head p { margin: 4px 0 0; color: var(--text-2); }

.card-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat { padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.stat .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.stat .k { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }

/* toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.toolbar .input-icon { width: 220px; }
.toolbar .input { height: 36px; }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 16px; }
.pcard { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; animation: rise .35s var(--ease) both; }
.pcard:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.pcard .media { position: relative; height: 176px; margin: 8px 8px 0; border-radius: 14px; background: var(--img-bg); overflow: hidden; display: grid; place-items: center; padding: 16px; }
.pcard .media img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s var(--ease); }
.pcard:hover .media img { transform: scale(1.04); }
.ph-img { color: #a1a1aa; }
.pcard .store { position: absolute; top: 10px; left: 10px; }
.pcard .flag { position: absolute; top: 10px; right: 10px; }
.store-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 4px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: rgba(9,9,11,.82); color: #fff; backdrop-filter: blur(6px); }
.store-badge i { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 9.5px; font-weight: 800; color: #fff; }
.pcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard .title { font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.price-line { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; }
.price { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.price-sub { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.spark { width: 88px; height: 34px; flex: none; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.pcard .foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-3); padding-top: 10px; border-top: 1px solid var(--border); }
.pcard .foot .err-t { color: var(--warn); display: inline-flex; align-items: center; gap: 4px; }

/* list view */
.list { overflow: hidden; }
.lrow { display: grid; grid-template-columns: 56px 1fr 130px 110px 100px 110px; gap: 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background .15s; }
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: var(--surface-2); }
.lrow.head { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 16px; }
.lrow.head:hover { background: none; }
.lrow .thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--img-bg); padding: 5px; display: grid; place-items: center; }
.lrow .thumb img { width: 100%; height: 100%; object-fit: contain; }
.lrow .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .s { font-size: 12px; color: var(--text-3); }
.lrow .num { font-weight: 700; }

.empty { text-align: center; padding: 64px 24px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-2); }
.empty .ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty h3 { margin: 0 0 6px; color: var(--text); font-family: var(--serif); font-size: 22px; font-weight: 600; }
.empty p { margin: 0 auto 18px; max-width: 380px; }
.skel { border-radius: var(--radius-lg); height: 340px; border: 1px solid var(--border); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }

/* ============ modal ============ */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); animation: pop .22s var(--ease); }
.modal h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.modal .sub { color: var(--text-2); margin: 4px 0 18px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal .row { display: flex; gap: 8px; }
.store-hints { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--text-3); align-items: center; }
.preview { display: flex; gap: 16px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); animation: rise .25s var(--ease); }
.preview .img { width: 96px; height: 96px; border-radius: 12px; background: var(--img-bg); flex: none; padding: 8px; display: grid; place-items: center; }
.preview .img img { width: 100%; height: 100%; object-fit: contain; }
.preview .t { font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.preview .price { margin-top: 8px; }
.target-box { margin-top: 18px; }
.target-box .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.loading-steps { display: grid; gap: 10px; padding: 8px 2px; }
.loading-steps div { display: flex; gap: 10px; align-items: center; color: var(--text-3); transition: color .3s; }
.loading-steps div.on { color: var(--text); }
.loading-steps div.done { color: var(--down); }

/* ============ detail ============ */
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-3); margin-bottom: 18px; font-size: 13px; }
.crumbs a:hover { color: var(--text); }
.detail { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
.detail .side { padding: 14px; position: sticky; top: 80px; }
.detail .bigimg { height: 320px; border-radius: 14px; background: var(--img-bg); display: grid; place-items: center; padding: 20px; overflow: hidden; }
.detail .bigimg img { width: 100%; height: 100%; object-fit: contain; }
.detail .side .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.detail .side .actions .btn.primary { grid-column: 1 / -1; }
.detail .main { display: grid; gap: 20px; }
.section { padding: 22px; }
.section h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.detail h1 { font-family: var(--serif); font-size: 26px; line-height: 1.3; margin: 10px 0 14px; letter-spacing: -0.01em; font-weight: 600; }
.bigprice { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bigprice .price { font-family: var(--serif); font-size: 44px; font-weight: 600; letter-spacing: -0.02em; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.tile { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.tile .k { font-size: 12px; color: var(--text-3); font-weight: 500; }
.tile .v { font-size: 16px; font-weight: 700; margin-top: 2px; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: 300px; display: block; }
.chart .gl { stroke: var(--border); stroke-dasharray: 3 5; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.tooltip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 10px; padding: 7px 10px; font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); box-shadow: var(--shadow); color: var(--text-2); }
.tooltip b { display: block; color: var(--text); font-size: 14px; }
.target-row { display: flex; gap: 8px; align-items: center; }
.target-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); margin: 14px 0 8px; }
.insight { display: flex; gap: 12px; padding: 16px; border-radius: 14px; background: linear-gradient(135deg, var(--accent-soft), var(--down-soft)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); line-height: 1.6; animation: rise .3s var(--ease); }
.insight svg { color: var(--accent); margin-top: 2px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; background: var(--warn-soft); color: var(--warn); margin-top: 12px; }
.hist { display: grid; }
.hist div { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.hist div:last-child { border-bottom: 0; }
.hist .d { color: var(--text-2); }

/* ============ alerts / settings ============ */
.alert-list { overflow: hidden; }
.arow { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); transition: background .15s; }
.arow:last-child { border-bottom: 0; }
.arow:hover { background: var(--surface-2); }
.arow .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.arow .thumb { width: 44px; height: 44px; border-radius: 10px; background: var(--img-bg); padding: 4px; flex: none; }
.arow .thumb img { width: 100%; height: 100%; object-fit: contain; }
.arow .msg { flex: 1; min-width: 0; }
.arow .when { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.arow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

.settings { display: grid; gap: 16px; max-width: 720px; }
.settings .section h3 { margin-bottom: 4px; }
.settings .section > p { margin: 0 0 16px; color: var(--text-2); }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.set-row:first-of-type { border-top: 0; }
.set-row .l b { display: block; font-weight: 600; }
.set-row .l span { color: var(--text-2); font-size: 13px; }
.form-grid { display: grid; gap: 12px; }
.danger-zone { border-color: color-mix(in srgb, var(--up) 35%, var(--border)); }

/* ============ toasts ============ */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); font-size: 13.5px; font-weight: 500; animation: pop .2s var(--ease); max-width: 460px; }
.toast.error svg { color: var(--up); }
.toast.success svg { color: var(--down); }

/* ============ responsive ============ */
@media (max-width: 1000px) {
  .lrow { grid-template-columns: 52px 1fr 110px 90px; }
  .lrow > :nth-child(5), .lrow > :nth-child(6) { display: none; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .detail { grid-template-columns: 1fr; }
  .detail .side { position: static; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .nav span.lbl { display: none; }
}
@media (max-width: 600px) {
  main.page { padding: 20px 14px 80px; }
  .topbar-inner { padding: 0 14px; gap: 10px; }
  .logo span { display: none; }
  .topbar .right .lbl { display: none; }
  .topbar .right #addBtn { width: 32px; padding: 0; }
  .nav a { padding: 0 9px; }
  .toolbar .input-icon { width: 100%; }
  .stat { padding: 14px; }
  .stat .ic { display: none; }
  .bigprice .price { font-size: 32px; }
  .lrow { grid-template-columns: 48px 1fr 90px; }
  .lrow > :nth-child(4) { display: none; }
}
