/* Loop: mono minimal. Near-black, white type, one soft light from the top.
   Orange (#FF5A1F) is only the one primary action per screen. */
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

:root {
  --bg: #0B0B0C; --surface: #141415; --surface-2: #0F0F10; --raise: #1E1E20;
  --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.18);
  --text: #F4F4F5; --body: #D4D4D8; --sub: #A1A1AA; --mute: #7C7C85; --placeholder: #5F5F68;
  --accent: #FF5A1F; --on-accent: #111316;
  --solid: #F4F4F5; --on-solid: #111316;          /* secondary filled button */
  --bubble: #1E1E20; --on-bubble: #F4F4F5;        /* the user's chat bubble */
  --glim-a: rgba(255, 190, 150, 0.35); --glim-b: #FF5A1F;
  --top: rgba(11, 11, 12, 0.72); --promo: linear-gradient(90deg, #232325, #1A1A1C);
  --radius: 20px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 14px/1.6 'Inter Tight', 'Noto Sans KR', system-ui, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--text); }
::selection { background: rgba(255, 90, 31, 0.35); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

/* ---- motion (kept small) ---- */
@keyframes float-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin-angle { to { --angle: 360deg; } }
@keyframes shimmer-text { from { background-position: 0 0; } to { background-position: -220% 0; } }
@keyframes typing-dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@keyframes bar-shine { to { transform: translateX(120%); } }
.rise { animation: float-up 0.55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }

/* a thin light that travels around the border while something is working */
.glim-border { position: relative; }
.glim-border::before { content: ''; position: absolute; inset: -1px; padding: 1px; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: conic-gradient(from var(--angle), transparent 0deg, transparent 220deg, var(--glim-a) 300deg, var(--glim-b) 340deg, transparent 360deg);
  -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);
  animation: spin-angle 3.4s linear infinite; }
.glim-border.glim::before { opacity: 1; }
.shimmer { background-image: linear-gradient(110deg, var(--mute) 0%, var(--text) 45%, var(--mute) 90%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; animation: shimmer-text 2.6s linear infinite; }

/* ---- page background layer ---- */
.aura { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.aura i, .aura b { position: absolute; display: block; }

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--top); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; margin-right: 20px; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: 0.06em; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: #F4F4F5; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.logo img { width: 22px; height: 22px; }
.top nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; color: var(--sub); text-decoration: none; transition: color 0.2s; }
.top nav a:hover { color: var(--text); }
body[data-page="home"] .top nav a[href="#/"], body[data-page="mine"] .top nav a[href="#/mine"], body[data-page="pricing"] .top nav a[href="#/pricing"], body[data-page="checkout"] .top nav a[href="#/pricing"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--sub); font-size: 13px; }
.demo-tag { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; }
.balance .balance-n { color: var(--text); font-weight: 600; }
.balance::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }

.ghost { min-height: 40px; padding: 0 14px; border-radius: 10px; background: transparent; border: 1px solid var(--line-strong); transition: background 0.2s; }
.ghost:hover { background: var(--raise); }
.primary { min-height: 48px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15px; transition: transform 0.2s var(--ease), filter 0.2s; }
.primary:hover { filter: brightness(1.08); }
.primary:active, .send:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: default; }

/* ---- home ---- */
.hero { max-width: 808px; margin: 0 auto; padding: clamp(48px, 18.5vh, 172px) 24px 64px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.hero h1 { text-align: center; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.26; font-weight: 400; letter-spacing: -0.01em; color: var(--text); }
.composer-wrap { width: 100%; border-radius: 24px; background: var(--promo); border: 1px solid var(--line); }
.promo { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px 0 16px; font-size: 13px; font-weight: 600; color: var(--text); }
.promo svg { color: var(--accent); flex: none; }
.promo .go { margin-left: auto; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; }
.promo .x { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--sub); font-size: 16px; }
.promo .go:hover, .promo .x:hover { background: var(--raise); }
.composer { border-radius: 23px; margin: 0 -1px -1px; padding: 14px 12px 10px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); transition: border-color 0.25s; }
.composer:focus-within, .composer.drag { border-color: rgba(255, 90, 31, 0.5); }
.composer textarea { min-height: 84px; resize: none; padding: 0; border: 0; background: transparent; font-size: 14px; line-height: 1.6; outline: none; color: var(--text); }
.composer textarea::placeholder, .ask input::placeholder { color: var(--placeholder); }
.files { display: flex; flex-wrap: wrap; gap: 6px; }
.file { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 8px; background: var(--raise); font-size: 13px; color: var(--body); }
.file button { border: 0; background: transparent; color: var(--mute); min-width: 28px; min-height: 28px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.row .spacer { margin-left: auto; }
.tool { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--body); font-size: 13px; font-weight: 600; transition: background 0.2s; }
.tool:hover, .tool:focus-within { background: var(--raise); }
.pick { position: relative; display: inline-flex; }
.pick[hidden] { display: none; }
.pick .tool { cursor: pointer; }
.pick .chev { color: var(--mute); transition: transform 0.2s var(--ease); }
.pick .tool[aria-expanded="true"] { background: var(--raise); color: var(--text); }
.pick .tool[aria-expanded="true"] .chev { transform: rotate(180deg); }
.menu { position: absolute; z-index: 20; left: 0; top: calc(100% + 8px); min-width: 196px; padding: 5px; display: flex; flex-direction: column; gap: 1px; border-radius: 14px; background: #19191B; border: 1px solid var(--line-strong); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 48px -16px rgba(0, 0, 0, 0.85); animation: menu-in 0.16s var(--ease); }
.menu[hidden] { display: none; }
.pick.up .menu { top: auto; bottom: calc(100% + 8px); left: auto; right: 0; }
.menu button { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--body); font-size: 13px; font-weight: 500; text-align: left; white-space: nowrap; cursor: pointer; outline: none; transition: background 0.15s, color 0.15s; }
.menu button:hover, .menu button:focus-visible { background: var(--raise); color: var(--text); }
.menu button > span { flex: 1; }
.menu small { color: var(--mute); font-size: 12px; font-weight: 500; }
.menu .check { color: var(--accent); visibility: hidden; }
.menu button[aria-selected="true"] { color: var(--text); font-weight: 600; }
.menu button[aria-selected="true"] .check { visibility: visible; }
.composer-wrap, .ask { position: relative; z-index: 5; }  /* keep an open menu above what follows */
.menu button[aria-disabled="true"] { color: var(--mute); cursor: default; }
.menu button[aria-disabled="true"]:hover { background: transparent; color: var(--mute); }
.tools { display: inline-flex; align-items: center; gap: 2px; }
.tools[hidden] { display: none; }
.ops { color: var(--mute); font-size: 12px; text-decoration: none; }
.ops:hover, body[data-page="admin"] .ops { color: var(--text); }
.admin { max-width: 1040px; }
.admin h1 { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 20px 0; }
.gauge { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--body); display: flex; flex-direction: column; gap: 10px; }
.table-scroll { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.admin table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin th, .admin td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--line); color: var(--body); font-weight: 400; }
.admin thead th { color: var(--sub); font-size: 12px; }
.admin th:first-child, .admin td[colspan] { text-align: left; }
.admin tbody tr:last-child > * { border-bottom: 0; }
.admin .strong { color: var(--text); font-weight: 600; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.tool.plus { width: 36px; justify-content: center; padding: 0; margin-left: -8px; }
.send { width: 34px; height: 34px; flex: none; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; transition: transform 0.2s var(--ease), opacity 0.2s; }
.send:not(:disabled):hover { transform: scale(1.06); }
.error { color: #F0764A; font-size: 13px; }

/* lists */
.wrap { max-width: 1120px; margin: 0 auto; padding: 40px 24px 120px; }
.wrap h2 { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 16px; }
.card-link { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color 0.25s, transform 0.3s var(--ease); }
.card-link:hover { border-color: rgba(255, 90, 31, 0.55); transform: translateY(-2px); }
.card-link .name { font-size: 15px; font-weight: 600; }
.card-link .meta { font-size: 13px; color: var(--mute); }
.note { font-size: 13px; color: var(--mute); }

/* template gallery: cards that preview a question and its answer */
.gallery { max-width: 1120px; margin: 0 auto; padding: 0 24px 88px; }
.g-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-bottom: 8px; }
.g-head h2 { font-size: 15px; font-weight: 600; color: var(--text); }
.g-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.g-tabs button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--mute); font-size: 13px; transition: color 0.2s, background 0.2s; }
.g-tabs button:hover { color: var(--text); }
.g-tabs button[aria-pressed="true"] { background: var(--raise); color: var(--text); font-weight: 600; }
.g-tabs button[aria-pressed="true"]::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 7px; border-radius: 50%; background: var(--accent); vertical-align: 2px; }

.g-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 8px; }
.g-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 16px; text-align: left; background: var(--surface); border: 1px solid var(--line); transition: border-color 0.25s, transform 0.3s var(--ease); }
.g-card:hover { border-color: rgba(255, 90, 31, 0.55); transform: translateY(-2px); }
.g-card .name { font-size: 15px; font-weight: 600; color: var(--text); }
.g-card .desc { font-size: 13px; color: var(--mute); }
.g-card .demo { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.g-card .q { align-self: flex-end; max-width: 90%; padding: 6px 10px; border-radius: 12px 12px 3px 12px; background: var(--raise); color: var(--text); font-size: 13px; }
.g-card .a { font-size: 13px; line-height: 1.55; color: var(--body); }
.g-card .src::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.g-card .src { align-self: flex-start; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 11px; color: var(--mute); }

/* ---- one rag ---- */
/* The console fills the window: its sidebar carries the brand and account, so the site's top bar steps aside. */
body[data-page="rag"] .top, body[data-page="rag"] .fall { display: none; }
.console { height: 100vh; height: 100dvh; padding: 10px; display: flex; gap: 10px; }
.c-side { flex: 0 0 248px; min-height: 0; padding: 18px 12px 12px; display: flex; flex-direction: column; gap: 6px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); animation: float-up 0.5s var(--ease) both; }
.c-side .brand { margin: 0 0 14px 8px; }
.c-new { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; transition: background 0.2s; }
.c-new:hover, .c-new.on { background: var(--raise); }
.c-create { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px 24px 12vh; }
.c-create .composer-wrap { max-width: 680px; }
.pricing h1, .checkout h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.pricing > .note { max-width: 620px; }
.p-switch { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 26px 0 14px; }
.p-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.p-card { display: flex; flex-direction: column; gap: 6px; padding: 22px 20px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.p-card h2 { margin: 0; font-size: 16px; font-weight: 600; }
.p-card .line, .co-sum .line { margin: 0; font-size: 13px; color: var(--mute); }
.p-card .price { margin: 14px 0 4px; display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.p-card .price strong { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.p-card .price span { font-size: 13px; color: var(--mute); }
.p-card ul { flex: 1 1 auto; margin: 6px 0 18px; padding: 14px 0 0; list-style: none; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--body); }
.p-card .link, .co-form .primary { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.p-card .primary { min-height: 44px; font-size: 14px; }
.p-sub { margin: 48px 0 4px; }
.p-rates { max-width: 620px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.p-rates small { margin-left: 6px; font-size: 11px; color: var(--mute); white-space: nowrap; }
.p-rates th { white-space: nowrap; }
.p-card .price + .line { margin-top: -2px; }
.seats { display: flex; align-items: center; gap: 12px; }
.seats button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-size: 18px; cursor: pointer; }
.seats button:hover { background: var(--raise); }
.seats output { min-width: 56px; text-align: center; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.seats small { font-size: 12px; color: var(--mute); }
.p-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0 14px; }
.p-pack { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--body); font-variant-numeric: tabular-nums; transition: border-color 0.25s; }
.p-pack:hover { border-color: rgba(255, 90, 31, 0.55); }
.p-pack strong { font-size: 15px; font-weight: 600; color: var(--text); }
.p-pack small { font-size: 12px; color: var(--mute); }
.co { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; margin-top: 22px; }
.co-form { flex: 1 1 380px; display: flex; flex-direction: column; gap: 16px; }
.co-form fieldset { margin: 0; padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.co-form legend { float: left; width: 100%; margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.co-form fieldset > label { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; color: var(--body); cursor: pointer; }
.co-form input[type="radio"], .co-form input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.co-tax { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.co-tax[hidden] { display: none; }
.co-tax label { font-size: 12px; color: var(--mute); }
.co-tax input { min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-size: 14px; }
.co-sum { flex: 1 1 300px; max-width: 420px; padding: 22px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.co-sum h2 { margin: 0; font-size: 16px; font-weight: 600; }
.co-sum dl { margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.co-sum dl div { display: flex; justify-content: space-between; color: var(--body); }
.co-sum dd { margin: 0; }
.co-sum .total { padding-top: 12px; border-top: 1px solid var(--line); color: var(--text); font-weight: 600; }
.hero-sub { margin: -14px 0 0; text-align: center; font-size: 15px; color: var(--sub); }
.band { max-width: 1120px; margin: 0 auto; padding: 0 24px 88px; }
.band h2 { margin: 0 0 6px; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.band .lead { margin: 0 0 22px; max-width: 660px; font-size: 14px; color: var(--sub); }
.why, .does { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.why article, .does article { padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.why h3, .does h3, .who h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--text); }
.why p, .does p, .who p { margin: 0; font-size: 13px; color: var(--sub); }
.why .n { display: block; margin-bottom: 14px; font-size: 12px; font-weight: 600; color: var(--accent); }
.does { margin-top: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; color: var(--mute); }
.pill.on { color: var(--body); }
.pill.on::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #4ADE80; }
.who { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.who a { display: flex; flex-direction: column; gap: 4px; padding: 22px 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; transition: border-color 0.25s; }
.who a:hover { border-color: rgba(255, 90, 31, 0.55); }
.who a span { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--text); }
.dw { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.dw-left { padding: 22px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); border-right: 1px solid var(--line); }
.dw-right { padding: 22px 24px; font-size: 13px; }
.dw-right h4:first-child { margin-top: 0; }
.dw-label { margin-top: 10px; font-size: 12px; color: var(--mute); }
.dw-label:first-child { margin-top: 0; }
.dw-ask { align-self: flex-start; margin: 0 0 6px; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--raise); color: var(--text); font-size: 13px; }
@media (max-width: 820px) { .dw { grid-template-columns: minmax(0, 1fr); } .dw-left { border-right: 0; border-bottom: 1px solid var(--line); } }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.steps li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; color: var(--body); }
.steps li::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; transform: translateY(-1px); }
.steps li.running::before { background: var(--accent); }
.steps li.none::before { background: var(--mute); }
.steps small { font-size: 12px; color: var(--mute); }
.cite { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin: 0 1px; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 6px; background: transparent; color: var(--sub); font-size: 11px; font-weight: 600; line-height: 1; vertical-align: 1px; }
button.cite { cursor: pointer; transition: border-color 0.2s, color 0.2s; }
button.cite:hover { border-color: var(--accent); color: var(--text); }
.md-table { margin: 0 0 10px; overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
.md-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-table th, .md-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.md-table th { font-size: 12px; font-weight: 600; color: var(--sub); background: var(--surface-2); }
.md-table tr:last-child td { border-bottom: 0; }
.work { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
details.work { display: block; }
details.work summary { cursor: pointer; font-size: 12px; color: var(--sub); }
details.work[open] summary { margin-bottom: 10px; }
.seg { flex: none; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--raise); }
.seg[hidden] { display: none; }
.seg button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--sub); font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.2s, color 0.2s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.empty .chips { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 18px; }
.chips button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--body); font-size: 13px; cursor: pointer; transition: border-color 0.2s, color 0.2s; }
.chips button:hover { border-color: var(--line-strong); color: var(--text); }
.chips small { font-size: 11px; color: var(--accent); font-weight: 600; }
.c-role { flex: none; min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--sub); font-size: 12px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.c-role:hover, .c-role[aria-pressed="true"] { background: var(--raise); color: var(--text); }
.role { display: flex; flex-direction: column; gap: 10px; }
.role h2 { margin: 0; font-size: 15px; font-weight: 600; }
.role .note { margin: 0; }
.role textarea { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; line-height: 1.6; resize: vertical; outline: none; }
.role textarea:focus { border-color: rgba(255, 90, 31, 0.5); }
.role .primary, .role .ghost { min-height: 40px; font-size: 13px; }
.c-role[hidden] { display: none; }
.msg.user .by { display: block; margin-bottom: 2px; font-size: 11px; opacity: 0.65; }
.rt-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rt-list li { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.rt-list li.off p { color: var(--mute); }
.rt-list p { margin: 0; font-size: 13px; color: var(--text); }
.rt-list small, .channels small, .send-preview small { font-size: 12px; color: var(--mute); }
.rt-acts { display: flex; gap: 6px; margin-top: 6px; }
.rt-acts button { min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--sub); font-size: 12px; cursor: pointer; }
.rt-acts button:hover { background: var(--raise); color: var(--text); }
.rt-form { display: flex; flex-direction: column; gap: 10px; }
.rt-when { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.role input:not([type]) { min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 14px; outline: none; }
.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.channels label { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color 0.2s; }
.channels label:has(input:checked) { border-color: rgba(255, 90, 31, 0.6); }
.channels input { margin-top: 3px; accent-color: var(--accent); }
.channels span { display: flex; flex-direction: column; }
.channels strong { font-size: 13px; font-weight: 600; color: var(--text); }
.channels label.soon { cursor: default; opacity: 0.55; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text); cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.check-row span { display: flex; flex-direction: column; gap: 2px; }
.check-row small { font-size: 12px; color: var(--mute); }
.doc-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.doc-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.doc-list .d-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--text); }
.doc-list .d-name svg { flex: none; color: var(--mute); }
.doc-list .d-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list small { grid-column: 1; font-size: 12px; color: var(--mute); padding-left: 23px; }
.doc-list button { grid-column: 2; grid-row: 1 / span 2; min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--sub); font-size: 12px; cursor: pointer; }
.doc-list button:hover { background: var(--raise); color: var(--text); }
.doc-add { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 12px; border: 1px dashed var(--line-strong); color: var(--text); font-size: 13px; cursor: pointer; transition: background 0.2s; }
.doc-add:hover { background: var(--raise); }
.doc-add.off { color: var(--mute); cursor: default; }
.doc-add.off:hover { background: transparent; }
.doc-add input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.send-preview { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.send-preview p { margin: 0; font-size: 13px; color: var(--body); }
.c-lead-sub { margin: -14px 0 0; font-size: 13px; color: var(--mute); text-align: center; }
.c-lead { margin: 0; font-size: 20px; color: var(--text); text-align: center; }
.c-label { margin: 18px 12px 4px; font-size: 12px; color: var(--mute); }
.c-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.c-list a { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-radius: 10px; color: var(--sub); text-decoration: none; font-size: 13px; transition: background 0.2s, color 0.2s; }
.c-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-list a small { font-size: 11px; color: var(--mute); }
.c-list a:hover { background: var(--raise); color: var(--text); }
.c-list a.on { background: var(--raise); color: var(--text); }
.c-list a.on span::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 2px; }
.c-user { padding: 12px 8px 4px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13px; color: var(--sub); }
.c-user .email { flex: 1 1 100%; order: -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--body); }
.c-user .ghost { min-height: 32px; margin-left: auto; padding: 0 10px; font-size: 12px; }
.c-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); animation: float-up 0.5s var(--ease) 0.06s both; }
.c-top { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.c-top h1 { margin: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-back { display: none; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: -8px; border-radius: 8px; color: var(--sub); }
.c-badge { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--sub); }
.c-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--mute); }
.c-badge i.ready { background: #4ADE80; }
.c-badge i.building { background: var(--accent); }
.c-mode { margin-left: auto; font-size: 12px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-body { flex: 1 1 auto; min-height: 0; display: flex; }
.c-source { flex: 0 0 42%; max-width: 520px; min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; border-left: 1px solid var(--line); background: var(--surface-2); }
.c-source .panel { background: var(--surface); }
.source { min-height: 0; display: flex; flex-direction: column; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 48px -24px rgba(0, 0, 0, 0.8); animation: float-up 0.4s var(--ease) both; }
.s-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--sub); font-size: 13px; }
.s-file { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.s-ref { color: var(--accent); }
.s-nav { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.s-nav button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--body); font-size: 16px; line-height: 1; cursor: pointer; }
.s-nav button:hover:not(:disabled) { background: var(--raise); }
.s-nav button:disabled { color: var(--placeholder); cursor: default; }
.s-text { padding: 10px 0; overflow-y: auto; font-size: 13px; line-height: 1.7; color: var(--sub); }
.ln { display: flex; gap: 12px; padding: 1px 16px 1px 0; overflow-wrap: anywhere; }
.ln .no { flex: 0 0 34px; text-align: right; color: var(--placeholder); font-size: 11px; line-height: 22px; font-variant-numeric: tabular-nums; user-select: none; }
.ln.hit { color: var(--text); background: rgba(255, 90, 31, 0.07); }
.ln mark { background: transparent; color: #FF8A5C; font-weight: 600; }
.s-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.s-actions button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--body); font-size: 12px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.s-actions button:hover { background: var(--raise); color: var(--text); }
.s-empty { margin: auto; max-width: 240px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--mute); font-size: 13px; }
.s-empty p { margin: 0; }
@media (max-width: 1100px) {
  .c-side { display: none; }
  .c-back { display: inline-flex; }
}
@media (max-width: 820px) {
  .console { padding: 0; }
  .c-main { border-radius: 0; border: 0; }
  .c-body { flex-direction: column; }
  .c-source { flex: 0 0 auto; max-width: none; max-height: 42%; border-left: 0; border-top: 1px solid var(--line); }
  .c-mode { display: none; }
  .c-top { flex-wrap: wrap; row-gap: 8px; padding: 10px 16px; }
  .c-top h1 { flex: 1 1 calc(100% - 48px); }
  .c-source > * { flex-shrink: 0; }
}
.panel { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.panel > :first-child { border-radius: 16px 16px 0 0; }
.panel > :last-child { border-radius: 0 0 16px 16px; }
.panel .head { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.panel .head .name { font-size: 17px; font-weight: 600; }
.panel .head .state { font-size: 13px; color: var(--mute); }
.panel dl { margin: 0; }
.panel dl div { display: flex; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.panel dt { flex: 0 0 96px; color: var(--mute); }
.panel dd { margin: 0; color: var(--body); }
.panel .cost { align-items: baseline; }
.panel .cost dd { font-size: 20px; font-weight: 600; color: var(--text); }
.panel .actions { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); }
.bar { height: 4px; border-radius: 2px; background: var(--raise); overflow: hidden; }
.bar > div { position: relative; height: 4px; border-radius: 2px; overflow: hidden; background: var(--accent); transition: width 0.6s var(--ease); min-width: 4%; }
.bar > div::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--bg), transparent); opacity: 0.5; transform: translateX(-100%); animation: bar-shine 1.6s linear infinite; }

.chat { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.msgs { flex: 1 1 auto; padding: 24px 20px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.empty { margin: auto; text-align: center; color: var(--mute); max-width: 360px; }
.msg { animation: float-up 0.4s var(--ease) both; }
.msg.old { animation: none; }
.msg.user { align-self: flex-end; max-width: 80%; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--bubble); color: var(--on-bubble); }
.msg.bot { max-width: 100%; color: var(--body); overflow-wrap: anywhere; }
.msg.bot h4 { margin: 14px 0 6px; font-size: 15px; color: var(--text); }
.msg.bot p { margin: 0 0 8px; }
.msg.bot ul { margin: 0 0 8px; padding-left: 20px; }
.msg.bot strong { color: var(--text); }
.msg.bot[data-msg] { cursor: pointer; }
.msg.bot[data-msg] .tag { transition: color 0.2s; }
.msg.bot.shown .tag { color: var(--body); }
.msg .tag { display: block; margin-top: 6px; font-size: 12px; color: var(--mute); }
.msg.bot .tag::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.thinking { display: inline-flex; align-items: center; gap: 8px; }
.dots i { display: inline-block; width: 4px; height: 4px; margin-left: 3px; border-radius: 50%; background: var(--accent); animation: typing-dot 1.4s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
.orb { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--accent); box-shadow: 0 0 12px rgba(255, 90, 31, 0.45), inset 0 0 6px rgba(255, 90, 31, 0.35); }
.ask-go { flex: none; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; cursor: pointer; transition: filter 0.2s, transform 0.2s var(--ease); }
.ask-go:hover { filter: brightness(1.08); }
.ask-go:active { transform: scale(0.97); }
.ask { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 12px 12px; padding: 6px 6px 6px 14px; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line); transition: border-color 0.25s; }
.ask:focus-within { border-color: rgba(255, 90, 31, 0.5); }
.ask input { flex: 1 1 200px; min-width: 0; min-height: 44px; border: 0; background: transparent; font-size: 14px; outline: none; color: var(--text); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- sign in ---- */
.link { display: inline-flex; align-items: center; text-decoration: none; }
.solid { min-height: 40px; padding: 0 16px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 600; transition: filter 0.2s; }
.solid:hover { filter: brightness(1.08); }
.top-right .email { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login { max-width: 400px; margin: 0 auto; padding: clamp(40px, 12vh, 120px) 24px 96px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.login form { display: flex; flex-direction: column; gap: 8px; }
.login label { font-size: 13px; color: var(--sub); margin-top: 4px; }
.login input { min-height: 46px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; outline: none; transition: border-color 0.2s; }
.login input:focus { border-color: var(--line-strong); }
.login input::placeholder { color: var(--placeholder); }
.login .primary { margin-top: 10px; }
.oauth { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; margin-top: 10px; border-radius: 12px; background: var(--solid); color: var(--on-solid); border: 0; font-weight: 600; font-size: 15px; transition: filter 0.2s; }
.oauth:hover { filter: brightness(0.94); }
.or { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; font-size: 12px; color: var(--mute); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.notice { font-size: 13px; color: var(--body); padding: 10px 12px; border-radius: 10px; background: var(--raise); }
.textlink { padding: 0; border: 0; background: transparent; color: #FF7A45; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }
.login .switch { margin-top: 6px; }

/* ---- footer: business information ---- */
.foot { border-top: 1px solid var(--line); }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 36px 24px 44px; display: flex; flex-direction: column; gap: 18px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; letter-spacing: 0.06em; }
.foot-brand .logo { width: 26px; height: 26px; border-radius: 7px; }
.foot-brand .logo img { width: 19px; height: 19px; }
.biz { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 12px; line-height: 1.7; color: var(--mute); }
.biz div { display: flex; gap: 6px; }
.biz dt { color: var(--mute); }
.biz dd { margin: 0; color: var(--sub); }
.biz a { color: var(--sub); text-decoration: none; }
.biz a:hover { color: var(--text); }
.copy { font-size: 12px; color: var(--mute); }
body[data-page="rag"] .foot { display: none; }  /* the chat fills the screen */

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.composer textarea:focus-visible, .ask input:focus-visible { outline: none; }

/* ---- page light: a hairline slit in the top bar's seam; warm white light falls on the grid
   behind the title and dies out before the input. The slit lights first, the grid a beat later.
   Shapes and strengths are measured from the reference capture (문서/배경.jpg). ---- */
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; width: min(1200px, 100%); height: 2px; margin: 0 auto; pointer-events: none;
  /* flat bright middle (about 110px), then a long thin tail along the seam */
  background: linear-gradient(90deg, transparent, rgba(255, 242, 230, 0.02) 1.3%, rgba(255, 242, 230, 0.075) 25.8%, rgba(255, 242, 230, 0.25) 39.5%, rgba(255, 242, 230, 0.36) 41.8%, rgba(255, 242, 230, 0.6) 44.2%, rgba(255, 242, 230, 0.84) 45.3%,
      rgba(255, 242, 230, 0.84) 54.7%, rgba(255, 242, 230, 0.6) 55.8%, rgba(255, 242, 230, 0.36) 58.2%, rgba(255, 242, 230, 0.25) 60.5%, rgba(255, 242, 230, 0.075) 74.2%, rgba(255, 242, 230, 0.02) 98.7%, transparent);
  animation: slit-on 0.9s var(--ease) both, slit-idle 6s ease-in-out 1.2s infinite alternate; }
@keyframes slit-on { from { opacity: 0; transform: scaleX(0.15); } to { opacity: 1; transform: none; } }
@keyframes slit-idle { from { opacity: 1; } to { opacity: 0.82; } }
.fall { position: absolute; left: 0; right: 0; top: 69px; height: 560px; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent);
  /* a soft bell falloff, shared by the three pools of light */
  --bell: #000, rgb(0 0 0 / 0.956) 10%, rgb(0 0 0 / 0.835) 20%, rgb(0 0 0 / 0.667) 30%, rgb(0 0 0 / 0.487) 40%, rgb(0 0 0 / 0.325) 50%, rgb(0 0 0 / 0.198) 60%, rgb(0 0 0 / 0.11) 70%, rgb(0 0 0 / 0.056) 80%, rgb(0 0 0 / 0.026) 90%, transparent; }
.fall i { left: 50%; transform: translateX(-50%); -webkit-mask-image: radial-gradient(closest-side, var(--bell)); mask-image: radial-gradient(closest-side, var(--bell));
  animation: light-on 1.6s ease-out 0.35s both; }
.fall i:nth-of-type(1) { top: -90px; width: 498px; height: 180px; background: rgb(255 204 140 / 0.145); }   /* bright core right under the slit */
.fall i:nth-of-type(2) { top: -87px; width: 1350px; height: 282px; background: rgb(255 218 145 / 0.099); }  /* spread just below it */
.fall i:nth-of-type(3) { top: -55px; width: 1704px; height: 414px; background: rgb(255 218 145 / 0.085); }  /* wide pool behind the title */
.fall b { left: 50%; top: 0; height: 100%; transform: translateX(-50%); background-size: 68px 68px; animation: light-on 1.4s ease-out 0.9s both; }
/* 34px cells near the light: every other line reaches far out, the lines between them stay near the middle */
.fall b:nth-of-type(1) { width: 1500px;
  background-image: linear-gradient(rgba(255, 236, 214, 0.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 236, 214, 0.022) 1px, transparent 1px);
  background-position: 50% -1px;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 78%), linear-gradient(90deg, transparent, #000 36%, #000 64%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(180deg, #000 30%, transparent 78%), linear-gradient(90deg, transparent, #000 36%, #000 64%, transparent); mask-composite: intersect; }
.fall b:nth-of-type(2) { width: 620px;
  background-image: linear-gradient(rgba(255, 236, 214, 0.046) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 236, 214, 0.046) 1px, transparent 1px);
  background-position: calc(50% + 34px) 33px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 68%), linear-gradient(90deg, transparent, #000 38%, #000 62%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(180deg, #000, transparent 68%), linear-gradient(90deg, transparent, #000 38%, #000 62%, transparent); mask-composite: intersect; }
@keyframes light-on { from { opacity: 0; } to { opacity: 1; } }
body[data-page="rag"] .fall { height: 240px; }  /* working screens: a shorter fall of light */

/* a soft silver glass band above the input */
.composer-wrap { --promo: linear-gradient(90deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.06)); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 40px 80px -40px rgba(0, 0, 0, 0.9); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.note.error { color: #F0764A; }
.danger-zone { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ghost.danger { color: #F0764A; border-color: rgba(240, 118, 74, 0.4); }
.ghost.danger:hover { background: rgba(240, 118, 74, 0.1); }
.legal { max-width: 760px; color: var(--body); font-size: 14px; line-height: 1.75; }
.legal h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.legal h2 { margin: 32px 0 8px; font-size: 16px; font-weight: 600; color: var(--text); }
.legal p, .legal ul { margin: 0 0 10px; }
.legal ul { padding-left: 20px; }
.legal li { margin: 0 0 4px; }
.legal .legal-date { color: var(--mute); font-size: 13px; }
.legal .md-table { margin: 10px 0 14px; overflow-x: auto; }
.legal table { width: 100%; border-collapse: collapse; font-size: 13px; }
.legal th, .legal td { padding: 9px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal th { color: var(--text); font-weight: 600; background: var(--surface); }
.copy a { color: inherit; }
.admin h2 { margin: 40px 0 6px; }
.grant-find { display: flex; gap: 8px; margin: 12px 0; }
.grant-find input, .grant-form input, .grant-form select { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.grant-find input { flex: 1; }
.grant-form { display: grid; grid-template-columns: 90px minmax(0, 320px); align-items: center; gap: 10px 12px; margin: 16px 0; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.grant-form .note, .grant-form .primary { grid-column: 1 / -1; justify-self: start; }
.grant-form label { font-size: 13px; color: var(--sub); }
.admin tr.picked td { background: var(--raise); }
.admin td small { color: var(--mute); font-size: 12px; }
#grant-accounts th, #grant-accounts td, #grant-log th, #grant-log td { text-align: left; }
