/* Dashboard and register page. Builds on /res/style.css (the bio.mass.fyi glass look). */

:root {
    --ui-line: rgba(255, 255, 255, 0.1);
    --ui-line-2: rgba(255, 255, 255, 0.18);
    --ui-fill: rgba(255, 255, 255, 0.05);
    --ui-fill-2: rgba(255, 255, 255, 0.09);
    --ui-muted: rgba(255, 255, 255, 0.55);
    --ui-faint: rgba(255, 255, 255, 0.38);
    --ui-ok: #8fe3a8;
    --ui-err: #ff8a8a;
    --ui-warn: #ffd27a;
    --ui-ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

button { font: inherit; color: inherit; }

.mi {
    font-family: "Material Symbols Rounded";
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    display: inline-block;
    width: 1em;
    overflow: hidden;
    white-space: nowrap;
    flex: none;
    font-feature-settings: "liga";
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.emoji { display: inline-block; width: 1.25em; text-align: center; font-size: 18px; line-height: 1; }

/* ---------- Forms (sign-in, register, editor) ---------- */

.f {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.f__label {
    padding-left: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ui-muted);
}

.f__hint {
    padding-left: 4px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--ui-faint);
}

.f__hint a,
.ui-link { text-decoration: underline; text-underline-offset: 2px; }
.f__hint a:hover,
.ui-link:hover { color: #fff; }

.f__wrap { position: relative; display: block; }

.f__prefix {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--ui-faint);
    pointer-events: none;
}

.input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--ui-line-2);
    border-radius: 14px;
    background: var(--ui-fill);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.f__wrap .input { padding-left: 34px; }
.input::placeholder { color: rgba(255, 255, 255, 0.28); }

.input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: var(--ui-fill-2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.input--key {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: 0.08em;
}

.input--mono {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
}

textarea.input {
    height: auto;
    min-height: 110px;
    padding: 12px 16px;
    line-height: 1.55;
    resize: vertical;
}

textarea.input--code {
    min-height: 220px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.82rem;
    tab-size: 4;
    white-space: pre;
}

select.input {
    appearance: none;
    padding-right: 40px;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.6) 50%), linear-gradient(135deg, rgba(255, 255, 255, 0.6) 50%, transparent 50%);
    background-position: calc(100% - 22px) 50%, calc(100% - 17px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}

select.input option { background: #111; color: #fff; }

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 4px;
    font-size: 0.88rem;
    color: var(--ui-muted);
    cursor: pointer;
}

.check input { width: 16px; height: 16px; margin: 0; accent-color: #fff; }

/* Buttons */

.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--ui-line-2);
    border-radius: 999px;
    background: var(--ui-fill);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.ui-btn .mi { font-size: 18px; }
.ui-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.32); }
.ui-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.ui-btn--primary {
    border-color: transparent;
    background: #fff;
    color: #000;
    font-weight: 600;
}

.ui-btn--primary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.86); border-color: transparent; }

.ui-btn--danger { color: var(--ui-err); border-color: rgba(255, 138, 138, 0.35); }
.ui-btn--danger:hover:not(:disabled) { background: rgba(255, 110, 110, 0.14); border-color: rgba(255, 138, 138, 0.6); }

.ui-btn--ghost { border-color: transparent; background: transparent; }
.ui-btn--sm { height: 32px; padding: 0 12px; font-size: 0.82rem; }
.ui-btn--block { width: 100%; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--ui-muted);
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}

.icon-btn:hover:not(:disabled) { background: var(--ui-fill-2); color: #fff; }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.icon-btn--danger:hover:not(:disabled) { background: rgba(255, 110, 110, 0.15); color: var(--ui-err); }

.badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border: 1px solid var(--ui-line-2);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ui-muted);
}

.badge--admin { border-color: rgba(255, 210, 122, 0.5); color: var(--ui-warn); }

.msg { margin: 0; padding-left: 4px; font-size: 0.86rem; }
.msg--error { color: var(--ui-err); }
.msg--ok { color: var(--ui-ok); }

/* ---------- Sign-in and register cards ---------- */

.signin {
    width: min(100%, 420px);
    padding: 32px 30px 30px;
}

.signin h1 { margin-bottom: 2px; }

.signin__form {
    width: 100%;
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.signin__submit {
    margin-top: 4px;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
}

.signin__submit:disabled { opacity: 0.6; cursor: progress; transform: none; }

.signin__foot {
    margin: 4px 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--ui-faint);
}

.steps-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.steps-dots span {
    width: 22px;
    height: 4px;
    border-radius: 999px;
    background: var(--ui-line-2);
    transition: background 200ms ease;
}

.steps-dots span.on { background: #fff; }

.keybox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 12px 16px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.keybox code {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1rem;
    letter-spacing: 0.06em;
    overflow-wrap: anywhere;
}

.avail { min-height: 1.2em; }

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

.app {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr) var(--preview-w, 460px);
    min-height: 100vh;
    min-height: 100svh;
}

.app--no-preview { grid-template-columns: 252px minmax(0, 1fr); }
.app--no-preview .preview { display: none; }

.side {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 12px 14px;
    border-right: 1px solid var(--ui-line);
    background: rgba(255, 255, 255, 0.025);
    overflow-y: auto;
}

.side__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 14px;
    font-weight: 600;
    letter-spacing: -0.03em;
    font-size: 1.15rem;
}

.side__brand img { width: 28px; height: 28px; object-fit: contain; }

.side__user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 4px 12px;
    padding: 10px 12px;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: var(--ui-fill);
}

.side__avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 600;
}

.side__avatar img { width: 100%; height: 100%; object-fit: cover; }

.side__who { min-width: 0; display: flex; flex-direction: column; }
.side__who strong { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__who span { font-size: 0.78rem; color: var(--ui-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav__label {
    margin: 14px 12px 6px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ui-faint);
}

.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.68);
    transition: background 150ms ease, color 150ms ease;
}

.nav a .mi { color: rgba(255, 255, 255, 0.5); }
.nav a:hover { background: var(--ui-fill); color: #fff; }

.nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.11);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav a[aria-current="page"] .mi { color: #fff; font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

.side__foot {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-top: 1px solid var(--ui-line);
}

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--ui-line);
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.topbar__title { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.02em; }
.topbar__menu,
.topbar__preview { display: none; }

.savebar {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.savebar__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
    font-size: 0.84rem;
    color: var(--ui-muted);
}

.savebar__status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ui-ok);
}

.savebar__status[data-state="dirty"]::before { background: var(--ui-warn); }
.savebar__status[data-state="error"] { color: var(--ui-err); }
.savebar__status[data-state="error"]::before { background: var(--ui-err); }
.savebar__status[data-state="busy"]::before { background: #fff; animation: pulse 900ms ease infinite alternate; }

@keyframes pulse { to { opacity: 0.2; } }

.content {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 28px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.panel-head { padding: 4px 4px 6px; }
.panel-head h1 { margin: 0; font-size: 1.8rem; font-weight: 600; letter-spacing: -0.04em; }
.panel-head p { margin: 6px 0 0; color: var(--ui-muted); line-height: 1.5; }

.box {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 22px 24px;
    border: 1px solid var(--ui-line-2);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025) 50%, rgba(255, 255, 255, 0.05));
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.box__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.box__head h2 { margin: 0; font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.box__head p { margin: 4px 0 0; font-size: 0.86rem; line-height: 1.45; color: var(--ui-muted); }

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.row--3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.empty {
    padding: 22px;
    border: 1px dashed var(--ui-line-2);
    border-radius: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--ui-faint);
}

/* Segmented control */

.seg {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--ui-line-2);
    border-radius: 14px;
    background: var(--ui-fill);
}

.seg button {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ui-muted);
    font-size: 0.86rem;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}

.seg button .mi { font-size: 18px; }
.seg button:hover { color: #fff; }
.seg button[aria-pressed="true"] { background: #fff; color: #000; font-weight: 600; }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.seg button:disabled:hover { color: var(--ui-muted); }

/* Switch */

.switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 4px;
    cursor: pointer;
}

.switch__text { display: flex; flex-direction: column; gap: 2px; }
.switch__text strong { font-size: 0.93rem; font-weight: 500; }
.switch__text span { font-size: 0.8rem; color: var(--ui-faint); line-height: 1.4; }

.switch input {
    appearance: none;
    flex: none;
    position: relative;
    width: 44px;
    height: 26px;
    margin: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    cursor: pointer;
    transition: background 180ms ease;
}

.switch input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 180ms var(--ui-ease);
}

.switch input:checked { background: #34c759; }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Colour */

.color {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color input[type="color"] {
    flex: none;
    width: 44px;
    height: 44px;
    padding: 4px;
    border: 1px solid var(--ui-line-2);
    border-radius: 14px;
    background: var(--ui-fill);
    cursor: pointer;
}

.color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 9px; }
.color .input { flex: 1; min-width: 0; }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }

.swatches button {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.swatches button[aria-pressed="true"] { border-color: #fff; }

/* Range */

.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; accent-color: #fff; }
.range output { min-width: 48px; text-align: right; font-size: 0.85rem; color: var(--ui-muted); font-variant-numeric: tabular-nums; }

/* Icon picker */

.iconpick { display: flex; gap: 8px; }

.iconpick__btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--ui-line-2);
    border-radius: 14px;
    background: var(--ui-fill);
    cursor: pointer;
}

.iconpick__btn:hover { background: var(--ui-fill-2); }
.iconpick__btn .mi { font-size: 22px; }

.popover {
    position: fixed;
    z-index: 100;
    width: min(340px, calc(100vw - 24px));
    max-height: min(420px, calc(100vh - 24px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--ui-line-2);
    border-radius: 18px;
    background: rgba(18, 18, 18, 0.96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.popover__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 4px;
    overflow-y: auto;
    padding-right: 2px;
}

.popover__grid button {
    display: grid;
    place-items: center;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

.popover__grid button:hover,
.popover__grid button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.12); }
.popover__grid .mi { font-size: 22px; }

/* Repeating lists (links, cards…) */

.items { display: flex; flex-direction: column; gap: 10px; }

.item {
    border: 1px solid var(--ui-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 160ms ease, background 160ms ease;
}

.item--open { border-color: var(--ui-line-2); background: rgba(255, 255, 255, 0.05); }
.item--hidden .item__summary { opacity: 0.5; }

.item__head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 8px 8px 12px;
}

.item__toggle {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.item__glyph {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.item__glyph .mi { font-size: 18px; }

.item__summary { min-width: 0; display: flex; flex-direction: column; }
.item__summary strong { font-size: 0.93rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__summary span { font-size: 0.78rem; color: var(--ui-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.item__chev { margin-left: auto; color: var(--ui-faint); transition: transform 200ms var(--ui-ease); }
.item--open .item__chev { transform: rotate(180deg); }

.item__tools { display: flex; gap: 2px; }

.item__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 6px 16px 18px;
}

.item .item { background: rgba(0, 0, 0, 0.2); }

.parts { display: flex; flex-direction: column; gap: 16px; }

.part {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--ui-line);
}

.part__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.part__head .f__label { padding: 0; }

.add-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Tag editor */

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 44px;
    padding: 6px;
    border: 1px solid var(--ui-line-2);
    border-radius: 14px;
    background: var(--ui-fill);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 30px;
    padding: 0 4px 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

.tag button {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ui-muted);
    cursor: pointer;
}

.tag button:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.tag button .mi { font-size: 16px; }
.tag--fav { background: rgba(255, 210, 122, 0.18); }
.tag--fav .tag__star { color: var(--ui-warn); }
.tag__star .mi { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

.tags input {
    flex: 1;
    min-width: 120px;
    height: 30px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
}

.tags input:focus { outline: none; }

/* Theme picker */

.themes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.theme-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--ui-line-2);
    border-radius: 18px;
    background: var(--ui-fill);
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.theme-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.35); }
.theme-card[aria-pressed="true"] { border-color: #fff; background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 1px #fff; }

.theme-card__mock {
    position: relative;
    height: 96px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    border-radius: 12px;
}

.theme-card__mock i { display: block; border-radius: 999px; }
.mock__avatar { width: 24px; height: 24px; }
.mock__line { width: 56%; height: 6px; }
.mock__line--short { width: 36%; height: 4px; opacity: 0.6; }
.mock__card { width: 100%; height: 22px; margin-top: 4px; border-radius: 6px !important; }

.theme-card__name { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px; font-weight: 600; font-size: 0.92rem; }
.theme-card__desc { padding: 0 4px 2px; font-size: 0.78rem; line-height: 1.35; color: var(--ui-faint); }

/* Overview */

.hello {
    display: flex;
    align-items: center;
    gap: 18px;
}

.hello__avatar {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    flex: none;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid var(--ui-line-2);
    background: rgba(255, 255, 255, 0.08);
    font-size: 1.6rem;
    font-weight: 600;
}

.hello__avatar img { width: 100%; height: 100%; object-fit: cover; }

.urlbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 16px;
    border: 1px solid var(--ui-line-2);
    border-radius: 999px;
    background: var(--ui-fill);
}

.urlbox a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9rem; }

.quick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.quick a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--ui-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 160ms ease, transform 160ms ease;
}

.quick a:hover { transform: translateY(-2px); border-color: var(--ui-line-2); }
.quick a .mi { font-size: 24px; }
.quick strong { font-size: 0.95rem; }
.quick span { font-size: 0.82rem; color: var(--ui-faint); line-height: 1.4; }

/* Tables (admin) */

.table { display: flex; flex-direction: column; }

.table__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-top: 1px solid var(--ui-line);
}

.table__row:first-child { border-top: 0; }
.table__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.table__main strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; }
.table__main span { font-size: 0.8rem; color: var(--ui-faint); }
.table__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.reveal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid rgba(143, 227, 168, 0.35);
    border-radius: 16px;
    background: rgba(143, 227, 168, 0.06);
}

.reveal p { margin: 0; font-size: 0.86rem; line-height: 1.5; color: var(--ui-muted); }
.reveal__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Preview pane ---------- */

.preview {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--ui-line);
    background: rgba(255, 255, 255, 0.02);
}

.preview__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 64px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--ui-line);
}

.preview__bar strong { font-size: 0.9rem; font-weight: 600; }
.preview__bar .seg { margin-left: auto; padding: 3px; }
.preview__bar .seg button { min-height: 28px; padding: 0 8px; }
.preview__close { display: none; }

.preview__stage {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    padding: 14px;
    overflow: auto;
}

.preview__frame {
    width: 100%;
    height: 100%;
    border: 1px solid var(--ui-line-2);
    border-radius: 16px;
    background: #000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transition: width 250ms var(--ui-ease);
}

.preview--mobile .preview__frame { width: 375px; max-width: 100%; border-radius: 28px; border-width: 6px; border-color: #222; }

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border: 1px solid var(--ui-line-2);
    border-radius: 999px;
    background: rgba(20, 20, 20, 0.95);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
    font-size: 0.9rem;
    transform: translateX(-50%);
    animation: toast-in 300ms var(--ui-ease) both;
}

.toast--error { border-color: rgba(255, 138, 138, 0.5); }

@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

.scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

/* ---------- Responsive ---------- */

@media (max-width: 1320px) {
    .app { grid-template-columns: 252px minmax(0, 1fr); }
    .topbar__preview { display: inline-flex; }

    .preview {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        width: min(100%, 480px);
        background: #050505;
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
        transform: translateX(105%);
        transition: transform 280ms var(--ui-ease);
    }

    .app--preview .preview { transform: none; }
    .preview__close { display: inline-grid; }
}

@media (max-width: 880px) {
    .app,
    .app--no-preview { grid-template-columns: minmax(0, 1fr); }
    .topbar__menu { display: inline-grid; }
    .topbar { padding: 10px 12px; }

    .side {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 40;
        width: 280px;
        background: #070707;
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6);
        transform: translateX(-105%);
        transition: transform 280ms var(--ui-ease);
    }

    .app--nav .side { transform: none; }
    .content { padding: 20px 14px 80px; }
    .savebar__status span { display: none; }
}

@media (max-width: 520px) {
    .topbar__title { display: none; }
    .box { padding: 18px 16px 20px; border-radius: 18px; }
    .item__body { padding: 6px 10px 14px; }
    .savebar .ui-btn--ghost { display: none; }
}

/* ---------- Roles and badges ---------- */

.badge--staff { border-color: rgba(245, 158, 11, 0.45); color: #fbbf24; }
.badge--danger { border-color: rgba(255, 138, 138, 0.5); color: var(--ui-err); }

.ubadges { display: inline-flex; gap: 4px; }

.ubadge {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: var(--badge);
    background: color-mix(in srgb, var(--badge) 18%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--badge) 45%, transparent);
}

.table__main .ubadge, .table__main .ubadges { color: var(--badge); font-size: inherit; }
.ubadge .mi { font-size: 14px; font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20; }
.ubadge--lg { width: 40px; height: 40px; }
.ubadge--lg .mi { font-size: 22px; }

.badge-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

.badge-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--badge) 30%, transparent);
    border-radius: 16px;
    background: color-mix(in srgb, var(--badge) 7%, transparent);
}

.badge-card div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.badge-card strong { font-weight: 600; font-size: 0.92rem; }
.badge-card span:not(.ubadge) { font-size: 0.8rem; color: var(--ui-faint); }

.badge-picker { display: flex; flex-wrap: wrap; gap: 8px; }

.bpick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px 0 9px;
    border: 1px solid var(--ui-line-2);
    border-radius: 999px;
    background: var(--ui-fill);
    font-size: 0.84rem;
    color: var(--ui-muted);
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.bpick .mi { font-size: 18px; color: var(--badge); }
.bpick:hover { border-color: color-mix(in srgb, var(--badge) 60%, transparent); color: #fff; }
.bpick[aria-pressed="true"] {
    color: #fff;
    border-color: color-mix(in srgb, var(--badge) 70%, transparent);
    background: color-mix(in srgb, var(--badge) 20%, transparent);
}
.bpick[aria-pressed="true"] .mi { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.bpick[aria-pressed="true"] .mi:last-child { color: #fff; font-size: 16px; }

/* ---------- Admin ---------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: var(--ui-fill);
}

.stat .mi { color: var(--ui-faint); margin-bottom: 6px; }
.stat strong { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.76rem; color: var(--ui-faint); }

.toolbar { display: flex; flex-direction: column; gap: 10px; }
.toolbar .seg button { min-height: 30px; font-size: 0.8rem; }

.search { position: relative; display: block; }
.search .mi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ui-faint); pointer-events: none; }
.search .input { padding-left: 40px; width: 100%; }

.toolbar__row { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar__row .search { flex: 1 1 240px; }
.sort { position: relative; display: block; flex: 0 1 220px; }
.sort > .mi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ui-faint); pointer-events: none; }
.sort .input { padding-left: 40px; padding-right: 40px; width: 100%; background-image: none; }
.sort__arrow {
    position: absolute; right: 10px; top: 50%;
    display: grid; place-items: center; width: 24px; height: 24px; margin-top: -12px;
    color: var(--ui-faint); pointer-events: none;
    transition: transform 0.2s ease, color 0.2s ease;
}
.sort__arrow .mi { font-size: 22px; }
.sort:hover .sort__arrow, .sort:focus-within .sort__arrow { color: #fff; }
.sort.is-open .sort__arrow { transform: rotate(180deg); }
.sort:has(select:open) .sort__arrow { transform: rotate(180deg); } /* own rule: older browsers drop it without losing the one above */

.urow { border-top: 1px solid var(--ui-line); }
.urow:first-child { border-top: 0; }
.urow .table__row { border-top: 0; }
.urow--suspended .table__main > strong a { text-decoration: line-through; opacity: 0.7; }
.urow--open { background: rgba(255, 255, 255, 0.025); border-radius: 16px; }

.urow__note { display: inline-flex; align-items: center; gap: 4px; color: var(--ui-warn) !important; }
.urow__note .mi { font-size: 15px; }

.suspend {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--ui-err) 45%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--ui-err) 8%, transparent);
}
.suspend__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.suspend__head .mi { color: var(--ui-err); font-size: 20px; }
.suspend__head span:last-child { color: var(--ui-muted); font-size: 13px; }
.suspend__reason { white-space: pre-wrap; overflow-wrap: anywhere; }
.suspend__reason--none { color: var(--ui-muted); font-style: italic; }
.suspend .f[hidden] { display: none; }

.manage {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 4px 14px;
    padding: 16px;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.25);
}

/* Sections inside the panel: even spacing, a thin line between each one. */
.manage > :empty { display: none; }
.manage__body { display: flex; flex-direction: column; gap: 18px; }
.manage__body > * + * { padding-top: 18px; border-top: 1px solid var(--ui-line); }
.manage__tabs .seg { width: 100%; }
.manage__tabs .seg button { flex: 1; min-height: 36px; font-size: 0.84rem; }
.manage .f__label { display: flex; align-items: center; gap: 8px; min-height: 18px; }
.manage__count {
    padding: 1px 8px; border-radius: 999px; background: var(--ui-fill-2, var(--ui-fill));
    color: #fff; font-size: 0.74rem; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums;
}
.manage .add-row .ui-btn--sm { height: 34px; }

/* An input with its buttons on the same line, same height. Wraps on narrow screens. */
.field-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-row > .input { flex: 1 1 180px; min-width: 0; }
.field-row > .ui-btn { flex: none; height: 44px; padding: 0 14px; }

.log { display: flex; flex-direction: column; max-height: 420px; overflow: auto; }

.log__row {
    display: flex;
    gap: 12px;
    padding: 10px 4px;
    border-top: 1px solid var(--ui-line);
    font-size: 0.86rem;
}

.log__row:first-child { border-top: 0; }
.log__icon { color: var(--ui-faint); }
.log__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.log__main strong { font-weight: 600; }
.log__detail { color: var(--ui-faint); overflow-wrap: anywhere; }
.log__main time { font-size: 0.75rem; color: var(--ui-faint); }

.editing {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border-bottom: 1px solid rgba(255, 210, 122, 0.25);
    background: rgba(255, 210, 122, 0.08);
    color: var(--ui-warn);
    font-size: 0.88rem;
}

.editing > span { flex: 1; }
.editing strong { color: #fff; }

/* ---------- Colour picker ---------- */

.color { flex-wrap: wrap; }

.color__sample {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--ui-line-2);
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
}

.palette-wrap { display: flex; flex-direction: column; gap: 10px; }
.palette-wrap:empty { display: none; }

.palette__row { display: flex; align-items: center; gap: 10px; }
.palette__label { flex: none; width: 64px; font-size: 0.74rem; color: var(--ui-faint); }

.palette {
    display: grid;
    grid-template-columns: repeat(18, minmax(0, 1fr));
    gap: 3px;
    padding: 8px;
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
}

.palette button {
    aspect-ratio: 1;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    transition: transform 120ms ease;
}

.palette button:hover { transform: scale(1.25); position: relative; z-index: 1; box-shadow: 0 0 0 2px #000, 0 0 0 3px #fff; }
.palette button[aria-pressed="true"] { box-shadow: 0 0 0 2px #000, 0 0 0 4px #fff; position: relative; z-index: 1; }

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }

.gradient-preview { height: 56px; border-radius: 14px; border: 1px solid var(--ui-line-2); }

/* Presets (custom colours, gradients) */

.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.presets--sm { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }

.preset {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    background: var(--ui-fill);
    cursor: pointer;
    transition: border-color 150ms ease, transform 150ms ease;
}

.preset:hover { border-color: rgba(255, 255, 255, 0.4); transform: translateY(-2px); }

.preset__mock {
    position: relative;
    display: block;
    height: 44px;
    border-radius: 9px;
    border: 1px solid transparent;
    overflow: hidden;
}

.preset__mock i { position: absolute; left: 8px; top: 8px; width: 14px; height: 14px; border-radius: 50%; }
.preset__mock b { position: absolute; left: 8px; right: 8px; bottom: 7px; height: 12px; border-radius: 4px; }
.presets--sm .preset__mock { height: 34px; }
.preset__name { font-size: 0.74rem; color: var(--ui-muted); text-align: center; }

.theme-card__tag { display: inline-flex; align-items: center; gap: 4px; }
.theme-card__tag .mi { font-size: 16px; }

/* Position diagram */

.posmap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border: 1px dashed var(--ui-line-2);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.25);
}

.posmap i, .posmap b { display: block; border-radius: 4px; background: rgba(255, 255, 255, 0.22); }

.pm__head { display: flex; flex-direction: column; gap: 8px; }
.pm__head--side { flex-direction: row; align-items: center !important; gap: 12px; }
.pm__head--right { justify-content: flex-end; }
.pm__head--side .pm__body { flex: 1; }
.pm__pic { flex: none; width: 34px; height: 34px; border-radius: 50% !important; background: rgba(255, 255, 255, 0.5) !important; }
.pm__body { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.pm__namewrap { display: flex; align-items: center; gap: 6px; }
.pm__name { width: 110px; height: 12px; background: rgba(255, 255, 255, 0.7) !important; }
.pm__tag { width: 150px; height: 6px; }
.pm__badges { display: flex !important; gap: 3px; background: none !important; }
.pm__badges b { width: 10px; height: 10px; border-radius: 50%; background: #fbbf24 !important; }
.pm__links { display: flex; gap: 6px; }
.pm__links i { width: 54px; height: 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.4) !important; }
.pm__links--stack { flex-direction: column; align-items: center; }
.pm__links--stack i { width: 60%; max-width: 220px; }
.pm__links--grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.pm__links--grid i { width: auto; }
.pm__sections { display: flex; flex-direction: column; gap: 6px; }
.pm__sections i { height: 26px; border-radius: 8px; background: rgba(255, 255, 255, 0.1) !important; }
.pm__sections--cols { flex-direction: row; }
.pm__sections--cols i { flex: 1; }

@media (max-width: 520px) {
    .palette { grid-template-columns: repeat(9, minmax(0, 1fr)); }
    .field-row > .ui-btn { flex: 1 1 auto; }
    .editing { padding: 10px 14px; }
}

/* ---------- Real-size preview ---------- */

.preview__stage {
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
}

.preview__screen {
    flex: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--ui-line-2);
    border-radius: 12px;
    background: #000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.preview__viewport { position: relative; overflow: hidden; }

.preview .preview__frame {
    position: absolute;
    top: 0;
    left: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #000;
    transform-origin: 0 0;
    transition: none;
}

.chrome {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border-bottom: 1px solid var(--ui-line);
    background: #161616;
}

.chrome i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.chrome i:nth-child(2) { background: #febc2e; }
.chrome i:nth-child(3) { background: #28c840; margin-right: 8px; }

.chrome__url {
    flex: 1;
    min-width: 0;
    height: 18px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.7rem;
    line-height: 18px;
    color: var(--ui-faint);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview--mobile .preview__screen { border: 8px solid #1d1d1d; border-radius: 34px; box-shadow: 0 0 0 1px #333, 0 20px 60px rgba(0, 0, 0, 0.6); }
.preview--mobile .preview__frame { width: 390px; max-width: none; border-radius: 0; border-width: 0; }

.preview__scale { margin-left: auto; font-size: 0.75rem; color: var(--ui-faint); font-variant-numeric: tabular-nums; }
.preview__bar .preview__scale + .seg { margin-left: 8px; }

/* ---------- Announcement, lock ---------- */

/* Icon and message sit centred across the bar. */
.announce {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(147, 197, 253, 0.25);
    background: rgba(59, 130, 246, 0.12);
    color: #bfdbfe;
    font-size: 0.9rem;
}

.announce > span { flex: 0 1 auto; min-width: 0; color: #fff; line-height: 1.45; overflow-wrap: anywhere; }
.announce > .mi { flex: none; }
.announce small { color: var(--ui-faint); font-size: 0.78rem; }
.announce--party { border-color: rgba(244, 114, 182, 0.3); background: linear-gradient(90deg, rgba(236, 72, 153, 0.16), rgba(168, 85, 247, 0.16), rgba(59, 130, 246, 0.16)); color: #f9a8d4; }
.announce--warning { border-color: rgba(255, 210, 122, 0.3); background: rgba(255, 210, 122, 0.1); color: var(--ui-warn); }

.editing--locked { border-color: rgba(255, 138, 138, 0.3); background: rgba(255, 110, 110, 0.08); color: var(--ui-err); }

.badge--warn { gap: 3px; border-color: rgba(255, 210, 122, 0.5); color: var(--ui-warn); }
.badge--warn .mi { font-size: 13px; }

/* ---------- Badges tab, perks ---------- */

.badge-row { cursor: default; }
.badge-row:hover { background: transparent; }
.badge-card--locked { opacity: 0.38; filter: grayscale(0.7); }

.perk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }

.perk {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--ui-line-2);
    border-radius: 16px;
    background: var(--ui-fill);
    color: var(--ui-muted);
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}

.perk:hover { border-color: rgba(250, 204, 21, 0.5); }
.perk[aria-pressed="true"] { border-color: rgba(250, 204, 21, 0.7); background: rgba(250, 204, 21, 0.1); color: #fff; }
.perk > .mi:last-child { margin-left: auto; }

.perk__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.25), rgba(236, 72, 153, 0.25));
    color: #fde68a;
}

.perk__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perk__text strong { font-weight: 600; font-size: 0.9rem; color: #fff; }
.perk__text span { font-size: 0.78rem; color: var(--ui-faint); }

.perk-teaser {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px dashed rgba(250, 204, 21, 0.35);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.06), rgba(236, 72, 153, 0.06));
}

.perk-teaser > .mi { font-size: 30px; color: #fde68a; }
.perk-teaser div { display: flex; flex-direction: column; gap: 3px; }
.perk-teaser span { font-size: 0.84rem; color: var(--ui-muted); }

.keybox--list { flex-direction: column; align-items: stretch; gap: 4px; max-height: 260px; overflow: auto; }

.perk__text strong { display: flex; align-items: center; gap: 6px; }
.perk__text .badge { height: 17px; padding: 0 6px; font-size: 0.6rem; color: var(--ui-warn); }

/* Badge colour */
.colour-dot {
    flex: none;
    width: 26px;
    height: 26px;
    margin: 0 4px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
    transition: transform 120ms ease;
}
.colour-dot:hover { transform: scale(1.12); }
.popover--colour { width: min(420px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 10px; }
.popover--colour .palette__label { width: 70px; }
.popover--colour input[type="color"] { width: 36px; height: 36px; }

/* ---------- Signatures (Accounts → Manage) ---------- */

.manage .signs-edit { gap: 10px; }
.signs-edit__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }

.signs-edit__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 12px;
    border: 1px dashed var(--ui-line);
    border-radius: 12px;
    font-size: 0.88rem;
}

.signs-edit__item > .mi { font-size: 18px; color: var(--ui-faint); }
.signs-edit__text { flex: 1; min-width: 0; font-style: italic; color: #fff; overflow-wrap: anywhere; }
.signs-edit__by { flex: none; font-size: 0.78rem; color: var(--ui-faint); }
.signs-edit__item .icon-btn { flex: none; }

/* ---------- Media, analytics and guestbook ---------- */

.f__hint--ok { color: var(--ui-ok); }
.f__hint--err { color: var(--ui-err); }
.f__hint--ok .mi,
.f__hint--err .mi,
.f__label .mi { font-size: 15px; vertical-align: -3px; }

.stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stats-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* Views per day: single series, one light hue, thin bars with a 2px gap and rounded tops. */
.chart { display: flex; flex-direction: column; gap: 6px; }
.chart__plot { position: relative; height: 180px; padding-left: 40px; }
.chart__grid {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}
.chart__grid span {
    display: block;
    width: 32px;
    font-size: 0.7rem;
    line-height: 0;
    text-align: right;
    color: var(--ui-faint);
    font-variant-numeric: tabular-nums;
}
.chart__grid span::after {
    content: "";
    position: absolute;
    left: 40px;
    right: 0;
    border-top: 1px solid var(--ui-line);
}
.chart__bars { position: relative; height: 100%; display: flex; align-items: flex-end; gap: 2px; }
.chart__col {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
}
.chart__col:hover,
.chart__col:focus-visible { background: var(--ui-fill); outline: none; }
.chart__bar {
    display: block;
    width: 100%;
    max-width: 28px;
    margin: 0 auto;
    border-radius: 4px 4px 0 0;
    background: #9ec5ff;
}
.chart__col:hover .chart__bar,
.chart__col:focus-visible .chart__bar { background: #cfe1ff; }
.chart__tip {
    position: absolute;
    top: 4px;
    z-index: 2;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 10px;
    border: 1px solid var(--ui-line-2);
    border-radius: 10px;
    background: #111;
    font-size: 0.76rem;
    color: var(--ui-muted);
    white-space: nowrap;
    pointer-events: none;
}
.chart__tip strong { color: #fff; font-weight: 600; }
.chart__axis { display: flex; justify-content: space-between; padding-left: 40px; font-size: 0.72rem; color: var(--ui-faint); }

/* Ranked lists */
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rank__row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.86rem;
    overflow: hidden;
}
.rank__bar { position: absolute; inset: 0 auto 0 0; z-index: -1; border-radius: 8px; background: rgba(158, 197, 255, 0.16); }
.rank__row { isolation: isolate; }
.rank__label { flex: 1; min-width: 0; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank__label .mi { font-size: 17px; color: var(--ui-faint); }
.rank__value { font-variant-numeric: tabular-nums; color: var(--ui-muted); }

/* Guestbook messages */
.gb-row { align-items: flex-start; }
.table__main .gb-row__text { font-size: 0.9rem; color: #fff; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- Layout board ---------- */

.arranged-note { display: block; }
.arranged-note .mi { font-size: 15px; vertical-align: -3px; }

.board-wrap { container-type: inline-size; }
.board { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
/* Sidebar and Main side by side, like the page, when there's room for the piece names. */
@container (min-width: 760px) {
    .board--left { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); }
    .board--right { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); }
}
.board .zone--header,
.board .zone--hidden { grid-column: 1 / -1; }

.zone {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--ui-line);
    border-radius: 18px;
    background: var(--ui-fill);
}
.zone--hidden { border-style: dashed; background: transparent; }
.zone__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 4px 4px; }
.zone__head .mi { color: var(--ui-faint); font-size: 18px; }
.zone__head strong { font-size: 0.92rem; font-weight: 600; }
.zone__head span { font-size: 0.76rem; color: var(--ui-faint); }
.zone__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 8px; }
.zone__empty {
    padding: 14px;
    border: 1px dashed var(--ui-line-2);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--ui-faint);
    text-align: center;
}
.zone__drop { height: 3px; margin: -2px 6px; border-radius: 3px; background: #9ec5ff; }

.chipi {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 6px 6px 6px 4px;
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    background: rgba(20, 20, 20, 0.9);
    cursor: grab;
    user-select: none;
}
.chipi:hover { border-color: var(--ui-line-2); }
.chipi--drag { opacity: 0.4; }
.chipi--empty .chipi__icon,
.chipi--empty .chipi__text { opacity: 0.5; }
.chipi__grip { color: var(--ui-faint); font-size: 18px; }
.chipi__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--ui-fill-2);
}
.chipi__icon .mi { font-size: 18px; }
.chipi--sec .chipi__icon { background: rgba(158, 197, 255, 0.16); color: #cfe1ff; }
.chipi__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chipi__text strong { font-size: 0.86rem; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chipi__text span { font-size: 0.72rem; color: var(--ui-faint); }
.chipi__tools { display: flex; align-items: center; gap: 2px; flex: none; }
.chipi__tools .icon-btn { width: 30px; height: 30px; }
.input--sm { height: 32px; min-height: 32px; padding: 0 28px 0 10px; font-size: 0.8rem; border-radius: 9px; width: auto; }

@media (max-width: 640px) { .chipi__grip { display: none; } }

/* ---------- Mass Drive ---------- */

/* The nav button above the groups. */
.nav a.nav__media {
    margin: 4px 0 2px;
    border: 1px solid var(--ui-line-2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    color: #fff;
    font-weight: 600;
}

.nav a.nav__media .mi { color: #fff; }
.nav a.nav__media .nav__ext { margin-left: auto; font-size: 16px; color: var(--ui-faint); }
.nav a.nav__media:hover { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.14); }

/* Link / Mass Drive file fields. */
.mf__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.seg--sm { padding: 3px; border-radius: 12px; flex-wrap: nowrap; }
.seg--sm button { min-height: 28px; padding: 0 10px; font-size: 0.78rem; border-radius: 9px; }
.seg--sm button .mi { font-size: 16px; }

.mf__body { display: flex; flex-direction: column; gap: 10px; }

.mf__current {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    background: var(--ui-fill);
}

.mf__current--empty { border-style: dashed; }

.mf__thumb {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    color: var(--ui-muted);
}

.mf__thumb img,
.mf__thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mf__thumb audio { width: 100%; }
.mf__current .mf__thumb:has(audio) { width: 220px; height: auto; background: none; }

.mf__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mf__info strong { font-size: 0.88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf__info span { font-size: 0.76rem; color: var(--ui-faint); }

.mf__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mf__status { font-size: 0.8rem; color: var(--ui-muted); }
.mf__status:empty { display: none; }

.mf__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
    max-height: 290px;
    overflow: auto;
    padding: 2px;
}

.mf__pick {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    background: var(--ui-fill);
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
    transition: border-color 150ms ease, background 150ms ease;
}

.mf__pick:hover { border-color: var(--ui-line-2); background: var(--ui-fill-2); }
.mf__pick[aria-pressed="true"] { border-color: #fff; }
.mf__pick .mf__thumb { width: 100%; height: auto; aspect-ratio: 1; }
.mf__name { font-size: 0.72rem; color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* An admin editing someone else's page: the top-left box shows whose page it is. */
.side__user--other { border-color: rgba(255, 210, 122, 0.35); background: rgba(255, 210, 122, 0.08); }
.side__user--other .side__who span { color: var(--ui-warn); }
