/* Kyoto - monochrome dashboard theme. The Discord-style preview at the end is intentionally in colour. */
:root {
  --bg: #000;
  --panel: rgba(12, 12, 12, .78);
  --panel-solid: #0c0c0c;
  --panel-2: #151515;
  --line: #222;
  --line-2: #333;
  --text: #f4f4f4;
  --muted: #8c8c8c;
  --dim: #7a7a7a;
  --accent: #fff;
  --ink: #000;
  --radius: 4px;
  --mono: 'JetBrains Mono', 'Cascadia Code', ui-monospace, Consolas, monospace;
  --sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --label: #d2d2d2;
  --ok: #3ddc97;
  --warn: #f0b429;
  --err: #ff6b6b;
  --discord-bg: #313338;
  --discord-embed: #2b2d31;
  font-family: var(--sans);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-underline-offset: 3px; text-decoration-color: #555; }
a:hover { text-decoration-color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #fff; color: #000; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #262626; border: 3px solid transparent; background-clip: padding-box; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background-color: #3a3a3a; }

/* ───── Background: dithered noise shader (canvas, see js/bg.js) + vignette ───── */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; image-rendering: pixelated;
  -webkit-mask-image: linear-gradient(#000 0%, #000 50%, rgba(0, 0, 0, .45) 100%); mask-image: linear-gradient(#000 0%, #000 50%, rgba(0, 0, 0, .45) 100%); }
.vignette { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 30%, transparent 45%, rgba(0, 0, 0, .55) 100%); }

/* ───── Layout shell ───── */
#app { position: relative; z-index: 1; display: grid; grid-template-columns: 256px 1fr; height: 100vh; }
#sidebar { border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px 14px; gap: 14px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; font-family: var(--mono); font-weight: 700; font-size: 16px; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark { width: 18px; height: 18px; border: 1.5px solid var(--text); position: relative; flex: none; }
.brand-mark::after { content: ''; position: absolute; inset: 3px; background: var(--text); animation: blink 2.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
#nav { display: flex; flex-direction: column; gap: 1px; }
#nav .nav-group { font-family: var(--mono); font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .16em; padding: 14px 10px 6px; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; color: var(--muted); text-decoration: none; cursor: pointer; border-radius: var(--radius); border: 1px solid transparent; transition: color .15s, background .15s; }
#nav a .n { font-family: var(--mono); font-size: 11.5px; color: var(--dim); width: 16px; }
#nav a:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
#nav a.active { color: var(--ink); background: var(--accent); }
#nav a.active .n { color: #666; }
.me { margin-top: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.me img { width: 26px; height: 26px; border-radius: 50%; filter: grayscale(1); }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me button { margin-left: auto; }
.legal-links { display: flex; gap: 14px; padding: 8px 6px 0; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.legal-links a { color: var(--dim); text-decoration: none; }
.legal-links a:hover { color: var(--text); }
#main { overflow: auto; padding: 32px 36px 80px; }
#main > * { animation: rise .35s ease-out backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ───── Typography ───── */
h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; letter-spacing: -.005em; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 10px; color: var(--label); }
.label-mono { font-family: var(--mono); font-size: 11.5px; font-weight: 500; margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.eyebrow { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--muted); }
.sub { color: var(--muted); margin: 0 0 24px; max-width: 760px; line-height: 1.55; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.page-head { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.page-head > :first-child { flex: 1; min-width: 260px; }

/* ───── Grid layouts ───── */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid { display: grid; gap: 14px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.two { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.three { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.mt { margin-top: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; backdrop-filter: blur(6px); position: relative; }
.card.flat { background: var(--panel-2); backdrop-filter: none; }
/* Card corner marks - a signature detail of the grid style */
.card.corners::before, .card.corners::after { content: ''; position: absolute; width: 8px; height: 8px; border: 1px solid var(--muted); pointer-events: none; }
.card.corners::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.card.corners::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.stat .label { font-family: var(--mono); color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; }
.stat .value { font-size: 30px; font-weight: 600; margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 13px; margin-top: 4px; color: var(--muted); }
.up::before { content: '▲ '; font-size: 10.5px; } .down::before { content: '▼ '; font-size: 10.5px; }
.up, .down { color: var(--text) !important; }
.chart-box { position: relative; height: 260px; }
.empty { color: var(--muted); padding: 40px; text-align: center; }
.empty.small { padding: 18px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ───── Module tiles on the overview ───── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: border-color .2s, transform .2s; min-height: 160px; }
.tile:hover { border-color: var(--muted); }
.tile .t-head { display: flex; align-items: center; gap: 8px; }
.tile .t-num { font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.tile .t-name { font-weight: 600; font-size: 16px; flex: 1; }
.tile .t-metric { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .t-desc { color: var(--muted); font-size: 13.5px; line-height: 1.5; flex: 1; }
.tile .t-go { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.tile:hover .t-go { color: var(--text); }
.status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--muted); }
.status.on { color: var(--text); }
.status.on::before { background: var(--text); border-color: var(--text); box-shadow: 0 0 8px rgba(255, 255, 255, .6); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line-2); padding: 5px 10px; border-radius: 99px; color: var(--muted); background: rgba(0, 0, 0, .5); }
.chip b { color: var(--text); font-weight: 500; }
.hero { display: flex; align-items: center; gap: 18px; }
.hero img, .hero .ph { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line-2); filter: grayscale(1); }
.hero .ph { background: #111; display: grid; place-items: center; font-family: var(--mono); font-size: 22px; }

/* ───── Form controls ───── */
input[type=text], input[type=url], input[type=number], input[type=search], input[type=datetime-local], input:not([type]), select, textarea {
  background: rgba(0, 0, 0, .6); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px 10px; width: 100%; outline: none; transition: border-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: #444; }
input:focus, select:focus, textarea:focus { border-color: var(--text); }
select option, select optgroup { background: #0c0c0c; }
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
textarea.code { font-family: var(--mono); font-size: 13.5px; min-height: 380px; }
input[type=color] { width: 42px; height: 36px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #000; }
input[type=checkbox] { appearance: none; width: 30px; height: 16px; border: 1px solid #555; border-radius: 99px; position: relative; cursor: pointer; flex: none; background: #000; transition: background .15s, border-color .15s; margin: 0; }
input[type=checkbox]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
input[type=checkbox]:checked { background: var(--text); border-color: var(--text); }
input[type=checkbox]:checked::after { transform: translateX(14px); background: #000; }
input[type=range] { width: 100%; accent-color: #fff; }
label.field, div.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--label); }
label.field > input, label.field > select, label.field > textarea, label.field > div, div.field > div { font-size: 15px; font-weight: 400; color: var(--text); }
label.field .hint, div.field .hint { font-size: 13px; font-weight: 400; color: var(--muted); }
label.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text); }
/* Picking items from a list uses square boxes; switches are only for turning a setting on or off */
label.check.box input[type=checkbox] { width: 18px; height: 18px; border-radius: 4px; }
label.check.box input[type=checkbox]::after { top: 2px; left: 5.5px; width: 5px; height: 9px; border-radius: 0; background: transparent; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); }
label.check.box input[type=checkbox]:checked::after { transform: rotate(45deg) scale(1); background: transparent; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.counter { font-size: 12px; color: var(--muted); text-align: right; font-family: var(--mono); }
.counter.over { color: var(--text); text-decoration: underline wavy; }

/* ───── Buttons ───── */
.btn { background: transparent; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 500; }
.btn.primary:hover { background: #d6d6d6; border-color: #d6d6d6; }
.btn.danger { border-style: dashed; color: var(--muted); }
.btn.danger:hover { color: var(--ink); background: var(--text); border-style: solid; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn:disabled { opacity: .4; cursor: default; }
.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: rgba(0, 0, 0, .5); }
.segmented button { background: transparent; border: 0; padding: 6px 12px; cursor: pointer; color: var(--muted); font-size: 14px; }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--accent); color: var(--ink); }

/* ───── Tables and lists ───── */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-family: var(--mono); color: var(--muted); font-weight: 400; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; } tr.clickable:hover, tbody tr:hover { background: rgba(255, 255, 255, .03); }
.scroll { max-height: 380px; overflow: auto; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.bar { height: 4px; background: #1c1c1c; overflow: hidden; }
.bar > div { height: 100%; background: var(--text); transition: width .4s; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); }
.tag.solid { background: var(--text); color: var(--ink); border-color: var(--text); }
.tag a { text-decoration: none; color: inherit; }
.user { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.user img, .user .av { width: 24px; height: 24px; border-radius: 50%; filter: grayscale(1); flex: none; background: #222; }
.user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user.gone span { color: var(--dim); text-decoration: line-through; }
.rank { font-family: var(--mono); color: var(--dim); width: 36px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.list-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; background: rgba(0, 0, 0, .4); }
.list-item.selected { border-color: var(--text); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.kv dd { margin: 0; }

/* ───── Message editor ───── */
.editor { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(380px, 1fr); gap: 20px; align-items: start; }
.editor-form { display: flex; flex-direction: column; gap: 12px; }
.preview-wrap { position: sticky; top: 0; }
details.block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(6px); }
details.block > summary { padding: 12px 14px; cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
details.block > summary::-webkit-details-marker { display: none; }
details.block > summary::before { content: '+'; font-family: var(--mono); color: var(--muted); width: 12px; }
details.block[open] > summary::before { content: '−'; }
details.block > .inner { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.embed-color-strip { width: 4px; align-self: stretch; border-radius: 2px; }
.field-item { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.problems { border: 1px dashed var(--text); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; white-space: pre-wrap; margin-bottom: 10px; }
.problems:empty { display: none; }

/* ───── Toasts and dialogs ───── */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: #0c0c0c; border: 1px solid var(--line-2); padding: 10px 14px 10px 12px; border-radius: var(--radius); max-width: 420px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); animation: in .2s ease-out; white-space: pre-wrap; display: flex; gap: 10px; }
.toast::before { content: 'i'; font-family: var(--mono); width: 18px; height: 18px; border: 1px solid var(--muted); border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex: none; }
.toast.ok { border-color: var(--text); } .toast.ok::before { content: '✓'; background: var(--text); color: var(--ink); border-color: var(--text); }
.toast.err { border-color: var(--err); } .toast.err::before { content: '!'; border-color: var(--err); color: var(--err); }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }
dialog { background: #0a0a0a; color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 22px; max-width: 760px; width: 92vw; }
dialog::backdrop { background: rgba(0, 0, 0, .75); backdrop-filter: blur(3px); }

/* ───── Login screen ───── */
.login { min-height: 100vh; display: grid; place-items: center; position: relative; z-index: 1; padding: 20px; }
.login .card { max-width: 440px; padding: 34px; }
.login h1 { font-size: 34px; }
.login code { font-family: var(--mono); background: #fff; color: #000; padding: 1px 6px; }

@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; } .preview-wrap { position: static; } }
/* The wrapper only matters on phones; on wider screens its children are laid out as if it weren't there */
#side-body { display: contents; }
#menu-toggle, #mobile-page { display: none; }
@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  #sidebar { position: sticky; top: 0; z-index: 50; padding: 12px 16px; gap: 0; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .85); overflow: visible; }
  .brand { gap: 10px; }
  #mobile-page { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 14px var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); }
  #menu-toggle { display: inline-flex; margin-left: auto; }
  #side-body { display: none; }
  #sidebar.open { position: fixed; inset: 0; overflow-y: auto; background: #000; }
  #sidebar.open #side-body { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; }
  #sidebar.open .me { margin-top: 8px; }
  #main { padding: 20px 16px 60px; } .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Discord-style preview */
.dc { background: var(--discord-bg); border-radius: var(--radius); padding: 16px 16px 16px 0; color: #dbdee1; font-size: 15px; line-height: 1.375; font-family: 'gg sans', 'Segoe UI', sans-serif; }
.dc-msg { display: grid; grid-template-columns: 72px 1fr; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; margin-left: 16px; object-fit: cover; background: #5865f2; }
.dc-head { display: flex; align-items: center; gap: 6px; }
.dc-name { color: #f2f3f5; font-weight: 500; }
.dc-badge { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 4px; }
.dc-time { color: #949ba4; font-size: 12px; }
.dc-content { white-space: pre-wrap; word-wrap: break-word; }
.dc-embed { display: grid; grid-template-columns: auto; max-width: 520px; background: var(--discord-embed); border-left: 4px solid #1e1f22; border-radius: 4px; padding: 8px 16px 16px 12px; margin-top: 6px; position: relative; }
.dc-embed.has-thumb { grid-template-columns: 1fr 80px; column-gap: 16px; }
.dc-embed > .dc-e-body { min-width: 0; }
.dc-e-author { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin-top: 8px; color: #f2f3f5; }
.dc-e-author img { width: 24px; height: 24px; border-radius: 50%; }
.dc-e-title { font-weight: 600; margin-top: 8px; color: #f2f3f5; }
.dc-e-title a { color: #00a8fc; text-decoration: none; }
.dc-e-desc { font-size: 14px; margin-top: 8px; white-space: pre-wrap; }
.dc-e-fields { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; margin-top: 8px; }
.dc-e-field { grid-column: span 12; font-size: 14px; min-width: 0; }
.dc-e-field.inline { grid-column: span 4; }
.dc-e-field-name { font-weight: 600; color: #f2f3f5; margin-bottom: 2px; }
.dc-e-field-value { white-space: pre-wrap; }
.dc-e-image, .dc-e-footer { grid-column: 1 / -1; }
.dc-e-image { margin-top: 16px; max-width: 100%; border-radius: 4px; max-height: 300px; object-fit: contain; }
.dc-e-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; margin-top: 8px; }
.dc-e-footer { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-top: 8px; color: #b5bac1; }
.dc-e-footer img { width: 20px; height: 20px; border-radius: 50%; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-button { background: #4e5058; color: #fff; padding: 2px 16px; height: 32px; display: inline-flex; align-items: center; gap: 6px; border-radius: 3px; font-size: 14px; font-weight: 500; text-decoration: none; }
.dc-button::after { content: '↗'; font-size: 12px; opacity: .8; }
.dc code { background: #2b2d31; padding: 0 3px; border-radius: 3px; font-size: 85%; font-family: Consolas, monospace; }
.dc pre { background: #2b2d31; border: 1px solid #1e1f22; padding: 8px; border-radius: 4px; white-space: pre-wrap; margin: 4px 0; }
.dc pre code { background: none; padding: 0; }
.dc blockquote { border-left: 4px solid #4e5058; margin: 0; padding: 0 8px 0 12px; }
.dc ul, .dc ol { margin: 2px 0; padding-left: 22px; white-space: pre-wrap; }
.dc li { margin: 1px 0; }
.dc li > ul, .dc li > ol { margin: 0; }
.dc pre.ansi { color: #b9bbbe; }
.dc .mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; padding: 0 2px; border-radius: 3px; font-weight: 500; }
.dc .spoiler { background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer; }
.dc .spoiler:hover { color: inherit; background: rgba(30, 31, 34, .6); }
.dc h1, .dc h2, .dc h3 { margin: 8px 0 4px; color: #f2f3f5; line-height: 1.25; }
.dc h1 { font-size: 24px; } .dc h2 { font-size: 20px; } .dc h3 { font-size: 16px; text-transform: none; letter-spacing: 0; }
.dc .subtext { font-size: 12px; color: #949ba4; }
.dc .ts { background: rgba(255, 255, 255, .06); padding: 0 2px; border-radius: 3px; }
.dc a { color: #00a8fc; text-decoration: none; }
.dc a.dc-button { color: #fff; }
.dc + .dc { margin-top: 10px; }
.dc-button.primary { background: #5865f2; }
.dc-button.primary::after { content: none; }

/* Form modal mock-up (monochrome) */
.modal-mock { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px; background: #070707; display: flex; flex-direction: column; gap: 10px; }
.modal-mock + .modal-mock { margin-top: 10px; }
.mm-title { font-weight: 600; }
.mm-label { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 5px; }
.mm-input { border: 1px solid var(--line-2); border-radius: var(--radius); min-height: 32px; padding: 7px 9px; color: var(--dim); font-size: 12.5px; }
.mm-input.tall { min-height: 64px; }
.mm-actions { display: flex; justify-content: flex-end; gap: 14px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 4px; }
.mm-submit { background: var(--text); color: var(--ink); padding: 5px 12px; border-radius: var(--radius); }

/* Server picker: servers without the bot, Discord login */
.tile-add { border-style: dashed; }
.tile-add .t-go { color: var(--green, #3ddc97); }
.btn.discord-login { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.discord-login:hover { background: #4752c4; border-color: #4752c4; }
#nav.no-guild a[data-page], #nav.no-guild .nav-group.srv { display: none; }

/* ═══════════ Page pattern (header · one surface split into sections · save bar) ═══════════ */
[hidden] { display: none !important; }
/* One width for every page, so headers and actions never jump between pages */
.page, .page.wide { max-width: 1280px; container-type: inline-size; }
.page-header { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; }
.ph-main { flex: 1; min-width: 260px; }
.ph-title { display: flex; align-items: center; gap: 12px; font-size: 28px; margin: 0 0 6px; }
.ph-title .ico { flex: none; color: var(--muted); }
.ph-purpose { color: var(--muted); margin: 0; max-width: 720px; text-wrap: pretty; line-height: 1.5; font-size: 15px; }
.ph-status { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--label); flex-wrap: wrap; }
.ph-aside { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
label.master { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border: 1px solid var(--line-2); border-radius: 99px; background: rgba(0, 0, 0, .6); font-weight: 600; cursor: pointer; min-width: 92px; }
label.master:hover { border-color: var(--muted); }
label.master input[type=checkbox] { width: 40px; height: 22px; }
label.master input[type=checkbox]::after { width: 16px; height: 16px; }
label.master input[type=checkbox]:checked { background: var(--ok); border-color: var(--ok); }
label.master input[type=checkbox]:checked::after { transform: translateX(18px); }

.surface { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; backdrop-filter: blur(6px); }
.surface + .surface, .surface + .grid, .grid + .surface, .surface + .quick, .quick + .surface, .tabs-row + .surface { margin-top: 16px; }
.section { padding: 22px 24px; }
.surface > .section + .section, .surface > * + details.section, .surface > details.section + * { border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.section-hint { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 640px; }
details.section.advanced > summary { padding: 16px 24px; cursor: pointer; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 12px; font-weight: 500; }
details.section.advanced > summary::-webkit-details-marker { display: none; }
details.section.advanced > summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
details.section.advanced[open] > summary::before { transform: rotate(45deg); }
details.section.advanced > summary:hover { color: var(--text); }
details.section.advanced > .section-body { padding: 0 24px 22px; display: flex; flex-direction: column; gap: 12px; }

.setting { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; }
.setting.toggle-row { max-width: 720px; flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
.setting.toggle-row .setting-control { flex: none; }
.setting + .setting { border-top: 1px solid rgba(255, 255, 255, .05); }
.setting-label { display: flex; flex-direction: column; gap: 3px; color: var(--label); font-size: 14.5px; font-weight: 500; }
.setting-hint { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.45; }
.setting-control { max-width: 720px; min-width: 0; }
.setting-control .row { flex-wrap: nowrap; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 10px; border: 1px solid var(--line-2); border-radius: 99px; color: var(--muted); white-space: nowrap; flex: none; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; }
.pill.on { color: var(--text); } .pill.on::before { background: var(--ok); border-color: var(--ok); }
.pill.warn { color: var(--text); border-color: rgba(240, 180, 41, .5); } .pill.warn::before { background: var(--warn); border-color: var(--warn); }
.pill.err { color: var(--text); border-color: rgba(255, 107, 107, .5); } .pill.err::before { background: var(--err); border-color: var(--err); }
.pill.info::before { display: none; }

.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--line); }
.row-link { display: flex; align-items: center; gap: 14px; padding: 12px 18px; min-height: 58px; text-decoration: none; color: var(--text); transition: background .12s; }
.row-link:hover { background: rgba(255, 255, 255, .045); }
.rl-icon { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); display: grid; place-items: center; flex: none; color: var(--label); background: rgba(0, 0, 0, .4); }
.row-link .rl-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-link .rl-text b { font-weight: 600; }
.row-link .rl-text span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-go { color: var(--dim); display: flex; transition: transform .15s, color .15s; }
.row-link:hover .rl-go { color: var(--text); transform: translateX(2px); }
.row-wrap { display: flex; align-items: center; }
.row-wrap > .row-link { flex: 1; min-width: 0; }
.row-wrap > .row-switch { padding: 0 18px 0 4px; display: flex; align-items: center; }
.attention { border-color: rgba(240, 180, 41, .35); }
.attention .row-link { box-shadow: inset 3px 0 0 var(--warn); }
.attention .row-link .btn { flex: none; }
.all-good { display: flex; align-items: center; gap: 12px; padding: 16px 20px; color: var(--label); }
.all-good .ico { color: var(--ok); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.block-title { margin: 28px 0 12px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }

.savebar { position: sticky; bottom: 0; z-index: 5; margin-top: 20px; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(8, 8, 8, .94); border: 1px solid var(--line); border-radius: 8px; backdrop-filter: blur(8px); }
.savebar-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.savebar.dirty { border-color: var(--warn); box-shadow: 0 -10px 30px rgba(0, 0, 0, .5); }
.savebar.dirty .savebar-dot { background: var(--warn); }
.savebar-msg { color: var(--muted); font-size: 14px; }
.savebar.dirty .savebar-msg { color: var(--text); }

/* Hairlines on each figure's left and top; the outer ones are clipped, so wrapped rows stay ruled correctly */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); overflow: hidden; }
.kpis > * { box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.kpis > .stat { padding: 16px 20px; }
.tabs-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Sidebar */
#nav a .ico { flex: none; color: var(--dim); }
#nav a:hover .ico { color: var(--text); }
#nav a.active .ico { color: var(--ink); }
#nav a .nav-end { margin-left: auto; display: flex; align-items: center; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid #555; }
.nav-dot.on { background: var(--ok); border-color: var(--ok); }
.nav-dot.warn { background: var(--warn); border-color: var(--warn); }
.nav-badge { font: 500 12px var(--mono); padding: 0 7px; line-height: 17px; border: 1px solid var(--line-2); border-radius: 99px; color: var(--text); }
.nav-badge.warn { border-color: var(--warn); color: var(--warn); }
#nav a.active .nav-badge { border-color: var(--ink); color: var(--ink); }
.side-label { font-family: var(--mono); font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .16em; padding: 0 4px; margin-bottom: -8px; }
.side-links { display: flex; flex-direction: column; gap: 1px; }
.side-links a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; white-space: nowrap; color: var(--muted); text-decoration: none; border-radius: var(--radius); font-size: 14px; }
.side-links a:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.side-links a.active { color: var(--ink); background: var(--accent); }

@media (max-width: 760px) {
  .setting { grid-template-columns: 1fr; gap: 8px; }
  .section { padding: 18px 16px; }
  .row-link .rl-text span { white-space: normal; }
}
.guild-icon { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); object-fit: cover; flex: none; }
.guild-icon.ph { display: grid; place-items: center; background: #111; font: 600 18px var(--mono); }
.forms-layout { grid-template-columns: 260px minmax(0, 1fr); }
@media (max-width: 1180px) { .forms-layout { grid-template-columns: 1fr; } }

/* Cards inside a grid line up: no sibling margin, equal heights */
.grid > .surface, .grid > .card { margin-top: 0 !important; }
.grid.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .grid.pair { grid-template-columns: 1fr; } }
.surface.fill { display: flex; flex-direction: column; }
.surface.fill > .empty { flex: 1; display: grid; place-items: center; }

/* Rich text: formatting toolbar and the channel / role / member picker */
.rt { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2, #0d0d0d); }
.rt:focus-within { border-color: var(--muted); }
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 5px 6px; border-bottom: 1px solid var(--line); }
.rt-grp { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-width: 0; }
.rt-grp:first-child { flex: 0 0 auto; flex-wrap: nowrap; }
.rt-btn { min-width: 28px; height: 26px; padding: 0 7px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: 600 13.5px var(--sans, inherit); cursor: pointer; }
.rt-btn:hover, .rt-btn:focus-visible { background: rgba(255, 255, 255, .07); color: var(--text); outline: none; }
.rt-ins { color: var(--text); font-weight: 500; }
.rt-sep { width: 1px; height: 16px; margin: 0 4px; background: var(--line-2); }
.rt > .rt-input { border: 0 !important; border-radius: 0 0 6px 6px; background: transparent; box-shadow: none !important; }
.rt-pop { position: fixed; z-index: 1000; width: 340px; max-height: 340px; display: flex; flex-direction: column; background: #101010; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 18px 40px rgba(0, 0, 0, .55); overflow: hidden; }
.rt-pop[hidden] { display: none; }
.rt-tabs { display: flex; gap: 2px; padding: 6px 6px 0; }
.rt-tabs[hidden] { display: none; }
.rt-tabs button { flex: 1; padding: 6px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.rt-tabs button.active { background: rgba(255, 255, 255, .09); color: var(--text); }
.rt-search { margin: 6px; width: auto !important; }
.rt-search[hidden] { display: none; }
.rt-list { overflow-y: auto; padding: 4px; }
.rt-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 5px; cursor: pointer; font-size: 14.5px; }
.rt-item.active { background: rgba(255, 255, 255, .08); }
.rt-item img { border-radius: 50%; flex: none; object-fit: cover; }
.rt-ic { width: 20px; text-align: center; color: var(--muted); flex: none; }
.rt-dot { width: 10px; height: 10px; margin: 0 5px; border-radius: 50%; flex: none; }
.rt-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-hint { margin-left: auto; padding-left: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.rt-empty { padding: 14px; color: var(--muted); font-size: 14px; text-align: center; }

/* Forms */
.list-item.new-item { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; padding-top: 10px; padding-bottom: 10px; color: var(--muted); border-style: dashed; cursor: pointer; }
.list-item.new-item:hover, .list-item.new-item.selected { color: var(--text); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; text-align: left; border: 1px solid var(--line-2); border-radius: 8px; background: rgba(255, 255, 255, .02); color: var(--text); cursor: pointer; font: inherit; transition: border-color .15s, background .15s, transform .15s; }
.tpl:hover { border-color: var(--muted); background: rgba(255, 255, 255, .04); transform: translateY(-1px); }
.tpl.active { border-color: var(--text); background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 1px var(--text) inset; }
.tpl-icon { font-size: 22px; line-height: 1; }
.tpl b { font-size: 15px; }
.tpl-blurb { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.tpl-meta { margin-top: auto; padding-top: 4px; color: var(--dim); font-size: 12.5px; }
.q-card { display: flex; flex-direction: column; gap: 10px; }
.q-num { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .08); font: 600 13px var(--mono); }
.q-extra { display: flex; flex-direction: column; gap: 8px; }
.page-mark { margin: 6px 0 8px; color: var(--muted); font: 600 11.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.mm-desc { color: var(--muted); font-size: 12px; margin: -2px 0 6px; }
.mm-select { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.mm-file { display: grid; place-items: center; min-height: 56px; border-style: dashed !important; color: var(--muted); font-size: 12.5px; }
.sticky-side { position: sticky; top: 16px; }
.dc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-btn { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 16px; border-radius: 4px; color: #fff; font: 500 14px var(--sans); white-space: nowrap; background: #4e5058; }
.dc-btn.primary { background: #5865f2; } .dc-btn.success { background: #248046; } .dc-btn.danger { background: #da373c; }
.action-card > summary { display: flex; align-items: center; gap: 10px; }
.result-mock { padding: 14px; border-radius: 6px; background: var(--discord-bg); }
.rm-embed { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-left: 4px solid #5865f2; border-radius: 4px; background: var(--discord-embed); font-size: 13.5px; }
.rm-field b { font-size: 12.5px; }
.sub-detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(200px, 1fr); gap: 20px; padding: 8px 0 14px; }
@media (max-width: 900px) { .sub-detail { grid-template-columns: 1fr; } }
.timeline h3 { margin-top: 0; }
.tl-item { padding: 6px 0 6px 12px; border-left: 2px solid var(--line-2); font-size: 14px; }
.label-like { display: block; margin-bottom: 6px; font-size: 14px; color: var(--label); }

/* Roblox group */
.group-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: rgba(255, 255, 255, .02); }
.gc-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--text); color: var(--ink); font: 700 18px var(--sans); }
.steps-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.steps-strip > div { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 14.5px; line-height: 1.5; color: var(--label); }
.steps-strip b { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .09); color: var(--text); font: 600 13px var(--mono); }
table.binds td { vertical-align: middle; padding-top: 10px; padding-bottom: 10px; }
table.binds td:first-child { width: 38%; }
.grid.split { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.setting-control .row.pick { flex-wrap: wrap; }
.action-card .setting-control { max-width: none; }
.action-card .inner > h3 { margin: 14px 0 0; }

/* Forms: your forms as one row of cards above the editor */
.form-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 20px; }
.form-strip[hidden] { display: none; }
.form-chip { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 72px; padding: 14px 16px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.form-chip:hover { border-color: var(--line-2); background: var(--panel-2); }
.form-chip.selected { border-color: var(--text); background: var(--panel-2); }
.form-chip-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.form-chip-top b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-chip-meta { color: var(--muted); font-size: 13px; }
.form-chip.new { flex-direction: row; align-items: center; justify-content: center; gap: 8px; border-style: dashed; color: var(--muted); font-weight: 500; }
.form-chip.new:hover, .form-chip.new.selected { color: var(--text); }

/* Layouts follow the width of the page, not the window (the sidebar takes 256px) */
@media (max-width: 760px) { .steps-strip { grid-template-columns: 1fr; } }
@container (max-width: 880px) { .editor { grid-template-columns: 1fr; } .preview-wrap { position: static; } }
@container (min-width: 900px) { .grid.split { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); } .grid.split .sticky-side { position: sticky; } }
@container (max-width: 899px) { .grid.split { grid-template-columns: 1fr; } .grid.split .sticky-side { position: static; } }

/* Message editor: the Send bar */
.sendbar .savebar-msg { color: var(--label); }
@media (max-width: 760px) { .sendbar { flex-wrap: wrap; } .sendbar .savebar-msg { flex-basis: 100%; } }

/* "More" menus */
.menu-pop { position: fixed; z-index: 1000; min-width: 180px; padding: 4px; display: flex; flex-direction: column; background: #101010; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
.menu-item { padding: 8px 12px; border: 0; border-radius: 5px; background: transparent; color: var(--text); text-align: left; font-size: 14px; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, .08); outline: none; }
.menu-item.danger { color: var(--err); }
.menu-item.danger:hover, .menu-item.danger:focus-visible { background: rgba(255, 107, 107, .12); }

/* Rows of fields stack on narrow pages */
@container (max-width: 560px) { .field-grid { grid-template-columns: 1fr !important; } }

/* Searchable pickers (look like the other fields) */
.combo { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 10px; width: 100%; background: rgba(0, 0, 0, .6); border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; outline: none; transition: border-color .15s, background .15s; user-select: none; }
.combo:hover { border-color: #444; }
.combo:focus-visible, .combo[aria-expanded=true] { border-color: var(--text); }
.combo.disabled { opacity: .5; pointer-events: none; }
.combo-value { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.combo-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-ph { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-caret { color: var(--muted); font-size: 11px; transition: transform .2s; }
.combo[aria-expanded=true] .combo-caret { transform: rotate(180deg); }
.combo-pop { position: fixed; z-index: 1000; display: flex; flex-direction: column; background: #101010; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 18px 40px rgba(0, 0, 0, .6); overflow: hidden; animation: pop-in .16s ease-out; }
.combo-search { margin: 8px; width: auto !important; }
.combo-list { overflow-y: auto; padding: 0 6px 6px; }
.combo-group { padding: 10px 8px 4px; font: 600 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.combo-item { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 14.5px; }
.combo-item.active { background: rgba(255, 255, 255, .08); }
.combo-item.empty { color: var(--muted); }
.combo-check { margin-left: auto; color: var(--ok); }
.combo-none { padding: 14px; color: var(--muted); text-align: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .06); }
.ch-ic { width: 16px; text-align: center; color: var(--muted); flex: none; }
.role-tag { color: var(--rc); border-color: color-mix(in srgb, var(--rc) 45%, transparent); background: color-mix(in srgb, var(--rc) 12%, transparent); }
.tag a { color: inherit; opacity: .6; text-decoration: none; margin-left: 2px; }
.tag a:hover { opacity: 1; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* Colour field */
.color-field { display: flex; flex-direction: column; gap: 8px; }
.cf-row { display: flex; gap: 8px; align-items: center; }
.cf-swatch { position: relative; width: 38px; height: 38px; flex: none; border-radius: 8px; border: 1px solid var(--line-2); cursor: pointer; overflow: hidden; transition: transform .15s; }
.cf-swatch:hover { transform: scale(1.06); }
.cf-wheel { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.cf-text { font-family: var(--mono); }
.cf-text.bad { border-color: var(--err) !important; }
.cf-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.cf-preset { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .12); cursor: pointer; padding: 0; transition: transform .15s; }
.cf-preset:hover { transform: scale(1.18); }
.cf-preset.none { background: transparent; color: var(--muted); font-size: 11px; line-height: 1; }
.cf-formats { display: flex; gap: 6px; flex-wrap: wrap; }
.cf-fmt { display: inline-flex; gap: 6px; align-items: baseline; padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); font: 12.5px var(--mono); cursor: pointer; }
.cf-fmt b { color: var(--label); font-weight: 600; font-family: var(--sans); }
.cf-fmt:hover { border-color: var(--line-2); color: var(--text); }

/* ───── Rich text: the "More" formatting panel ───── */
.rt-more-btn { font-weight: 600; }
.rt-more-btn.on { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.rt-more {
  position: fixed; z-index: 1000; overflow: auto; overscroll-behavior: contain;
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); padding: 14px; display: grid; gap: 14px;
  animation: pop-in 0.16s ease-out;
}
.rt-group { display: grid; gap: 8px; }
.rt-group-title { font-size: 13px; font-weight: 600; color: var(--label); }
.rt-group-body { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-chip {
  font: inherit; font-size: 14px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 10px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.rt-chip:hover { background: #1f1f1f; border-color: #4a4a4a; transform: translateY(-1px); }
.rt-chip:active { transform: scale(0.97); }
.rt-c { font-style: normal; font-weight: 800; }
.rt-note { font-size: 13px; color: var(--muted); font-weight: 400; }
.rt-ansi { display: grid; gap: 8px; }
.rt-sws { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rt-sws .rt-note { width: 40px; }
.rt-sw {
  width: 26px; height: 26px; border-radius: 7px; border: 2px solid rgba(255, 255, 255, 0.14); cursor: pointer; padding: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.rt-sw:hover { transform: scale(1.12); }
.rt-sw.on { box-shadow: 0 0 0 2px var(--panel-solid), 0 0 0 4px var(--accent); }
.rt-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rt-row input[type="datetime-local"], .rt-row select { flex: 1 1 160px; min-width: 0; }
.rt-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.rt-ansi-sample { font-family: var(--mono); font-size: 14px; padding: 3px 8px; border-radius: 5px; background: var(--discord-embed); }

/* ───── Components V2: editor ───── */
.mode-switch { display: flex; flex-wrap: wrap; width: 100%; }
.mode-switch button { flex: 1 1 140px; padding: 8px 12px; }
.v2-list { display: grid; gap: 10px; }
.v2-list.in-box { padding: 10px; border: 1px dashed var(--line-2); border-radius: 8px; }
.v2-rows { display: grid; gap: 10px; }
.v2-block > summary { font-weight: 600; }
.v2-ic { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 7px; background: var(--panel-2); font-size: 15px; }
.v2-pic { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.v2-pic > .grow { flex: 1 1 180px; }
.tag.over { color: var(--err); border-color: var(--err); }

/* ───── Components V2: preview ───── */
.dc .v2 { display: grid; gap: 8px; margin-top: 4px; max-width: 520px; }
.dc .v2-text { white-space: pre-wrap; word-wrap: break-word; }
.dc .v2-box { background: var(--discord-embed); border: 1px solid #3f4147; border-left: 4px solid; border-radius: 8px; padding: 14px; display: grid; gap: 8px; }
.dc .v2-box.no-accent { border-left-width: 1px; border-left-color: #3f4147; }
.dc .v2-box.spoiler-box { filter: blur(0.5px); }
.dc .v2-section { display: flex; gap: 12px; align-items: flex-start; }
.dc .v2-sec-text { flex: 1; display: grid; gap: 4px; min-width: 0; }
.dc .v2-thumb { width: 85px; height: 85px; border-radius: 8px; object-fit: cover; flex: none; }
.dc .v2-thumb.empty, .dc .v2-ph { display: grid; place-items: center; background: #1e1f22; color: #80848e; font-size: 22px; }
.dc .v2-gallery { display: grid; gap: 4px; border-radius: 8px; overflow: hidden; grid-template-columns: repeat(2, 1fr); }
.dc .v2-gallery.n1 { grid-template-columns: 1fr; }
.dc .v2-gallery.n3 { grid-template-columns: repeat(3, 1fr); }
.dc .v2-gallery img, .dc .v2-ph { width: 100%; height: 100%; min-height: 90px; max-height: 300px; object-fit: cover; display: block; }
.dc .v2-gallery.n1 img { max-height: 340px; object-fit: contain; background: #1e1f22; }
.dc .v2-gallery .spoiler-img { filter: blur(14px); }
.dc .v2-sep { height: 4px; }
.dc .v2-sep.big { height: 14px; }
.dc .v2-sep.line { height: 1px; background: #3f4147; margin: 4px 0; }
.dc .v2-sep.line.big { margin: 10px 0; }
.v2-rows > button, .v2-rows > .row > button.btn.small:only-child { justify-self: start; }

/* Attachments in the message preview */
.dc-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; max-width: 520px; }
.dc-attach-img { max-width: 100%; max-height: 300px; border-radius: 8px; display: block; }
.dc-attach-file { display: flex; align-items: center; gap: 10px; background: var(--discord-embed); border: 1px solid #3f4147; border-radius: 8px; padding: 10px 14px; font-size: 14px; color: #00a8fc; }
.dc-file-ic { font-size: 22px; }

/* File picker (uploads) */
.file-picker { display: grid; gap: 8px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.file-tile {
  position: relative; display: grid; grid-template-rows: 78px auto; gap: 6px; padding: 6px; min-width: 0;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; text-align: left; color: var(--text); font: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.file-tile:hover { border-color: #4a4a4a; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
.file-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.file-tile img { width: 100%; height: 78px; object-fit: cover; border-radius: 6px; background: #111; }
.file-tile .file-ic { display: grid; place-items: center; height: 78px; font-size: 34px; background: #111; border-radius: 6px; }
.file-tile.add { grid-template-rows: auto; align-content: center; justify-items: center; text-align: center; border-style: dashed; min-height: 128px; }
.file-plus { font-size: 26px; line-height: 1; }
.file-meta { display: grid; gap: 1px; min-width: 0; }
.file-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-check {
  position: absolute; top: 10px; left: 10px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--accent); color: var(--ink); font: 700 12px/22px var(--sans); text-align: center; animation: pop-in .18s ease-out;
}
.file-del {
  position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 12px; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; opacity: 0; transition: opacity .15s;
}
.file-tile:hover .file-del, .file-tile:focus-within .file-del { opacity: 1; }
.file-del:hover { background: var(--err); }
@media (hover: none) { .file-del { opacity: 1; } }

/* ───── Livelier dashboard: colour emoji and soft motion ───── */
.emo {
  display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; line-height: 1; flex: none;
  font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), filter .2s, opacity .2s;
}
@keyframes wiggle {
  0% { transform: rotate(0) scale(1); }
  25% { transform: rotate(-12deg) scale(1.18); }
  50% { transform: rotate(9deg) scale(1.18); }
  75% { transform: rotate(-4deg) scale(1.08); }
  100% { transform: rotate(0) scale(1); }
}
@keyframes twinkle {
  0% { transform: scale(1) rotate(0); filter: drop-shadow(0 0 0 rgba(245, 197, 66, 0)); }
  45% { transform: scale(1.35) rotate(72deg); filter: drop-shadow(0 0 6px rgba(245, 197, 66, .8)); }
  100% { transform: scale(1) rotate(144deg); filter: drop-shadow(0 0 0 rgba(245, 197, 66, 0)); }
}
@keyframes tile-in { from { opacity: 0; transform: scale(.6) rotate(-12deg); } }
@keyframes open-in { from { opacity: 0; transform: translateY(-6px); } }

/* Sidebar: each section keeps its own colour; the active one gets a soft tinted pill instead of a white block */
#nav a .emo { opacity: .85; filter: saturate(.8); }
#nav a:hover .emo { opacity: 1; filter: none; animation: wiggle .55s ease; }
#nav a.active { color: var(--text); background: color-mix(in srgb, var(--tint, #fff) 16%, transparent); border-color: color-mix(in srgb, var(--tint, #fff) 38%, transparent); }
#nav a.active .emo { opacity: 1; filter: none; }
#nav a { transition: color .15s, background .2s, border-color .2s, transform .2s; }
#nav a:hover:not(.active) { transform: translateX(2px); }

/* "Review Kyoto" stands out in gold */
#side-links a.review-link {
  color: #f7d774; border: 1px solid rgba(245, 197, 66, .32); border-radius: 8px; padding: 6px 10px;
  background: linear-gradient(90deg, rgba(245, 197, 66, .16), rgba(245, 197, 66, .03));
  transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
}
#side-links a.review-link:hover { border-color: rgba(245, 197, 66, .6); box-shadow: 0 6px 20px rgba(245, 197, 66, .15); transform: translateY(-1px); }
#side-links a.review-link:hover .emo { animation: twinkle .8s ease; }
#side-links a:not(.review-link):hover .emo { animation: wiggle .55s ease; }

/* Page headers: the emoji sits on a tile tinted with the section's colour */
.ph-tile {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--tint) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint) 42%, transparent);
  box-shadow: 0 8px 26px color-mix(in srgb, var(--tint) 22%, transparent);
  animation: tile-in .55s cubic-bezier(.34, 1.56, .64, 1) both;
}
.page-header:hover .ph-tile .emo { animation: wiggle .6s ease; }

/* Overview rows */
.rl-icon.tinted { background: color-mix(in srgb, var(--tint) 14%, transparent); border-color: color-mix(in srgb, var(--tint) 36%, transparent); }
.row-link { transition: background .15s, box-shadow .2s; }
.row-link:hover .rl-icon .emo { animation: wiggle .55s ease; }
.row-link:hover .rl-icon.tinted { box-shadow: 0 4px 16px color-mix(in srgb, var(--tint) 30%, transparent); }

/* Things you click feel physical */
.btn { transition: background .15s, border-color .15s, color .15s, transform .12s, box-shadow .2s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(255, 255, 255, .14); }
.form-chip, .v2-ic, .rt-btn { transition: transform .15s, background .15s, border-color .15s, box-shadow .2s; }
.form-chip:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
.v2-block > summary:hover .v2-ic, details.block > summary:hover .v2-ic { transform: scale(1.12) rotate(-6deg); }
.kpis > .stat { transition: background .2s; }
.kpis > .stat:hover { background: rgba(255, 255, 255, .03); }

/* Panels open smoothly */
details.block[open] > .inner, details.section[open] > .section-body { animation: open-in .28s ease-out both; }
.surface { animation: rise .45s cubic-bezier(.2, .7, .2, 1) backwards; }
.page > .surface:nth-of-type(2) { animation-delay: .05s; }
.page > .surface:nth-of-type(3) { animation-delay: .1s; }
.page > .surface:nth-of-type(4) { animation-delay: .15s; }

/* Star rating */
.stars { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.star { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; display: grid; place-items: center; font-size: 26px; padding: 0; transition: background .15s, transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.star .emo { filter: grayscale(1) brightness(.55); opacity: .55; transition: filter .2s, opacity .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.star.lit .emo { filter: drop-shadow(0 0 8px rgba(245, 197, 66, .45)); opacity: 1; }
.star:hover { background: rgba(245, 197, 66, .1); transform: translateY(-2px); }
.star:hover .emo { transform: scale(1.2) rotate(-8deg); }
.star:focus-visible { outline: 2px solid #f5c542; outline-offset: 2px; }
.star.pop .emo { animation: twinkle .6s ease backwards; }
.star-word { margin-left: 10px; font-weight: 600; color: #f7d774; min-width: 120px; }
.star-line { letter-spacing: 2px; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.dim-stars { filter: grayscale(1); opacity: .35; }
@media (max-width: 420px) { .rt-btn { min-width: 26px; padding: 0 5px; } }
