@layer reset, tokens, base, layout, components, pages, utilities;

@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans/DMSans-400.woff2") format("woff2"), url("../fonts/dm-sans/DMSans-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans/DMSans-500.woff2") format("woff2"), url("../fonts/dm-sans/DMSans-500.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans/DMSans-600.woff2") format("woff2"), url("../fonts/dm-sans/DMSans-600.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans/DMSans-700.woff2") format("woff2"), url("../fonts/dm-sans/DMSans-700.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono/JetBrainsMono-Regular.woff2") format("woff2"), url("../fonts/jetbrains-mono/JetBrainsMono-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono/JetBrainsMono-Bold.woff2") format("woff2"), url("../fonts/jetbrains-mono/JetBrainsMono-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

@layer tokens {
  :root {
    color-scheme: light;
    --canvas: #F8F8F9;
    --surface: #FFFFFF;
    --elevated: #FFFFFF;
    --sunken: #F2F2F4;
    --thumb: #FFFFFF;
    --line: #E4E4E7;
    --line-strong: #D4D4D8;
    --ink: #18181B;
    --ink-2: #52525B;
    --ink-3: #71717A;
    --metal: #C08276;
    --metal-hover: #9E6358;
    --metal-text: #9E6358;
    --metal-on: #18181B;
    --metal-on-hover: #FFFFFF;
    --metal-wash: rgb(192 130 118 / .10);
    --metal-line: rgb(192 130 118 / .45);
    --bubble-mine: #F6ECE9;
    --bubble-mine-line: rgb(192 130 118 / .32);
    --foil: linear-gradient(135deg, #D9A79C 0%, #B87A6E 55%, #8F584D 100%);
    --foil-on: #1F1411;
    --foil-text: #8F584D;
    --danger: #B42318;
    --danger-wash: rgb(180 35 24 / .07);
    --success: #067647;
    --success-wash: rgb(6 118 71 / .07);
    --warning: #B54708;
    --warning-wash: rgb(181 71 8 / .07);
    --info: #3F3F46;
    --scrim: rgb(9 9 11 / .42);
    --shadow-pop: 0 1px 2px rgb(24 24 27 / .05), 0 18px 44px -16px rgb(24 24 27 / .24);
    --shadow-thumb: 0 1px 2px rgb(24 24 27 / .10), 0 0 0 1px rgb(24 24 27 / .06);
    --metal-sheen: inset 0 1px 0 rgb(255 255 255 / .28), inset 0 -1px 0 rgb(0 0 0 / .08);
    --rg-metal: linear-gradient(115deg, #F7E0D8 0%, #D9A497 16%, #9A5D51 34%, #EBC3B6 50%, #B57568 66%, #F3D5CB 82%, #A4675A 100%);
    --rg-metal-danger: linear-gradient(115deg, #F6C4BE 0%, #D4574A 20%, #93251C 40%, #EC8F84 58%, #B23A2F 78%, #F2B3AB 100%);
    --btn-primary-fill: linear-gradient(180deg, #3A3A40 0%, #1E1E22 48%, #111113 100%);
    --btn-primary-fill-hover: linear-gradient(180deg, #424248 0%, #232327 48%, #121214 100%);
    --btn-primary-ink: #FFFFFF;
    --btn-fill: linear-gradient(180deg, #FFFFFF 0%, #FAF8F8 55%, #F1EDEC 100%);
    --btn-fill-hover: linear-gradient(180deg, #FFFFFF 0%, #FBF5F3 55%, #F4EAE7 100%);
    --btn-vip-fill: linear-gradient(180deg, #34282A 0%, #1F1718 50%, #140F10 100%);
    --btn-vip-ink: #F1C9BD;
    --btn-raise: inset 0 1px 0 rgb(255 255 255 / .9), inset 0 -2px 0 rgb(24 24 27 / .05), 0 1px 1px rgb(24 24 27 / .06), 0 6px 14px -8px rgb(110 62 52 / .38);
    --btn-raise-hover: inset 0 1px 0 rgb(255 255 255 / .9), inset 0 -2px 0 rgb(24 24 27 / .05), 0 2px 3px rgb(24 24 27 / .06), 0 14px 26px -12px rgb(110 62 52 / .45);
    --btn-primary-raise: inset 0 1px 0 rgb(255 255 255 / .16), inset 0 -2px 0 rgb(0 0 0 / .45), 0 1px 1px rgb(24 24 27 / .16), 0 7px 16px -8px rgb(90 48 40 / .55);
    --btn-primary-raise-hover: inset 0 1px 0 rgb(255 255 255 / .18), inset 0 -2px 0 rgb(0 0 0 / .45), 0 2px 3px rgb(24 24 27 / .14), 0 16px 28px -12px rgb(90 48 40 / .6);
    --btn-press: inset 0 2px 5px rgb(24 24 27 / .16), 0 0 0 rgb(0 0 0 / 0);
    --btn-primary-press: inset 0 2px 6px rgb(0 0 0 / .55), 0 0 0 rgb(0 0 0 / 0);
    --lift-1: 0 1px 1px rgb(24 24 27 / .04), 0 10px 24px -14px rgb(70 44 38 / .28);
    --lift-2: 0 1px 2px rgb(24 24 27 / .05), 0 18px 40px -20px rgb(70 44 38 / .36), 0 2px 6px -2px rgb(24 24 27 / .05);
    --lift-3: 0 2px 3px rgb(24 24 27 / .06), 0 30px 60px -24px rgb(70 44 38 / .45), 0 60px 110px -50px rgb(70 44 38 / .4);
    --sheen: rgb(214 160 146 / .16);
    --emboss-light: rgb(255 255 255 / .9);
    --emboss-shade: rgb(110 62 52 / .22);
    --keycap-fill: linear-gradient(180deg, #FFFFFF 0%, #FBF7F6 60%, #F3ECEA 100%);
    --keycap-raise: inset 0 1px 0 #FFFFFF, inset 0 -3px 0 rgb(110 62 52 / .09), 0 1px 1px rgb(24 24 27 / .06), 0 8px 16px -8px rgb(110 62 52 / .42);
    --keycap-raise-hover: inset 0 1px 0 #FFFFFF, inset 0 -3px 0 rgb(110 62 52 / .09), 0 2px 3px rgb(24 24 27 / .06), 0 14px 24px -10px rgb(110 62 52 / .48);

    --font-sans: "Plus Jakarta Sans", "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --fs-xs: 13.5px;
    --fs-sm: 15px;
    --fs-ui: 16px;
    --fs-body: 17px;
    --fs-lg: 19px;
    --fs-xl: 22px;
    --fs-2xl: 26px;
    --fs-3xl: 32px;
    --fs-4xl: clamp(32px, 3.8vw, 44px);
    --fs-display: clamp(42px, 5.6vw, 76px);

    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
    --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

    --r-xs: 4px;
    --r-sm: 7px;
    --r-md: 10px;
    --r-lg: 14px;

    --ease: cubic-bezier(.2, .8, .2, 1);
    --dur-1: 120ms;
    --dur-2: 180ms;
    --dur-3: 320ms;

    --header-h: 76px;
    --shell-shadow: 0 1px 0 rgb(24 24 27 / .06), 0 14px 30px -22px rgb(24 24 27 / .45);
    --content-max: 1240px;
    --wide-max: 1360px;
    --gutter: clamp(16px, 4vw, 40px);
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --canvas: #09090B;
    --surface: #111114;
    --elevated: #18181C;
    --sunken: #18181C;
    --thumb: #2A2A30;
    --line: #27272A;
    --line-strong: #3F3F46;
    --ink: #F4F4F5;
    --ink-2: #A1A1AA;
    --ink-3: #8B8B94;
    --metal: #C08276;
    --metal-hover: #D9A79C;
    --metal-text: #D9A79C;
    --metal-on: #18181B;
    --metal-on-hover: #18181B;
    --metal-wash: rgb(192 130 118 / .14);
    --metal-line: rgb(217 167 156 / .40);
    --bubble-mine: #2A1F1D;
    --bubble-mine-line: rgb(192 130 118 / .30);
    --foil-text: #D9A79C;
    --danger: #F97066;
    --danger-wash: rgb(249 112 102 / .10);
    --success: #47CD89;
    --success-wash: rgb(71 205 137 / .10);
    --warning: #FDB022;
    --warning-wash: rgb(253 176 34 / .10);
    --info: #D4D4D8;
    --scrim: rgb(0 0 0 / .62);
    --shadow-pop: 0 0 0 1px #27272A, 0 24px 56px -18px rgb(0 0 0 / .72);
    --shadow-thumb: 0 1px 2px rgb(0 0 0 / .5), 0 0 0 1px rgb(255 255 255 / .06);
    --metal-sheen: inset 0 1px 0 rgb(255 255 255 / .30), inset 0 -1px 0 rgb(0 0 0 / .12);
    --btn-primary-fill: linear-gradient(180deg, #FFFFFF 0%, #F3F1F1 52%, #E3DFDE 100%);
    --btn-primary-fill-hover: linear-gradient(180deg, #FFFFFF 0%, #F8F3F2 52%, #EBE3E1 100%);
    --btn-primary-ink: #18181B;
    --btn-fill: linear-gradient(180deg, #26262C 0%, #1A1A1F 52%, #131316 100%);
    --btn-fill-hover: linear-gradient(180deg, #2E2D33 0%, #201E22 52%, #161416 100%);
    --btn-vip-fill: linear-gradient(180deg, #2E2224 0%, #1E1617 50%, #120D0E 100%);
    --btn-vip-ink: #F1C9BD;
    --btn-raise: inset 0 1px 0 rgb(255 255 255 / .09), inset 0 -2px 0 rgb(0 0 0 / .45), 0 1px 1px rgb(0 0 0 / .5), 0 8px 18px -10px rgb(0 0 0 / .9);
    --btn-raise-hover: inset 0 1px 0 rgb(255 255 255 / .11), inset 0 -2px 0 rgb(0 0 0 / .45), 0 2px 3px rgb(0 0 0 / .5), 0 16px 28px -12px rgb(0 0 0 / .95), 0 8px 26px -14px rgb(217 167 156 / .28);
    --btn-primary-raise: inset 0 1px 0 rgb(255 255 255 / .9), inset 0 -2px 0 rgb(24 24 27 / .14), 0 1px 1px rgb(0 0 0 / .5), 0 8px 20px -10px rgb(0 0 0 / .9);
    --btn-primary-raise-hover: inset 0 1px 0 rgb(255 255 255 / .9), inset 0 -2px 0 rgb(24 24 27 / .14), 0 2px 3px rgb(0 0 0 / .5), 0 16px 30px -12px rgb(0 0 0 / .95), 0 10px 30px -14px rgb(217 167 156 / .35);
    --btn-press: inset 0 2px 6px rgb(0 0 0 / .6), 0 0 0 rgb(0 0 0 / 0);
    --btn-primary-press: inset 0 2px 6px rgb(24 24 27 / .3), 0 0 0 rgb(0 0 0 / 0);
    --lift-1: inset 0 1px 0 rgb(255 255 255 / .05), 0 0 0 1px rgb(255 255 255 / .03), 0 12px 28px -14px rgb(0 0 0 / .85);
    --lift-2: 0 1px 0 rgb(255 255 255 / .03) inset, 0 20px 44px -20px rgb(0 0 0 / .9), 0 2px 8px -2px rgb(0 0 0 / .5);
    --lift-3: 0 1px 0 rgb(255 255 255 / .04) inset, 0 34px 70px -24px rgb(0 0 0 / .95), 0 60px 120px -50px rgb(0 0 0 / .8);
    --sheen: rgb(255 255 255 / .075);
    --shell-shadow: 0 1px 0 rgb(255 255 255 / .06), 0 16px 30px -18px rgb(0 0 0 / .9);
    --emboss-light: rgb(255 255 255 / .06);
    --emboss-shade: rgb(0 0 0 / .7);
    --keycap-fill: linear-gradient(180deg, #26262C 0%, #1A1A1F 60%, #141417 100%);
    --keycap-raise: inset 0 1px 0 rgb(255 255 255 / .08), inset 0 -3px 0 rgb(0 0 0 / .45), 0 1px 1px rgb(0 0 0 / .5), 0 10px 18px -8px rgb(0 0 0 / .9);
    --keycap-raise-hover: inset 0 1px 0 rgb(255 255 255 / .1), inset 0 -3px 0 rgb(0 0 0 / .45), 0 2px 3px rgb(0 0 0 / .5), 0 16px 26px -10px rgb(0 0 0 / .95), 0 8px 24px -12px rgb(217 167 156 / .22);
  }
  @media (max-width: 899px) { :root { --header-h: 64px; } }
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
  ol[role="list"], ul[role="list"], .list-reset { list-style: none; padding: 0; }
  img, svg, video, canvas, picture { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
  table { border-collapse: collapse; }
  fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
  legend { padding: 0; float: left; width: 100%; }
  [hidden] { display: none !important; }
}

@layer base {
  html { background: var(--canvas); scroll-padding-top: calc(var(--header-h) + 16px); }
  body {
    min-height: 100dvh;
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: 1.6;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  h1, h2, h3, h4 { font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
  h1 { font-size: var(--fs-4xl); letter-spacing: -0.032em; line-height: 1.08; }
  h2 { font-size: var(--fs-2xl); letter-spacing: -0.024em; }
  h3 { font-size: var(--fs-lg); }
  p { text-wrap: pretty; }
  a { color: inherit; text-decoration: none; }
  strong { font-weight: 600; }
  code, kbd, samp { font-family: var(--font-mono); font-size: .92em; }
  ::selection { background: rgb(192 130 118 / .30); color: var(--ink); }
  :focus-visible { outline: 2px solid var(--metal); outline-offset: 2px; }
  :focus:not(:focus-visible) { outline: none; }
  * { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
  .theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
  .i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .i--sm { width: 15px; height: 15px; }
  .i--lg { width: 22px; height: 22px; }
}

@layer layout {
  .container { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gutter); }
  .container--wide { max-width: var(--wide-max); }
  .container--narrow { max-width: 760px; }
  .stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--s-4)); }
  .stack--sm { --stack-gap: var(--s-2); }
  .stack--lg { --stack-gap: var(--s-8); }
  .cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--s-2)); }
  .split { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
  .grid-2 { display: grid; gap: var(--s-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
  .app-main { width: 100%; max-width: var(--content-max); margin-inline: auto; padding: 0 var(--gutter) var(--s-16); }
  .app-main--wide { max-width: var(--wide-max); }
  .app-main--flush { max-width: none; padding: 0; }
  .page-head {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
    gap: var(--s-4) var(--s-6); padding: var(--s-10) 0 var(--s-5); margin-bottom: var(--s-6);
    border-bottom: 1px solid var(--line);
  }
  .page-head h1 { font-size: clamp(26px, 2.6vw, 32px); }
  .page-head__lead { margin-top: 6px; color: var(--ink-2); max-width: 62ch; }
  .page-head__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
  .section { padding-block: var(--s-20); }
  .section + .section { border-top: 1px solid var(--line); }
  .settings-layout { display: grid; gap: var(--s-8); grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .settings-nav { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 2px; }
  .settings-nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); font-size: var(--fs-ui); color: var(--ink-2); }
  .settings-nav a:hover { background: var(--sunken); color: var(--ink); }
  .settings-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
  @media (max-width: 899px) {
    .settings-layout { grid-template-columns: 1fr; gap: var(--s-4); }
    .settings-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
    .settings-nav a { flex: none; }
  }
}

@layer components {
  .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17.5px; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
  .brand__mark {
    width: 22px; height: 22px; flex: none; background: var(--metal);
    -webkit-mask: url("../img/hiraya-mark.png") center / contain no-repeat; mask: url("../img/hiraya-mark.png") center / contain no-repeat;
  }
  .brand__sub { color: var(--ink-3); font-weight: 500; }

  .btn {
    --btn-h: 44px;
    --btn-ring: 1.5px;
    --btn-bg: var(--btn-fill);
    --btn-bg-hover: var(--btn-fill-hover);
    --btn-ink: var(--ink);
    --btn-shadow: var(--btn-raise);
    --btn-shadow-hover: var(--btn-raise-hover);
    --btn-shadow-press: var(--btn-press);
    --btn-rim: var(--rg-metal);
    --btn-lift: -1px;
    position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: var(--btn-h); padding: 0 18px; border: 0; border-radius: var(--r-sm);
    font-size: var(--fs-ui); font-weight: 600; letter-spacing: -0.005em; line-height: 1; white-space: nowrap;
    background: var(--btn-bg); color: var(--btn-ink); box-shadow: var(--btn-shadow);
    cursor: pointer; user-select: none; text-decoration: none; -webkit-tap-highlight-color: transparent;
    transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), color var(--dur-1) var(--ease), filter var(--dur-1) var(--ease);
  }
  .btn::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: var(--btn-ring); pointer-events: none;
    background: var(--btn-rim); background-size: 240% 240%; background-position: 0% 50%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    transition: background-position .7s var(--ease), opacity var(--dur-2) var(--ease);
  }
  .btn .i { width: 16px; height: 16px; }
  .btn:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--btn-bg-hover); box-shadow: var(--btn-shadow-hover); color: var(--btn-ink-hover, var(--btn-ink)); transform: translateY(var(--btn-lift)); }
  .btn:hover:not(:disabled):not([aria-disabled="true"])::before { background-position: 100% 50%; }
  .btn:active:not(:disabled):not([aria-disabled="true"]) { box-shadow: var(--btn-shadow-press); transform: translateY(1px); transition-duration: 60ms; }
  .btn:disabled, .btn[aria-disabled="true"] { opacity: .48; cursor: not-allowed; box-shadow: none; }
  .btn--primary {
    --btn-bg: var(--btn-primary-fill); --btn-bg-hover: var(--btn-primary-fill-hover); --btn-ink: var(--btn-primary-ink);
    --btn-shadow: var(--btn-primary-raise); --btn-shadow-hover: var(--btn-primary-raise-hover); --btn-shadow-press: var(--btn-primary-press);
  }
  .btn--secondary { --btn-ink: var(--ink); }
  .btn--ghost { --btn-bg: transparent; --btn-bg-hover: var(--sunken); --btn-ink: var(--ink-2); --btn-ink-hover: var(--ink); --btn-lift: 0px;
    --btn-shadow: none; --btn-shadow-hover: none; --btn-shadow-press: inset 0 1px 3px rgb(0 0 0 / .12); }
  .btn--ghost::before { opacity: .55; }
  .btn--ghost:hover:not(:disabled)::before { opacity: 1; }
  .btn--danger { --btn-ink: var(--danger); --btn-rim: var(--rg-metal-danger); --btn-bg-hover: linear-gradient(var(--danger-wash), var(--danger-wash)), var(--btn-fill-hover); }
  .btn--vip { --btn-bg: var(--btn-vip-fill); --btn-bg-hover: var(--btn-vip-fill); --btn-ink: var(--btn-vip-ink); --btn-ring: 2px;
    --btn-shadow: var(--btn-primary-raise); --btn-shadow-hover: var(--btn-primary-raise-hover); --btn-shadow-press: var(--btn-primary-press); }
  :root[data-theme="dark"] .btn--vip { --btn-shadow: var(--btn-raise); --btn-shadow-hover: var(--btn-raise-hover); --btn-shadow-press: var(--btn-press); }
  .btn--vip:hover:not(:disabled) { filter: brightness(1.12); }
  .btn--sm { --btn-h: 36px; padding: 0 14px; font-size: var(--fs-sm); border-radius: 6px; }
  .btn--lg { --btn-h: 52px; --btn-ring: 2px; padding: 0 26px; font-size: var(--fs-body); }
  .btn--block { width: 100%; }
  .btn--icon { width: var(--btn-h); padding: 0; }
  .btn[data-busy] { color: transparent !important; pointer-events: none; }
  .btn[data-busy]::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--btn-ink); border-right-color: transparent;
    animation: spin .7s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .link { color: var(--metal-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
  .link:hover { text-decoration-thickness: 2px; }
  .text-btn { padding: 0; border: 0; background: none; font-weight: 600; font-size: inherit; color: var(--metal-text); cursor: pointer; }
  .text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

  .icon-btn {
    position: relative; isolation: isolate; display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
    border: 0; border-radius: 8px; background: transparent; color: var(--ink-2);
    transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
  }
  .icon-btn::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: 0;
    background: var(--rg-metal); background-size: 240% 240%; background-position: 0% 50%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    transition: opacity var(--dur-2) var(--ease), background-position .7s var(--ease);
  }
  .icon-btn:hover:not(:disabled), .icon-btn[aria-expanded="true"], .icon-btn[aria-pressed="true"] { background: var(--btn-fill); color: var(--ink); box-shadow: var(--btn-raise); }
  .icon-btn:hover:not(:disabled) { transform: translateY(-1px); }
  .icon-btn:hover:not(:disabled)::before, .icon-btn[aria-expanded="true"]::before, .icon-btn[aria-pressed="true"]::before { opacity: 1; background-position: 100% 50%; }
  .icon-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: var(--btn-press); transition-duration: 60ms; }
  .icon-btn:disabled { opacity: .45; cursor: not-allowed; }
  .count {
    position: absolute; top: 0; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
    font: 700 13px/19px var(--font-mono); text-align: center; color: var(--metal-on); background: var(--metal);
    box-shadow: 0 0 0 2px var(--canvas);
  }

  .form { display: grid; gap: var(--s-5); }
  .field { display: grid; gap: 6px; min-width: 0; }
  .field__label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
  .field__label small { font-weight: 500; color: var(--ink-3); }
  .field__hint { font-size: 14.5px; line-height: 1.45; color: var(--ink-3); }
  .field__error { font-size: 14.5px; line-height: 1.45; color: var(--danger); }
  .field__error:empty { display: none; }
  .input, .select, .textarea {
    width: 100%; min-width: 0; height: 48px; padding: 0 14px;
    border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
    font-size: var(--fs-body); line-height: 1.4;
    transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
  }
  .input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: 1; }
  .input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
  .input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--metal); box-shadow: 0 0 0 3px var(--metal-wash); }
  .input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
  .input:disabled { background: var(--sunken); color: var(--ink-3); }
  .textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
  .select {
    appearance: none; padding-right: 36px; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
    background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat;
  }
  .input-group { position: relative; }
  .input-group > .i { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
  .input-group > .input { padding-left: 38px; }
  .input-group > .input-suffix { position: absolute; right: 6px; top: 50%; translate: 0 -50%; }
  .otp { font-family: var(--font-mono); font-size: 24px; letter-spacing: .42em; text-align: center; height: 52px; }

  .check { display: inline-flex; align-items: flex-start; gap: 10px; font-size: var(--fs-ui); cursor: pointer; }
  .check input, .radio input {
    appearance: none; flex: none; width: 18px; height: 18px; margin: 2px 0 0; border: 1px solid var(--line-strong); background: var(--surface);
    display: grid; place-items: center; transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
  }
  .check input { border-radius: 5px; }
  .radio input { border-radius: 50%; }
  .check input::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--metal-on); border-top: 0; border-right: 0; rotate: -45deg; translate: 0 -1px; scale: 0; transition: scale var(--dur-1) var(--ease); }
  .radio input::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--metal-on); scale: 0; transition: scale var(--dur-1) var(--ease); }
  .check input:checked, .radio input:checked { background: var(--metal); border-color: var(--metal); }
  .check input:checked::after, .radio input:checked::after { scale: 1; }

  .choices { display: flex; flex-wrap: wrap; gap: 8px; }
  .choice { position: relative; display: inline-flex; }
  .choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
  .choice span {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
    border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface);
    font-size: var(--fs-ui); font-weight: 500; color: var(--ink-2); user-select: none;
    transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
  }
  .choice span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: background-color var(--dur-1) var(--ease); }
  .choice:hover span { border-color: var(--ink-3); color: var(--ink); }
  .choice input:checked + span { border-color: var(--metal); background: var(--metal-wash); color: var(--ink); }
  .choice input:checked + span::before { background: var(--metal); }
  .choice input:focus-visible + span { outline: 2px solid var(--metal); outline-offset: 2px; }

  .segmented {
    --count: 2; --index: 0;
    position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--sunken); isolation: isolate;
  }
  .segmented__thumb {
    position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--count));
    border-radius: 6px; background: var(--thumb); box-shadow: var(--shadow-thumb);
    transform: translateX(calc(var(--index) * 100%)); transition: transform var(--dur-2) var(--ease);
  }
  .segmented button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px;
    border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
  }
  .segmented button .i { width: 15px; height: 15px; }
  .segmented button[aria-checked="true"], .segmented button[aria-selected="true"] { color: var(--ink); }
  .segmented button:focus-visible { outline-offset: 0; }
  .segmented--block { display: grid; width: 100%; }

  .switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-ui); }
  .switch input { appearance: none; width: 34px; height: 20px; margin: 0; border-radius: 10px; background: var(--line-strong); position: relative; transition: background-color var(--dur-2) var(--ease); cursor: pointer; }
  .switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: translate var(--dur-2) var(--ease); }
  .switch input:checked { background: var(--metal); }
  .switch input:checked::after { translate: 14px 0; }

  .badge {
    display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
    border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--surface);
    font: 500 13.5px/1 var(--font-mono); letter-spacing: .01em; color: var(--ink-2); white-space: nowrap;
  }
  .badge .i { width: 13px; height: 13px; stroke-width: 1.8; }
  .badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
  .badge--metal { color: var(--metal-text); border-color: var(--metal-line); background: var(--metal-wash); }
  .badge--ok { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); background: var(--success-wash); }
  .badge--warn { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, transparent); background: var(--warning-wash); }
  .badge--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-wash); }
  .badge--muted { color: var(--ink-3); background: var(--sunken); }
  .badge--vip { border: 0; background: var(--foil); color: var(--foil-on); font-weight: 700; letter-spacing: .08em; box-shadow: var(--metal-sheen); }
  .badge--lg { height: 28px; padding: 0 10px; font-size: 14.5px; }

  .tags { display: flex; flex-wrap: wrap; gap: 6px; }
  .tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-xs); font-size: 14.5px; color: var(--ink-2); background: var(--surface); white-space: nowrap; }

  .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); min-width: 0; }
  .panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 14px 20px; border-bottom: 1px solid var(--line); min-height: 56px; }
  .panel__title { font-size: var(--fs-body); font-weight: 600; letter-spacing: -0.01em; }
  .panel__sub { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
  .panel__body { padding: 20px; }
  .panel__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
  .panel + .panel { margin-top: var(--s-5); }

  .hairline-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
  .hairline-grid > * { background: var(--surface); min-width: 0; }

  .spec { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); column-gap: var(--s-6); }
  .spec > dt, .spec > dd { padding: 11px 0; border-top: 1px solid var(--line); }
  .spec > dt:first-of-type, .spec > dt:first-of-type + dd { border-top: 0; }
  .spec > dt { color: var(--ink-2); font-size: var(--fs-sm); }
  .spec > dd { font-size: var(--fs-ui); min-width: 0; overflow-wrap: anywhere; }

  .avatar {
    --size: 40px;
    position: relative; display: grid; place-items: center; flex: none; width: var(--size); height: var(--size);
    border-radius: calc(var(--size) * .28); overflow: hidden; background: var(--sunken); border: 1px solid var(--line);
    font-weight: 600; font-size: calc(var(--size) * .38); color: var(--ink-2); letter-spacing: -0.02em;
  }
  .avatar img { width: 100%; height: 100%; object-fit: cover; }
  .avatar--xs { --size: 28px; } .avatar--sm { --size: 36px; } .avatar--lg { --size: 56px; } .avatar--xl { --size: 112px; }
  .avatar--vip { border: 0; padding: 2px; background: var(--foil); }
  .avatar--vip img, .avatar--vip > span { border-radius: calc(var(--size) * .24); }
  .avatar--vip > span { width: 100%; height: 100%; display: grid; place-items: center; background: var(--sunken); }

  .shell {
    position: sticky; top: 0; z-index: 40; height: var(--header-h);
    background: transparent;
    transition: background-color var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease), color var(--dur-3) var(--ease);
  }
  .shell.is-solid { background: var(--canvas); box-shadow: var(--shell-shadow); }
  .shell__inner { height: 100%; max-width: var(--wide-max); margin-inline: auto; padding-inline: var(--gutter); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s-4); }
  .shell__start { display: flex; align-items: center; gap: var(--s-4); min-width: 0; }
  .shell__end { justify-self: end; display: flex; align-items: center; gap: 10px; }
  .shell__context { padding-left: var(--s-4); border-left: 1px solid var(--line); font-size: var(--fs-body); color: var(--ink-2); font-weight: 500; }
  .shell .brand, .auth__top .brand { font-size: 21px; gap: 12px; }
  .shell .brand__mark, .auth__top .brand__mark { width: 30px; height: 30px; }
  .shell .btn, .auth__top .btn { --btn-h: 46px; padding: 0 22px; font-size: var(--fs-body); border-radius: var(--r-sm); }
  .shell .icon-btn, .auth__top .icon-btn { width: 46px; height: 46px; border-radius: 10px; }
  .shell .icon-btn .i, .auth__top .icon-btn .i { width: 22px; height: 22px; }
  .shell .count { top: 3px; right: 3px; }
  .nav { display: flex; align-items: stretch; height: var(--header-h); }
  .nav a, .nav span[aria-disabled] {
    position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 0 18px;
    font-size: var(--fs-body); font-weight: 500; color: var(--ink-2); transition: color var(--dur-1) var(--ease);
  }
  .nav a .i, .nav span .i { width: 20px; height: 20px; }
  .nav a:hover { color: var(--ink); }
  .nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
  .nav a::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px; background: var(--metal); transform: scaleX(0); transition: transform var(--dur-2) var(--ease); }
  .nav a[aria-current="page"]::after { transform: scaleX(1); }
  .nav span[aria-disabled] { color: var(--ink-3); cursor: not-allowed; }
  .nav span[aria-disabled] .i--lock { width: 13px; height: 13px; color: var(--metal-text); }
  .avatar-btn { padding: 0; border: 0; background: none; border-radius: 11px; }
  .avatar-btn .avatar { --size: 42px; transition: box-shadow var(--dur-1) var(--ease); }
  .avatar-btn:hover .avatar, .avatar-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 3px var(--metal-wash); }
  .public-nav { display: flex; gap: 6px; }
  .public-nav a { height: 46px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: var(--r-sm); font-size: var(--fs-body); font-weight: 500; color: var(--ink-2); }
  .public-nav a:hover, .public-nav a[aria-current="page"] { color: var(--ink); background: var(--sunken); }
  @media (max-width: 899px) {
    .shell__inner { grid-template-columns: 1fr auto; }
    .shell .nav, .shell .public-nav, .shell__context, .shell__spacer { display: none; }
    .hide-mobile { display: none !important; }
    .shell .brand, .auth__top .brand { font-size: 19px; gap: 10px; }
    .shell .brand__mark, .auth__top .brand__mark { width: 27px; height: 27px; }
    .shell .btn { --btn-h: 42px; padding: 0 16px; font-size: var(--fs-ui); }
    .shell .icon-btn, .auth__top .icon-btn { width: 44px; height: 44px; }
    .shell__end { gap: 8px; }
    .avatar-btn .avatar { --size: 38px; }
  }
  @media (min-width: 900px) { .show-mobile { display: none !important; } }

  .tabbar {
    position: fixed; inset: auto 0 0 0; z-index: 40; display: grid; grid-template-columns: repeat(var(--tabs, 3), 1fr);
    height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar span[aria-disabled] { position: relative; display: grid; place-items: center; align-content: center; gap: 3px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
  .tabbar .i { width: 20px; height: 20px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--metal); }
  .tabbar span[aria-disabled] { opacity: .55; }
  @media (min-width: 900px) { .tabbar { display: none; } }
  @media (max-width: 899px) { body.has-tabbar { padding-bottom: calc(60px + env(safe-area-inset-bottom)); } }

  .popover {
    position: fixed; inset: auto; margin: 0; padding: 6px; width: min(320px, calc(100vw - 16px));
    max-height: min(640px, calc(100dvh - var(--header-h) - 16px)); overflow: auto;
    border: 1px solid var(--line); border-radius: 12px; background: var(--elevated); color: var(--ink); box-shadow: var(--shadow-pop);
  }
  .popover:popover-open { animation: pop-in var(--dur-2) var(--ease); }
  @keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
  .popover--wide { width: min(400px, calc(100vw - 16px)); padding: 0; }
  .menu__profile { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; }
  a.menu__profile:hover { background: var(--sunken); }
  .menu__profile strong { display: block; font-size: var(--fs-ui); line-height: 1.3; }
  .menu__profile small { display: block; font-size: 14.5px; color: var(--ink-3); }
  .menu__item {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
    border: 0; border-radius: 7px; background: none; color: var(--ink); font-size: var(--fs-ui); text-align: left; cursor: pointer;
  }
  .menu__item:hover, .menu__item:focus-visible { background: var(--sunken); outline: none; }
  .menu__item .i { width: 16px; height: 16px; color: var(--ink-3); }
  .menu__item--danger, .menu__item--danger .i { color: var(--danger); }
  .menu__item kbd { margin-left: auto; font-size: 13px; color: var(--ink-3); }
  .menu__sep { height: 1px; margin: 6px -6px; background: var(--line); border: 0; }
  .menu__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 4px 6px 10px; font-size: var(--fs-ui); }
  .menu__row > span { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
  .menu__row > span .i { width: 16px; height: 16px; color: var(--ink-3); }
  .menu__note { padding: 6px 10px 8px; font-size: 14.5px; line-height: 1.45; color: var(--ink-3); }

  .notif-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 10px; }
  .notif-head strong { font-size: var(--fs-body); }
  .notif-tabs { display: flex; gap: 4px; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
  .notif-list { display: grid; padding: 6px; }
  .notif {
    display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 10px; border-radius: 8px;
    color: var(--ink); font-size: var(--fs-ui); line-height: 1.45;
  }
  a.notif:hover { background: var(--sunken); }
  .notif__icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--sunken); border: 1px solid var(--line); color: var(--ink-2); }
  .notif__icon .i { width: 16px; height: 16px; }
  .notif--broadcast .notif__icon { background: var(--metal-wash); border-color: var(--metal-line); color: var(--metal-text); }
  .notif__time { display: block; margin-top: 2px; font: 13.5px var(--font-mono); color: var(--ink-3); }
  .notif__body { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 2px; white-space: pre-line; }
  .notif__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--metal); margin-top: 7px; }
  .notif-foot { display: block; padding: 12px; border-top: 1px solid var(--line); text-align: center; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
  .notif-foot:hover { color: var(--ink); background: var(--sunken); }

  .tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .tabs [role="tab"], .tabs a {
    position: relative; flex: none; height: 40px; padding: 0 12px; border: 0; background: none;
    display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-ui); font-weight: 500; color: var(--ink-2); cursor: pointer;
  }
  .tabs [role="tab"]:hover, .tabs a:hover { color: var(--ink); }
  .tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--ink); font-weight: 600; }
  .tabs [aria-selected="true"]::after, .tabs [aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--metal); }
  .tabs .count-inline { font: 500 13px var(--font-mono); color: var(--ink-3); }
  .pill-tabs { display: inline-flex; gap: 4px; }
  .pill-tabs button { height: 30px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; background: none; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
  .pill-tabs button[aria-selected="true"] { background: var(--sunken); border-color: var(--line); color: var(--ink); }

  .table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
  .table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15.5px; }
  .table th {
    position: sticky; top: 0; z-index: 1; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line);
    text-align: left; font-size: 14.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  }
  .table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  .table tbody tr:last-child td { border-bottom: 0; }
  .table tbody tr { transition: background-color var(--dur-1) var(--ease); }
  .table tbody tr:hover { background: color-mix(in srgb, var(--sunken) 60%, transparent); }
  .table tbody tr[data-href] { cursor: pointer; }
  .table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .table .mono { font-family: var(--font-mono); font-size: 14px; color: var(--ink-2); white-space: nowrap; }
  .table .who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
  .table .who strong { display: block; font-weight: 600; line-height: 1.3; }
  .table .who small { display: block; color: var(--ink-3); font-size: 14px; }
  .table .actions { text-align: right; white-space: nowrap; }
  .table-empty { padding: 40px 16px; text-align: center; color: var(--ink-3); }
  .pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px 0; font-size: var(--fs-sm); color: var(--ink-2); }
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
  .toolbar .input-group { flex: 1 1 240px; max-width: 360px; }
  .toolbar .input, .toolbar .select { height: 36px; font-size: var(--fs-ui); }
  .toolbar .select { width: auto; background-position: calc(100% - 17px) 15px, calc(100% - 12px) 15px; }

  dialog.dialog {
    width: min(var(--dialog-w, 480px), calc(100vw - 24px)); max-height: calc(100dvh - 48px); padding: 0;
    border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--elevated); color: var(--ink); box-shadow: var(--shadow-pop);
    overflow: auto;
  }
  dialog.dialog[open] { animation: dialog-in var(--dur-3) var(--ease); }
  dialog.dialog::backdrop { background: var(--scrim); }
  @keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
  .dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 0; }
  .dialog__head h2 { font-size: var(--fs-lg); letter-spacing: -0.015em; }
  .dialog__body { padding: 12px 20px 20px; color: var(--ink-2); font-size: var(--fs-ui); }
  .dialog__body:focus { outline: none; }
  .dialog__body .form { margin-top: 8px; color: var(--ink); }
  .dialog__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
  dialog.drawer {
    --dialog-w: 520px;
    margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(var(--dialog-w), 100vw); border-radius: 0; border-width: 0 0 0 1px;
  }
  dialog.drawer[open] { animation: drawer-in var(--dur-3) var(--ease); }
  @keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }

  .toasts { position: fixed; z-index: 1000; right: 16px; top: calc(var(--header-h) + 12px); display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
  .toast {
    pointer-events: auto; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 12px 12px 12px 14px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--elevated); box-shadow: var(--shadow-pop); font-size: var(--fs-ui); line-height: 1.45;
    animation: toast-in var(--dur-3) var(--ease);
  }
  .toast .i { margin-top: 2px; color: var(--ink-3); }
  .toast--ok .i { color: var(--success); } .toast--error .i { color: var(--danger); } .toast--metal .i { color: var(--metal-text); }
  .toast strong { display: block; }
  .toast p { color: var(--ink-2); font-size: var(--fs-sm); white-space: pre-line; }
  .toast__close { border: 0; background: none; color: var(--ink-3); padding: 2px; border-radius: 4px; }
  .toast[data-leaving] { opacity: 0; transform: translateY(-6px); transition: opacity var(--dur-2), transform var(--dur-2); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

  .notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: var(--fs-ui); line-height: 1.5; color: var(--ink); }
  .notice .i { margin-top: 2px; color: var(--ink-3); }
  .notice--warn { border-color: color-mix(in srgb, var(--warning) 35%, transparent); background: var(--warning-wash); }
  .notice--warn .i { color: var(--warning); }
  .notice--danger { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-wash); }
  .notice--danger .i { color: var(--danger); }
  .notice--ok { border-color: color-mix(in srgb, var(--success) 35%, transparent); background: var(--success-wash); }
  .notice--ok .i { color: var(--success); }
  .notice--metal { border-color: var(--metal-line); background: var(--metal-wash); }
  .notice--metal .i { color: var(--metal-text); }
  .notice p + p { margin-top: 4px; }
  .form-status:empty { display: none; }

  .empty { display: grid; justify-items: center; gap: 8px; padding: 56px 24px; text-align: center; color: var(--ink-2); font-size: var(--fs-ui); }
  .empty__mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); margin-bottom: 6px; }
  .empty__title { color: var(--ink); font-weight: 600; font-size: var(--fs-body); }
  .empty .btn { margin-top: 10px; }
  .skeleton { border-radius: 6px; background: linear-gradient(90deg, var(--sunken) 0%, color-mix(in srgb, var(--sunken) 55%, var(--surface)) 50%, var(--sunken) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
  @keyframes shimmer { to { background-position: -200% 0; } }

  .vip-locked { position: relative; isolation: isolate; overflow: hidden; }
  .vip-locked > .vip-locked__content { filter: blur(14px) saturate(.6); opacity: .65; pointer-events: none; user-select: none; }
  .vip-cue { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 16px; text-align: center; font-size: var(--fs-sm); color: var(--ink); }
  .vip-cue__lock { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--foil); color: var(--foil-on); box-shadow: var(--metal-sheen); }
  .vip-cue__lock .i { width: 17px; height: 17px; stroke-width: 1.8; }
  .vip-cue strong { font-weight: 600; }
  .vip-cue p { color: var(--ink-2); max-width: 30ch; }
  .vip-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--foil-text); font-weight: 600; }
  .vip-inline .i { width: 14px; height: 14px; }

  .manifest { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
  .manifest li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font: 500 14.5px/1.4 var(--font-mono); color: var(--ink-2); }
  .manifest li .i { width: 16px; height: 16px; color: var(--metal-text); }
  .manifest li b { color: var(--ink); font-weight: 700; }

  .steps { display: grid; gap: 2px; counter-reset: step; }
  .steps li { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--ink-3); }
  .steps li::before { counter-increment: step; content: counter(step, decimal-leading-zero); font: 500 13.5px var(--font-mono); color: var(--ink-3); }
  .steps li[data-state="current"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
  .steps li[data-state="current"]::before { color: var(--metal-text); }
  .steps li[data-state="done"] { color: var(--ink-2); }
  .progress { height: 2px; background: var(--line); border-radius: 1px; overflow: hidden; }
  .progress > span { display: block; height: 100%; width: var(--value, 0%); background: var(--metal); transition: width var(--dur-3) var(--ease); }

  .site-footer { border-top: 1px solid var(--line); padding: var(--s-12) 0 var(--s-10); font-size: var(--fs-sm); color: var(--ink-2); }
  .site-footer__grid { display: grid; gap: var(--s-8); grid-template-columns: 1.4fr repeat(3, 1fr); }
  .site-footer h2 { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); letter-spacing: 0; margin-bottom: 10px; }
  .site-footer ul { list-style: none; padding: 0; display: grid; gap: 8px; }
  .site-footer a:hover { color: var(--ink); }
  .site-footer__base { margin-top: var(--s-10); padding-top: var(--s-5); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--ink-3); }
  @media (max-width: 799px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__brand { grid-column: 1 / -1; } }

  .prose { max-width: 68ch; font-size: 18px; line-height: 1.7; color: var(--ink-2); }
  .prose > * + * { margin-top: 1em; }
  .prose h2 { margin-top: 2.2em; font-size: var(--fs-xl); color: var(--ink); }
  .prose h3 { margin-top: 1.6em; font-size: var(--fs-lg); color: var(--ink); }
  .prose ul, .prose ol { padding-left: 1.2em; }
  .prose li + li { margin-top: .4em; }
  .prose strong { color: var(--ink); }
  .prose a { color: var(--metal-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

  .faq { border-top: 1px solid var(--line); }
  .faq details { border-bottom: 1px solid var(--line); }
  .faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; cursor: pointer; list-style: none; font-weight: 600; font-size: var(--fs-lg); letter-spacing: -0.01em; }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary .i { transition: transform var(--dur-2) var(--ease); color: var(--ink-3); }
  .faq details[open] summary .i { transform: rotate(45deg); }
  .faq details > div { padding: 0 0 20px; max-width: 64ch; color: var(--ink-2); }
}

@layer utilities {
  .sr-only { position: absolute !important; 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; left: 12px; top: -48px; z-index: 100; padding: 8px 12px; border-radius: 6px; background: var(--ink); color: var(--canvas); font-weight: 600; font-size: var(--fs-sm); }
  .skip-link:focus { top: 12px; }
  .mono { font-family: var(--font-mono); }
  .tabular { font-variant-numeric: tabular-nums; }
  .muted { color: var(--ink-2); }
  .faint { color: var(--ink-3); }
  .metal-text { color: var(--metal-text); }
  .text-sm { font-size: var(--fs-sm); }
  .text-xs { font-size: var(--fs-xs); }
  .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nowrap { white-space: nowrap; }
  .grow { flex: 1 1 auto; min-width: 0; }
  .mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); } .mt-8 { margin-top: var(--s-8); }
  .w-full { width: 100%; }
  .center { text-align: center; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  }
}

@layer pages {
  .auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 560px); }
  .cut-video__poster, .cut-video__poster img, .cut-video__video { position: absolute; inset: 0; width: 100%; height: 100%; }
  .cut-video__poster img, .cut-video__video { object-fit: cover; object-position: var(--focus, 50% 25%); }
  .auth__visual { --focus: 50% 8%; position: sticky; top: 0; align-self: start; height: 100dvh; overflow: hidden; background: #18181B; }
  .auth__visual[data-cut="square"] { --focus: 50% 18%; }
  .auth__visual[data-cut="wide"] { --focus: 50% 24%; }
  .auth__visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(9 9 11 / .1) 0%, transparent 35%, rgb(9 9 11 / .82) 100%); }
  .auth__visual-copy { position: absolute; z-index: 1; left: clamp(24px, 4vw, 48px); right: clamp(24px, 4vw, 48px); bottom: clamp(24px, 4vw, 48px); display: grid; gap: 20px; color: #F4F4F5; }
  .auth__visual-copy .brand { color: #F4F4F5; }
  .manifest--on-media { border-color: rgb(255 255 255 / .18); max-width: 380px; }
  .manifest--on-media li { color: rgb(244 244 245 / .78); border-color: rgb(255 255 255 / .18); }
  .manifest--on-media b { color: #FFFFFF; }
  .manifest--on-media .i { color: #D9A79C; }
  .auth__panel { display: flex; flex-direction: column; gap: 16px; padding: 20px clamp(20px, 5vw, 56px) 24px; background: var(--canvas); border-left: 1px solid var(--line); }
  .auth__top { display: flex; align-items: center; justify-content: space-between; }
  .auth__main { flex: 1; display: grid; align-items: center; padding-block: 24px; }
  .auth-card { width: 100%; max-width: 400px; margin-inline: auto; display: grid; gap: var(--s-6); }
  .auth-head h1 { font-size: 32px; letter-spacing: -0.03em; }
  .auth-head p { margin-top: 8px; color: var(--ink-2); }
  .auth-divider { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--ink-3); }
  .auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
  .auth-alt { display: grid; gap: 16px; }
  .google-slot { display: flex; justify-content: center; align-items: center; height: calc(40px * var(--g-scale, 1)); min-height: 44px; }
  .google-slot > * { transform: scale(var(--g-scale, 1)); transform-origin: center; }
  .auth-switch { text-align: center; font-size: var(--fs-ui); color: var(--ink-2); }
  .auth__legal { text-align: center; font-size: 14.5px; color: var(--ink-3); }
  .meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .meter span { height: 3px; border-radius: 2px; background: var(--line); transition: background-color var(--dur-2) var(--ease); }
  .meter span.is-on { background: var(--metal); }
  @media (max-width: 899px) { .auth { grid-template-columns: 1fr; } .auth__visual { display: none; } .auth__panel { border-left: 0; } }

  .membership { padding-block: var(--s-10) var(--s-16); }
  .membership__head { max-width: 780px; }
  .membership__head h1 { font-size: clamp(30px, 3.4vw, 44px); }
  .membership__lead { margin-top: 10px; font-size: var(--fs-lg); color: var(--ink-2); max-width: 60ch; }
  .membership__checks { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
  .membership__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-6); margin-top: var(--s-8); align-items: start; }
  .tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
  .tier { position: relative; display: grid; gap: var(--s-5); align-content: start; padding: var(--s-6); transition: background-color var(--dur-2) var(--ease); }
  .tier + .tier { border-left: 1px solid var(--line); }
  .tier.is-active { background: color-mix(in srgb, var(--metal) 5%, var(--surface)); }
  .tier--vip::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--foil); }
  .tier__head h2 { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 24px; }
  .tier__head p { margin-top: 6px; font-size: var(--fs-ui); color: var(--ink-2); }
  .tier__plans { display: grid; gap: 8px; }
  .plan-option { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
  .plan-option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
  .plan-option:hover { border-color: var(--ink-3); }
  .plan-option.is-selected { border-color: var(--metal); box-shadow: 0 0 0 3px var(--metal-wash); }
  .plan-option:has(input:focus-visible) { outline: 2px solid var(--metal); outline-offset: 2px; }
  .plan-option.is-disabled { opacity: .5; cursor: not-allowed; }
  .plan-option__main strong { display: block; font-size: var(--fs-body); }
  .plan-option__main small { font-size: 14.5px; color: var(--ink-3); }
  .plan-option__side { display: flex; align-items: center; gap: 10px; }
  .plan-option__side > strong { font-size: var(--fs-body); }
  .tier__features { list-style: none; margin: 0; padding: var(--s-4) 0 0; border-top: 1px solid var(--line); display: grid; gap: 9px; font-size: var(--fs-ui); color: var(--ink-2); }
  .tier__features li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; }
  .tier__features .i { width: 16px; height: 16px; margin-top: 2px; color: var(--metal-text); }
  .tier__features .is-locked, .tier__features .is-locked .i { color: var(--ink-3); }
  .checkout { position: sticky; top: calc(var(--header-h) + 16px); }
  .checkout__spec > dd { text-align: right; }
  .checkout__total { font-size: 24px !important; font-weight: 600; letter-spacing: -0.02em; }
  .checkout__pay { min-height: 48px; }
  .checkout__note { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; color: var(--ink-3); }
  .checkout__note .i { margin-top: 2px; }
  .checkout__foot { justify-content: space-between; align-items: center; }
  @media (max-width: 1099px) { .membership__grid { grid-template-columns: 1fr; } .checkout { position: static; } }
  @media (max-width: 699px) { .tiers { grid-template-columns: 1fr; } .tier + .tier { border-left: 0; border-top: 1px solid var(--line); } }

  .setup { display: grid; grid-template-columns: 250px minmax(0, 680px); justify-content: center; gap: var(--s-12); padding-block: var(--s-10) var(--s-20); }
  .setup__aside { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; display: grid; gap: var(--s-6); }
  .setup__kicker { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); }
  .setup__form { display: grid; gap: var(--s-5); min-width: 0; }
  .setup__count { font-size: 14px; color: var(--ink-3); }
  .setup__step h1 { font-size: clamp(26px, 3vw, 34px); }
  .setup__lead { margin: 8px 0 var(--s-6); color: var(--ink-2); max-width: 56ch; }
  .setup__nav { display: flex; align-items: center; gap: 12px; padding-top: var(--s-5); border-top: 1px solid var(--line); }
  .setup__nav [data-next] { margin-left: auto; }
  .birthday { display: grid; grid-template-columns: 1.4fr .8fr 1fr; gap: 8px; }
  .input-prefix { position: absolute; left: 12px; top: 50%; translate: 0 -50%; font-family: var(--font-mono); color: var(--ink-3); pointer-events: none; }
  .input--prefixed { padding-left: 28px; }
  .photo-pick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-6); }
  .photo-pick__frame { position: relative; width: 180px; aspect-ratio: 4 / 5; padding: 0; display: grid; place-items: center; overflow: hidden; border: 1px dashed var(--line-strong); border-radius: 24px; background: var(--surface); color: var(--ink-3); }
  .photo-pick__frame:hover { border-color: var(--metal); color: var(--ink); }
  .photo-pick__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .photo-pick__empty { display: grid; justify-items: center; gap: 8px; font-size: var(--fs-sm); }
  .prompts { display: grid; gap: var(--s-4); }
  .prompt-field { gap: 8px; }
  .interest-groups { display: grid; gap: var(--s-6); }
  .compact-grid { gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  @media (max-width: 899px) { .setup { grid-template-columns: 1fr; gap: var(--s-5); padding-top: var(--s-6); } .setup__aside { position: static; } .setup__aside .steps, .setup__manifest, .setup__kicker { display: none; } }

  .filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: var(--s-5); }
  .filter-row__count { margin-left: auto; font-family: var(--font-mono); font-size: 14px; }
  @media (max-width: 599px) {
    .filter-row { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
    .filter-row::-webkit-scrollbar { display: none; }
    .filter-row button { flex: none; }
    .filter-row__count { padding-left: 12px; white-space: nowrap; }
  }
  .people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 228px), 1fr)); gap: var(--s-5); }
  .person { display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
  .person__photo { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--sunken); }
  .person__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-3) var(--ease); }
  .person:hover .person__photo img { transform: scale(1.025); }
  .person__initial { position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; font-weight: 600; color: var(--ink-3); }
  .person__vip { position: absolute; top: 10px; left: 10px; }
  .person__body { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-width: 0; }
  .person__name { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-lg); min-width: 0; }
  .person__name a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .person__name a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .person__age { font-weight: 500; color: var(--ink-2); }
  .person__teaser { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .person__q { display: block; margin-bottom: 2px; font: 500 13.5px var(--font-mono); color: var(--metal-text); }
  .person__actions { display: flex; align-items: center; gap: 6px; margin-top: auto; }
  .person__actions > .btn:first-child { flex: 1; }
  .people__empty, .matches__empty { grid-column: 1 / -1; }
  .person--skeleton .person__photo { display: block; }

  .matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: var(--s-4); }
  .match { display: grid; grid-template-columns: 128px minmax(0, 1fr); min-height: 172px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
  .match__photo { position: relative; display: block; background: var(--sunken); }
  .match__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .match__body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; min-width: 0; }
  .match__when { font: 500 13.5px var(--font-mono); color: var(--ink-3); }
  .match__last { margin: 4px 0 8px; font-size: var(--fs-ui); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .match__time { margin-left: auto; font-family: var(--font-mono); }
  .match--skeleton { display: block; height: 172px; border: 0; }

  .chat { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100dvh - var(--header-h)); }
  .chat__list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
  .chat__list-head { display: grid; gap: 12px; padding: 20px 16px 12px; }
  .chat__list-head h1 { font-size: 24px; }
  .chat__list-head .input { height: 42px; font-size: var(--fs-ui); }
  .conversations { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
  .conversation { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px; border-radius: 10px; }
  .conversation:hover { background: var(--sunken); }
  .conversation[aria-current="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
  .conversation__text { display: grid; gap: 2px; min-width: 0; }
  .conversation__top, .conversation__preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
  .conversation__top strong { font-size: var(--fs-ui); }
  .conversation__time { flex: none; font: 13px var(--font-mono); color: var(--ink-3); }
  .conversation__preview { font-size: 15px; color: var(--ink-2); }
  .count--inline { position: static; flex: none; box-shadow: none; }
  .chat__thread { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
  .chat__placeholder { grid-row: 1 / -1; align-self: center; }
  .thread-head { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .thread-head__who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
  .thread-head__who > span:last-child { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; column-gap: 8px; min-width: 0; }
  .thread-head__who strong { font-size: var(--fs-body); }
  .thread-head__who small { grid-column: 1 / -1; font-size: 14px; color: var(--ink-3); }
  .chat__back { display: none; }
  .shield-bar { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 7px 20px; border-bottom: 1px solid var(--line); font: 500 13.5px var(--font-mono); color: var(--ink-3); }
  .shield-bar span { display: inline-flex; align-items: center; gap: 6px; }
  .shield-bar .i { color: var(--metal-text); }
  .stream { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; padding: 20px clamp(16px, 4vw, 40px); }
  .stream__day { align-self: center; margin: 18px 0 6px; font: 500 13.5px var(--font-mono); color: var(--ink-3); }
  .stream__empty { margin: auto; }
  .msg { display: grid; justify-items: start; gap: 4px; max-width: min(560px, 78%); margin-top: 8px; }
  .msg--mine { align-self: flex-end; justify-items: end; }
  .bubble { padding: 10px 14px; border-radius: 16px; font-size: 16.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
  .msg--theirs .bubble { border: 1px solid var(--line); border-bottom-left-radius: 5px; background: var(--surface); }
  .msg--mine .bubble { border: 1px solid var(--bubble-mine-line); border-bottom-right-radius: 5px; background: var(--bubble-mine); }
  .msg__meta { display: flex; align-items: center; gap: 8px; font: 13px var(--font-mono); color: var(--ink-3); }
  .msg--mine .msg__meta { flex-direction: row-reverse; }
  .msg__reply { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 0; border-radius: 6px; background: none; font: 500 14px var(--font-sans); color: var(--ink-3); opacity: 0; transition: opacity var(--dur-1) var(--ease); }
  .msg:hover .msg__reply, .msg__reply:focus-visible { opacity: 1; }
  .msg__reply:hover { color: var(--ink); background: var(--sunken); }
  @media (hover: none) { .msg__reply { opacity: 1; } }
  .msg__quote { display: grid; gap: 2px; max-width: 100%; padding: 6px 10px; border: 0; border-left: 2px solid var(--metal); border-radius: 0 6px 6px 0; background: var(--sunken); text-align: left; font-size: 14.5px; color: var(--ink-2); }
  .msg__quote strong { font-size: 14px; color: var(--ink); }
  .msg__gift { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .msg__gift img { width: 64px; height: 64px; object-fit: contain; }
  .msg__gift-text { display: grid; gap: 2px; }
  .msg__photo { position: relative; display: block; width: min(280px, 100%); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
  .msg__photo img { width: 100%; max-height: 320px; object-fit: cover; }
  .msg__photo.vip-locked { height: 200px; }
  .msg__photo-blur { position: absolute; inset: 0; background: radial-gradient(80% 70% at 35% 30%, #D9B4AA, transparent 70%), linear-gradient(135deg, #B88F86, #6F6C72 65%, #3F3F46); }
  .msg.is-flash .bubble, .msg.is-flash .msg__photo { box-shadow: 0 0 0 3px var(--metal-wash); }
  .composer { position: relative; display: grid; gap: 8px; padding: 12px clamp(12px, 3vw, 24px) 14px; border-top: 1px solid var(--line); background: var(--surface); }
  .composer__extras { display: grid; gap: 6px; }
  .composer__extras:empty, .composer__warning:empty { display: none; }
  .composer__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 8px; }
  .composer__tools { display: flex; gap: 2px; padding-bottom: 3px; }
  .composer__input { width: 100%; min-height: 42px; max-height: 168px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--canvas); color: var(--ink); font-size: var(--fs-body); line-height: 1.45; resize: none; }
  .composer__input:focus { outline: none; border-color: var(--metal); box-shadow: 0 0 0 3px var(--metal-wash); }
  .composer__send { --btn-h: 46px; border-radius: 12px; }
  @media (max-width: 599px) {
    .composer__tools .icon-btn { width: 34px; }
    .composer__send { padding-inline: 12px; }
    .composer__send-label { display: none; }
  }
  .composer__cost { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: rgb(0 0 0 / .12); font: 700 13px/20px var(--font-mono); text-align: center; }
  .composer__meta { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-3); }
  .composer__price { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .composer__count { flex: none; white-space: nowrap; }
  .composer__count[data-state="near"] { color: var(--warning); }
  .composer__count[data-state="over"] { color: var(--danger); }
  .draft-chip { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); font-size: 15px; }
  .draft-chip > .i { color: var(--metal-text); }
  .draft-chip__text { display: grid; flex: 1; min-width: 0; }
  .draft-chip__text span { font-size: 14.5px; color: var(--ink-2); }
  .draft-chip__thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
  .draft-chip__gift { width: 40px; height: 40px; object-fit: contain; }
  .popover--emoji { width: min(340px, calc(100vw - 16px)); padding: 0; }
  .emoji__search { padding: 10px; }
  .emoji__search .input { height: 40px; font-size: var(--fs-ui); }
  .emoji__body { max-height: 240px; overflow: auto; padding: 0 10px 6px; }
  .emoji__grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
  .emoji__btn { aspect-ratio: 1; border: 0; border-radius: 8px; background: none; font-size: 22px; line-height: 1; }
  .emoji__btn:hover, .emoji__btn:focus-visible { background: var(--sunken); }
  .emoji__label { padding: 6px 2px; font-size: 14px; color: var(--ink-3); }
  .emoji__tabs { display: flex; gap: 2px; padding: 6px; border-top: 1px solid var(--line); }
  .emoji__tab { width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; font-size: 18px; }
  .emoji__tab[aria-selected="true"] { background: var(--sunken); }
  .popover--gifts { width: min(440px, calc(100vw - 16px)); padding: 0; }
  .gifts__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 14px 8px; }
  .gifts__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; padding: 6px 14px 14px; }
  .gift { display: grid; justify-items: center; gap: 4px; padding: 10px 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: center; }
  .gift:hover, .gift[aria-pressed="true"] { border-color: var(--metal); background: var(--metal-wash); }
  .gift img { width: 52px; height: 52px; object-fit: contain; }
  .gift__name { font-size: 15px; font-weight: 600; }
  .gift__price { font: 13.5px var(--font-mono); color: var(--ink-3); }
  .gift__price.is-short { color: var(--danger); }
  .gift__price s { opacity: .7; }
  .gifts__cue { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--ink-2); }
  .gifts__cue .i { color: var(--foil-text); }
  @media (max-width: 899px) {
    .chat { grid-template-columns: 1fr; height: calc(100dvh - var(--header-h) - 60px - env(safe-area-inset-bottom)); }
    .chat[data-open] .chat__list { display: none; }
    .chat:not([data-open]) .chat__thread { display: none; }
    .chat__back { display: inline-grid; }
    .thread-head { padding: 8px 12px; }
    .shield-bar { padding: 6px 12px; }
    .shield-bar span:nth-child(n+2) { display: none; }
    .msg { max-width: 86%; }
  }

  .notif-page { margin-top: var(--s-4); padding: 6px; }
  .notif-group { padding: 12px 10px 4px; font-size: 14.5px; font-weight: 600; color: var(--ink-3); }
  .notif--full { padding: 12px; }

  .profile { padding-bottom: var(--s-12); }
  .profile__cover { position: relative; height: clamp(170px, 22vw, 260px); margin-top: var(--s-5); overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sunken); }
  .profile__cover > img { width: 100%; height: 100%; object-fit: cover; }
  .profile__cover-art { position: absolute; inset: 0; background: radial-gradient(90% 140% at 82% 0%, rgb(217 167 156 / .55), transparent 60%), radial-gradient(60% 90% at 10% 100%, rgb(161 161 170 / .35), transparent 70%), linear-gradient(135deg, var(--sunken), var(--surface)); }
  .profile__cover .vip-cue { color: var(--ink); }
  .profile__cover-btn { position: absolute; right: 14px; bottom: 14px; z-index: 2; }
  .profile__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-8); align-items: start; }
  .profile__identity { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 20px; margin-top: -52px; padding-inline: 12px; }
  .profile__avatar { --size: 116px; box-shadow: 0 0 0 4px var(--canvas); }
  .profile__avatar-btn { margin-left: -46px; margin-bottom: 2px; border-color: var(--line); background: var(--surface); }
  .profile__names { flex: 1; min-width: 200px; padding-bottom: 4px; }
  .profile__names h1 { display: flex; align-items: baseline; gap: 10px; font-size: clamp(26px, 3vw, 34px); }
  .profile__age { font-weight: 500; color: var(--ink-2); }
  .profile__handle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font: 500 15px var(--font-mono); color: var(--ink-3); }
  .profile__actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 4px; }
  .profile__section { padding: var(--s-6) 0; border-top: 1px solid var(--line); }
  .profile__section:first-of-type { margin-top: var(--s-6); }
  .profile__section h2 { margin-bottom: 12px; font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0; color: var(--ink-3); }
  .profile__bio { max-width: 64ch; font-size: 18px; line-height: 1.7; white-space: pre-line; }
  .prompt-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
  .prompt-card { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
  .prompt-card figcaption { font: 500 14px var(--font-mono); color: var(--metal-text); }
  .prompt-card blockquote { margin: 8px 0 0; font-size: 19px; font-weight: 500; line-height: 1.45; letter-spacing: -0.01em; }
  .profile__aside { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 16px; margin-top: var(--s-6); }
  .profile__aside .panel + .panel { margin-top: 0; }
  @media (max-width: 899px) { .profile__grid { grid-template-columns: 1fr; } .profile__aside { position: static; } .profile__identity { margin-top: -44px; } .profile__avatar { --size: 96px; } }

  .page-head--tight { padding-top: var(--s-6); }
  .settings-content { min-width: 0; }
  .settings-content .panel + .panel { margin-top: var(--s-4); }
  .form--narrow { max-width: 440px; }
  .privacy-split { gap: var(--s-6); }
  .rows { list-style: none; margin: 0; padding: 0; }
  .row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: var(--fs-ui); }
  .row:first-child { border-top: 0; }
  .row--stack { display: grid; gap: 6px; }
  .row__icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--sunken); color: var(--ink-3); }
  .row__icon .i { width: 15px; height: 15px; }
  .row__time { font: 13.5px var(--font-mono); color: var(--ink-3); white-space: nowrap; }
  .reply { margin-top: 6px; padding: 10px 12px; border-left: 2px solid var(--metal); border-radius: 0 8px 8px 0; background: var(--sunken); }
  .reply__who { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; }
  .reply__body { margin-top: 4px; font-size: var(--fs-ui); white-space: pre-line; }
  .wallet { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: var(--s-4); }
  .wallet__cell { display: grid; gap: 4px; align-content: start; padding: 18px 20px; }
  .wallet__label { font-size: 14.5px; color: var(--ink-2); }
  .wallet__value { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
  .table-wrap--flush, .panel > .table-wrap { border: 0; border-radius: 0 0 var(--r-md) var(--r-md); }
  .shop { display: grid; gap: 8px; }
  .choices--scroll { max-height: 220px; overflow: auto; padding: 2px; }
  .select--sm { width: auto; height: 32px; padding-right: 30px; font-size: var(--fs-sm); background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; }
  .secret { display: block; padding: 12px 14px; border: 1px dashed var(--metal-line); border-radius: 8px; background: var(--metal-wash); font-size: 20px; letter-spacing: .06em; user-select: all; }
  .cluster--end { justify-content: flex-end; }
  .invite { scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
  .invite__row { display: flex; flex-wrap: wrap; gap: 8px; }
  .invite__row > .input { flex: 1 1 260px; min-width: 0; }
  .invite .wallet { margin-bottom: 0; }
  .membership__invite { max-width: 780px; margin-top: var(--s-6); }
  .trial-chip { text-decoration: none; transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease); }
  .trial-chip:hover { border-color: var(--metal); }
  .trial-chip.is-ending { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, transparent); background: var(--warning-wash); }
  @media (max-width: 479px) {
    .shell:has(.trial-chip:not([hidden])) .shell__start .brand > span:last-child { display: none; }
    .trial-chip { padding: 0 8px; }
  }
}

@layer utilities {
  .mb-2 { margin-bottom: var(--s-2); }
  .mb-4 { margin-bottom: var(--s-4); }
  .measure-sm { max-width: 34ch; }
  .self-start { align-self: flex-start; }
  .block { display: block; }
}

@layer pages {
  .qr-wrap { display: grid; place-items: center; margin: 4px 0 12px; }
  .qr { width: min(220px, 70vw); height: auto; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); }
  .secret-key { font: 600 17px var(--font-mono); letter-spacing: .06em; text-align: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--sunken); color: var(--ink); overflow-wrap: anywhere; user-select: all; }
  .recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin: 0; padding: 14px 18px 14px 36px; border-radius: var(--r-sm); background: var(--sunken); font: 500 16px var(--font-mono); color: var(--ink); }
  .two-factor-step[hidden] { display: none; }
  .visibility-options { display: grid; gap: 12px; }
  .visibility-options .radio { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
  .visibility-options .radio small { display: block; color: var(--ink-3); font-size: 14.5px; }
}
