/* ==========================================================================
   CPWGames Tools — design system
   Dark, Twitch-adjacent, no external fonts or assets.
   ========================================================================== */

:root {
    color-scheme: dark;
    --bg: #0a0710;
    --bg-soft: #110c19;
    --panel: rgba(255, 255, 255, 0.04);
    --panel-strong: #150f1f;
    --border: rgba(255, 255, 255, 0.09);
    --border-soft: rgba(255, 255, 255, 0.06);
    --text: #f4f0fb;
    --muted: #a79bbd;
    --purple: #9146ff;
    --purple-soft: #b98cff;
    --violet: #7a2ff2;
    --green: #43d99a;
    --amber: #f6c46a;
    --red: #ff6f85;
    --radius: 18px;
    --radius-sm: 12px;
    --max: 1120px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
    --shadow: 0 30px 80px -40px rgba(145, 70, 255, 0.6);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--purple-soft);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #d9c4ff;
}

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.025em;
    font-weight: 700;
}

p {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
}

:focus-visible {
    outline: 2px solid var(--purple-soft);
    outline-offset: 3px;
    border-radius: 6px;
}

::selection {
    background: rgba(145, 70, 255, 0.4);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Ambient background
   -------------------------------------------------------------------------- */

.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60% 45% at 15% -5%, rgba(145, 70, 255, 0.28), transparent 70%),
        radial-gradient(45% 40% at 90% 0%, rgba(88, 101, 242, 0.16), transparent 72%),
        radial-gradient(55% 45% at 50% 105%, rgba(145, 70, 255, 0.12), transparent 70%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 76px 76px;
    mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 75%);
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
}

.container--narrow {
    max-width: 760px;
}

.section {
    padding: 76px 0;
}

.section--tight {
    padding: 44px 0;
}

.section-head {
    max-width: 660px;
    margin-bottom: 34px;
}

.section-head--center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--purple-soft);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--purple), transparent);
}

.h1 {
    font-size: clamp(2.4rem, 5.2vw, 3.9rem);
    line-height: 1.03;
    letter-spacing: -0.04em;
}

.h2 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
}

.h3 {
    font-size: 1.15rem;
}

.lead {
    margin-top: 18px;
    color: var(--muted);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.65;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.875rem;
}

.tiny {
    font-size: 0.78rem;
}

.mono {
    font-family: var(--mono);
}

.center {
    text-align: center;
}

.nowrap {
    white-space: nowrap;
}

.stack > * + * {
    margin-top: 16px;
}

.stack-md > * + * {
    margin-top: 12px;
}

.stack-lg > * + * {
    margin-top: 24px;
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.row--center {
    justify-content: center;
}

.row--wrap {
    flex-wrap: wrap;
}

.row--between {
    justify-content: space-between;
}

.spacer {
    flex: 1;
}

.divider {
    height: 1px;
    border: 0;
    margin: 24px 0;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 16px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--purple);
    color: #fff;
    font-weight: 600;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 12px;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 7, 16, 0.72);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
    font-size: 1.06rem;
    letter-spacing: -0.02em;
}

.brand-lockup {
    display: block;
    width: auto;
    height: 44px;
}

.brand .brand-logo,
.brand-name {
    display: none;
}

.brand:hover {
    color: var(--text);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #dcc6ff;
    background: linear-gradient(150deg, rgba(145, 70, 255, 0.5), rgba(122, 47, 242, 0.12));
    border: 1px solid rgba(185, 140, 255, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.brand-mark svg {
    width: 21px;
    height: 21px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.nav-link {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.is-active {
    color: var(--text);
    background: rgba(145, 70, 255, 0.16);
}

.nav-menu {
    position: relative;
}

.nav-menu summary {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    list-style: none;
}

.nav-menu summary::-webkit-details-marker {
    display: none;
}

.nav-menu summary svg {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
    transform: rotate(90deg);
}

.nav-menu[open] summary svg {
    transform: rotate(-90deg);
}

.nav-menu-options {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 60;
    min-width: 218px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-strong);
    box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.75);
}

.nav-menu-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.84rem;
    white-space: nowrap;
}

.nav-menu-option:hover {
    background: rgba(145, 70, 255, 0.14);
    color: var(--text);
}

.nav-menu-option.is-active {
    background: rgba(145, 70, 255, 0.2);
    font-weight: 600;
}

.nav-menu-soon {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav-menu-check {
    color: var(--purple-soft);
    font-size: 0.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.account-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 190px;
}

.account-chip span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-chip img,
.account-chip-fallback {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}

.account-chip-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, var(--purple), var(--violet));
    color: #fff;
    font-size: 0.75rem;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.nav-toggle {
    display: none;
    order: 3;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
}

.nav-toggle-bars {
    display: grid;
    gap: 4px;
    justify-items: center;
}

.nav-toggle-bars span {
    display: block;
    width: 17px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #a970ff 0%, #7a2ff2 60%, #6a1fe0 100%);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 14px 40px -18px rgba(145, 70, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn--primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 20px 48px -16px rgba(145, 70, 255, 1), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.btn--ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
}

.btn--ghost:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.btn--danger {
    color: #ffd7dd;
    background: rgba(255, 111, 133, 0.1);
    border-color: rgba(255, 111, 133, 0.35);
}

.btn--danger:hover {
    color: #fff;
    background: rgba(255, 111, 133, 0.2);
}

.btn--tiny {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
}

.btn--block {
    width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex: none;
}

/* --------------------------------------------------------------------------
   Badges, chips, cards
   -------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(185, 140, 255, 0.3);
    background: rgba(145, 70, 255, 0.12);
    color: #d9c4ff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge--ok {
    border-color: rgba(67, 217, 154, 0.32);
    background: rgba(67, 217, 154, 0.1);
    color: #a8f0cd;
}

.badge--warn {
    border-color: rgba(246, 196, 106, 0.32);
    background: rgba(246, 196, 106, 0.1);
    color: #ffdba0;
}

.badge--error {
    border-color: rgba(255, 111, 133, 0.32);
    background: rgba(255, 111, 133, 0.1);
    color: #ffc1cb;
}

.badge--muted {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 7px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.04);
    color: #cfc3e4;
    font-family: var(--mono);
    font-size: 0.73rem;
    line-height: 1.5;
    word-break: break-word;
}

.chip--ok {
    border-color: rgba(67, 217, 154, 0.24);
    background: rgba(67, 217, 154, 0.08);
    color: #b7f4d9;
}

.chip--off {
    opacity: 0.45;
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, 0.25);
}

.card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card--pad {
    padding: 26px;
}

.card--glow {
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card--accent {
    border-color: rgba(185, 140, 255, 0.28);
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(145, 70, 255, 0.16), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
}

.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
    position: relative;
    padding: 80px 0 56px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 52px;
    align-items: center;
}

.hero-copy .h1 em {
    font-style: normal;
    background: linear-gradient(120deg, #d9c4ff 0%, #a970ff 45%, #7a2ff2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 0.84rem;
}

.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.hero-meta svg {
    width: 15px;
    height: 15px;
    color: var(--green);
    flex: none;
}

/* Faux token card used as hero artwork */
.hero-visual {
    position: relative;
}

.hero-visual::before {
    content: "";
    position: absolute;
    inset: -22px;
    z-index: -1;
    border-radius: 34px;
    background: radial-gradient(closest-side, rgba(145, 70, 255, 0.35), transparent 78%);
    filter: blur(22px);
}

.token-mock {
    position: relative;
    padding: 1px;
    border-radius: 22px;
    background: linear-gradient(150deg, rgba(185, 140, 255, 0.55), rgba(255, 255, 255, 0.08) 45%, rgba(145, 70, 255, 0.35));
    box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.9);
    transform: rotate(-1.2deg);
}

.token-mock-inner {
    border-radius: 21px;
    background: linear-gradient(180deg, #150f20, #0d0915);
    padding: 22px;
}

.mock-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mock-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(140deg, #9146ff, #4a1aa8);
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.03em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.mock-name {
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.2;
}

.mock-sub {
    color: var(--muted);
    font-size: 0.76rem;
    margin-top: 3px;
}

.mock-field {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
}

.mock-label {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.mock-value {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: #e5dcf7;
    letter-spacing: 0.03em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mock-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 16px;
}

.mock-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-soft);
    color: var(--muted);
    font-size: 0.74rem;
}

.mock-fab {
    position: absolute;
    right: -14px;
    bottom: -18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(67, 217, 154, 0.4);
    background: #0d1a15;
    color: #b7f4d9;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.9);
}

.mock-fab svg {
    width: 15px;
    height: 15px;
}

/* --------------------------------------------------------------------------
   Feature grid
   -------------------------------------------------------------------------- */

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

.feature {
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.feature:hover {
    border-color: rgba(185, 140, 255, 0.3);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
    transform: translateY(-2px);
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    border-radius: 11px;
    border: 1px solid rgba(185, 140, 255, 0.24);
    background: rgba(145, 70, 255, 0.14);
    color: var(--purple-soft);
}

.feature-icon svg {
    width: 19px;
    height: 19px;
}

.feature h3 {
    font-size: 0.98rem;
    margin-bottom: 6px;
}

.feature p {
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Steps
   -------------------------------------------------------------------------- */

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    counter-reset: step;
}

.step {
    position: relative;
    padding: 26px 22px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.025);
    overflow: hidden;
}

.step::after {
    counter-increment: step;
    content: "0" counter(step);
    position: absolute;
    top: 12px;
    right: 16px;
    font-family: var(--mono);
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.06em;
    color: rgba(255, 255, 255, 0.05);
    line-height: 1;
}

.step h3 {
    margin: 12px 0 8px;
    font-size: 1rem;
}

.step p {
    color: var(--muted);
    font-size: 0.87rem;
}

.step-kicker {
    display: inline-flex;
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px solid rgba(185, 140, 255, 0.25);
    background: rgba(145, 70, 255, 0.12);
    color: var(--purple-soft);
    font-family: var(--mono);
    font-size: 0.7rem;
}

/* --------------------------------------------------------------------------
   Scope explorer
   -------------------------------------------------------------------------- */

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

.scope-group-card {
    display: block;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    transition: border-color 0.2s ease, background 0.2s ease;
}

a.scope-group-card:hover {
    border-color: rgba(185, 140, 255, 0.35);
    background: rgba(145, 70, 255, 0.1);
    color: var(--text);
}

.scope-group-card h3 {
    font-size: 0.94rem;
    margin-bottom: 4px;
}

.scope-group-card p {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.scope-group-count {
    display: inline-flex;
    margin-top: 12px;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--purple-soft);
}

/* --------------------------------------------------------------------------
   Authorize / scope picker
   -------------------------------------------------------------------------- */

.page-head {
    padding: 52px 0 30px;
}

.page-head .h1 {
    font-size: clamp(1.9rem, 3.6vw, 2.8rem);
}

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

.preset {
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.preset span {
    color: var(--muted);
    font-weight: 500;
}

.preset:hover {
    border-color: rgba(185, 140, 255, 0.4);
    background: rgba(145, 70, 255, 0.14);
}

.preset.is-active {
    border-color: rgba(185, 140, 255, 0.55);
    background: rgba(145, 70, 255, 0.2);
    color: #fff;
}

.scope-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.scope-group + .scope-group {
    margin-top: 14px;
}

.scope-group-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-soft);
}

.scope-group-head h2 {
    font-size: 0.98rem;
    margin: 0;
}

.scope-group-head p {
    color: var(--muted);
    font-size: 0.79rem;
    line-height: 1.45;
}

.scope-group-head .row {
    margin-left: auto;
    flex: none;
}

.scope-list {
    display: grid;
    gap: 0;
    padding: 6px 8px 10px;
}

.scope-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.scope-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.scope-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    accent-color: var(--purple);
    cursor: pointer;
}

.scope-item-body {
    min-width: 0;
}

.scope-item-name {
    display: block;
    font-family: var(--mono);
    font-size: 0.79rem;
    color: #e8def8;
    word-break: break-word;
}

.scope-item-desc {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.79rem;
    line-height: 1.45;
}

.scope-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.38);
}

.authorize-bar {
    position: sticky;
    bottom: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid rgba(185, 140, 255, 0.28);
    border-radius: 16px;
    background: rgba(16, 11, 24, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.authorize-count {
    font-size: 0.86rem;
    color: var(--muted);
}

.authorize-count strong {
    display: block;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.authorize-bar .btn {
    margin-left: auto;
}

/* --------------------------------------------------------------------------
   Flash / alerts
   -------------------------------------------------------------------------- */

.flash {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.88rem;
}

.flash--ok {
    border-color: rgba(67, 217, 154, 0.3);
    background: rgba(67, 217, 154, 0.09);
    color: #d6ffee;
}

.flash--warn {
    border-color: rgba(246, 196, 106, 0.32);
    background: rgba(246, 196, 106, 0.09);
    color: #ffe9c2;
}

.flash--error {
    border-color: rgba(255, 111, 133, 0.34);
    background: rgba(255, 111, 133, 0.1);
    color: #ffd8de;
}

.flash-close {
    margin-left: auto;
    padding: 0 4px;
    border: 0;
    background: none;
    color: inherit;
    font-size: 1.15rem;
    line-height: 1;
    opacity: 0.6;
    cursor: pointer;
}

.flash-close:hover {
    opacity: 1;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(246, 196, 106, 0.26);
    background: rgba(246, 196, 106, 0.07);
    color: #f6e3bd;
    font-size: 0.85rem;
    line-height: 1.55;
}

.notice > svg {
    width: 20px;
    height: 20px;
    flex: none;
    margin-top: 1px;
}

.notice strong {
    color: #ffe9c2;
}

.notice--info {
    border-color: rgba(185, 140, 255, 0.26);
    background: rgba(145, 70, 255, 0.08);
    color: #ddd0f2;
}

/* Account switch panel */

.switch-card {
    padding: 28px;
    overflow: hidden;
}

.switch-card-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.switch-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: 14px;
    border: 1px solid rgba(185, 140, 255, 0.28);
    background: rgba(145, 70, 255, 0.14);
    color: #d9c4ff;
}

.switch-icon svg {
    width: 24px;
    height: 24px;
}

.switch-card-head .h2 {
    max-width: 620px;
}

.switch-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.switch-step {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    padding: 17px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.switch-step-num {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(185, 140, 255, 0.28);
    background: rgba(145, 70, 255, 0.12);
    color: var(--purple-soft);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 700;
}

.switch-step h3 {
    margin: 2px 0 4px;
    font-size: 0.92rem;
}

.switch-step p {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.6;
}

.switch-step strong {
    color: var(--text);
}

.switch-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--purple-soft);
    font-size: 0.78rem;
    font-weight: 600;
}

.switch-link svg {
    width: 14px;
    height: 14px;
}

.switch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.switch-footnote {
    max-width: 780px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 16px;
    align-items: start;
}

.profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: #1a1226;
    flex: none;
}

.profile-avatar--fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, var(--purple), #4a1aa8);
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.profile-login {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.8rem;
    margin-top: 3px;
}

.meta-list {
    display: grid;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.meta-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-soft);
    font-size: 0.84rem;
}

.meta-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.meta-list dt,
.meta-list .meta-key {
    color: var(--muted);
    flex: none;
}

.meta-list .meta-val {
    text-align: right;
    font-family: var(--mono);
    font-size: 0.79rem;
    color: #e7ddf7;
    word-break: break-word;
}

.token-field {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
}

.token-value {
    flex: 1;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    color: #e8def8;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.5;
    word-break: break-all;
    transition: filter 0.15s ease;
}

.token-value.is-masked {
    filter: blur(5px);
    user-select: none;
}

.token-field .btn {
    flex: none;
    padding: 0 14px;
}

.token-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.token-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.79rem;
}

.token-meta .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}

.countdown {
    font-family: var(--mono);
    color: #d7c9ee;
}

.history-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.history-table th {
    padding: 0 12px 10px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
}

.history-table td {
    padding: 12px;
    border-top: 1px solid var(--border-soft);
    color: var(--muted);
    vertical-align: middle;
    white-space: nowrap;
}

.history-table tr.is-current td {
    background: rgba(145, 70, 255, 0.06);
}

.history-table tr.is-current td:first-child {
    color: var(--text);
}

.history-table .badge {
    margin-left: 8px;
    padding: 3px 8px;
    font-size: 0.62rem;
}

.history-table .countdown {
    font-size: 0.78rem;
}

.history-table .countdown.is-expired {
    color: #ffb3bd;
}

.granted-groups {
    display: grid;
    gap: 18px;
}

.granted-group h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
}

.granted-group h3::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-soft);
}

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

.code-block {
    position: relative;
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    color: #d9cdf0;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.75;
    overflow-x: auto;
}

.code-block .tok {
    color: #a970ff;
}

.code-block .str {
    color: #7fe0b0;
}

.code-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.code-head h3 {
    font-size: 0.9rem;
}

.snippet-tabs {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.25);
}

.tab {
    padding: 5px 10px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
}

.tab.is-active {
    background: rgba(145, 70, 255, 0.24);
    color: #fff;
}

.tab-panel[hidden] {
    display: none;
}

/* --------------------------------------------------------------------------
   FAQ accordion + prose
   -------------------------------------------------------------------------- */

.faq {
    display: grid;
    gap: 10px;
}

.faq details {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.faq details[open] {
    border-color: rgba(185, 140, 255, 0.28);
    background: rgba(145, 70, 255, 0.06);
}

.faq summary {
    position: relative;
    padding: 16px 48px 16px 18px;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    color: var(--purple-soft);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1;
}

.faq details[open] summary::after {
    content: "–";
}

.faq .faq-answer {
    padding: 0 18px 18px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

.faq .faq-answer p + p {
    margin-top: 10px;
}

.faq .faq-answer code,
.prose code {
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.07);
    font-family: var(--mono);
    font-size: 0.82em;
    color: #e8dcff;
    word-break: break-word;
}

.prose {
    max-width: 760px;
    color: #cfc4e0;
    font-size: 0.95rem;
    line-height: 1.75;
}

.prose h2 {
    margin: 38px 0 12px;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.prose h2:first-child {
    margin-top: 0;
}

.prose h3 {
    margin: 24px 0 8px;
    font-size: 1rem;
    color: var(--text);
}

.prose p {
    margin: 0 0 14px;
}

.prose ul,
.prose ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.prose li {
    margin-bottom: 7px;
}

.prose li::marker {
    color: var(--purple-soft);
}

.prose strong {
    color: var(--text);
}

.prose a {
    text-decoration: underline;
    text-decoration-color: rgba(185, 140, 255, 0.4);
    text-underline-offset: 2px;
}

.legal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 26px;
    color: var(--muted);
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Setup / CTA / callouts
   -------------------------------------------------------------------------- */

.setup-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.7;
}

.setup-list code {
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.07);
    font-family: var(--mono);
    font-size: 0.85em;
    color: #e8dcff;
}

.cta-band {
    position: relative;
    margin: 10px 0 0;
    padding: 48px 40px;
    border-radius: 24px;
    border: 1px solid rgba(185, 140, 255, 0.28);
    background:
        radial-gradient(90% 140% at 0% 0%, rgba(145, 70, 255, 0.26), transparent 60%),
        radial-gradient(80% 120% at 100% 100%, rgba(88, 101, 242, 0.18), transparent 65%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
    overflow: hidden;
}

.cta-band h2 {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    max-width: 620px;
}

.cta-band p {
    margin-top: 12px;
    max-width: 560px;
    color: #cfc3e4;
}

.cta-band .hero-actions {
    margin-top: 24px;
}

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

.security-item {
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.025);
}

.security-item h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.security-item h3 svg {
    width: 16px;
    height: 16px;
    color: var(--green);
    flex: none;
}

.security-item p {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    margin-top: 60px;
    border-top: 1px solid var(--border-soft);
    background: rgba(8, 5, 13, 0.6);
    padding: 44px 0 24px;
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.footer-brand p {
    max-width: 280px;
    margin-top: 12px;
    line-height: 1.6;
}

.brand--footer {
    font-size: 1rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.86rem;
}

.footer-col a {
    color: var(--muted);
    width: fit-content;
}

.footer-col a:hover {
    color: var(--text);
}

.footer-link-button {
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    line-height: inherit;
    text-align: left;
    cursor: pointer;
}

.footer-link-button:hover {
    color: var(--text);
}

.footer-heading {
    margin: 0 0 4px;
    color: #e7ddf7;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   Cookie consent
   -------------------------------------------------------------------------- */

.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 1000;
    width: min(var(--max), calc(100vw - 32px));
    transform: translateX(-50%);
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(17, 12, 25, 0.97);
    box-shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cookie-copy {
    min-width: 0;
}

.cookie-copy h2 {
    margin: 0 0 4px;
    font-size: 0.95rem;
}

.cookie-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.cookie-copy a {
    color: var(--purple-soft);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-actions {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    gap: 8px;
}

.cookie-actions .btn {
    white-space: nowrap;
}

[data-theme="light"] .cookie-banner {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(23, 15, 42, 0.14);
    box-shadow: 0 24px 70px -28px rgba(23, 15, 42, 0.45), inset 0 1px 0 #ffffff;
}

@media (max-width: 760px) {
    .switch-card {
        padding: 20px;
    }

    .switch-card-head {
        gap: 12px;
    }

    .switch-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .switch-steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .switch-actions .btn {
        width: 100%;
    }

    .cookie-banner {
        left: 0;
        bottom: 0;
        width: 100%;
        transform: none;
        border-radius: var(--radius) var(--radius) 0 0;
        padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    }

    .cookie-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .cookie-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .cookie-actions .btn {
        width: 100%;
    }
}

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

@media (max-width: 980px) {
    .hero {
        padding: 56px 0 40px;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .hero-visual {
        max-width: 480px;
    }

    .feature-grid,
    .steps,
    .security-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 26px;
    }
}

@media (max-width: 900px) {
    .nav-toggle {
        display: grid;
        place-items: center;
        margin-left: auto;
    }

    .header-actions {
        margin-left: 0;
    }

    .site-nav {
        display: none;
        order: 4;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin: 0 0 14px;
        padding-top: 8px;
        border-top: 1px solid var(--border-soft);
    }

    .header-inner.is-open .site-nav {
        display: flex;
    }

    .nav-link {
        padding: 11px 12px;
    }

    .nav-menu {
        width: 100%;
    }

    .nav-menu summary {
        justify-content: space-between;
    }

    .nav-menu-options {
        position: static;
        min-width: 0;
        padding: 2px 0 6px 12px;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .nav-menu-option {
        padding: 9px 12px;
    }

    .header-inner {
        flex-wrap: wrap;
        padding-top: 12px;
        padding-bottom: 4px;
    }

    .header-inner.is-open {
        padding-bottom: 8px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 18px;
    }

    .section {
        padding: 52px 0;
    }

    .page-head {
        padding: 36px 0 22px;
    }

    .feature-grid,
    .steps,
    .security-grid,
    .footer-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .card--pad {
        padding: 20px;
    }

    .token-mock {
        transform: none;
    }

    .mock-fab {
        right: 4px;
    }

    .authorize-bar {
        flex-wrap: wrap;
        bottom: 8px;
    }

    .authorize-bar .btn {
        width: 100%;
        margin-left: 0;
    }

    .authorize-count strong {
        display: inline;
        font-size: 0.95rem;
    }

    .cta-band {
        padding: 32px 22px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .token-field {
        flex-wrap: wrap;
    }

    .token-field .btn {
        padding: 8px 14px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .account-chip span:last-child {
        display: none;
    }

    .account-chip {
        padding-right: 4px;
    }
}

/* --------------------------------------------------------------------------
   Utilities used by templates (keeps the CSP free of 'unsafe-inline')
   -------------------------------------------------------------------------- */

.h1--page {
    font-size: clamp(1.9rem, 3.6vw, 2.7rem);
}

.token-label {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.scope-toggle {
    width: 18px;
    height: 18px;
    flex: none;
    accent-color: var(--purple);
    cursor: pointer;
}

.scope-group-head .badge {
    margin-left: auto;
    flex: none;
}

.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.mt-20 { margin-top: 20px; }
.mt-22 { margin-top: 22px; }
.mt-28 { margin-top: 28px; }
.mb-12 { margin-bottom: 12px; }
.mb-22 { margin-bottom: 22px; }
.pt-0 { padding-top: 0; }
.ml-auto { margin-left: auto; }
.mr-4 { margin-right: 4px; }
.self-center { align-self: center; }

/* --------------------------------------------------------------------------
   Brand assets
   -------------------------------------------------------------------------- */

.brand-logo {
    width: 34px;
    height: 34px;
    display: block;
    flex: none;
}

.brand-plate {
    display: inline-flex;
    margin-top: 16px;
}

.footer-logo {
    width: 240px;
    height: auto;
    display: block;
}

.mock-logo {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #0b0b26;
    flex: none;
}

/* --------------------------------------------------------------------------
   Theme toggle + language menu
   -------------------------------------------------------------------------- */

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
    border-color: rgba(185, 140, 255, 0.4);
    background: rgba(145, 70, 255, 0.12);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.theme-icon {
    display: none;
    line-height: 0;
}

.theme-icon--moon {
    display: inline-flex;
}

[data-theme="light"] .theme-icon--moon {
    display: none;
}

[data-theme="light"] .theme-icon--sun {
    display: inline-flex;
}

.lang-menu {
    position: relative;
}

.lang-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.lang-menu summary::-webkit-details-marker {
    display: none;
}

.lang-menu summary:hover {
    color: var(--text);
    border-color: rgba(185, 140, 255, 0.4);
}

.lang-menu summary svg {
    width: 16px;
    height: 16px;
}

.lang-options {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 60;
    min-width: 168px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-strong);
    box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.75);
}

.lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.84rem;
}

.lang-option:hover {
    background: rgba(145, 70, 255, 0.14);
    color: var(--text);
}

.lang-option.is-active {
    background: rgba(145, 70, 255, 0.2);
    font-weight: 600;
}

.lang-option .lang-check {
    color: var(--purple-soft);
    font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Home: hero hub card + tool grid
   -------------------------------------------------------------------------- */

.h1--grad {
    background: linear-gradient(115deg, #ffffff 0%, #ddcbff 55%, #a970ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hub-list {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.hub-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
}

.hub-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 8px;
    background: rgba(145, 70, 255, 0.18);
    color: #c9a8ff;
}

.hub-icon svg {
    width: 16px;
    height: 16px;
}

.hub-row strong {
    display: block;
    font-size: 0.82rem;
    line-height: 1.25;
}

.hub-row small {
    display: block;
    margin-top: 2px;
    color: #a79bbd;
    font-size: 0.7rem;
}

.hub-state {
    margin-left: auto;
    flex: none;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(67, 217, 154, 0.12);
    color: #a8f0cd;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hub-row--soon {
    opacity: 0.7;
}

.hub-row--soon .hub-state {
    background: rgba(255, 255, 255, 0.07);
    color: #b8adc9;
}

.hub-row--soon .hub-icon {
    background: rgba(255, 255, 255, 0.06);
    color: #b8adc9;
}

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

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
    color: var(--text);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

a.tool-card:hover {
    color: var(--text);
    border-color: rgba(185, 140, 255, 0.34);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.015));
    transform: translateY(-2px);
}

.tool-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    border: 1px solid rgba(185, 140, 255, 0.24);
    background: rgba(145, 70, 255, 0.14);
    color: var(--purple-soft);
}

.tool-icon svg {
    width: 20px;
    height: 20px;
}

.tool-card h3 {
    font-size: 1.05rem;
}

.tool-card p {
    flex: 1;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--purple-soft);
    font-size: 0.85rem;
    font-weight: 600;
}

.tool-link svg {
    width: 15px;
    height: 15px;
}

.tool-card--soon {
    border-style: dashed;
    opacity: 0.85;
}

.tool-card--soon:hover {
    transform: none;
}

.tool-badge {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* --------------------------------------------------------------------------
   Emote search
   -------------------------------------------------------------------------- */

.emote-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 24px;
}

select.input {
    cursor: pointer;
}

.field label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.input::placeholder {
    color: rgba(167, 155, 189, 0.7);
}

.input:focus {
    outline: 2px solid var(--purple-soft);
    outline-offset: 1px;
}

.emote-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 14px;
    margin: 30px 0 12px;
}

.emote-head h2 {
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}

.emote-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
}

.emote-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.emote-filter:hover {
    border-color: var(--purple-soft);
    color: var(--text);
}

.emote-filter.is-active {
    border-color: var(--purple);
    background: var(--purple);
    color: #fff;
}

.emote-filter span {
    font-size: 0.62rem;
    opacity: 0.72;
}

.emote-filter:disabled {
    cursor: not-allowed;
    opacity: 0.38;
}

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

.emote-sections {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.emote-head + .emote-sections {
    margin-top: 0;
}

.emote-section {
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.018);
}

.emote-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 11px;
}

.emote-section-head h2 {
    font-size: 0.92rem;
    letter-spacing: -0.01em;
}

.emote-section-count {
    flex: none;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 600;
}

.emote-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 2px 2px 4px;
}

.emote-row .emote-card {
    min-width: 0;
}

@media (max-width: 1100px) {
    .emote-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.emote-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 154px;
    margin: 0;
    padding: 13px 10px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.028);
    color: var(--text);
    font: inherit;
    text-align: center;
    cursor: pointer;
    appearance: none;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.emote-card:hover {
    border-color: var(--purple-soft);
    background: rgba(145, 70, 255, 0.06);
    transform: translateY(-1px);
}

.emote-card:focus-visible,
.emote-dialog-close:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 2px;
}

.emote-card-image {
    display: grid;
    place-items: center;
    width: 100%;
    height: 66px;
    border-radius: 10px;
    background: rgba(145, 70, 255, 0.08);
}

.emote-image-fallback {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 1.3rem;
    font-weight: 700;
}

.emote-card img,
.emote-dialog-image img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
}

.emote-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
}

.emote-tag {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid rgba(160, 107, 255, 0.2);
    border-radius: 999px;
    background: rgba(160, 107, 255, 0.12);
    color: var(--muted);
    font-size: 0.56rem;
    font-weight: 600;
    line-height: 1.4;
}

.emote-tag--animated {
    border-color: rgba(255, 180, 80, 0.28);
    background: rgba(255, 180, 80, 0.12);
}

.emote-tag--channel {
    border-color: rgba(83, 252, 24, 0.24);
    background: rgba(83, 252, 24, 0.1);
}

.emote-tag--subscribers {
    border-color: rgba(255, 204, 102, 0.28);
    background: rgba(255, 204, 102, 0.12);
}

.emote-tag--global {
    border-color: rgba(112, 167, 255, 0.28);
    background: rgba(112, 167, 255, 0.12);
}

.emote-tag--emoji {
    border-color: rgba(255, 122, 198, 0.28);
    background: rgba(255, 122, 198, 0.12);
}

.emote-id {
    display: grid;
    gap: 2px;
    width: 100%;
    padding-top: 6px;
    border-top: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: 0.56rem;
}

.emote-id code {
    overflow: hidden;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.emote-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 100%;
    margin-top: auto;
}

.emote-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.71rem;
    line-height: 1.3;
    white-space: nowrap;
}

.emote-card .btn {
    padding: 5px 8px;
    font-size: 0.68rem;
}

.emote-card .emote-actions .btn {
    width: 100%;
    padding: 5px 3px;
    font-size: 0.62rem;
    white-space: nowrap;
}

.emote-note {
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.78rem;
}

/* Emote details dialog */
.emote-dialog {
    width: min(420px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
}

.emote-dialog::backdrop {
    background: rgba(5, 3, 12, 0.74);
    backdrop-filter: blur(6px);
}

.emote-dialog-panel {
    position: relative;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.emote-dialog-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.emote-dialog-close:hover {
    border-color: var(--purple-soft);
    color: var(--text);
}

.emote-dialog .eyebrow {
    display: block;
    margin-bottom: 12px;
    text-align: center;
}

.emote-dialog-image {
    display: grid;
    place-items: center;
    width: 128px;
    height: 128px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: rgba(145, 70, 255, 0.08);
}

.emote-dialog-image img {
    width: 112px;
    height: 112px;
    object-fit: contain;
}

.emote-dialog-name {
    margin: 0 0 8px;
    overflow-wrap: anywhere;
    font-family: var(--mono);
    font-size: 1.05rem;
    text-align: center;
}

.emote-dialog-tags {
    justify-content: center;
    min-height: 20px;
    margin-bottom: 14px;
}

.emote-dialog-id {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    font-size: 0.72rem;
}

.emote-dialog-id code {
    overflow-wrap: anywhere;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.7rem;
    text-align: right;
}

.emote-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
}

.emote-dialog-actions .btn {
    width: 100%;
    padding-right: 8px;
    padding-left: 8px;
}

.emote-dialog--protection {
    width: min(480px, calc(100% - 32px));
}

.emote-protection-actions {
    margin-top: 20px;
}

.emote-protection-actions .btn {
    text-align: center;
}

/* --------------------------------------------------------------------------
   Light theme
   -------------------------------------------------------------------------- */

[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f4fb;
    --bg-soft: #ffffff;
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --border: rgba(23, 15, 42, 0.13);
    --border-soft: rgba(23, 15, 42, 0.08);
    --text: #171126;
    --muted: #5f5675;
    --purple: #7c2ff0;
    --purple-soft: #6a1fd6;
    --violet: #5b17c9;
    --green: #0f8a58;
    --amber: #9a6400;
    --red: #c22a45;
    --shadow: 0 30px 80px -46px rgba(88, 34, 170, 0.4);
}

[data-theme="light"] body {
    background: var(--bg);
}

[data-theme="light"] .aurora {
    background:
        radial-gradient(60% 45% at 15% -5%, rgba(145, 70, 255, 0.16), transparent 70%),
        radial-gradient(45% 40% at 90% 0%, rgba(88, 101, 242, 0.11), transparent 72%),
        radial-gradient(55% 45% at 50% 105%, rgba(145, 70, 255, 0.08), transparent 70%);
}

[data-theme="light"] body::before {
    background-image:
        linear-gradient(rgba(23, 15, 42, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 15, 42, 0.035) 1px, transparent 1px);
}

[data-theme="light"] .site-header {
    background: rgba(255, 255, 255, 0.82);
    border-bottom-color: var(--border-soft);
}

[data-theme="light"] .cookie-banner .btn--ghost {
    background: #ffffff;
    border-color: rgba(23, 15, 42, 0.16);
}

[data-theme="light"] .icon-btn,
[data-theme="light"] .lang-menu summary,
[data-theme="light"] .account-chip,
[data-theme="light"] .btn--ghost,
[data-theme="light"] .preset,
[data-theme="light"] .tab,
[data-theme="light"] .flash,
[data-theme="light"] .input {
    background: #ffffff;
}

[data-theme="light"] .btn--ghost:hover,
[data-theme="light"] .icon-btn:hover {
    background: #f2ecfd;
}

[data-theme="light"] .nav-link:hover {
    background: rgba(23, 15, 42, 0.05);
}

[data-theme="light"] .nav-link.is-active {
    background: rgba(124, 47, 240, 0.1);
    color: var(--text);
}

[data-theme="light"] .card,
[data-theme="light"] .feature,
[data-theme="light"] .step,
[data-theme="light"] .scope-group,
[data-theme="light"] .security-item,
[data-theme="light"] .scope-group-card,
[data-theme="light"] .tool-card,
[data-theme="light"] .emote-section,
[data-theme="light"] .emote-card,
[data-theme="light"] .faq details {
    background: #ffffff;
}

[data-theme="light"] .card {
    box-shadow: inset 0 1px 0 #ffffff, 0 18px 40px -34px rgba(23, 15, 42, 0.35);
}

[data-theme="light"] .card--accent {
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(124, 47, 240, 0.09), transparent 60%),
        #ffffff;
}

[data-theme="light"] .feature:hover,
[data-theme="light"] .tool-card:hover {
    background: #ffffff;
}

[data-theme="light"] .step::after {
    color: rgba(23, 15, 42, 0.06);
}

[data-theme="light"] .scope-group-head {
    background: #f5f1fc;
}

[data-theme="light"] .scope-item:hover {
    background: rgba(124, 47, 240, 0.05);
}

[data-theme="light"] .scope-item-name,
[data-theme="light"] .meta-list .meta-val,
[data-theme="light"] .token-value,
[data-theme="light"] .code-block {
    color: #2b2142;
}

[data-theme="light"] .token-value,
[data-theme="light"] .code-block {
    background: #f7f4fd;
    border-color: var(--border);
}

[data-theme="light"] .code-block .tok {
    color: #6a1fd6;
}

[data-theme="light"] .code-block .str {
    color: #0b7a50;
}

[data-theme="light"] .chip {
    border-color: var(--border);
    background: #f4f0fb;
    color: #4a3f63;
}

[data-theme="light"] .chip--ok {
    border-color: rgba(15, 138, 88, 0.25);
    background: #e9fbf2;
    color: #0c6b47;
}

[data-theme="light"] .badge {
    border-color: rgba(124, 47, 240, 0.24);
    background: #f3ecff;
    color: #5b17c9;
}

[data-theme="light"] .badge--ok {
    border-color: rgba(15, 138, 88, 0.25);
    background: #e9fbf2;
    color: #0c6b47;
}

[data-theme="light"] .badge--warn {
    border-color: rgba(154, 100, 0, 0.24);
    background: #fff6e3;
    color: #8a5a00;
}

[data-theme="light"] .badge--error {
    border-color: rgba(194, 42, 69, 0.22);
    background: #ffedf0;
    color: #a51f38;
}

[data-theme="light"] .badge--muted {
    border-color: var(--border);
    background: #f5f2fb;
    color: #5f5675;
}

[data-theme="light"] .flash--ok {
    border-color: rgba(15, 138, 88, 0.28);
    background: #e9fbf2;
    color: #0b5f40;
}

[data-theme="light"] .flash--warn {
    border-color: rgba(154, 100, 0, 0.25);
    background: #fff7e6;
    color: #7a5000;
}

[data-theme="light"] .flash--error {
    border-color: rgba(194, 42, 69, 0.25);
    background: #ffeef1;
    color: #9f1c33;
}

[data-theme="light"] .notice {
    border-color: rgba(154, 100, 0, 0.25);
    background: #fff8ea;
    color: #6f4a00;
}

[data-theme="light"] .notice strong {
    color: #5a3c00;
}

[data-theme="light"] .notice--info {
    border-color: rgba(124, 47, 240, 0.2);
    background: #f3edff;
    color: #4c2a86;
}

[data-theme="light"] .authorize-bar {
    border-color: rgba(124, 47, 240, 0.25);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 24px 60px -34px rgba(23, 15, 42, 0.4);
}

[data-theme="light"] .faq details[open] {
    background: #f7f2ff;
}

[data-theme="light"] .prose {
    color: #3d3355;
}

[data-theme="light"] .site-footer {
    background: #ffffff;
}

[data-theme="light"] .cta-band {
    background:
        radial-gradient(90% 140% at 0% 0%, rgba(124, 47, 240, 0.12), transparent 60%),
        radial-gradient(80% 120% at 100% 100%, rgba(88, 101, 242, 0.1), transparent 65%),
        #ffffff;
}

[data-theme="light"] .cta-band p {
    color: #4a3f63;
}

[data-theme="light"] .h1--grad {
    background: linear-gradient(115deg, #1a1230 0%, #4b2a86 55%, #7a2ff2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

[data-theme="light"] .hero-visual::before {
    background: radial-gradient(closest-side, rgba(145, 70, 255, 0.2), transparent 78%);
}

[data-theme="light"] .tab.is-active {
    background: #e9dcff;
    color: #2b1a4d;
}

[data-theme="light"] .countdown {
    color: #3d2a5e;
}

[data-theme="light"] .lang-options {
    box-shadow: 0 24px 50px -24px rgba(23, 15, 42, 0.4);
}

[data-theme="light"] .emote-card .emote-name {
    color: #2b2142;
}

[data-theme="light"] .skip-link {
    color: #ffffff;
}

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

@media (max-width: 760px) {
    .emote-search {
        grid-template-columns: minmax(0, 1fr);
    }

    .emote-search .btn {
        width: 100%;
    }

    .tool-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .footer-logo {
        width: 190px;
    }

    .brand .brand-lockup {
        display: none;
    }

    .brand .brand-logo {
        display: block !important;
    }

    .brand-name {
        display: none;
    }

    .header-actions {
        gap: 6px;
    }

    .lang-menu summary {
        padding: 0 8px;
    }

    .lang-menu .lang-code {
        display: none;
    }

    .lang-options {
        left: 0;
        right: auto;
        max-width: calc(100vw - 36px);
    }

    .emote-section {
        padding: 12px;
    }

    .emote-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .emote-card img {
        width: 44px;
        height: 44px;
    }

    .emote-card-image {
        height: 54px;
    }

    .emote-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .emote-dialog-panel {
        padding: 20px 16px;
    }

    .emote-dialog-actions {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Long-lived (implicit) token page
   -------------------------------------------------------------------------- */

[hidden] {
    display: none !important;
}

.authorize-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.implicit-page {
    padding: 52px 0 84px;
}

.implicit-hero {
    max-width: 640px;
    margin: 0 auto 30px;
    text-align: center;
}

.implicit-orb {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border: 1px solid rgba(67, 217, 154, 0.32);
    border-radius: 18px;
    background: radial-gradient(circle at 30% 20%, rgba(67, 217, 154, 0.2), rgba(145, 70, 255, 0.08));
    color: var(--green);
    box-shadow: 0 0 42px rgba(67, 217, 154, 0.14);
}

.implicit-orb svg {
    width: 26px;
    height: 26px;
}

.implicit-hero .badge {
    margin-bottom: 13px;
}

.implicit-hero .lead {
    max-width: 560px;
    margin: 14px auto 0;
}

.implicit-card {
    position: relative;
    overflow: hidden;
    padding: clamp(20px, 4vw, 32px);
    border: 1px solid rgba(185, 140, 255, 0.22);
    border-radius: 24px;
    background: linear-gradient(155deg, rgba(26, 18, 38, 0.97), rgba(13, 9, 21, 0.98));
    box-shadow: 0 30px 90px -48px rgba(145, 70, 255, 0.8);
}

.implicit-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(185, 140, 255, 0.85), rgba(67, 217, 154, 0.55), transparent);
}

.implicit-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.implicit-identity {
    display: flex;
    align-items: center;
    gap: 13px;
}

.implicit-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: none;
    border: 1px solid rgba(185, 140, 255, 0.25);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(145, 70, 255, 0.22), rgba(67, 217, 154, 0.06));
    color: #d9c4ff;
}

.implicit-icon svg {
    width: 22px;
    height: 22px;
}

.implicit-kicker {
    display: block;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.implicit-heading {
    margin-top: 3px;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.implicit-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.3;
}

.status-indicator {
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 50%;
    background: #f6c46a;
}

.status-checking {
    background: #f6c46a;
    box-shadow: 0 0 10px rgba(246, 196, 106, 0.35);
}

.status-valid {
    background: #43d99a;
    box-shadow: 0 0 10px rgba(67, 217, 154, 0.45);
}

.status-invalid {
    background: #ff6f85;
    box-shadow: 0 0 10px rgba(255, 111, 133, 0.4);
}

.implicit-state {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.implicit-spinner {
    width: 12px;
    height: 12px;
    flex: none;
    border: 2px solid rgba(185, 140, 255, 0.25);
    border-top-color: var(--purple-soft);
    border-radius: 50%;
    animation: implicit-spin 0.8s linear infinite;
}

@keyframes implicit-spin {
    to { transform: rotate(360deg); }
}

.implicit-token-panel {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.18);
}

.implicit-token-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.implicit-oauth-tag {
    padding: 3px 8px;
    border: 1px solid rgba(67, 217, 154, 0.24);
    border-radius: 999px;
    background: rgba(67, 217, 154, 0.07);
    color: #a8f0cd;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
}

.implicit-token-field {
    margin-top: 0;
}

.implicit-token-field .token-value {
    display: flex;
    align-items: center;
    min-height: 54px;
    font-size: 0.83rem;
}

.implicit-expiry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 14px 0 0;
    padding: 13px 16px;
    border: 1px solid rgba(67, 217, 154, 0.2);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(67, 217, 154, 0.08), rgba(145, 70, 255, 0.06));
    color: var(--muted);
    font-size: 0.8rem;
}

.implicit-expiry-label {
    font-weight: 600;
}

.implicit-expiry .countdown {
    color: #a8f0cd;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.implicit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 16px;
}

.implicit-actions .btn--primary {
    flex: 1;
    min-width: 170px;
}

.implicit-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: 0.76rem;
}

.implicit-footer .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}

.implicit-error-actions {
    margin-top: 16px;
}

.implicit-note {
    max-width: 580px;
    margin: 22px auto 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.6;
    text-align: center;
}

@media (max-width: 640px) {
    .implicit-page {
        padding: 38px 0 64px;
    }

    .implicit-card {
        padding: 18px;
        border-radius: 20px;
    }

    .implicit-status {
        width: 100%;
        justify-content: flex-start;
    }

    .implicit-expiry {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .implicit-actions .btn {
        width: 100%;
    }
}

.implicit-scopes {
    margin-top: 18px;
}

.implicit-scopes summary {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.implicit-scopes summary::marker {
    color: var(--purple-soft);
}

.implicit-scopes .chip-row {
    max-height: 220px;
    margin-top: 10px;
    overflow: auto;
    padding-right: 6px;
}

[data-implicit-result] .token-label {
    display: block;
}

[data-implicit-result] .token-value {
    min-height: 54px;
}

@media (max-width: 640px) {
    .authorize-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* Four-platform status grid */
.tool-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1200px) {
    .tool-grid--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .tool-grid--four {
        grid-template-columns: minmax(0, 1fr);
    }
}
