@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Syne:wght@500;600;700;800&display=swap");

:root {
    --bg: #09080a;
    --bg-2: #100e12;
    --fg: #f6eee9;
    --muted: #a89893;
    --muted-bg: rgba(242, 198, 192, 0.08);
    --border: rgba(242, 198, 192, 0.12);
    --input: rgba(242, 198, 192, 0.16);
    --card: #161318;
    --sidebar: #110f13;
    --surface: #131116;
    --primary: #e07a73;
    --primary-strong: #c75b56;
    --primary-fg: #fff7f4;
    --ring: #f2c6c2;
    --ok: #b7d8c2;
    --warn: #ead3b3;
    --danger: #e07a73;
    --blush: #f2c6c2;
    --peach: #f0d4c4;
    --sage: #c9dcc9;
    --lilac: #d5c8e4;
    --sand: #e8dcc8;
    --radius: 28px;
    --pill: 999px;
    --font: "Manrope", "Segoe UI", system-ui, sans-serif;
    --display: "Syne", "Manrope", sans-serif;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    color-scheme: dark;
    -webkit-font-smoothing: antialiased;
}

body {
    position: relative;
    isolation: isolate;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(80px);
}

body::before {
    width: 42vw;
    height: 42vw;
    max-width: 560px;
    max-height: 560px;
    top: -12vw;
    right: -8vw;
    background: rgba(224, 122, 115, 0.28);
}

body::after {
    width: 34vw;
    height: 34vw;
    max-width: 420px;
    max-height: 420px;
    bottom: -10vw;
    left: -8vw;
    background: rgba(213, 200, 228, 0.16);
}

::selection { background: rgba(224, 122, 115, 0.35); color: var(--fg); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(242, 198, 192, 0.22); border-radius: var(--pill); }
::-webkit-scrollbar-track { background: transparent; }

a { color: inherit; }

.logo {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    background: transparent;
    overflow: hidden;
}

.logo img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    display: block;
}

.kicker {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: var(--pill);
    background: var(--muted-bg);
    color: var(--blush);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Auth ── */

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.auth-stage {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 36px;
    overflow: hidden;
    background: rgba(19, 17, 22, 0.78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: 36px 34px;
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(224, 122, 115, 0.22), transparent 55%),
        linear-gradient(180deg, #18141a 0%, #100e12 100%);
    border-right: 1px solid var(--border);
}

.auth-panel-top {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.auth-panel h1 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.auth-panel p {
    margin: 12px 0 0;
    max-width: 32ch;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.auth-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-pills li {
    height: 32px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--pill);
    background: rgba(242, 198, 192, 0.1);
    color: var(--blush);
    font-size: 12px;
    font-weight: 600;
}

.auth-box {
    padding: 36px 34px;
}

.auth-stage--solo {
    width: min(440px, 100%);
    grid-template-columns: 1fr;
}

.auth-stage--solo .auth-box {
    text-align: center;
}

.auth-stage--solo .auth-mark {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.auth-stage--solo .logo,
.auth-stage--solo .logo img {
    width: 56px;
    height: 56px;
}

.auth-stage--solo .auth-intro {
    text-align: center;
}

.auth-stage--solo .field {
    text-align: left;
}

.auth-mark {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-mark b {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.auth-intro {
    margin-bottom: 22px;
}

.auth-intro b {
    display: block;
    font-family: var(--display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.auth-intro p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.auth-card { padding: 0; }

.err {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: var(--pill);
    background: rgba(224, 122, 115, 0.12);
    border: 1px solid rgba(224, 122, 115, 0.28);
    color: var(--blush);
    font-size: 13px;
}

.field { display: block; margin-bottom: 14px; }
.field > span {
    display: block;
    margin-bottom: 7px;
    padding-left: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--blush);
}

.field input,
.secret input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--input);
    border-radius: var(--pill);
    background: rgba(9, 8, 10, 0.45);
    color: var(--fg);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.secret input { padding-right: 46px; }

.field input:focus,
.secret:focus-within input {
    border-color: var(--primary);
    background: rgba(9, 8, 10, 0.7);
    box-shadow: 0 0 0 4px rgba(224, 122, 115, 0.16);
}

.field input[aria-invalid="true"] { border-color: var(--danger); }

.field input::placeholder {
    color: #7c6f6c;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--fg);
    caret-color: var(--fg);
    box-shadow: 0 0 0 1000px #1a161c inset;
    transition: background-color 9999s ease-out;
}

.has-error {
    animation: formShake 0.42s ease;
}

@keyframes formShake {
    12%, 88% { transform: translateX(-3px); }
    36%, 64% { transform: translateX(3px); }
}

.secret { position: relative; display: block; }

.eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: var(--pill);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
}
.eye:hover { color: var(--fg); background: var(--muted-bg); }
.eye svg { width: 16px; height: 16px; }
.eye .icon-on { display: block; }
.eye .icon-off { display: none; }
.eye.is-open .icon-on { display: none; }
.eye.is-open .icon-off { display: block; }

.hint { display: block; margin-top: 7px; padding-left: 6px; font-size: 12px; color: var(--muted); line-height: 1.45; }

.warn-hint {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(234, 211, 179, 0.1);
    border: 1px solid rgba(234, 211, 179, 0.22);
    color: var(--sand);
    line-height: 1.5;
    font-size: 13px;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 18px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

.remember input {
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid var(--input);
    border-radius: 6px;
    background: transparent;
}

.remember input:checked {
    background: var(--primary);
    border-color: var(--primary);
}
.remember input:checked::after {
    content: "";
    display: block;
    width: 8px;
    height: 4px;
    margin: 4px auto 0;
    border-left: 2px solid var(--primary-fg);
    border-bottom: 2px solid var(--primary-fg);
    transform: rotate(-45deg);
}

.meta { margin: 0; font-size: 12px; color: var(--muted); }

.cta {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: var(--pill);
    background: linear-gradient(180deg, #e58a84 0%, var(--primary) 100%);
    color: var(--primary-fg);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(199, 91, 86, 0.28);
    transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.cta:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
}
.cta:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.cta.is-loading { cursor: progress; opacity: 1; }

.spinner {
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 247, 244, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: spin 0.7s linear infinite;
}
.cta.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.switch {
    margin: 22px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}
.switch a {
    color: var(--blush);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(242, 198, 192, 0.4);
}

/* ── App ── */

.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    padding: 18px 12px;
    background: rgba(17, 15, 19, 0.86);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(18px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 6px 8px 18px;
    text-decoration: none;
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.sidebar-brand .logo,
.sidebar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.nav-kicker {
    margin: 0 10px 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--pill);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.sidebar-nav a:hover {
    color: var(--fg);
    background: var(--muted-bg);
}

.sidebar-nav a.is-on {
    color: var(--primary-fg);
    background: linear-gradient(180deg, #e58a84 0%, var(--primary) 100%);
    box-shadow: 0 8px 20px rgba(199, 91, 86, 0.22);
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-radius: var(--pill);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.nav-group-toggle svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.nav-group-toggle .chev {
    margin-left: auto;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    transition: transform 0.28s ease;
}

.nav-group-toggle:hover {
    color: var(--fg);
    background: var(--muted-bg);
}

.nav-group.is-open > .nav-group-toggle {
    color: var(--blush);
    background: var(--muted-bg);
}

.nav-group.is-open > .nav-group-toggle .chev {
    transform: rotate(180deg);
}

.nav-group-items {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s ease;
}

.nav-group.is-open > .nav-group-items {
    grid-template-rows: 1fr;
}

.nav-group-inner {
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 0 0 12px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.28s ease, padding 0.28s ease;
}

.nav-group.is-open > .nav-group-items > .nav-group-inner {
    padding-bottom: 4px;
    opacity: 1;
    transform: none;
}

.nav-group-items a {
    font-size: 13px;
}

.sidebar-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px;
    border-radius: 22px;
    background: rgba(9, 8, 10, 0.35);
    border: 1px solid var(--border);
}

.sidebar-foot strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
}

.logout-pill {
    display: inline-flex;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.logout-pill:hover { color: var(--blush); }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--pill);
    display: grid;
    place-items: center;
    background: rgba(224, 122, 115, 0.18);
    color: var(--blush);
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 34px;
}

.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: rgba(19, 17, 22, 0.78);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 28px 0;
}

.topbar h1 {
    margin: 0;
    font-family: var(--display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.clock-pill {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--pill);
    background: var(--muted-bg);
    border: 1px solid var(--border);
    color: var(--blush);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.content {
    padding: 24px 28px 40px;
}

/* ── Dashboard ── */

.board {
    display: grid;
    gap: 16px;
    width: 100%;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 220px;
    padding: 32px 36px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background:
        radial-gradient(90% 120% at 0% 0%, rgba(224, 122, 115, 0.22), transparent 52%),
        rgba(9, 8, 10, 0.32);
}

.hero-copy {
    flex: 1;
    min-width: 0;
}

.hero-copy h2 {
    margin: 10px 0 8px;
    font-family: var(--display);
    font-size: clamp(32px, 4.4vw, 52px);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1.06;
}

.hero-copy p {
    margin: 0 0 22px;
    max-width: 62ch;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .cta,
.hero-actions .ghost {
    width: auto;
    min-width: 148px;
    padding: 0 22px;
}

.ghost,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: var(--pill);
    background: transparent;
    color: var(--fg);
    text-decoration: none;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.ghost:hover,
.ghost-btn:hover {
    background: var(--muted-bg);
    border-color: rgba(242, 198, 192, 0.28);
}

.status-chip {
    min-width: 168px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(9, 8, 10, 0.45);
    text-align: right;
    flex: 0 0 auto;
}

.status-chip b {
    display: block;
    font-family: var(--display);
    font-size: 40px;
    letter-spacing: -0.06em;
}
.status-chip strong { display: block; font-size: 13px; font-weight: 700; }
.status-chip small { color: var(--muted); font-size: 12px; }
.status-chip.is-on {
    border-color: rgba(183, 216, 194, 0.28);
}
.status-chip.is-on strong { color: var(--ok); }

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric {
    position: relative;
    min-height: 168px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(9, 8, 10, 0.28);
    overflow: hidden;
}

.metric::before {
    content: "";
    position: absolute;
    top: 14px;
    right: 14px;
    width: 10px;
    height: 10px;
    border-radius: var(--pill);
    background: var(--blush);
}

.metric[data-tone="rose"]::before { background: var(--primary); }
.metric[data-tone="peach"]::before { background: var(--peach); }
.metric[data-tone="sage"]::before { background: var(--sage); }
.metric[data-tone="lilac"]::before { background: var(--lilac); }

.metric small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.metric strong {
    display: block;
    margin: 18px 0 8px;
    font-family: var(--display);
    font-size: clamp(32px, 3.2vw, 44px);
    font-weight: 700;
    letter-spacing: -0.05em;
}
.metric span { color: var(--muted); font-size: 12px; }

.apps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.app-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 180px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background:
        radial-gradient(80% 80% at 100% 0%, rgba(224, 122, 115, 0.16), transparent 55%),
        rgba(9, 8, 10, 0.28);
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.app-card:nth-child(2) {
    background:
        radial-gradient(80% 80% at 100% 0%, rgba(213, 200, 228, 0.16), transparent 55%),
        rgba(9, 8, 10, 0.28);
}

.app-card:hover {
    transform: translateY(-2px);
    border-color: rgba(224, 122, 115, 0.35);
}

.app-card i {
    display: inline-flex;
    align-self: flex-start;
    height: 24px;
    padding: 0 10px;
    align-items: center;
    font-style: normal;
    color: var(--blush);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--pill);
    background: var(--muted-bg);
}
.app-card strong {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.04em;
}
.app-card em { color: var(--muted); font-style: normal; font-size: 13px; line-height: 1.55; }
.app-card b {
    margin-top: auto;
    align-self: flex-start;
    height: 32px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--pill);
    background: var(--primary);
    color: var(--primary-fg);
    font-size: 12px;
    font-weight: 700;
}

.pair {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 12px;
}

.pane {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(9, 8, 10, 0.28);
}

.pane h3 {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blush);
}

.kv { list-style: none; margin: 0; padding: 0; }
.kv li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
}
.kv li:first-child { border-top: 0; padding-top: 0; }
.kv span { color: var(--muted); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    text-decoration: none;
}
.feed li:first-child a { border-top: 0; padding-top: 0; }
.feed strong { display: block; font-size: 14px; font-weight: 600; }
.feed small { color: var(--muted); font-size: 12px; }
.feed-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.feed-meta b { color: var(--muted); font-size: 12px; font-weight: 600; }

.empty-state { margin: 0; color: var(--muted); font-size: 14px; }
.empty-state a { color: var(--blush); font-weight: 700; }

.pill {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: var(--pill);
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    background: var(--muted-bg);
    color: var(--muted);
}
.pill.running { background: rgba(213, 200, 228, 0.18); color: var(--lilac); }
.pill.done { background: rgba(183, 216, 194, 0.16); color: var(--ok); }
.pill.error { background: rgba(224, 122, 115, 0.16); color: var(--blush); }
.pill.stopped { background: rgba(232, 220, 200, 0.14); color: var(--sand); }

/* ── Tools ── */

.work {
    display: grid;
    grid-template-columns: minmax(300px, 0.38fr) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    width: 100%;
}

.scrape-form,
.scrape-live {
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-height: 100%;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: rgba(9, 8, 10, 0.28);
}

.form-head { margin-bottom: 16px; }
.form-head small {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: var(--pill);
    background: var(--muted-bg);
    color: var(--blush);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.form-head h3 {
    margin: 10px 0 0;
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scrape-form .remember { margin: 6px 0 16px; }
.scrape-actions { display: flex; gap: 8px; margin-top: auto; }
.scrape-actions .cta { margin-top: 0; flex: 1; width: auto; }
.scrape-actions .ghost-btn { height: 48px; }
.scrape-form .hint { margin-top: 14px; }

.live-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.live-head small {
    color: var(--blush);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.live-head h3 {
    margin: 6px 0 0;
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.stats { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.stats b {
    color: var(--fg);
    font-size: 16px;
    font-family: var(--display);
}

.progress-wrap {
    height: 8px;
    margin: 0 0 8px;
    border-radius: var(--pill);
    background: var(--muted-bg);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0;
    border-radius: var(--pill);
    background: linear-gradient(90deg, var(--primary), var(--blush));
    transition: width 0.25s ease;
}
.progress-copy { margin: 0 0 12px; color: var(--muted); font-size: 12px; }

.log {
    max-height: 128px;
    overflow: auto;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(9, 8, 10, 0.35);
    font-size: 12px;
    color: var(--muted);
}
.log p { margin: 0 0 4px; }
.log p:last-child { margin: 0; }

.scrape-live .live-table { flex: 1; min-height: 280px; }
.scrape-live .log { max-height: 140px; }

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 20px;
}
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 12px 14px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
tr:last-child td { border-bottom: 0; }
.empty td { color: var(--muted); }

.friend-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-height: min(68vh, 720px);
    overflow: auto;
}

.friend-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(9, 8, 10, 0.32);
    animation: friendIn 0.3s ease both;
}

@keyframes friendIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.friend-head {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--pill);
    object-fit: cover;
    background: var(--muted-bg);
    border: 1px solid var(--border);
}

.friend-meta { min-width: 0; }
.friend-meta strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.friend-meta small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    margin-top: auto;
}

.badge-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}
.badge-icon img { width: 22px; height: 22px; object-fit: contain; display: block; }

.badge-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: var(--pill);
    background: var(--muted-bg);
    color: var(--blush);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--pill);
    background: var(--muted-bg);
    color: var(--fg);
    font-size: 12px;
    font-weight: 600;
}

.secret-list {
    display: grid;
    gap: 10px;
    max-height: min(68vh, 720px);
    overflow: auto;
}

.secret-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(9, 8, 10, 0.32);
    animation: friendIn 0.3s ease both;
}

.secret-card .friend-head {
    grid-template-columns: 40px minmax(0, 1fr) auto;
}

.secret-snippet {
    margin: 0;
    color: var(--fg);
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.ghost-link {
    align-self: start;
    color: var(--blush);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.ghost-link:hover { color: var(--primary); }

@media (max-width: 1080px) {
    .auth-stage { grid-template-columns: 1fr; }
    .auth-panel { display: none; }
    .auth-mark { display: flex; }
    .hero {
        flex-direction: column;
        align-items: stretch;
        min-height: 0;
        padding: 24px;
    }
    .status-chip { text-align: left; }
    .metrics { grid-template-columns: 1fr 1fr; }
    .apps, .pair, .work { grid-template-columns: 1fr; }
    .friend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
    .app {
        grid-template-columns: 1fr;
        padding: 8px;
    }
    .sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        border-radius: 22px;
    }
    .sidebar-brand { padding: 0; }
    .nav-kicker { display: none; }
    .sidebar-nav { flex-direction: row; flex: 1; align-items: flex-start; }
    .nav-group { min-width: 148px; }
    .sidebar-foot { border: 0; padding: 6px; margin: 0 0 0 auto; background: transparent; }
    .sidebar-foot div { display: none; }
    .topbar, .content { padding-left: 16px; padding-right: 16px; }
    .field-row { grid-template-columns: 1fr; }
    .friend-grid { grid-template-columns: 1fr; }
    .metrics { grid-template-columns: 1fr; }
    .metric { min-height: 0; }
    .auth-box { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .spinner, .friend-card, .cta, .app-card { animation: none; transition: none; }
    .nav-group-items, .nav-group-inner, .nav-group-toggle .chev { transition: none; }
    body::before, body::after { display: none; }
}
