/* Styles shared by the Markdown tools. */

.note--muted { color: var(--muted) !important; }
.note--warn { color: var(--orange) !important; }
.note code { font-family: var(--mono); font-size: 11.5px; background: rgba(255,255,255,.6); padding: 1px 4px; border-radius: 4px; }
.pane__body--short { min-height: 220px; }
.pane__body--short .src { min-height: 220px; }
.pane__body--stack { display: flex; flex-direction: column; }
.pane__body--stack .src { flex: 1; min-height: 360px; resize: none; }
.pane__body--stack .preview-scroll { flex: 1; min-height: 360px; }
.pane__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px; border-top: 1px solid var(--line-2); background: #FBFAFE; }
.preview-scroll { overflow: auto; max-height: 70vh; min-height: 480px; }
.preview { padding: 22px 26px; }
.hint-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin-top: -20px; }
.hint-line .ico { margin-top: 2px; color: var(--violet); }

/* Editor */
.editor-host { height: 70vh; min-height: 480px; overflow: hidden; }
.editor-host .cm-editor { height: 100%; }
.bench--editor .preview-scroll { height: 70vh; max-height: none; }
.fmt { display: flex; gap: 2px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.fmt__b { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px; color: var(--ink-2); display: grid; place-items: center; font-size: 15px; }
.fmt__b:hover { background: var(--violet-tint); color: var(--violet); }
.fmt__mono { font-family: var(--mono); font-size: 12px; font-weight: 600; }

/* PDF paper preview */
.paper-scroll { overflow: auto; max-height: 75vh; padding: 20px; display: flex; justify-content: center; align-items: flex-start; }
.paper { background: #fff; box-shadow: 0 6px 22px rgba(30,26,58,.14); transform-origin: top left; flex: none; box-sizing: border-box; }
.doc { font-size: 11pt; }
.doc .pb { border-top: 2px dashed #C9C2EA; margin: 24px -10px; position: relative; height: 0; }
.doc .pb::after { content: "Page break"; position: absolute; right: 0; top: -10px; font: 600 10px/1 var(--font); color: #8E8AA3; background: #fff; padding: 0 6px; text-transform: uppercase; letter-spacing: .05em; }
.doc--document { font-family: Georgia, "Times New Roman", serif; color: #1a1a1a; }
.doc--document h1, .doc--document h2, .doc--document h3 { font-family: Georgia, "Times New Roman", serif; border: 0; }
.doc--document h1 { text-align: center; font-size: 2em; }
.doc--document pre { background: #f7f7f7; }
.doc--minimal h1, .doc--minimal h2 { border: 0; }
.doc--minimal th, .doc--minimal td { border: 0; border-bottom: 1px solid #E7E4EE; }
.doc--minimal th { background: none; }
.doc--minimal tr:nth-child(2n) td { background: none; }
.doc--minimal pre { background: none; border-left: 3px solid #E7E4EE; border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0; }
.doc table { display: table; width: auto; }

@media print {
  #print-root .doc { font-size: 11pt; color: #000; }
  #print-root .doc .pb { break-after: page; page-break-after: always; border: 0; margin: 0; }
  #print-root .doc .pb::after { content: none; }
  #print-root .doc h1, #print-root .doc h2, #print-root .doc h3, #print-root .doc h4 { break-after: avoid; page-break-after: avoid; }
  #print-root .doc pre, #print-root .doc blockquote, #print-root .doc img, #print-root .doc tr { break-inside: avoid; page-break-inside: avoid; }
  #print-root .doc table { display: table; width: 100%; }
  #print-root .doc thead { display: table-header-group; }
  #print-root .doc pre { white-space: pre-wrap; word-break: break-word; }
  #print-root .doc a { color: inherit; }
  #print-root .doc tr:nth-child(2n) td { background: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Table generator */
.tg { padding: 16px 16px 8px; border-bottom: 1px solid var(--line); }
.tg__hint { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.tg__scroll { overflow-x: auto; padding-bottom: 8px; }
.tg__grid { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.tg__grid td { border: 1px solid var(--line); padding: 0; background: #fff; min-width: 140px; }
.tg__grid tr td + td { border-left: 0; }
.tg__grid tbody tr + tr td { border-top: 0; }
.tg__head td { background: #F5F3FA; }
.tg__head .tg__cell { font-weight: 600; }
.tg__cell { width: 100%; min-width: 120px; height: 42px; border: 0; padding: 0 12px; font-size: 14px; background: transparent; outline: none; }
.tg__cell:focus { box-shadow: inset 0 0 0 2px var(--violet); background: #fff; }
.tg__ctl th { padding: 0 0 6px; font-weight: 400; }
.tg__colbar { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.seg--xs button { height: 30px; width: 32px; padding: 0; display: grid; place-items: center; }
.tg__rowctl { width: 64px; padding-right: 6px; text-align: right; font-weight: 400; }
.tg__lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tg__del { width: 30px; height: 30px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--faint); font-size: 18px; line-height: 1; }
.tg__del:hover:not([disabled]) { color: var(--rose); border-color: #F6CFDF; background: var(--rose-tint); }
.tg__del[disabled] { opacity: .3; cursor: not-allowed; }
.tg__out .pane__body .preview { padding: 16px 20px; }

/* Modal (import) reuses the palette shell */
.modal { max-width: 560px; }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 18px; }
.modal__body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.modal__ta { min-height: 200px; border: 1px solid var(--line); border-radius: 10px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-2); }

@media (max-width: 760px) {
  .editor-host, .bench--editor .preview-scroll { height: 62vh; min-height: 360px; }
  .fmt { width: 100%; justify-content: space-between; }
  .fmt__b { width: 34px; }
  .bench__bar .check { min-height: 36px; }
  .paper-scroll { padding: 12px; max-height: none; }
  .preview-scroll { max-height: none; min-height: 360px; }
  .preview { padding: 18px 16px; }
  .hint-line { margin-top: -24px; font-size: 13px; }
  .tg { padding: 12px; }
  .tg__out .pane + .pane { border-top: 1px solid var(--line); }
  .pane__head .note--muted code { display: none; }
}
@media (max-width: 760px) {
  /* Table generator shows both output panes stacked (no tabs). */
  .tg__out .pane { display: flex !important; }
}

/* ── Shared bits for the second batch of tools ───────────── */
.src--prose { font-family: var(--font); font-size: 15.5px; line-height: 1.65; }
.bar-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.linkbtn { border: 0; background: none; color: var(--violet); font-size: 12.5px; font-weight: 600; padding: 4px 6px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; text-transform: none; letter-spacing: 0; }
.linkbtn:hover { background: var(--violet-tint); }
.empty { padding: 28px 22px; color: var(--muted); font-size: 14.5px; }
.empty code { font-family: var(--mono); background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
.empty--ok { color: var(--teal); font-weight: 600; }
.btn--lg { height: 54px; padding: 0 28px; font-size: 16px; border-radius: 14px; min-width: 120px; }

/* Status line */
.status { padding: 0 16px; font-size: 14px; border-bottom: 1px solid var(--line); background: #fff; }
.status:empty { display: none; }
.status:not(:empty) { padding: 10px 16px; }
.status--ok { background: #EEF9F3; color: #0E6B44; border-color: #CDEBDC; }
.status--warn { background: #FFF7EA; color: #7A4B00; }
.status--error { background: #FDEEF2; color: #8E1B3F; border-color: #F6CFDF; }
.status__snip { margin: 8px 0 4px; font-family: var(--mono); font-size: 12.5px; background: rgba(255,255,255,.7); padding: 8px 10px; border-radius: 8px; overflow-x: auto; color: var(--ink); white-space: pre; }
.status__warn, .status__hint { display: block; margin-top: 4px; font-size: 13.5px; }
.status code { font-family: var(--mono); font-size: 12.5px; }

/* Stat cards */
.statbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #FBFAFE; }
.stat { border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-family: var(--font); font-weight: 700; font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; font-weight: 600; }
.stat--violet { background: var(--violet-tint); color: var(--violet); }
.stat--blue { background: var(--blue-tint); color: var(--blue); }
.stat--teal { background: var(--teal-tint); color: var(--teal); }
.stat--rose { background: var(--rose-tint); color: var(--rose); }
.pane--side { flex: 0 1 340px; }
.pane--side .pane__body { padding: 8px 18px 18px; min-height: 0; }
.details { margin: 0; display: flex; flex-direction: column; }
.details div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.details__h { font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.kw { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.kw li { display: flex; justify-content: space-between; gap: 10px; }
.kw b { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.goalbar { position: relative; margin: 0; height: 34px; background: var(--line-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.goalbar__fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--violet-tint); transition: width .2s; }
.goalbar__fill.is-done { background: #DDF4E6; }
.goalbar span { position: relative; display: flex; align-items: center; height: 100%; padding: 0 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

/* Limits (character counter) */
.limits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.limit__top { display: flex; justify-content: space-between; font-size: 14px; gap: 8px; }
.limit__top b { font-variant-numeric: tabular-nums; }
.limit__bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.limit__bar i { display: block; height: 100%; border-radius: 99px; background: var(--teal); transition: width .15s; }
.limit--near .limit__bar i { background: #D98A00; }
.limit--near .limit__top b { color: #8A5600; }
.limit--over .limit__bar i { background: var(--rose); }
.limit--over .limit__top b { color: var(--rose); }
.limit__sub { font-size: 12px; color: var(--muted); }

/* HTML → Markdown rich input */
.rich { min-height: 480px; padding: 18px; outline: none; background: #fff; overflow: auto; max-height: 70vh; }
.rich:empty::before { content: attr(data-placeholder); color: var(--faint); }

/* Escape: renders-as box */
.renders { border-top: 1px solid var(--line-2); padding: 12px 16px; background: #FBFAFE; max-height: 220px; overflow: auto; }
.renders__label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.renders__md { font-size: 14px; }

/* Table → CSV */
.csvlist { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.csvcard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.csvcard__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; background: var(--teal-tint); color: var(--teal); }
.csvcard__head h3 { font-family: var(--font); font-size: 15px; letter-spacing: 0; }
.csvcard__head span { font-size: 12.5px; font-weight: 600; }
.csvcard__table { overflow-x: auto; padding: 10px 14px 0; }
.csvcard__table table { border-collapse: collapse; font-size: 13px; }
.csvcard__table th, .csvcard__table td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; white-space: nowrap; }
.csvcard__table th { background: #F5F3FA; }
.csvcard__table .more { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.csvcard__csv { margin: 10px 14px; padding: 10px 12px; background: #FBFAFE; border: 1px solid var(--line-2); border-radius: 8px; font-family: var(--mono); font-size: 12.5px; max-height: 160px; overflow: auto; white-space: pre; }
.csvcard__actions { display: flex; gap: 8px; justify-content: flex-end; padding: 0 14px 14px; }

/* Diff */
.diffhead { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #FBFAFE; flex-wrap: wrap; }
.diffhead__h { font-family: var(--font); font-size: 15px; letter-spacing: 0; }
.diffstat { flex: 1; font-size: 13.5px; color: var(--muted); }
.diffstat .plus { color: #127A47; font-weight: 700; }
.diffstat .minus { color: var(--rose); font-weight: 700; }
.diffscroll { overflow: auto; max-height: 70vh; }
.difftable { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13px; line-height: 1.6; table-layout: fixed; }
.difftable--split col, .difftable td.ln { width: 48px; }
.difftable td { padding: 1px 10px; vertical-align: top; white-space: pre-wrap; word-break: break-word; }
.difftable td.ln { color: var(--faint); text-align: right; user-select: none; background: #FBFAFE; border-right: 1px solid var(--line-2); font-size: 12px; }
.difftable td.del { background: #FDECEF; }
.difftable td.add { background: #E8F7EE; }
.difftable td.empty-cell { background: repeating-linear-gradient(-45deg, #FAFAFC, #FAFAFC 6px, #F3F2F7 6px, #F3F2F7 12px); }
.difftable del { background: #F7C2CF; text-decoration: none; border-radius: 3px; }
.difftable ins { background: #B8E8CB; text-decoration: none; border-radius: 3px; }
.difftable .sign { display: inline-block; width: 16px; color: var(--muted); user-select: none; }
.difftable tr.fold td { background: var(--soft); color: var(--muted); text-align: center; font-family: var(--font); font-size: 12.5px; padding: 6px; }
.difftable--split td.tx:nth-child(2) { border-right: 1px solid var(--line); }

/* Link checker */
.pane--narrow { flex: 1 1 360px; }
.pane--wide { flex: 2 1 560px; }
.livenote { display: flex; gap: 8px; align-items: flex-start; margin: 14px 16px 6px; padding: 10px 12px; font-size: 13px; color: var(--ink-2); background: var(--soft); border-radius: 10px; }
.livenote .ico { margin-top: 2px; color: var(--violet); }
.linktable-wrap { overflow-x: auto; padding: 0 8px 12px; }
.linktable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.linktable th { text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); }
.linktable td { padding: 10px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.lt-line { color: var(--faint); font-variant-numeric: tabular-nums; width: 44px; }
.lt-link { min-width: 220px; }
.lt-link strong { font-weight: 600; margin-right: 4px; }
.lt-link code { display: block; font-family: var(--mono); font-size: 12px; color: var(--blue); word-break: break-all; margin-top: 2px; }
.lt-kind { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--line-2); padding: 1px 6px; border-radius: 99px; }
.redir { display: block; color: var(--muted); font-size: 11.5px; word-break: break-all; margin-top: 3px; }
.pill-s { display: inline-flex; gap: 5px; align-items: baseline; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; line-height: 1.4; }
.pill-s--ok { background: #E8F7EE; color: #0E6B44; }
.pill-s--warn { background: #FFF2DB; color: #7A4B00; }
.pill-s--error { background: #FDECEF; color: #8E1B3F; }
.pill-s--info { background: var(--line-2); color: var(--muted); }
.c-err { color: var(--rose); font-weight: 700; }
.c-warn { color: #8A5600; font-weight: 700; }

/* Regex tester */
.rx { padding: 14px 16px; border-bottom: 1px solid var(--line); background: #FBFAFE; display: flex; flex-direction: column; gap: 8px; }
.rx__row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rx__pattern { flex: 1 1 420px; display: flex; align-items: center; gap: 2px; height: 50px; padding: 0 14px; border: 1.5px solid #D6D2E2; border-radius: 12px; background: #fff; font-family: var(--mono); font-size: 16px; }
.rx__pattern:focus-within { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(91,63,217,.12); }
.rx__pattern input { flex: 1; min-width: 0; border: 0; outline: 0; font-family: var(--mono); font-size: 16px; color: var(--ink); background: transparent; height: 46px; padding: 0 4px; font-variant-ligatures: none; }
.rx__slash { color: var(--faint); font-size: 18px; }
.rx__flagtext { color: var(--violet); font-weight: 600; min-width: 18px; }
.rx__flags { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.rx__flags code { font-family: var(--mono); color: var(--violet); font-weight: 600; }
.rx__replace { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line-2); background: #FBFAFE; flex-wrap: wrap; }
.rx__repl { flex: 1; min-width: 160px; font-family: var(--mono); }
.rx__hl { margin: 0; padding: 18px; font-family: var(--mono); font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.rx__hl mark { border-radius: 3px; padding: 1px 0; }
.rx__hl mark.m0 { background: #FFE58A; }
.rx__hl mark.m1 { background: #BFE3FF; }
.rx__hl .zero { display: inline-block; width: 2px; height: 1em; background: var(--rose); vertical-align: middle; }
.rx__list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.rx__m { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.rx__mh { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.rx__mh b { color: var(--ink); }
.rx__mv { font-family: var(--mono); font-size: 13.5px; background: #FFF6CC; padding: 2px 6px; border-radius: 5px; word-break: break-all; }
.rx__m ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.rx__m li { display: flex; gap: 10px; }
.rx__m li span { color: var(--muted); min-width: 70px; }
.rx__m li code { font-family: var(--mono); word-break: break-all; }
.rx__explain { list-style: none; margin: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.rx__explain li { display: flex; gap: 12px; align-items: baseline; font-size: 14px; }
.rx__explain code { font-family: var(--mono); font-size: 13px; background: var(--violet-tint); color: var(--violet); padding: 2px 7px; border-radius: 6px; min-width: 52px; text-align: center; white-space: pre; }

/* Base64 */
.filedrop { min-height: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; color: var(--violet); }
.filedrop p { color: var(--ink-2); font-size: 15px; }
.filedrop .muted { font-size: 13.5px; color: var(--muted); }
.b64preview { border-top: 1px solid var(--line-2); padding: 14px; background: repeating-conic-gradient(#F3F2F7 0% 25%, #fff 0% 50%) 50% / 16px 16px; text-align: center; }
.b64preview img { max-height: 240px; margin: 0 auto; box-shadow: 0 2px 10px rgba(0,0,0,.1); }

/* DOCX preview paper */
.paper--flow { width: 100%; max-width: 640px; padding: 48px 52px; margin: 0 auto; }

/* Cheatsheet */
.cheat { display: flex; flex-direction: column; gap: 18px; }
.cheat__bar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 10px; display: flex; flex-direction: column; gap: 10px; }
.cheat__search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border: 1.5px solid #D6D2E2; border-radius: 12px; background: #fff; color: var(--violet); max-width: 520px; }
.cheat__search input { flex: 1; border: 0; outline: 0; font-size: 15px; color: var(--ink); background: transparent; }
.cheat__toc { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.cheat__toc a { flex: none; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--violet); background: var(--violet-tint); padding: 6px 12px; border-radius: 99px; }
.cheat__sec { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; scroll-margin-top: 120px; }
.cheat__sec[hidden] { display: none; }
.cheat__head { display: flex; align-items: center; gap: 10px; }
.cheat__head h2 { font-size: 22px; }
.gfm { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--teal); background: var(--teal-tint); padding: 3px 8px; border-radius: 99px; }
.cheat__desc { color: var(--muted); font-size: 14.5px; margin: 6px 0 14px; }
.cheat__ex { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cheat__ex + .cheat__ex { margin-top: 12px; }
.cheat__src { background: #FBFAFE; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.cheat__src pre { margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.65; white-space: pre-wrap; flex: 1; }
.cheat__src .src { min-height: 220px; background: #FBFAFE; }
.cheat__out { padding: 0 0 4px; }
.cheat__out .md { padding: 14px 18px; font-size: 14.5px; }
.cheat__label { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 6px 16px; min-height: 34px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-2); }

/* Timer & stopwatch */
.clock { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: 0 6px 24px rgba(30,26,58,.06); padding: 20px 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.clock__tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: #ECE9F4; border-radius: 12px; width: 100%; max-width: 480px; }
.clock__tabs button { height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 15px; }
.clock__tabs button[aria-selected="true"] { background: #fff; color: var(--rose); box-shadow: 0 1px 4px rgba(30,26,58,.12); }
.clock__panel { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; }
.clock__panel[hidden] { display: none; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip-l { height: 42px; padding: 0 16px; border-radius: 99px; border: 1px solid #F6CFDF; background: var(--rose-tint); color: var(--rose); font-weight: 600; font-size: 14px; }
.chip-l:hover { background: #F9D9E6; }
.ring { position: relative; width: min(78vw, 380px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__bg { fill: none; stroke: #F3F1F8; stroke-width: 7; }
.ring__fg { fill: none; stroke: var(--rose); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring__inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.bigtime { font-family: var(--display); font-weight: 700; font-size: clamp(52px, 13vw, 84px); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1; }
.bigtime--sw { font-size: clamp(56px, 14vw, 104px); padding: 30px 0 10px; }
.clock__sub { font-size: 14px; color: var(--muted); font-weight: 500; }
.hms { display: flex; gap: 6px; align-items: baseline; }
.hms label { display: flex; align-items: baseline; gap: 2px; }
.hms input { width: 2.3ch; border: 0; border-bottom: 2px solid var(--line); background: transparent; font-family: var(--display); font-weight: 700; font-size: clamp(40px, 10vw, 64px); text-align: center; color: var(--ink); padding: 0; -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
.hms input::-webkit-outer-spin-button, .hms input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hms input:focus { outline: none; border-color: var(--rose); }
.hms span { font-size: 18px; color: var(--muted); font-weight: 600; margin-right: 6px; }
.clock__ctl { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.clock__ctl .btn--primary { background: var(--rose); border-color: var(--rose); }
.clock__ctl .btn--primary:hover { background: #961D4E; border-color: #961D4E; }
.clock__foot { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: center; border-top: 1px solid var(--line-2); padding-top: 12px; width: 100%; }
.clock.is-done .ring__fg { stroke: var(--lime); }
.clock.is-done .bigtime { animation: pulse 0.6s ease-in-out 6; color: var(--rose); }
@keyframes pulse { 50% { opacity: .35; } }
.laps-wrap { width: 100%; max-width: 520px; max-height: 320px; overflow: auto; }
.laps { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.laps th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.laps td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); font-family: var(--mono); }
.laps tr.best td { color: #0E6B44; font-weight: 600; }
.laps tr.worst td { color: var(--rose); font-weight: 600; }
.pomo-phase { font-weight: 700; font-size: 15px; padding: 6px 16px; border-radius: 99px; background: var(--rose-tint); color: var(--rose); }
.pomo-phase--short, .pomo-phase--long { background: var(--teal-tint); color: var(--teal); }
.clock[data-phase="short"] .ring--pomo .ring__fg, .clock[data-phase="long"] .ring--pomo .ring__fg { stroke: var(--teal); }
.pomo-set { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.clock.is-full { justify-content: center; border-radius: 0; border: 0; }
.clock.is-full .ring { width: min(80vh, 80vw); }
.clock.is-full .bigtime { font-size: min(18vh, 15vw); }
.clock.is-full .bigtime--sw { font-size: min(24vh, 17vw); }
.hint-line kbd { border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: #fff; }

@media (max-width: 760px) {
  .statbar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 8px; }
  .stat strong { font-size: 24px; }
  .pane--side { flex-basis: 100%; }
  .bench:not(.has-tabs) .pane + .pane { border-top: 1px solid var(--line); }
  .bench .pane--side { display: flex !important; }
  .difftable { font-size: 12px; }
  .difftable td.ln { width: 30px; padding: 1px 4px; }
  .rx__pattern { flex-basis: 100%; }
  .linktable th:nth-child(1), .linktable td:nth-child(1) { display: none; }
  .cheat__sec { padding: 14px; }
  .cheat__src { border-right: 0; border-bottom: 1px solid var(--line); }
  .clock { padding: 14px 10px; }
  .btn--lg { min-width: 0; padding: 0 22px; }
}
