/* ShopAssist user pages: lists, a list, sign in. The admin pages keep style.css and DevExtreme. */

:root {
    --bg: #F5F6F8;
    --card: #FFFFFF;
    --line: #E4E7EC;
    --line-strong: #D5DAE2;
    --text: #14171F;
    --muted: #5B6270;
    --soft: #F0F2F5;
    --accent: #2F55D4;
    --accent-hover: #2446B8;
    --accent-soft: #EEF2FD;
    --accent-ink: #1D3FB8;
    --good: #0B6B35;
    --good-soft: #E3F4EA;
    --bad: #A34500;
    --bad-soft: #FFEFE3;
    --warn-ink: #5A3B00;
    --warn-soft: #FFF8EB;
    --warn-line: #F3D9A4;
    --link: #2348C9;
    --link-hover: #16328F;
    --nav-ink: #3F4654;
    --input-line: #C9CFD8;
    --input-bg: #FFFFFF;
    --dash: #CBD1DB;
    --row-line: #EEF0F3;
    --item-body: #F8F9FB;
    --photo-ink: #8A93A3;
    --hover-line: #C3CBE0;
    --avatar-bg: #FFE7D6;
    --avatar-ink: #9A3D0A;
    --mark-0-bg: #EEF2FD; --mark-0-ink: #1D3FB8;
    --mark-1-bg: #FFF1E6; --mark-1-ink: #9A3D0A;
    --mark-2-bg: #E8F6F1; --mark-2-ink: #0B6150;
    --mark-3-bg: #F3EEFC; --mark-3-ink: #5B2DA8;
    --bar-bg: #14171F;
    --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
    --shadow: rgba(20, 23, 31, .12);
    --shadow-strong: rgba(20, 23, 31, .25);
    --radius: 18px;
    --display: Manrope, Inter, system-ui, sans-serif;
    color-scheme: light;
}

/* dark: the system setting unless the toggle picked light, or the toggle picked dark; the same values twice */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0E1014;
        --card: #171A20;
        --line: #262A33;
        --line-strong: #353B46;
        --text: #E8EBF1;
        --muted: #9BA3B1;
        --soft: #20242C;
        --accent: #3D63E6;
        --accent-hover: #5277F0;
        --accent-soft: #1B2547;
        --accent-ink: #AFC0FF;
        --good: #5FCF8E;
        --good-soft: #11301F;
        --bad: #FF9E66;
        --bad-soft: #3A2414;
        --warn-ink: #F2CB75;
        --warn-soft: #2C2412;
        --warn-line: #574519;
        --link: #8EA8FF;
        --link-hover: #B6C6FF;
        --nav-ink: #B5BCC8;
        --input-line: #3A404C;
        --input-bg: #111318;
        --dash: #3A404C;
        --row-line: #22262E;
        --item-body: #13161B;
        --photo-ink: #6F7787;
        --hover-line: #3E4C7A;
        --avatar-bg: #3B2617;
        --avatar-ink: #FFBA8C;
        --mark-0-bg: #1B2547; --mark-0-ink: #AFC0FF;
        --mark-1-bg: #3B2617; --mark-1-ink: #FFBA8C;
        --mark-2-bg: #0F3029; --mark-2-ink: #7FDCC2;
        --mark-3-bg: #2A1F45; --mark-3-ink: #CDB4FF;
        --bar-bg: #2A2F3A;
        --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
        --shadow: rgba(0, 0, 0, .4);
        --shadow-strong: rgba(0, 0, 0, .6);
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0E1014;
    --card: #171A20;
    --line: #262A33;
    --line-strong: #353B46;
    --text: #E8EBF1;
    --muted: #9BA3B1;
    --soft: #20242C;
    --accent: #3D63E6;
    --accent-hover: #5277F0;
    --accent-soft: #1B2547;
    --accent-ink: #AFC0FF;
    --good: #5FCF8E;
    --good-soft: #11301F;
    --bad: #FF9E66;
    --bad-soft: #3A2414;
    --warn-ink: #F2CB75;
    --warn-soft: #2C2412;
    --warn-line: #574519;
    --link: #8EA8FF;
    --link-hover: #B6C6FF;
    --nav-ink: #B5BCC8;
    --input-line: #3A404C;
    --input-bg: #111318;
    --dash: #3A404C;
    --row-line: #22262E;
    --item-body: #13161B;
    --photo-ink: #6F7787;
    --hover-line: #3E4C7A;
    --avatar-bg: #3B2617;
    --avatar-ink: #FFBA8C;
    --mark-0-bg: #1B2547; --mark-0-ink: #AFC0FF;
    --mark-1-bg: #3B2617; --mark-1-ink: #FFBA8C;
    --mark-2-bg: #0F3029; --mark-2-ink: #7FDCC2;
    --mark-3-bg: #2A1F45; --mark-3-ink: #CDB4FF;
    --bar-bg: #2A2F3A;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --shadow: rgba(0, 0, 0, .4);
    --shadow-strong: rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.sa {
    margin: 0;
    /* the footer stays at the bottom of a short page */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.sa a { color: var(--link); text-decoration: none; }
.sa a:hover { color: var(--link-hover); }
.sa h1, .sa h2, .sa h3 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }
.sa button, .sa input, .sa textarea, .sa select { font: inherit; color: inherit; }
.sa :focus-visible { outline: 3px solid rgba(47, 85, 212, .45); outline-offset: 2px; }
.sa-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.sa-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.sa-header-in { max-width: 1120px; margin: 0 auto; padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.sa-brand { display: flex; align-items: center; gap: 10px; color: var(--text) !important; }
.sa-brand-name { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.sa-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: 16px; }
.sa-nav a { padding: 10px 14px; border-radius: 10px; color: var(--nav-ink); font-weight: 500; }
.sa-nav a:hover { background: var(--soft); color: var(--text); }
.sa-nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.sa-user { margin-left: auto; position: relative; }
.sa-user > summary { list-style: none; cursor: pointer; height: 44px; padding: 0 12px 0 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sa-user > summary::-webkit-details-marker { display: none; }
.sa-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-bg); color: var(--avatar-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sa-user-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px var(--shadow); padding: 6px; display: flex; flex-direction: column; z-index: 30; }
.sa-menu[popover] { inset: auto; margin: 0; color: var(--text); }
.sa-menu[popover]:not(:popover-open) { display: none; }
.sa-menu a, .sa-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: var(--text) !important; cursor: pointer; font-size: 14px; }
.sa-menu a:hover, .sa-menu button:hover { background: var(--soft); }
.sa-menu-label { padding: 8px 12px 4px; color: var(--muted); font-size: 12px; }
.sa-menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.sa-menu .danger { color: var(--bad) !important; }
.sa-limits { padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 6px; min-width: 240px; font-size: 13px; }
.sa-limits-plan { font-weight: 600; }
.sa-limits-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.sa-limits-row b { color: var(--text); font-weight: 600; }
.sa-limits-note { color: var(--muted); font-size: 12px; }
.sa-bar { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.sa-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.sa-bar-full > span { background: var(--bad); }

/* language and theme */
.sa-prefs { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sa-prefs + .sa-user { margin-left: 0; }
.sa-lang { display: inline-flex; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.sa-lang button { border: 0; background: none; padding: 0 9px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.sa-lang button:hover { color: var(--text); }
.sa-lang button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); cursor: default; }
.sa-theme { width: 40px; height: 40px; border-radius: 10px; }
.sa-theme .moon, :root[data-theme="dark"] .sa-theme .sun { display: none; }
:root[data-theme="dark"] .sa-theme .moon { display: block; }
.sa-auth-prefs { position: absolute; top: 16px; right: 16px; }

/* layout */
.sa-main { flex: 1 0 auto; width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 24px; }
.sa-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.sa-head h1 { font-size: 34px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.sa-lead { margin: 6px 0 0; color: var(--muted); font-size: 16px; max-width: 640px; }
.sa-back { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; }
.sa-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.sa-muted { color: var(--muted); }

/* buttons */
.sa-btn { height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--card); color: var(--text) !important; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.sa-btn:hover { background: var(--soft); }
.sa-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff !important; }
.sa-btn-primary:hover { background: var(--accent-hover); }
.sa-btn-sm { height: 40px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.sa-btn-link { height: auto; padding: 0; border: 0; background: none; color: var(--link) !important; font-weight: 600; }
.sa-btn-link:hover { background: none; color: var(--link-hover) !important; }
.sa-btn-danger { color: var(--bad) !important; }
.sa-icon-btn { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--nav-ink); }
.sa-icon-btn:hover { background: var(--soft); }

/* forms */
.sa-field { display: flex; flex-direction: column; gap: 6px; }
.sa-field label { font-size: 14px; font-weight: 600; }
.sa-input { height: 48px; padding: 0 14px; border: 1px solid var(--input-line); border-radius: 12px; background: var(--input-bg); font-size: 15px; width: 100%; }
textarea.sa-input { height: auto; min-height: 140px; padding: 12px 14px; resize: vertical; }
.sa-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(47, 85, 212, .18); }
/* an input with a button that empties it, hidden while it is empty (the input needs a placeholder, a space will do) */
.sa-clearable { position: relative; }
.sa-clearable .sa-input { padding-right: 48px; }
.sa-clearable .sa-clear-btn { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sa-clearable .sa-clear-btn:hover { background: var(--soft); color: var(--text); }
.sa-clearable .sa-input:placeholder-shown + .sa-clear-btn { display: none; }
.sa-field-error { color: var(--bad); font-size: 13px; }
.sa-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sa-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.sa-choice { display: flex; gap: 10px; flex-wrap: wrap; }
.sa-choice label { flex: 1 1 140px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 500; }
.sa-choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.sa-choice input { accent-color: var(--accent); }

/* notices */
.sa-flash { border-radius: 14px; padding: 14px 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.sa-flash-ok { background: var(--good-soft); color: var(--good); }
.sa-flash-error { background: var(--bad-soft); color: var(--bad); }
.sa-flash-warn { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.sa-toast { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); box-shadow: 0 12px 32px var(--shadow-strong); cursor: pointer; transition: opacity .3s, transform .3s; }
.sa-toast.sa-toast-gone { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.sa-toast + .sa-toast { bottom: 84px; }
.sa-pill { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.sa-pill-good { background: var(--good-soft); color: var(--good); }
.sa-pill-bad { background: var(--bad-soft); color: var(--bad); }
.sa-pill-info { background: var(--accent-soft); color: var(--accent-ink); }
.sa-good { color: var(--good); }
.sa-bad { color: var(--bad); }

/* lists home */
.sa-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.sa-list-card { padding: 22px; display: flex; flex-direction: column; gap: 18px; color: var(--text) !important; transition: border-color .15s, box-shadow .15s; }
.sa-list-card:hover { border-color: var(--hover-line); box-shadow: 0 6px 20px var(--shadow); }
.sa-list-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sa-mark { width: 48px; height: 48px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.sa-mark-0 { background: var(--mark-0-bg); color: var(--mark-0-ink); }
.sa-mark-1 { background: var(--mark-1-bg); color: var(--mark-1-ink); }
.sa-mark-2 { background: var(--mark-2-bg); color: var(--mark-2-ink); }
.sa-mark-3 { background: var(--mark-3-bg); color: var(--mark-3-ink); }
.sa-list-name { font-family: var(--display); font-weight: 700; font-size: 19px; overflow-wrap: anywhere; }
.sa-list-sub { color: var(--muted); font-size: 14px; }
.sa-list-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sa-caption { color: var(--muted); font-size: 13px; }
.sa-big { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -0.01em; }
.sa-new-list { min-height: 168px; border: 2px dashed var(--dash); border-radius: var(--radius); background: transparent; color: var(--nav-ink); font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.sa-new-list:hover { border-color: var(--accent); color: var(--accent-ink); background: rgba(47, 85, 212, .03); }

.sa-section { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.sa-section h2 { font-size: 21px; font-weight: 800; }
.sa-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 0; border-top: 1px solid var(--row-line); color: var(--text) !important; }
.sa-drop:first-of-type { border-top: 0; }
.sa-drop-name { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sa-drop-name b { font-weight: 600; }
.sa-drop-prices { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sa-was { color: var(--muted); font-size: 14px; text-decoration: line-through; }
.sa-now { font-family: var(--display); font-weight: 800; font-size: 18px; }

/* a list */
.sa-add { padding: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sa-add-input { flex: 999 1 380px; min-width: 0; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border: 1px solid var(--input-line); border-radius: 14px; background: var(--input-bg); transition: border-color .15s, box-shadow .15s; }
.sa-add-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 85, 212, .18); }
.sa-add-input svg { flex: none; color: var(--muted); }
.sa-add-input input { flex: 1; min-width: 0; border: 0; font-size: 16px; background: transparent; }
/* the frame around shows the focus; the selector has to beat ".sa :focus-visible" */
.sa .sa-add-input input:focus-visible { outline: none; }
.sa-add .sa-btn { flex: 1 0 auto; height: 52px; border-radius: 14px; }
.sa-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.sa-tile { padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.sa-tile .sa-caption { font-size: 13px; }

.sa-items { display: flex; flex-direction: column; gap: 12px; }
.sa-item { display: flex; align-items: flex-start; gap: 4px; padding-left: 14px; overflow: hidden; scroll-margin-top: 140px; }
.sa-item:has(details[open]) { border: 2px solid var(--accent); }
.sa-item-select { padding-top: 44px; flex: none; }
.sa-item-select input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.sa-item details { flex: 1; min-width: 0; }
.sa-item summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 18px 18px 18px 8px; }
.sa-item summary::-webkit-details-marker { display: none; }
.sa-photo { width: 72px; height: 72px; flex: none; border-radius: 14px; background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--photo-ink); overflow: hidden; }
/* the shop's picture of the product over the bag icon; the icon shows when there is none or it did not load */
.sa-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sa-photo img + svg { display: none; }
.sa-item-text { flex: 999 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sa-item-name { font-weight: 600; font-size: 17px; overflow-wrap: anywhere; }
.sa-item .sa-edit-btn { width: 28px; height: 28px; margin: -4px 0; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; cursor: pointer; }
.sa-item .sa-edit-btn:hover { background: var(--soft); color: var(--text); }
.sa-item-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 13px; color: var(--muted); }
.sa-item-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 120px; margin-left: auto; }
.sa-item-price .sa-now { font-size: 22px; }
.sa-delta { font-size: 13px; font-weight: 600; }
.sa-chevron { transition: transform .15s; }
.sa-item details[open] .sa-chevron { transform: rotate(180deg); }
.sa-spark { flex: none; }
.sa-item-body { background: var(--item-body); border-top: 1px solid var(--line); margin-left: -18px; padding: 8px 18px 18px 26px; display: flex; flex-direction: column; gap: 16px; }
.sa-lines { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.sa-line { display: flex; align-items: flex-start; gap: 4px; }
.sa-line p { margin: 0 4px 0 0; min-width: 0; white-space: pre-line; overflow-wrap: anywhere; }
.sa-line-icon { flex: none; width: 24px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.sa-line .sa-edit-btn { flex: none; }
/* relative keeps the hidden texts of the table inside its scroll */
.sa-table-wrap { overflow-x: auto; position: relative; }
.sa-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.sa-table th { padding: 10px 8px; font-weight: 500; color: var(--muted); text-align: left; }
.sa-table td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.sa-table .num { text-align: right; white-space: nowrap; }
.sa-table .shop-title { display: block; color: var(--muted); font-size: 12px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.sa-item-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.sa-restore { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.sa-restore select { height: 40px; width: auto; max-width: 220px; padding-top: 0; padding-bottom: 0; }
.sa-empty { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.sa-empty h2 { font-size: 20px; }

.sa-groupbar { position: sticky; bottom: 16px; z-index: 10; background: var(--bar-bg); color: #fff; border-radius: 16px; padding: 12px 12px 12px 18px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; box-shadow: 0 12px 32px var(--shadow-strong); }
.sa-groupbar[hidden] { display: none; }
.sa-groupbar span { flex: 1 1 240px; font-size: 14px; }
.sa-groupbar .sa-btn { border-color: transparent; }

/* dialogs */
.sa-dialog { border: 0; border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 64px var(--shadow-strong); background: var(--card); color: var(--text); }
.sa-dialog::backdrop { background: rgba(20, 23, 31, .45); }
.sa-dialog form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.sa-dialog h2 { font-size: 22px; font-weight: 800; }
.sa-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* sign in */
.sa-auth { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.sa-auth-in { width: 100%; max-width: 1040px; display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.sa-auth-pitch { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.sa-auth-pitch h1 { font-size: 44px; line-height: 1.1; font-weight: 800; letter-spacing: -0.025em; }
.sa-feature { display: flex; gap: 14px; align-items: flex-start; }
.sa-feature-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.sa-feature b { display: block; font-weight: 600; font-size: 16px; }
.sa-feature span { color: var(--muted); }
.sa-auth-card { flex: 1 1 380px; max-width: 440px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.sa-auth-card h2 { font-size: 24px; font-weight: 800; }
.sa-provider { height: 52px; border-radius: 14px; border: 0; width: 100%; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; color: #fff !important; }
.sa-provider-yandex { background: #14171F; }
.sa-provider-yandex:hover { background: #2A2F3A; }
.sa-provider-vk { background: #0B5ED7; }
.sa-provider-vk:hover { background: #0A52BC; }
.sa-provider-other { background: var(--card); color: var(--text) !important; border: 1px solid var(--line-strong); }
.sa-provider-badge { width: 26px; height: 26px; border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.sa-provider-yandex .sa-provider-badge { border-radius: 50%; color: #14171F; font-size: 15px; }
.sa-provider-vk .sa-provider-badge { color: #0B5ED7; font-size: 12px; }
.sa-providers { display: flex; flex-direction: column; gap: 10px; }
.sa-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.sa-or::before, .sa-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sa-auth-form { display: flex; flex-direction: column; gap: 14px; }
.sa-auth-form .sa-btn { height: 52px; border-radius: 14px; }

@media (max-width: 640px) {
    .sa-header-in { padding: 10px 16px; gap: 10px 8px; }
    /* brand, switchers and the user on one row, the sections scroll on the next */
    .sa-nav { margin-left: 0; order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .sa-nav { gap: 2px; margin: 0 -8px; width: calc(100% + 16px); }
    .sa-nav a { padding: 8px; font-size: 14px; white-space: nowrap; }
    .sa-brand-name { font-size: 18px; }
    .sa-lang button { padding: 0 7px; }
    .sa-user > summary { padding: 0 5px; }
    .sa-user-name { display: none; }
    .sa-main { padding: 20px 16px 48px; gap: 18px; }
    .sa-head h1 { font-size: 26px; }
    .sa-head .sa-btn { padding: 0 12px; }
    .sa-auth-pitch h1 { font-size: 32px; }
    .sa-auth-card { padding: 22px; }
    .sa-item { padding-left: 10px; }
    .sa-item summary { padding: 14px 14px 14px 6px; gap: 10px 12px; }
    .sa-item-select { padding-top: 34px; }
    .sa-photo { width: 56px; height: 56px; }
    .sa-item-text { flex-basis: calc(100% - 80px); }
    .sa-spark { display: none; }
    .sa-item-price { align-items: flex-start; margin-left: 68px; flex-direction: row; align-items: baseline; gap: 10px; }
    .sa-item-price .sa-now { font-size: 19px; }
    .sa-item summary > .sa-chevron-btn { display: none; }
    .sa-item summary > button.sa-icon-btn { margin-left: auto; }
    .sa-item-body { margin-left: -14px; padding: 8px 14px 14px 18px; }
    .sa-section { padding: 18px; }
    .sa-tiles { gap: 8px; }
    .sa-tile { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; padding: 12px 16px; }
    .sa-tile .sa-big { font-size: 18px; }
    .sa-tile-hint { display: none; }
    .sa-add { padding: 12px; }
}

/* privacy policy and other text pages */
.sa-doc { padding: 32px; max-width: 820px; line-height: 1.6; }
.sa-doc h2 { font-size: 20px; font-weight: 700; margin: 28px 0 8px; }
.sa-doc h2:first-child { margin-top: 0; }
.sa-doc p, .sa-doc ul, .sa-doc ol { margin: 0 0 12px; }
.sa-doc ul, .sa-doc ol { padding-left: 22px; }
.sa-doc h2[id] { scroll-margin-top: 90px; }
.sa-doc li + li { margin-top: 6px; }
.sa-footer { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; color: var(--muted); font-size: 14px; }
.sa-footer a { color: var(--muted); }
.sa-footer a:hover { color: var(--text); }
.sa-footer .sa-powered { margin-left: auto; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.sa-footer .sa-powered:hover { background: var(--accent); color: #fff; }
@media (max-width: 640px) {
    .sa-doc { padding: 20px 16px; }
    /* the header wraps to several rows */
    .sa-doc h2[id] { scroll-margin-top: 130px; }
}

/* price history chart (_ItemChart.cshtml): categorical slots in fixed order, validated for both themes;
   svg lines stretch with the card, the labels are html so they keep their size */
.sa-s1 { --series: var(--series-1); }
.sa-s2 { --series: var(--series-2); }
.sa-s3 { --series: var(--series-3); }
.sa-s4 { --series: var(--series-4); }
.sa-chart { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sa-chart-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 14px; }
.sa-chart-head .sa-muted { font-size: 13px; }
.sa-chart-body { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 6px; }
.sa-chart-y { position: relative; min-width: 64px; }
.sa-chart-y span { position: absolute; right: 0; transform: translateY(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sa-chart-area { position: relative; height: 170px; touch-action: pan-y; cursor: crosshair; }
.sa-chart-area svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sa-chart-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sa-chart-target { stroke: var(--good); stroke-width: 1.5; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.sa-chart-line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sa-chart-out { fill: none; stroke: var(--series); stroke-width: 2; stroke-dasharray: 5 5; opacity: .55; vector-effect: non-scaling-stroke; }
.sa-chart-x { position: relative; height: 16px; }
.sa-chart-x span { position: absolute; top: 0; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; }
.sa-chart-x span:first-child { transform: none; }
.sa-chart-x span:last-child { transform: translateX(-100%); }
.sa-chart-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: .6; pointer-events: none; }
.sa-chart-tip { position: absolute; top: 4px; min-width: 160px; padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 8px 24px var(--shadow); font-size: 13px; pointer-events: none; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.sa-chart-tip[hidden], .sa-chart-cross[hidden] { display: none; }
.sa-chart-tip-date { color: var(--muted); font-size: 12px; }
.sa-chart-tip > div:not(.sa-chart-tip-date) { display: flex; align-items: center; gap: 6px; }
.sa-chart-tip b { margin-left: auto; padding-left: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.sa-chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text); }
.sa-chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.sa-key { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--series, var(--muted)); border-radius: 1px; flex: none; }
.sa-key-out { border-top-style: dashed; opacity: .7; }
.sa-key-target { border-top: 2px dotted var(--good); }
@media (max-width: 640px) {
    .sa-chart-area { height: 140px; }
    .sa-chart-y { min-width: 52px; }
    .sa-chart-y span, .sa-chart-x span { font-size: 11px; }
}
