/* RepoKub v2 — light studio canvas, glass 3D cards, light/bold type pairs (ref: "swapie"), Ateneo Blue palette */
:root {
  /* Ateneo Blue tints & shades */
  --t90: #E6EBF0; --t75: #BFCEDA; --t60: #99B0C4; --t45: #7393AE; --t30: #4C7598; --t15: #265882;
  --base: #003A6C; --s42: #00213E; --s85: #000910;
  --ground: var(--t90);
  --ink: var(--s85);
  --muted: var(--t30);
  --dark: var(--s42);
  --accent: var(--t15);
  --holo: conic-gradient(from 210deg at 32% 40%, var(--t90), var(--t60), var(--t15), var(--base), var(--t45), var(--t75), var(--t90));
  --radius: 28px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box }
html { scroll-behavior: smooth }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: 'Manrope', 'Noto Sans Thai', system-ui, sans-serif; overflow-x: hidden }
a { color: inherit }
img { display: block; max-width: 100% }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0) }
.light { font-weight: 300 }
.bold { font-weight: 800 }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 4vw, 48px); transition: background .3s, box-shadow .3s }
/* once the deck has docked, the nav gets a glass backing so cards don't run under the logo */
html.docked .nav { background: rgba(230, 235, 240, .82); box-shadow: 0 1px 0 rgba(0, 33, 62, .06); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px) }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; text-decoration: none }
.logo-star { width: 18px; height: 18px; color: var(--accent) }
.links { display: flex; gap: 6px }
.links a { padding: 10px 14px; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--muted); border-radius: 999px; transition: background .25s, color .25s }
.links a:hover { background: rgba(0, 9, 16, .06); color: var(--ink) }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 999px; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none; border: 0; cursor: pointer; transition: transform .35s cubic-bezier(.2, .9, .2, 1.4), background .25s }
.btn-ink { background: var(--ink); color: #fff }
.btn-ghost { background: rgba(255, 255, 255, .7); border: 1px solid rgba(0, 9, 16, .1); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px) }

/* ---------- 1 · hero ---------- */
.hero { position: relative; height: 100svh; min-height: 680px; overflow: hidden;
  background: radial-gradient(ellipse 60% 55% at 70% 30%, #F7F9FB, rgba(247, 249, 251, 0) 70%), radial-gradient(ellipse 50% 40% at 100% 100%, rgba(153, 176, 196, .45), transparent 70%), var(--ground) }
/* fixed so the deck can fly down into the library while the page scrolls (main.js morph) */
.cluster { position: fixed; z-index: 20; left: 8vw; right: 0; top: 4vh; height: 70vh; perspective: 1600px; pointer-events: none }
html.docked .cluster { visibility: hidden }
.tilt { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .8s var(--ease) }
.card3d { position: absolute; left: var(--x); top: var(--y); width: clamp(220px, 26vw, 420px); aspect-ratio: 1.58;
  --k: calc(1 - var(--e, 0)); /* 1 = deck pose, 0 = flat, docked in the library */
  transform: rotateX(calc(36deg * var(--k))) rotateY(calc(-14deg * var(--k))) rotateZ(calc(var(--rz, -28deg) * var(--k))) }
.card3d .face { animation: bob 6s ease-in-out calc(var(--i, 0) * -.8s) infinite alternate }
.corner-card { position: absolute; right: -6vw; bottom: -12vh; width: 30vw; aspect-ratio: 1.58; z-index: 1;
  transform: perspective(1400px) rotateX(36deg) rotateY(-14deg) rotateZ(-26deg) }
.corner-card .face { animation: bob 7s ease-in-out infinite alternate }
.face { position: absolute; inset: 0; overflow: hidden; border-radius: 20px;
  background: linear-gradient(135deg, rgba(230, 235, 240, .7), rgba(115, 147, 174, .32) 48%, rgba(0, 58, 108, .55));
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .65), inset 2px 3px 0 rgba(255, 255, 255, .9), inset -10px -14px 30px rgba(0, 33, 62, .25),
    3px 5px 0 -1px rgba(255, 255, 255, .9), 5px 8px 0 -1px var(--t75), -18px 30px 44px -18px rgba(0, 33, 62, .55) }
.face img, .face .tex { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .72; mix-blend-mode: multiply }
/* auto glass pattern (main.js glassArt): a hashed crop/zoom/flip of one AI texture + a faint monogram */
.face { container-type: inline-size }
.face .tex { background: var(--tex) var(--tx, 50%) var(--ty, 50%) / var(--ts, 100%) auto no-repeat; scale: var(--fl, 1) 1 }
.face .mono { position: absolute; right: 4%; bottom: -12%; z-index: 1; font: 800 62cqw/1 'Manrope', sans-serif; letter-spacing: -.08em; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .05)); -webkit-background-clip: text; background-clip: text; color: transparent }
.face.navy .mono { background-image: linear-gradient(160deg, rgba(191, 206, 218, .45), rgba(191, 206, 218, 0)) }
.face::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit;
  background: radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 45%), linear-gradient(to top, rgba(0, 33, 62, .35), rgba(0, 33, 62, 0) 40%) }
.face::after { content: ""; position: absolute; inset: -20% -60%; z-index: 1; pointer-events: none;
  background: linear-gradient(var(--sa, 105deg), transparent 40%, rgba(255, 255, 255, .55) 48%, rgba(255, 255, 255, .15) 52%, transparent 60%);
  translate: -60% 0; animation: sheen 7s ease-in-out calc(var(--i, 0) * .35s + 2.2s) infinite }
/* alternate cards are deep navy glass */
.face.navy { background: linear-gradient(135deg, rgba(76, 117, 152, .85), rgba(0, 58, 108, .9) 50%, rgba(0, 9, 16, .95)) }
.face.navy img, .face.navy .tex { mix-blend-mode: overlay; opacity: .5 }
.face.navy .lbl { background: rgba(0, 9, 16, .45); color: #fff }
.face.navy .lbl b { color: var(--t75) }
@keyframes sheen { 0% { translate: -60% 0 } 35%, 100% { translate: 60% 0 } }
.lbl { position: absolute; left: 12px; bottom: 10px; display: flex; gap: 8px; align-items: center; z-index: 2;
  padding: 7px 10px; border-radius: 12px; font: 700 11px/1 'Manrope', sans-serif; color: var(--ink); background: rgba(255, 255, 255, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px) }
.lbl b { font-weight: 800; color: var(--base) }
.orb { position: absolute; left: var(--x); top: var(--y); width: clamp(56px, 6vw, 92px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0 8%, rgba(255, 255, 255, .6) 14%, rgba(191, 206, 218, .35) 40%, rgba(38, 88, 130, .5) 70%, rgba(0, 58, 108, .55) 100%);
  box-shadow: inset -8px -12px 24px rgba(0, 58, 108, .35), 0 20px 40px -14px rgba(0, 33, 62, .45); animation: bob 7s ease-in-out infinite alternate }
.o2 { animation-delay: -3s }
@keyframes bob { from { translate: 0 calc(-10px * var(--bob, 1)); rotate: 0deg } to { translate: 0 calc(12px * var(--bob, 1)); rotate: calc(3deg * var(--bob, 1)) } }

.hero-copy { position: absolute; left: clamp(16px, 5vw, 72px); bottom: clamp(32px, 9vh, 96px); right: 16px; max-width: 1100px; z-index: 2 }
.display { margin: 0; font-size: clamp(38px, 5.6vw, 88px); line-height: 1.08; letter-spacing: -.04em }
.display .line { display: block }
.display .w { display: inline-block }
.hero-copy { position: absolute }
.loader { position: absolute; left: 0; top: -1.6em; display: flex; gap: 6px; font-size: clamp(38px, 5.6vw, 88px); opacity: 0; pointer-events: none }
.loader svg { width: 14px; height: 14px; color: var(--ink) }
.caret { display: inline-block; width: .45em; height: .45em; margin-left: .12em; vertical-align: middle; color: var(--accent); opacity: 0 }
html.intro .card3d, html.intro .corner-card, html.intro .orb, html.intro .hero .w, html.intro .pill-img,
html.intro .scr, html.intro .thai, html.intro .hero .sub, html.intro .search, html.intro .feats, html.intro .scroll-cue, html.intro .nav { opacity: 0 }
.nw { display: inline-block; white-space: nowrap }
.pill-img { display: inline-block; vertical-align: middle; width: 2.3em; height: .8em; margin-left: .15em; border-radius: 999px; overflow: hidden; background: var(--holo); translate: 0 -.06em; box-shadow: 0 8px 20px -8px rgba(0, 58, 108, .5) }
.pill-img img { width: 100%; height: 100%; object-fit: cover }
.inline-star { display: inline-block; width: .62em; height: .62em; color: var(--accent); vertical-align: baseline; translate: 0 .02em; animation: spin 8s linear infinite }
@keyframes spin { to { rotate: 360deg } }
.hero .sub { margin: 14px 0 0; font-size: clamp(15px, 1.3vw, 18px); font-weight: 500; color: var(--muted) }
.search { display: flex; align-items: center; gap: 10px; width: min(520px, 100%); margin-top: 22px; padding: 6px 6px 6px 18px; border-radius: 999px; color: var(--muted);
  background: rgba(255, 255, 255, .78); border: 1px solid rgba(0, 9, 16, .08); box-shadow: 0 16px 40px -20px rgba(0, 33, 62, .25); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px) }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-family: inherit; font-size: 16px; font-weight: 500; color: var(--ink) }
.feats { display: flex; flex-wrap: wrap; gap: 28px; margin: 28px 0 0; padding: 0; list-style: none }
.feats li { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--muted); text-transform: uppercase; letter-spacing: .04em }
.feats svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round }
.scroll-cue { position: absolute; right: clamp(16px, 4vw, 48px); bottom: clamp(32px, 9vh, 96px); width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(0, 9, 16, .15) }
.scroll-cue svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; animation: nudge 1.8s ease-in-out infinite }
@keyframes nudge { 50% { translate: 0 5px } }

/* ---------- section heads ---------- */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; max-width: 1200px; margin: 0 auto 28px }
.section-head h2 { margin: 0; font-size: clamp(32px, 4.4vw, 60px); letter-spacing: -.035em; line-height: 1.05 }
.sample { margin: 0; font-size: 12px; color: var(--muted) }

/* ---------- 2 · library ---------- */
.lib { min-height: 100svh; padding: 8vh 16px 12vh }
.cards.featured { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.all-head { margin-top: 12vh }
.all-head .count { margin-left: 8px; font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--muted) }
.all-head { margin-bottom: 16px }
.toolbar { position: sticky; top: 88px; z-index: 30; display: flex; align-items: center; gap: 8px; max-width: 1200px; margin: 0 auto 24px; padding: 8px;
  border-radius: 28px; background: rgba(247, 249, 251, .78); border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 16px 40px -24px rgba(0, 33, 62, .45); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3) }
.toolbar .segs { flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none }
.toolbar .seg { flex: none }
.tsearch { flex: 0 1 300px; min-width: 160px; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid rgba(0, 9, 16, .08); color: var(--muted) }
.tsearch:focus-within { border-color: var(--t45); box-shadow: 0 0 0 3px rgba(115, 147, 174, .25) }
.tsearch svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round }
.tsearch input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-family: inherit; font-size: 16px; font-weight: 500; color: var(--ink) }
.sort { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(0, 9, 16, .12); background: #fff; font: 600 14px 'Manrope', 'Noto Sans Thai', sans-serif; color: var(--ink) }
#grid .rcard { content-visibility: auto; contain-intrinsic-size: auto 380px }
.more { display: flex; margin: 32px auto 0 }
.more[hidden], .btn[hidden] { display: none }
.segs { display: flex; flex-wrap: wrap; gap: 6px }
.seg { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(0, 9, 16, .12); background: transparent; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .25s, color .25s }
.seg[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; max-width: 1200px; margin: 0 auto }
.rcard { display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; background: #fff; box-shadow: 0 1px 0 rgba(0, 9, 16, .04), 0 20px 40px -28px rgba(0, 33, 62, .4); transition: transform .5s var(--ease) }
.rcard:hover { transform: translateY(-6px) }
.rcard .art { position: relative; inset: auto; flex: none; aspect-ratio: 1.58; margin: 10px 10px 0; border-radius: 14px }
.rcard .art::after { animation: none; display: none }
.rcard .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px }
.rcard .meta { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted) }
.rcard h3 { margin: 0; font-size: 18px; letter-spacing: -.02em }
.rcard p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted) }
.rcard .foot2 { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; font-weight: 700 }
.rcard .foot2 a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; color: var(--base) }
.empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--muted) }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 28px clamp(16px, 4vw, 48px); font-size: 13px; color: var(--muted); border-top: 1px solid rgba(0, 9, 16, .08) }
.foot span:first-child { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink) }

/* ---------- motion (scroll-driven where supported) ---------- */
.reveal-up { animation: up .9s var(--ease) var(--delay, 0s) both }
@keyframes up { from { opacity: 0; translate: 0 28px; filter: blur(6px) } to { opacity: 1; translate: 0 0; filter: none } }
@supports (animation-timeline: view()) {
  main .reveal-up { animation: up linear both; animation-timeline: view(); animation-range: entry 0% cover 22% }
  .hero .reveal-up { animation: up .9s var(--ease) calc(.2s + var(--delay, 0s)) both; animation-timeline: auto }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .links { display: none }
  .cluster { left: -20vw; right: -30vw; top: 9vh; height: 50vh }
  .opt, .corner-card { display: none }
  /* featured row = swipeable carousel; the deck docks into its first slots */
  .cards.featured { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 12px; scrollbar-width: none }
  .featured .rcard { scroll-snap-align: start }
  .toolbar { top: 86px; flex-wrap: wrap; margin: 0 -8px 20px }
  .tsearch { flex: 1 1 0 }
  .toolbar .segs { order: 3; flex: 1 1 100% }
  .hero-copy { bottom: 28px }
  .scroll-cue { display: none }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important }
}

/* =========================================================================================
   App UI (auth, save, toast) + inner pages: repo detail, my library, submit, admin
   ========================================================================================= */
.auth { display: flex; align-items: center; min-height: 44px }
.acct { position: relative }
.avatar-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 2px solid #fff; cursor: pointer; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--t45), var(--base)); color: #fff; font: 800 16px 'Manrope', 'Noto Sans Thai', sans-serif; box-shadow: 0 8px 20px -10px rgba(0, 33, 62, .6) }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px; border-radius: 18px; background: rgba(255, 255, 255, .95); box-shadow: 0 24px 50px -20px rgba(0, 33, 62, .45); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px) }
.menu-name { margin: 6px 10px 8px; font-size: 13px; font-weight: 700; color: var(--muted) }
.menu a, .menu button { display: flex; width: 100%; min-height: 44px; align-items: center; padding: 0 12px; border: 0; border-radius: 12px; background: none; font: 600 14px 'Manrope', 'Noto Sans Thai', sans-serif; color: var(--ink); text-decoration: none; cursor: pointer; text-align: left }
.menu a:hover, .menu button:hover { background: var(--t90) }
.rk-dialog { width: min(420px, calc(100vw - 32px)); padding: 28px; border: 0; border-radius: 28px; box-shadow: 0 40px 80px -30px rgba(0, 33, 62, .6); color: var(--ink) }
.rk-dialog::backdrop { background: rgba(0, 9, 16, .35); backdrop-filter: blur(4px) }
.rk-dialog h3 { margin: 0 0 6px; font-size: 22px }
.rk-dialog p { margin: 0 0 18px; color: var(--muted); line-height: 1.5 }
.btn.wide { width: 100%; margin-top: 8px }
.rk-toast { position: fixed; left: 50%; bottom: 28px; z-index: 90; translate: -50% 20px; opacity: 0; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; transition: opacity .3s, translate .3s; pointer-events: none }
.rk-toast.show { opacity: 1; translate: -50% 0 }
.demo-banner { position: fixed; left: 12px; bottom: 12px; z-index: 80; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--base); background: rgba(255, 255, 255, .85); box-shadow: 0 8px 20px -12px rgba(0, 33, 62, .5) }
.demo-banner button { min-height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--t90); font: inherit; color: var(--ink); cursor: pointer }

/* cards: whole card is a link, ♥ sits on the art */
.rcard { position: relative }
.rcard .stretch { color: inherit; text-decoration: none }
.rcard .stretch::after { content: ""; position: absolute; inset: 0; z-index: 1 }
.rcard .go { color: var(--base) }
.save { position: absolute; top: 18px; right: 18px; z-index: 3; width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer; font-size: 17px; line-height: 1;
  color: var(--t45); background: rgba(255, 255, 255, .85); box-shadow: 0 6px 16px -8px rgba(0, 33, 62, .5); backdrop-filter: blur(8px); transition: transform .3s cubic-bezier(.2, .9, .2, 1.4), color .2s }
.save:hover { transform: scale(1.1) }
.save.on { color: #fff; background: var(--base) }
:focus-visible { outline: 3px solid var(--t45); outline-offset: 2px }

/* ---------- inner pages ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 112px 16px 96px }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none }
.page h1 { margin: 0; font-size: clamp(34px, 5vw, 60px); line-height: 1.05; letter-spacing: -.035em }
.page h2 { margin: 0 0 16px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em }
.panel { margin-top: 20px; padding: clamp(18px, 3vw, 28px); border-radius: 28px; background: #fff; box-shadow: 0 1px 0 rgba(0, 9, 16, .04), 0 24px 48px -32px rgba(0, 33, 62, .45) }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--t90); font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--base) }
.muted { color: var(--muted) }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }

.d-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(20px, 4vw, 48px); align-items: center; margin-top: 12px }
.d-art { position: relative; aspect-ratio: 1.58; transform: perspective(1400px) rotateX(16deg) rotateY(-14deg) rotateZ(-4deg); filter: drop-shadow(0 30px 40px rgba(0, 33, 62, .3)) }
.d-art .face { border-radius: 26px }
.d-desc { margin: 14px 0 0; font-size: 18px; line-height: 1.55; color: var(--muted) }
.d-stats { display: flex; flex-wrap: wrap; gap: 18px; margin: 20px 0 22px; font-size: 14px; font-weight: 600 }
.d-stats b { font-size: 22px; letter-spacing: -.02em; margin-right: 4px }
.st { color: var(--t75) } .st.on { color: var(--base) }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 10px }
.steps li.txt { counter-increment: s; display: flex; gap: 12px; align-items: baseline; line-height: 1.55 }
.steps li.txt::before { content: counter(s); flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--base); color: #fff; font-size: 13px; font-weight: 800 }
.code { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--s85); color: #E6EBF0; font: 500 14px/1.5 ui-monospace, 'SF Mono', Menlo, monospace }
.code code { flex: 1; min-width: 0; overflow-x: auto; white-space: pre }
.code button, .copy-btn { flex: none; min-height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: rgba(230, 235, 240, .14); color: #fff; font: 600 13px 'Manrope', 'Noto Sans Thai', sans-serif; cursor: pointer }
.prompt-box { position: relative; padding: 18px; border-radius: 18px; background: var(--t90); line-height: 1.65; white-space: pre-wrap }
.prompt-box .copy-btn { position: absolute; right: 10px; top: 10px; background: var(--ink) }
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 18px; background: var(--s42) }
.clip-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px }
.clip-item { display: flex; flex-direction: column; gap: 8px }

.rv-sum { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin-bottom: 20px }
.rv-big { font-size: 56px; font-weight: 800; letter-spacing: -.04em; line-height: 1 }
.bar { height: 10px; border-radius: 999px; background: var(--t90); overflow: hidden }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--t45), var(--base)) }
.form { display: flex; flex-direction: column; gap: 12px }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600 }
.field input, .field textarea, .field select, .form textarea { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(0, 9, 16, .12); background: #fff; font: 500 16px/1.5 'Manrope', 'Noto Sans Thai', sans-serif; color: var(--ink) }
.field textarea, .form textarea { min-height: 96px; resize: vertical }
.star-input { display: flex; gap: 2px }
.star-input button { width: 44px; height: 44px; border: 0; background: none; font-size: 28px; color: var(--t75); cursor: pointer }
.star-input button.on { color: var(--base) }
.toggle { display: flex; gap: 8px; flex-wrap: wrap }
.toggle button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(0, 9, 16, .12); background: #fff; font: 600 14px 'Manrope', 'Noto Sans Thai', sans-serif; color: var(--muted); cursor: pointer }
.toggle button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column }
.item { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid rgba(0, 9, 16, .07) }
.item .who { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, var(--t60), var(--base)); color: #fff; font-weight: 800 }
.item .who img { width: 100%; height: 100%; object-fit: cover }
.item .main { flex: 1; min-width: 0 }
.item .top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px }
.item p { margin: 6px 0 0; line-height: 1.6 }
.badge { padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #E3F1EA; color: #1C6B45 }
.badge.no { background: #F6E7E7; color: #9B2C2C }
.badge.pending { background: var(--t90); color: var(--base) }
.link-btn { min-height: 32px; padding: 0 6px; border: 0; background: none; font: 600 13px 'Manrope', 'Noto Sans Thai', sans-serif; color: var(--muted); cursor: pointer }
.link-btn:hover { color: var(--ink) }
.replies { margin: 8px 0 0; padding-left: 16px; border-left: 2px solid var(--t90) }
.replies .item { border-top: 0; padding: 10px 0 }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0 0 }
.tabs button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(0, 9, 16, .12); background: transparent; font: 600 14px 'Manrope', 'Noto Sans Thai', sans-serif; color: var(--muted); cursor: pointer }
.tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff }
.table { width: 100%; border-collapse: collapse; font-size: 14px }
.table th, .table td { padding: 12px 8px; text-align: left; border-top: 1px solid rgba(0, 9, 16, .07); vertical-align: middle }
.table th { font-size: 12px; letter-spacing: .06em; color: var(--muted); border-top: 0 }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.notice { padding: 14px 16px; border-radius: 16px; background: var(--t90); color: var(--base); font-size: 14px; line-height: 1.5 }
.empty-state { padding: 40px 16px; text-align: center; color: var(--muted) }
@media (max-width: 760px) {
  .d-hero { grid-template-columns: 1fr }
  .d-art { max-width: 420px }
  .rv-sum { grid-template-columns: 1fr }
  .grid2 { grid-template-columns: 1fr }
  .table .hide-sm { display: none }
}
/* inner pages: nav always has its glass backing */
body.inner .nav { background: rgba(230, 235, 240, .82); box-shadow: 0 1px 0 rgba(0, 33, 62, .06); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px) }
.rk-dialog.big { width: min(760px, calc(100vw - 32px)); max-height: 90vh; overflow: auto }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(0, 9, 16, .12); background: #fff; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; cursor: pointer }
.check input { width: 18px; height: 18px; accent-color: var(--base) }
.check:has(input:checked) { border-color: var(--base); background: var(--t90) }
.ai-box { border: 1.5px solid var(--t75); background: linear-gradient(160deg, #fff, #F3F6F9) }
.seg-more { border-style: dashed; color: var(--base) }
.toolbar .segs.open { padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: var(--t60) transparent; cursor: grab; mask-image: linear-gradient(90deg, #000 94%, transparent) }
.toolbar .segs.open::-webkit-scrollbar { height: 6px }
.toolbar .segs.open::-webkit-scrollbar-thumb { background: var(--t60); border-radius: 999px }
.toolbar .segs.dragging { cursor: grabbing; user-select: none }
.toolbar .segs.dragging .seg { pointer-events: none }
