/* nunubot.org/tools: shared look of the Discord tools. Tokens come from /style.css. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav { background: var(--bg); }
.mono, .code { font-family: "Geist Mono", ui-monospace, monospace; }

.t-hero { padding: clamp(40px, 7vh, 80px) 0 clamp(28px, 4vh, 44px); }
.crumbs { color: var(--muted); font-size: var(--step-small); margin-bottom: 18px; }
.crumbs a:hover { color: var(--ink); }
.t-hero h1 { font-size: var(--step-display); font-weight: 700; letter-spacing: -0.045em; line-height: 1; max-width: 18ch; }
.t-hero .lead { max-width: 60ch; }
.t-main { padding: 0 0 clamp(72px, 10vh, 120px); }

/* ---------- controls ---------- */
.panel { background: var(--surface); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 32px); min-width: 0; }
.panel h2 { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .label { font-size: var(--step-small); font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.field > span small { font-weight: 500; font-variant-numeric: tabular-nums; }
.field > span small.over { color: #ff6b6b; }
.in {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--bg-2); color: var(--ink); font: inherit; font-size: 1rem; transition: border-color .15s;
}
.in:focus { outline: none; border-color: var(--bot); }
.in::placeholder { color: #6f7585; }
textarea.in { min-height: 112px; resize: vertical; line-height: 1.5; }
input[type="color"].in { padding: 4px; cursor: pointer; }
input[type="date"].in, input[type="time"].in { color-scheme: dark; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--bot-fill); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button.btn { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.btn.sm { font-size: var(--step-small); }
.pill {
  font: inherit; font-size: var(--step-small); font-weight: 500; color: var(--ink); background: var(--surface-2);
  border: 0; border-radius: 999px; padding: 8px 14px; min-height: 36px; cursor: pointer; transition: background-color .15s;
}
.pill:hover { background: #262b3e; }
.pill.on { background: var(--bot-fill); color: #fff; }
.hint { color: var(--muted); font-size: var(--step-small); }
.mt { margin-top: 14px; }
.msg { font-size: var(--step-small); font-weight: 500; }
.msg.ok { color: #3ddc84; }
.msg.err { color: #ff6b6b; }
.code { background: #1e1f22; color: #dbdee1; padding: 4px 8px; border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }

/* ---------- Discord look ---------- */
.dc { background: #313338; color: #dbdee1; border-radius: var(--r); padding: 16px; font-size: 15px; line-height: 1.375; overflow-wrap: anywhere; }
.ts-chip { background: #3f4147; color: #dbdee1; border-radius: 3px; padding: 0 2px; }
.ansi-pre { margin: 0; font-family: "Geist Mono", Consolas, monospace; font-size: 14px; line-height: 1.45; white-space: pre-wrap; background: #2b2d31; border: 1px solid #1e1f22; border-radius: 4px; padding: 8px 10px; color: #b9bbbe; }
.fg30 { color: #4f545c; } .fg31 { color: #dc322f; } .fg32 { color: #859900; } .fg33 { color: #b58900; }
.fg34 { color: #268bd2; } .fg35 { color: #d33682; } .fg36 { color: #2aa198; } .fg37 { color: #ffffff; }
.bg40 { background: #002b36; } .bg41 { background: #cb4b16; } .bg42 { background: #586e75; } .bg43 { background: #657b83; }
.bg44 { background: #839496; } .bg45 { background: #6c71c4; } .bg46 { background: #93a1a1; } .bg47 { background: #fdf6e3; }
.b { font-weight: 700; } .u { text-decoration: underline; }
.bg-fg30 { background: #4f545c; } .bg-fg31 { background: #dc322f; } .bg-fg32 { background: #859900; } .bg-fg33 { background: #b58900; }
.bg-fg34 { background: #268bd2; } .bg-fg35 { background: #d33682; } .bg-fg36 { background: #2aa198; } .bg-fg37 { background: #ffffff; }

/* ---------- tools hub ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tool-card { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border-radius: var(--r-lg); padding: clamp(22px, 3vw, 32px); transition: transform .25s var(--ease), background-color .2s; }
.tool-card:hover { transform: translateY(-4px); background: var(--surface-2); }
.tool-card h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.tool-card p { color: var(--muted); max-width: 48ch; }
.tool-card .prod-go { color: var(--bot); margin-top: auto; padding-top: 8px; }
.tc-demo { background: #313338; border-radius: var(--r); padding: 18px; min-height: 132px; display: grid; gap: 12px; align-content: center; margin-bottom: 8px; color: #dbdee1; font-size: 15px; }
.tc-demo .code { justify-self: start; }
.tc-id { display: flex; gap: 12px; align-items: center; }
.tc-av { width: 44px; height: 44px; border-radius: 14px; background: var(--bot-fill); flex: none; }
.tc-id div { display: grid; }
.tc-id b { color: #f2f3f5; }
.tc-id span { color: #949ba4; font-size: 13px; }
.tc-ts { font-size: 15px; }
.tc-embed { background: #2b2d31; border-left: 4px solid var(--bot); border-radius: 4px; padding: 10px 14px; display: grid; gap: 6px; }
.tc-embed b { color: #f2f3f5; }
.tc-embed i { display: block; height: 8px; border-radius: 4px; background: #3f4147; }
.tc-embed i.short { width: 60%; }

/* ---------- information under a tool ---------- */
.t-info { padding: clamp(72px, 10vh, 120px) 0; background: var(--bg-2); }
.t-steps { margin: 32px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.t-steps li { counter-increment: s; background: var(--surface); border-radius: var(--r-lg); padding: 26px; display: grid; gap: 8px; align-content: start; }
.t-steps li::before { content: counter(s); font-size: var(--step-head); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--bot); }
.t-steps b { font-size: var(--step-lead); font-weight: 600; }
.t-steps span { color: var(--muted); }
.faq { margin-top: 28px; display: grid; gap: 8px; max-width: 860px; }
.faq details { background: var(--surface); border-radius: var(--r); padding: 0 22px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--bot); font-size: 1.4em; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 20px; color: var(--muted); max-width: 70ch; }
.faq code { font-family: "Geist Mono", monospace; font-size: .9em; background: var(--bg-2); padding: 1px 6px; border-radius: 5px; color: var(--ink); }
.more { margin-top: 56px; }
.more .row { margin-top: 16px; }

/* ---------- timestamp ---------- */
.ts-list { display: grid; gap: 8px; }
.ts-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; padding: 14px 16px; background: var(--bg-2); border-radius: 14px; }
.ts-row .ts-name { color: var(--muted); font-size: var(--step-small); }
.ts-row .ts-prev { font-size: 1.0625rem; font-weight: 600; grid-column: 1; }
.ts-row .code { grid-column: 1; justify-self: start; font-size: 13px; }
.ts-row .pill { grid-column: 2; grid-row: 1 / span 3; }
.ts-row.main { background: var(--bot-fill); }
.ts-row.main .ts-name { color: #ffe3ef; }
.ts-row.main .pill { background: #0a0b0f; color: #fff; }
.ts-row.main .code { background: rgba(0, 0, 0, .28); color: #fff; }

/* ---------- colored text ---------- */
.ansi-tools { display: grid; gap: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 40px; height: 40px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.sw:hover, .sw:focus-visible { border-color: #fff; }
.sw.none { background: transparent; border: 2px dashed var(--line); color: var(--muted); font: inherit; font-size: 18px; }
.ansi-edit { min-height: 220px; outline: none; cursor: text; }
.ansi-edit:focus { border-color: #5865f2; }
.ansi-edit:empty::before { content: attr(data-placeholder); color: #6d6f78; }

/* ---------- embed builder ---------- */
.eb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.eb-form { display: grid; gap: 16px; }
.eb-form details { background: var(--surface); border-radius: var(--r-lg); padding: 0 clamp(18px, 3vw, 26px); }
.eb-form summary { cursor: pointer; padding: 20px 0; font-weight: 600; font-size: var(--step-lead); list-style: none; display: flex; justify-content: space-between; }
.eb-form summary::-webkit-details-marker { display: none; }
.eb-form summary::after { content: "+"; color: var(--bot); }
.eb-form details[open] summary::after { content: "−"; }
.eb-form details > .stack { padding-bottom: 24px; }
.eb-field { background: var(--bg-2); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.eb-field .row { justify-content: space-between; }
.eb-side { position: sticky; top: 84px; display: grid; gap: 16px; }
.eb-total { font-size: var(--step-small); color: var(--muted); }

/* the preview, drawn like Discord */
.dmsg { display: flex; gap: 16px; }
.dmsg-av { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; background: #5865f2; }
.dmsg-body { min-width: 0; flex: 1; }
.dmsg-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dmsg-who b { color: #f2f3f5; font-weight: 500; }
.dmsg-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.dmsg-time { color: #949ba4; font-size: 12px; }
.dmsg-text { margin-top: 2px; white-space: pre-wrap; }
.demb { margin-top: 6px; max-width: 520px; background: #2b2d31; border-left: 4px solid #1e1f22; border-radius: 4px; padding: 8px 16px 16px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 16px; }
.demb > * { grid-column: 1; }
.demb-thumb { grid-column: 2; grid-row: 1 / span 6; width: 80px; height: 80px; object-fit: cover; border-radius: 4px; margin-top: 8px; }
.demb-author { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 600; color: #f2f3f5; }
.demb-author img { width: 24px; height: 24px; border-radius: 50%; }
.demb-title { margin-top: 8px; font-weight: 600; color: #f2f3f5; font-size: 16px; }
.demb-title a { color: #00a8fc; }
.demb-desc { margin-top: 8px; font-size: 14px; white-space: pre-wrap; }
.demb-fields { margin-top: 8px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; }
.demb-fields > div { grid-column: span 12; font-size: 14px; min-width: 0; }
.demb-fields > div.s4 { grid-column: span 4; } .demb-fields > div.s6 { grid-column: span 6; }
.demb-fields b { display: block; color: #f2f3f5; font-weight: 600; margin-bottom: 2px; }
.demb-fields span { white-space: pre-wrap; }
.demb-image { grid-column: 1 / -1; margin-top: 16px; max-width: 100%; max-height: 300px; border-radius: 4px; object-fit: contain; justify-self: start; }
.demb-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: #dbdee1; }
.demb-foot img { width: 20px; height: 20px; border-radius: 50%; }
.dc a { color: #00a8fc; }
.dc a:hover { text-decoration: underline; }
.dc code { font-family: Consolas, "Geist Mono", monospace; font-size: 85%; background: #1e1f22; border-radius: 3px; padding: 1px 3px; }
.dc pre { margin: 6px 0; background: #2b2d31; border: 1px solid #1e1f22; border-radius: 4px; padding: 8px; white-space: pre-wrap; font-family: Consolas, "Geist Mono", monospace; font-size: 14px; }
.demb pre { background: #1e1f22; }
.dc blockquote { margin: 2px 0; padding-left: 12px; border-left: 4px solid #4e5058; }
.dc .spoiler { background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer; }
.dc .spoiler.shown { background: #3f4147; color: inherit; }
.dc .h1 { font-size: 1.5em; font-weight: 700; color: #f2f3f5; display: block; margin: 4px 0; }
.dc .h2 { font-size: 1.25em; font-weight: 700; color: #f2f3f5; display: block; margin: 4px 0; }
.dc .h3 { font-size: 1em; font-weight: 700; color: #f2f3f5; display: block; margin: 4px 0; }
.dc .sub { font-size: 12px; color: #949ba4; display: block; }
.json { font-family: "Geist Mono", monospace; font-size: 13px; min-height: 180px; }

@media (max-width: 1000px) {
  .eb { grid-template-columns: 1fr; }
  .eb-side { position: static; }
  .t-steps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .tool-grid, .grid2 { grid-template-columns: 1fr; }
}
