/* The account area in Rhino Sync's own look, as the sign-in pages (auth.css) and the viewer: deep navy charcoal, glassy
   cards with hairline borders, #44E100 with a soft glow, the blueprint grid. Always dark. Plain CSS, no build step. */

:root {
    --bg:         #080b11;
    --panel:      rgba(12, 17, 26, 0.86);
    --surface:    rgba(150, 192, 228, 0.030);
    --surface-2:  rgba(150, 192, 228, 0.055);
    --border:     rgba(150, 192, 228, 0.11);
    --grid:       rgba(150, 192, 228, 0.08);

    --text:       #eef3f8;
    --text-dim:   #a7b2c0;
    --text-faint: #717d8c;

    --sync:        #44E100;
    --accent-text: #44E100;
    --accent-soft: rgba(68, 225, 0, 0.11);
    --accent-line: rgba(68, 225, 0, 0.30);
    --on-accent:   #0b1400;
    --button:      #44E100;
    --button-hover:#5ae81f;
    --on-button:   #0b1400;
    --card:        rgba(150, 192, 228, 0.030);
    --card-2:      rgba(150, 192, 228, 0.025);
    --glow:        rgba(68, 225, 0, 0.22);
    --good:        #44E100;
    --good-soft:   rgba(68, 225, 0, 0.11);
    --trial:       #c4b5fd;
    --trial-soft:  rgba(124, 58, 237, 0.18);
    --info:        #7cc8ff;
    --info-soft:   rgba(29, 183, 241, 0.14);
    --bone:        rgba(150, 192, 228, 0.08);
    --bone-shine:  rgba(150, 192, 228, 0.16);
    --danger:      #ff6b5e;
    --danger-soft: rgba(255, 107, 94, 0.12);
    --warn:        #f5b947;
    --warn-soft:   rgba(245, 185, 71, 0.12);

    --solid:       #131a26;
    --solid-hover: #1c2636;
    --shadow:      0 12px 32px -18px rgba(0, 0, 0, .6);
    --lift:        0 24px 60px -24px rgba(0, 0, 0, .7);

    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
    --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

    color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.006em;
    -webkit-font-smoothing: antialiased;
}

/* blueprint grid, as on the auth pages */
body::before {
    content: "";
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 76%);
            mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 76%);
}

/* the accent bloom over the grid, as the sign-in pages */
body::after {
    content: "";
    position: fixed; z-index: -1; pointer-events: none;
    left: 50%; top: -280px; transform: translateX(-50%);
    width: 900px; height: 620px;
    background: radial-gradient(closest-side, var(--glow), transparent 70%);
    filter: blur(30px);
    opacity: .5;
}

button { font: inherit; color: inherit; }

svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow, .caption {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.eyebrow { color: var(--accent-text); margin-bottom: 12px; }
.caption { color: var(--text-faint); font-size: 10.5px; }

/* ---------- gate: loading, signed out, refused ---------- */

.gate {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: calc(100% - 32px); max-width: 440px; max-height: calc(100% - 32px);
    overflow-y: auto;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 36px 32px 32px;
    text-align: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: 3px solid var(--button);
    border-radius: 16px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--lift);
}
.gate .logo { width: 72px; height: 72px; display: block; }
.gate h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.gate > p { color: var(--text-dim); font-size: 14px; overflow-wrap: anywhere; text-wrap: pretty; }
.gate .actions { display: grid; gap: 10px; width: 100%; }
.gate .actions:empty, .gate .actions:not(:has(button:not([hidden]))) { display: none; }
.gate .actions button { min-height: 44px; padding: 0 18px; border-radius: 10px; }
.gate .hint { font-size: 13px; color: var(--text-faint); }
.gate.refused h1::before {
    content: "";
    display: block;
    width: 40px; height: 4px; margin: 0 auto 16px;
    border-radius: 2px;
    background: var(--warn);
}

.primary, .secondary {
    padding: 12px 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
}
.primary { color: var(--on-button); background: var(--button); border: 1px solid transparent; }
.primary:hover { background: var(--button-hover); }
.secondary { background: var(--surface); border: 1px solid var(--border); }
.secondary:hover { background: var(--surface-2); border-color: var(--accent-line); }

.link { background: none; border: none; color: var(--accent-text); cursor: pointer; padding: 0; font-size: inherit; }
.link:hover { text-decoration: underline; }

/* The sign-in card while loading: the Rhino Sync mark breathing */
.gate.loading .logo { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .gate.loading .logo { animation: none; } }

/* ---------- shell ---------- */

.shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "top top" "side page";
    min-height: 100vh;
}

.top {
    grid-area: top;
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center; gap: 16px;
    min-height: 59px;
    padding: 10px 20px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { width: 30px; height: 30px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }
.brand-area { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-text); }

.team-chip {
    margin-left: 8px;
    padding: 4px 10px;
    font-size: 13px; font-weight: 500;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 260px;
}
.team-chip:empty { display: none; }

.top-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top-tools .account-menu { margin-left: 4px; }

/* The account menu over the gate, when someone is signed in there */
.gate-corner { position: fixed; top: 12px; right: 16px; z-index: 3; }
.gate-corner .account-menu-button { background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

.icon-button {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
}
.icon-button:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }

.side {
    grid-area: side;
    position: sticky; top: 59px;
    align-self: start;
    display: flex; flex-direction: column; gap: 2px;
    padding: 18px 12px;
}
.side a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    color: var(--text-dim);
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 10px;
}
.side a:hover { color: var(--text); background: var(--surface); }
.side a.current { color: var(--text); background: var(--accent-soft); border-color: var(--accent-line); }
.side a.current svg { color: var(--accent-text); }
.soon {
    margin-left: auto;
    padding: 1px 7px;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.page { grid-area: page; padding: 30px 36px 56px; max-width: 1080px; width: 100%; }

/* Home alone: no side menu, the page centred */
.shell.solo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "page"; }
.shell.solo .side { display: none; }
.shell.solo .page { justify-self: center; }

.page h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; }
.page .lead { margin-top: 6px; color: var(--text-dim); font-size: 15px; max-width: 640px; text-wrap: pretty; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }

.card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 20px 22px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.card.wide { grid-column: 1 / -1; }
.card .value { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; overflow-wrap: anywhere; }
.card .value.quiet { color: var(--text-faint); }
.card .detail { color: var(--text-dim); font-size: 13.5px; overflow-wrap: anywhere; }
.card .note { color: var(--text-faint); font-size: 13px; }
.card .error { color: var(--danger); font-size: 13px; }

.rows { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 13.5px; }
.rows dt { color: var(--text-faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; align-self: center; }
.rows dd { color: var(--text); }

.pill {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 10px;
    font-size: 12px; font-weight: 600;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-dim);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }
.pill.bad { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }

.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--sync); }

/* ---------- home: the portal's overview ---------- */

.page h1.welcome { letter-spacing: -0.025em; margin-bottom: 22px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-head.first { margin-top: 0; }
.section-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }

.tile { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tile-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.tile-logo { width: 52px; height: 52px; flex: none; display: block; }
.tile-title { flex: 1; min-width: 0; display: grid; gap: 1px; }
.tile-name { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; color: var(--sync); }
.tile-plan { color: var(--text); }
.tile-plan.free { color: var(--text-faint); }
.tile-name.none { color: var(--text); font-size: 17px; }
.tile-sub { font-size: 13px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-body { display: grid; gap: 10px; padding: 14px 18px 16px; border-top: 1px solid var(--border); background: var(--card-2); }
.tile-body .rows { font-size: 13px; }
/* MKS didn't answer: the card faded, its logo grey */
.tile.unavailable { border-style: dashed; box-shadow: none; }
.tile.unavailable .tile-logo { filter: grayscale(1); opacity: .45; }
.tile-foot { border-top: 1px solid var(--border); }
/* The whole strip is the link: it fills with a tint, the bolt flashes and an arrow slides in */
.tile-upgrade { position: relative; display: flex; align-items: center; gap: 7px; padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--sync); text-decoration: none; transition: background .2s ease; }
.tile-upgrade:hover, .tile-upgrade:focus-visible { background: var(--accent-soft); text-decoration: none; }
.tile-upgrade svg { width: 18px; height: 18px; fill: currentColor; stroke: none; transition: transform .25s cubic-bezier(.2, .7, .3, 1); }
.tile-upgrade:hover svg { animation: bolt-flash .5s ease; transform: scale(1.12); }
.tile-upgrade::after { content: "\2192"; margin-left: auto; font-size: 16px; opacity: 0; transform: translateX(-8px); transition: opacity .2s ease, transform .25s cubic-bezier(.2, .7, .3, 1); }
.tile-upgrade:hover::after, .tile-upgrade:focus-visible::after { opacity: 1; transform: none; }
@keyframes bolt-flash { 0% { opacity: 1; } 30% { opacity: .35; } 60% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tile-upgrade svg, .tile-upgrade::after { transition: none; animation: none; } }
.tile-message { font-size: 13px; color: var(--warn); }

/* Tags: a dot, then a word (as the portal's) */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--text-dim); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--danger-soft); color: var(--danger); }
.tag.trial { background: var(--trial-soft); color: var(--trial); }
.tag.info { background: var(--info-soft); color: var(--info); }

.team { display: grid; gap: 14px; padding: 18px 20px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.team-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.team-avatar { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--info-soft); color: var(--info); font-weight: 700; font-size: 15px; }
.team-name { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.team-head .tag { margin-left: auto; }
.team .error, .page > .error { color: var(--danger); font-size: 13px; }


.button { display: inline-flex; align-items: center; justify-content: center; font-weight: 600; text-decoration: none; border-radius: 9px; cursor: pointer; color: var(--text); background: var(--card); border: 1px solid var(--border); }
.button:hover { background: var(--solid-hover); }
.button.primary { color: var(--on-button); background: var(--button); border-color: var(--button); box-shadow: 0 8px 24px -10px var(--glow); }
.button.primary:hover { background: var(--button-hover); }
.button.small { min-height: 30px; padding: 0 12px; font-size: 12.5px; }

.placeholder {
    margin-top: 28px;
    padding: 48px 32px;
    text-align: center;
    color: var(--text-dim);
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: var(--surface);
}
.placeholder svg { width: 32px; height: 32px; color: var(--accent-text); margin-bottom: 12px; }
.placeholder strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

@media (max-width: 760px) {
    .shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "side" "page"; }
    .side {
        position: static;
        flex-direction: row; gap: 4px;
        padding: 10px 12px;
        overflow-x: auto;
        border-bottom: 1px solid var(--border);
    }
    .side a { flex: none; padding: 7px 10px; }
    .side .soon { display: none; }
    .team-chip { display: none; }
    .page { padding: 22px 16px 48px; }
    .cards { grid-template-columns: 1fr; }
}
