/* Kyvex account area. Uses the tokens, fonts and buttons from /style.css. */

body.app { min-height: 100vh; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.kmark { width: 22px; height: 24px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--strong); text-underline-offset: 3px; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.link:hover { text-decoration-color: var(--accent); }
.eyebrow-sm { font-size: 11px; color: var(--muted); margin: 0; }
.fine { font-size: 13px; color: var(--muted); margin-top: 16px; }
hr { border: 0; border-top: 1px solid var(--divider); margin: 6px 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }

/* Buttons that only exist here */
.btn { cursor: pointer; font-family: inherit; }
.btn-wide { width: 100%; justify-content: center; }
.btn-danger { background: transparent; color: #F87171; border-color: #5c2a2a; }
.btn-danger:hover { background: #1f1010; border-color: #F87171; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border: 2px solid var(--muted); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-primary.is-busy::after { border-color: #000; border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); background: var(--raised); border-color: var(--border); }

/* Loading */
.boot { min-height: 50vh; display: grid; place-items: center; }
.boot svg { width: 44px; height: 48px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }
.loading { display: flex; gap: 8px; justify-content: center; padding: 120px 0; }
.loading span { width: 8px; height: 8px; background: var(--strong); animation: dots 1s infinite; }
.loading span:nth-child(2) { animation-delay: .15s; } .loading span:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 30% { background: var(--accent); } }

/* Gate screens: sign in, link Discord, banned */
.gate { display: flex; justify-content: center; padding: 88px 16px 104px; }
.gate-card { width: 100%; max-width: 420px; padding: 40px 36px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; animation: fade .5s both; }
.gate-logo { display: inline-flex; margin-bottom: 28px; }
.gate-logo svg { width: 34px; height: 37px; }
.gate h1 { margin: 6px 0 10px; font-size: 28px; font-weight: 700; }
.gate .muted { font-size: 15px; }
.providers { display: grid; gap: 10px; margin-top: 28px; }
.gate-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; font-size: 15px; }
.gate-list li { display: flex; gap: 10px; align-items: center; }
.gate-list .i { width: 18px; height: 18px; color: var(--muted); }
.gate-back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.gate-back:hover { color: var(--text); }
.gate-back .i { width: 16px; height: 16px; }

.notice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: 16px 0; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--inset); }
.notice.tone-bad { border-color: #5c2a2a; color: #F87171; }
.notice .i { width: 18px; height: 18px; }

/* Under the site's top bar: the profile (or admin) header, then the pinned tab row */
.ahead { border-bottom: 1px solid var(--divider); background: var(--dots); }
.ahead[hidden], .atabs[hidden] { display: none; }
.ahead-in { display: flex; align-items: center; gap: 22px; padding-top: 44px; padding-bottom: 36px; animation: fade .4s both; }
.ahead-in .avatar { border: 1px solid var(--strong); }
.ahead-text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ahead-text h1 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.ahead-text .muted { font-size: 14px; }
.ahead-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ahead-badge { display: grid; place-items: center; width: 72px; height: 72px; border: 1px solid #5c4710; border-radius: 18px; background: #17140b; color: #FBBF24; flex: none; }
.ahead-badge .i { width: 30px; height: 30px; }
.atabs { position: sticky; top: 64px; z-index: 9; background: rgba(0, 0, 0, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--divider); }
.subtabs { display: flex; align-items: stretch; height: 52px; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: -14px; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { position: relative; display: flex; align-items: center; padding: 0 14px; font-size: 14px; color: var(--muted); white-space: nowrap; transition: color .2s; }
.subtabs a:hover, .subtabs a[aria-current] { color: var(--text); }
.subtabs a::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--strong); transform: scaleX(0); transition: transform .25s var(--ease); }
.subtabs a:hover::after { transform: scaleX(1); }
.subtabs a[aria-current]::after { background: var(--accent); transform: scaleX(1); }
.app-main { min-height: 60vh; }
.view { padding-top: 40px; padding-bottom: 104px; }
.view.enter > * { animation: fade .35s both; }
.view.enter > *:nth-child(2) { animation-delay: .04s; } .view.enter > *:nth-child(3) { animation-delay: .08s; } .view.enter > *:nth-child(4) { animation-delay: .12s; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--raised); border: 1px solid var(--border); }
.avatar-letter { display: inline-grid; place-items: center; font-weight: 700; color: var(--text); }
.who { display: inline-flex; align-items: center; gap: 8px; }
.menu { position: fixed; z-index: 50; display: grid; gap: 2px; padding: 6px; background: var(--panel); border: 1px solid var(--strong); border-radius: 12px; }

/* Page parts */
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.back:hover { color: var(--text); }
.back .i { width: 16px; height: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { margin: 6px 0 0; font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; letter-spacing: -.01em; }
.page-head .muted { margin-top: 6px; font-size: 14px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub-head { font-size: 18px; margin: 36px 0 14px; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--divider); }
.panel-head h2 { font-size: 16px; margin: 0; }
.panel-head .link { font-size: 13px; color: var(--muted); }
.panel-empty { padding: 32px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 72px 24px; border: 1px dashed var(--strong); border-radius: 14px; }
.empty > .i { width: 32px; height: 32px; color: var(--muted); margin-bottom: 6px; }
.empty h2 { font-size: 20px; margin: 0; }
.empty p { max-width: 30em; margin: 0 0 8px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stats-2 { grid-template-columns: repeat(2, 1fr); margin-bottom: 20px; }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stat { display: grid; gap: 6px; padding: 20px 22px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; transition: border-color .2s, transform .2s; }
a.stat:hover { border-color: var(--strong); transform: translateY(-2px); }
.stat .mono { font-size: 10px; color: var(--muted); }
.stat strong { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat .muted { font-size: 13px; }
.stat-warn strong { color: #FBBF24; }
.stat-accent { border-color: #155e6b; }
.stat-accent strong { color: var(--accent); }

/* Rows and lists */
.rows { display: grid; }
.row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--divider); transition: background .15s; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--raised); }
button.row { width: 100%; border: 0; border-bottom: 1px solid var(--divider); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; grid-template-columns: 1fr auto auto; }
button.row:hover { background: var(--raised); }
.page-note { margin: -8px 0 20px; font-size: 14px; }
.row-static { grid-template-columns: auto 1fr auto auto; }
.row-id { font-size: 12px; color: var(--muted); min-width: 44px; }
.row-title { display: grid; gap: 2px; min-width: 0; font-weight: 600; font-size: 15px; }
.row-title small { font-weight: 400; font-size: 13px; }
.row time { font-size: 12px; }
.prov { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--inset); }

.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid; }
.tone-muted { color: var(--muted); border-color: var(--strong); }
.tone-info { color: #60A5FA; border-color: #1e3a5f; }
.tone-warn { color: #FBBF24; border-color: #5c4710; }
.tone-ok { color: #4ADE80; border-color: #1d5233; }
.tone-bad { color: #F87171; border-color: #5c2a2a; }
.tone-accent { color: var(--accent); border-color: #155e6b; }
.tag { font-size: 9px; padding: 2px 6px; border: 1px solid var(--strong); border-radius: 4px; color: var(--muted); }
.tag-note { color: #FBBF24; border-color: #5c4710; }

.acts { display: grid; }
.act { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--divider); font-size: 14px; }
.act:last-child { border-bottom: 0; }
a.act:hover { background: var(--raised); }
.act .i { width: 18px; height: 18px; color: var(--muted); }
.act-text { min-width: 0; overflow-wrap: anywhere; }
.act time { font-size: 11px; color: var(--muted); }
.audit-row { position: relative; border-bottom: 1px solid var(--divider); }
.audit-row .act { border-bottom: 0; padding-bottom: 4px; }
.audit-subject { display: block; padding: 0 22px 12px 54px; font-size: 12px; color: var(--muted); }
.more-row { display: flex; justify-content: center; margin-top: 20px; }

/* Tabs, toolbars, search */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--inset); border: 1px solid var(--border); border-radius: 10px; width: fit-content; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .tabs { margin-bottom: 0; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--muted); font-size: 14px; font-weight: 600; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--raised); color: var(--text); border-color: var(--strong); }
.tab .mono { font-size: 11px; color: var(--muted); }
.search { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; background: var(--inset); border: 1px solid var(--border); border-radius: 10px; min-width: min(340px, 100%); }
.search:focus-within { border-color: var(--strong); }
.search .i { color: var(--muted); width: 18px; height: 18px; }
.search input { flex: 1; background: none; border: 0; color: var(--text); font: inherit; font-size: 14px; outline: none; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 700 10px 'JetBrains Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 14px 22px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
.table td { padding: 14px 22px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--raised); }
.table .num { text-align: right; }
.act-cell { text-align: right; white-space: nowrap; }

/* Forms */
.form { display: grid; gap: 20px; }
.form-section { padding: 28px; display: grid; gap: 20px; }
.form-section > header { display: flex; gap: 16px; align-items: flex-start; }
.form-section h2 { font-size: 18px; margin: 0 0 4px; }
.form-section h2 em { font-style: normal; font-weight: 400; font-size: 14px; }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--strong); border-radius: 9px; font-size: 12px; color: var(--muted); flex: none; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; position: relative; }
.field > span, .field > legend { font-size: 13px; font-weight: 600; padding: 0; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input:not([type=radio]):not([type=checkbox]), .field textarea, .field select, .composer textarea {
  width: 100%; padding: 12px 14px; background: var(--inset); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font: inherit; font-size: 15px; outline: none; transition: border-color .15s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus, .composer textarea:focus { border-color: #4a4a4a; }
.field input::placeholder, .field textarea::placeholder, .composer textarea::placeholder { color: #5c5c5c; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238F8F8F' stroke-width='2' stroke-linecap='square'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.field input[type=date] { color-scheme: dark; }
.field input[type=file] { padding: 10px; font-size: 14px; }
.field-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.field-half { max-width: 280px; }
.counter { position: absolute; right: 12px; bottom: 10px; font-size: 10px; color: var(--muted); }
.money-input { display: flex; align-items: center; background: var(--inset); border: 1px solid var(--border); border-radius: 10px; padding-left: 14px; }
.money-input span { color: var(--muted); }
.field .money-input input { border: 0; background: none; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice input, .pill input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: grid; gap: 4px; height: 100%; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--inset); cursor: pointer; transition: border-color .15s, background .15s; }
.choice span .i { margin-bottom: 8px; color: var(--muted); }
.choice strong { font-size: 14px; }
.choice small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.choice span:hover { border-color: var(--strong); }
.choice input:checked + span { border-color: var(--accent); background: var(--raised); }
.choice input:checked + span .i { color: var(--accent); }
.choice input:focus-visible + span, .pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill span { display: inline-flex; height: 38px; align-items: center; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--inset); font-size: 14px; cursor: pointer; transition: border-color .15s; }
.pill span:hover { border-color: var(--strong); }
.pill input:checked + span { border-color: var(--text); background: var(--raised); }
.drop { display: grid; justify-items: center; gap: 6px; padding: 32px; border: 1px dashed var(--strong); border-radius: 12px; background: var(--inset); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--panel); }
.drop .i { width: 26px; height: 26px; color: var(--muted); }
.drop .muted { font-size: 13px; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.file-list:empty { display: none; }
.file-list li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 8px 8px 8px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.file-list li > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .mono { font-size: 11px; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.form-foot .muted { font-size: 13px; }
.inline-form { display: flex; align-items: flex-end; gap: 12px; margin-top: 20px; max-width: 520px; }
.inline-form .field { flex: 1; }
.inline-form .btn { height: 48px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.toggle input { accent-color: #FBBF24; }

/* Commission page */
.detail-head { margin-bottom: 20px; }
.progress { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 0 0 24px; padding: 0; }
.progress li { display: grid; gap: 8px; font-size: 12px; color: var(--muted); }
.progress li span { height: 4px; border-radius: 2px; background: var(--border); }
.progress li.done span { background: var(--muted); }
.progress li.now { color: var(--text); font-weight: 600; }
.progress li.now span { background: var(--accent); }
.detail { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.thread-panel { display: flex; flex-direction: column; height: calc(100vh - 240px); min-height: 520px; position: sticky; top: 140px; }
.thread { flex: 1; overflow-y: auto; padding: 22px; display: grid; gap: 18px; align-content: start; scroll-behavior: smooth; }
.brief { padding: 18px 20px; background: var(--inset); border: 1px solid var(--divider); border-radius: 12px; }
.brief p.pre { margin-top: 10px; font-size: 15px; }
.msg { display: flex; gap: 12px; align-items: flex-start; animation: fade .25s both; }
.msg-self { flex-direction: row-reverse; }
.bubble { max-width: 78%; padding: 12px 16px; background: var(--raised); border: 1px solid var(--border); border-radius: 14px; border-top-left-radius: 4px; }
.msg-self .bubble { border-top-left-radius: 14px; border-top-right-radius: 4px; background: #14181a; border-color: #1f2a2e; }
.msg-internal .bubble { background: #17140b; border-color: #3d3010; border-style: dashed; }
.bubble-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; flex-wrap: wrap; }
.bubble-head time { font-size: 10px; color: var(--muted); margin-left: auto; }
.bubble p { font-size: 15px; line-height: 1.55; }
.msg-system { align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding: 0 6px; }
.msg-system .i { width: 16px; height: 16px; }
.msg-system > span { flex: 1; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.msg-system strong { color: var(--text); font-weight: 600; }
.msg-system time { font-size: 10px; }
.quote { display: grid; gap: 8px; justify-items: start; padding: 18px 20px; border: 1px solid var(--strong); border-radius: 12px; background: var(--inset); }
.quote-top { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.quote-amount { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.quote p { color: var(--muted); font-size: 14px; }
.quote time { font-size: 11px; }
.composer { border-top: 1px solid var(--divider); padding: 14px; display: grid; gap: 10px; }
.composer textarea { resize: none; min-height: 48px; max-height: 220px; }
.composer-bar { display: flex; align-items: center; gap: 12px; }
.composer-hint { font-size: 12px; margin-left: auto; }
.aside { display: grid; gap: 16px; }
.aside-card { padding: 18px 20px; display: grid; gap: 12px; }
.aside-card h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 0; }
.aside-card h3 .i { width: 16px; height: 16px; color: var(--muted); }
.staff-card { border-color: #3d3010; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv span { color: var(--muted); }
.kv strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.kv a { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aside-files, .aside-inv { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.aside-files li { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; }
.aside-files .link { display: inline-flex; align-items: center; gap: 6px; min-width: 0; text-decoration: none; }
.aside-files .link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aside-files .link:hover span { text-decoration: underline; }
.aside-files .i { width: 15px; height: 15px; color: var(--muted); }
.aside-files .mono { font-size: 10px; flex: none; }
.aside-inv li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--divider); border-radius: 10px; }
.aside-inv li > div { display: grid; flex: 1; min-width: 0; }
.aside-inv .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Products (your account) */
.product-title { display: flex; gap: 18px; align-items: center; }
.product-title .kmark { width: 40px; height: 44px; }
.product-title h1 { font-weight: 800; }
.release { padding: 26px 28px; }
.release-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.release-head h2 { font-size: 28px; margin: 6px 0 2px; }
.changelog { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--divider); font-size: 15px; color: #cfcfcf; line-height: 1.7; }
.version { border-bottom: 1px solid var(--divider); }
.version:last-child { border-bottom: 0; }
.version summary { display: grid; grid-template-columns: 90px 1fr auto auto; gap: 16px; align-items: center; padding: 14px 22px; cursor: pointer; list-style: none; }
.version summary::-webkit-details-marker { display: none; }
.version summary:hover { background: var(--raised); }
.version .changelog, .version > .small { margin: 0 22px 18px; padding-top: 14px; }
.admin-product { margin-bottom: 16px; }

/* Settings */
.settings-block { padding: 26px 28px; margin-bottom: 20px; }
.settings-block > header { margin-bottom: 18px; }
.settings-block h2 { font-size: 18px; margin: 0 0 4px; }
.settings-block .rows { border: 1px solid var(--divider); border-radius: 12px; }
.settings-block .row { padding: 14px 16px; }
.settings-split { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.profile-row { display: flex; gap: 18px; align-items: center; }
.profile-row .big { font-size: 20px; }
.user-head { display: flex; gap: 18px; align-items: center; }

/* Dialogs and toasts */
.dialog-back { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .72); animation: fade-in .15s both; }
.dialog-back.leaving { animation: fade-out .2s both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.dialog { width: 100%; max-width: 460px; padding: 28px; background: var(--panel); border: 1px solid var(--strong); border-radius: 16px; display: grid; gap: 16px; animation: pop .2s both; }
.dialog h2 { font-size: 20px; margin: 0; }
.dialog form { display: grid; gap: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.dialog-actions .sp { flex: 1; }
.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 40%; background: var(--accent); animation: slide-bar 1.2s ease-in-out infinite; }
@keyframes slide-bar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--raised); border: 1px solid var(--strong); border-radius: 12px; font-size: 14px; max-width: 380px; animation: pop .2s both; }
.toast .i { width: 18px; height: 18px; }
.toast.tone-ok .i { color: #4ADE80; }
.toast.tone-bad { border-color: #5c2a2a; }
.toast.tone-bad .i { color: #F87171; }
.toast.leaving { animation: fade-out .3s both; }
.noscript { padding: 40px; text-align: center; }

/* Responsive */
@media (max-width: 1100px) {
  .detail { grid-template-columns: 1fr; }
  .thread-panel { position: static; height: 70vh; }
  .stats-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stats-2 { grid-template-columns: 1fr 1fr; }
  .stat { padding: 14px; gap: 4px; }
  .stat strong { font-size: 20px; }
  .stat .mono { font-size: 9px; letter-spacing: .08em; }
  .stat .muted { font-size: 11px; }
  .stats-4 { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .row { grid-template-columns: auto 1fr auto; }
  .row time { display: none; }
  .composer-hint { display: none; }
  .composer-bar .btn { margin-left: auto; }
  .bubble { max-width: 88%; }
  .progress { grid-template-columns: repeat(6, 1fr); font-size: 0; }
  .progress li { font-size: 0; }
  .progress li.now { font-size: 12px; grid-column: span 1; white-space: nowrap; }
  .version summary { grid-template-columns: 70px 1fr auto; }
  .version summary > .mono.muted { display: none; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .gate-card { padding: 32px 24px; }
  .view { padding-top: 28px; padding-bottom: 72px; }
  #toasts { left: 16px; right: 16px; bottom: 16px; }
  .ahead-in { flex-wrap: wrap; padding-top: 32px; padding-bottom: 28px; gap: 16px; }
  .ahead-actions { width: 100%; }
  .ahead-actions .btn { flex: 1; }
  .thread-panel { height: 75vh; }
}

/* Admin: product list and editor */
.ap-name { display: flex; align-items: center; gap: 14px; }
.ap-name img, .ap-noimg { width: 72px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex: none; }
.ap-noimg { display: grid; place-items: center; background: var(--inset); color: var(--muted); }
.ap-noimg .i { width: 18px; height: 18px; }
.editor { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.editor-side { position: sticky; top: 140px; display: grid; gap: 14px; }
.editor-label { margin-top: 6px; }
.editor-preview .pc { animation: none; pointer-events: none; }
.prefix-input { display: flex; align-items: center; background: var(--inset); border: 1px solid var(--border); border-radius: 10px; padding-left: 14px; overflow: hidden; }
.prefix-input .mono { font-size: 12px; color: var(--muted); white-space: nowrap; letter-spacing: .02em; }
.field .prefix-input input { border: 0; background: none; padding-left: 2px; }
.field input[readonly] { color: var(--muted); }
.seg-fit { width: fit-content; min-width: 300px; }
.md-tabs { margin-bottom: -8px; }
.md-input { font-family: 'JetBrains Mono', monospace !important; font-size: 14px !important; line-height: 1.7 !important; min-height: 280px; }
.md-preview { min-height: 280px; padding: 16px 18px; background: var(--inset); border: 1px solid var(--border); border-radius: 10px; }
.feature-edit { display: grid; gap: 8px; }
.feature-row { display: flex; align-items: center; gap: 10px; }
.feature-row .drag-dot { color: var(--accent); display: grid; }
.feature-row .drag-dot .i { width: 18px; height: 18px; }
.feature-row input { flex: 1; }
.tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 50px; padding: 8px 10px; background: var(--inset); border: 1px solid var(--border); border-radius: 10px; cursor: text; }
.tag-input:focus-within { border-color: #4a4a4a; }
.tag-input .tag-chip { gap: 4px; padding-right: 4px; cursor: default; }
.tag-input .tag-chip button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; background: none; color: inherit; padding: 0; }
.tag-input .tag-chip .i { width: 12px; height: 12px; }
.field .tag-input input { flex: 1; min-width: 140px; border: 0; background: none; padding: 6px 4px; }
.drop-cover { width: 100%; aspect-ratio: 16 / 9; align-content: center; font: inherit; color: var(--text); }
.cover-edit { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--inset); }
.cover-edit img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-actions { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; }
.cover-actions .btn { background: rgba(0, 0, 0, .8); }
.gallery-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.g-item { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--inset); cursor: grab; transition: opacity .15s, border-color .15s; }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.g-item.dragging { opacity: .4; }
.g-item.over { border-color: var(--accent); }
.g-remove { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; background: rgba(0, 0, 0, .8); color: var(--text); }
.g-n { position: absolute; left: 6px; bottom: 6px; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, .8); color: var(--muted); }
.g-add { aspect-ratio: 16 / 9; display: grid; place-items: center; align-content: center; gap: 4px; border: 1px dashed var(--strong); border-radius: 10px; background: var(--inset); color: var(--muted); font: 600 13px 'Sora', sans-serif; cursor: pointer; }
.g-add:hover { border-color: var(--accent); color: var(--text); }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { flex: none; position: relative; width: 38px; height: 22px; margin-top: 2px; border-radius: 999px; background: var(--strong); transition: background .2s; }
.switch > span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: #000; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch div { display: grid; gap: 2px; font-size: 14px; }
.switch small { font-size: 12px; }
.danger-zone { border-color: #5c2a2a; }
.danger-zone .step-n { color: #F87171; border-color: #5c2a2a; }
.cat-admin { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.cat-admin-row { display: flex; align-items: center; gap: 8px; }
.cat-admin-row input, .cat-add input { flex: 1; padding: 10px 12px; background: var(--inset); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font: inherit; font-size: 14px; outline: none; }
.cat-admin-row .mono { font-size: 11px; min-width: 20px; text-align: right; }
.cat-add { display: flex !important; grid-template-columns: none; gap: 8px; align-items: center; }
.product-thumb { width: 120px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); flex: none; background: var(--inset); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumb svg { width: 30px; height: 33px; }
@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .editor-side { position: static; order: -1; }
  .editor-preview { max-width: 380px; }
}

/* Overview */
.greeting { font-size: 18px; color: var(--muted); margin-bottom: 18px; }
.greeting strong { color: var(--text); }
.next { display: flex; align-items: center; gap: 22px; padding: 26px 28px; margin-bottom: 20px; background: var(--panel) var(--dots); border: 1px solid var(--border); border-radius: 18px; }
.next-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--strong); background: var(--inset); flex: none; }
.next-icon .i { width: 26px; height: 26px; }
.next-warn { border-color: #5c4710; } .next-warn .next-icon { color: #FBBF24; border-color: #5c4710; }
.next-accent { border-color: #155e6b; } .next-accent .next-icon { color: var(--accent); border-color: #155e6b; }
.next-ok .next-icon { color: #4ADE80; border-color: #1d5233; }
.next-text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.next-text .mono { font-size: 10px; color: var(--muted); }
.next-text h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.next-text .muted { font-size: 14px; }
.cols-wide { grid-template-columns: 1fr 320px; align-items: start; }
.panel-head-mid { border-top: 1px solid var(--divider); }
.quick { display: grid; gap: 10px; }
.quick .eyebrow-sm { margin-bottom: 2px; }
.quick-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; transition: border-color .2s; }
.quick-link:hover { border-color: var(--strong); }
.quick-link > span:nth-child(2) { flex: 1; display: grid; gap: 2px; min-width: 0; }
.quick-link strong { font-size: 14px; }
.quick-link small { font-size: 12px; }
.quick-go { width: 16px; height: 16px; color: var(--muted); transition: transform .2s var(--ease), color .2s; }
.quick-link:hover .quick-go { transform: translateX(3px); color: var(--text); }
@media (max-width: 1100px) { .cols-wide { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .next { flex-wrap: wrap; padding: 22px; }
  .next-action { width: 100%; }
  .next-action .btn { width: 100%; }
}
.team-form { display: grid; gap: 16px; }

/* Admin: docs, showcase and reviews */
.admin-group { margin-bottom: 16px; }
.field-row-3 { grid-template-columns: 2fr 1.4fr .6fr; }
.md-box { display: grid; gap: 10px; }
.md-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.md-bar .tabs { margin: 0; }
.admin-reviews { display: grid; gap: 14px; }
.admin-review { display: grid; gap: 10px; }
.admin-review.is-hidden .review { opacity: .5; border-style: dashed; }
.admin-review-actions { display: flex; align-items: center; gap: 8px; }
.admin-review-actions .small { margin-left: auto; }
.review-card .stars svg { width: 15px; height: 15px; }
@media (max-width: 860px) { .field-row-3 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------------------------------- */
/* The writing editor (editor.js) */

.ed { position: relative; display: grid; border: 1px solid var(--border); border-radius: 14px; background: var(--inset); overflow: hidden; transition: border-color .15s; }
.ed:focus-within { border-color: #3d3d3d; }
.ed.ed-drop { border-color: var(--accent); border-style: dashed; }
.ed-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: var(--panel); border-bottom: 1px solid var(--divider); }
.ed-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.ed-btn { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); font: 700 13px 'Sora', sans-serif; cursor: pointer; transition: color .12s, background .12s, border-color .12s; }
.ed-btn:hover { color: var(--text); background: var(--raised); border-color: var(--border); }
.ed-btn:active { transform: translateY(1px); }
.ed-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.ed-btn b, .ed-btn i, .ed-btn s { font-size: 14px; line-height: 1; }
.ed-sep { width: 1px; height: 20px; margin: 0 6px; background: var(--border); }
.ed-modes { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--inset); }
.ed-modes button[data-mode] { padding: 5px 12px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--muted); font: 600 13px 'Sora', sans-serif; cursor: pointer; }
.ed-modes button[data-mode]:hover { color: var(--text); }
.ed-modes button[data-mode].on { color: var(--text); background: var(--raised); border-color: var(--strong); }
.ed-modes .ed-btn { min-width: 30px; height: 30px; }
.ed-panes { display: grid; grid-template-columns: 1fr; }
.ed[data-mode="split"] .ed-panes { grid-template-columns: 1fr 1fr; }
.ed-input { width: 100%; min-height: var(--ed-min, 320px); padding: 20px 22px; border: 0; outline: none; resize: none; background: transparent; color: var(--text); font: 400 14.5px/1.75 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0; tab-size: 2; overflow: hidden; }
.ed-input::placeholder { color: #555; font-family: 'Sora', sans-serif; }
.ed-preview { min-height: var(--ed-min, 320px); padding: 20px 26px; background: var(--panel); overflow-y: auto; }
.ed[data-mode="write"] .ed-preview { display: none; }
.ed[data-mode="preview"] .ed-input { display: none; }
.ed[data-mode="split"] .ed-preview { border-left: 1px solid var(--divider); }
.ed-foot { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--divider); background: var(--panel); font-size: 12px; color: var(--muted); }
.ed-foot .mono { font-size: 10px; }
.ed-hint { flex: 1; }
.ed-help-btn { border: 0; background: none; color: var(--muted); font: 600 12px 'Sora', sans-serif; cursor: pointer; text-decoration: underline; text-decoration-color: var(--strong); text-underline-offset: 3px; }
.ed-help-btn:hover { color: var(--text); }
.ed-help { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 18px; padding: 14px 16px; border-top: 1px solid var(--divider); background: var(--inset); font-size: 13px; }
.ed-help[hidden] { display: none; }
.ed-help div { display: flex; justify-content: space-between; gap: 12px; }
.ed-help code { font: 12px 'JetBrains Mono', monospace; color: var(--text); }
.ed-help span { color: var(--muted); }
/* Full screen: the editor fills the window, split view by default. */
.ed.ed-full { position: fixed; inset: 0; z-index: 400; border-radius: 0; border: 0; grid-template-rows: auto 1fr auto auto; }
.ed.ed-full .ed-panes { min-height: 0; }
.ed.ed-full .ed-input { height: 100% !important; min-height: 0; overflow-y: auto; }
.ed.ed-full .ed-preview { max-height: none !important; height: 100%; }
.ed.ed-full .ed-input, .ed.ed-full .ed-preview { padding: 32px max(32px, 6vw); }
body.ed-lock { overflow: hidden; }
@media (max-width: 900px) {
  .ed[data-mode="split"] .ed-panes { grid-template-columns: 1fr; }
  .ed[data-mode="split"] .ed-preview { border-left: 0; border-top: 1px solid var(--divider); }
  .ed-hint { display: none; }
}

/* Inputs inside a combined field (address prefix, price, tags) have no box of their own. */
.field .prefix-input input:not([type=radio]):not([type=checkbox]), .field .money-input input:not([type=radio]):not([type=checkbox]), .field .tag-input input:not([type=radio]):not([type=checkbox]) { border: 0; background: none; border-radius: 0; }

/* Support tickets */
.support-note { margin: -12px 0 20px; font-size: 14px; }
.choice-grid-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--inset); color: var(--text); font: 13px 'Sora', sans-serif; cursor: pointer; }
.file-chip:hover { border-color: var(--strong); }
.file-chip .i { width: 14px; height: 14px; color: var(--muted); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.file-chip em { font-style: normal; font-size: 10px; color: var(--muted); }
.rate-note { width: 100%; padding: 10px 12px; background: var(--inset); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font: inherit; font-size: 14px; resize: vertical; outline: none; }

/* Product editor: requires / includes lists */
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--inset); max-height: 240px; overflow-y: auto; }
.pick-list em { font-style: normal; font-size: 9px; }
.owned-group { display: grid; gap: 12px; margin-bottom: 28px; }
.owned-group .pgrid-public { grid-template-columns: minmax(0, 420px); }
.owned-addons { margin-bottom: 8px; }
