/* Dev Utilities — leans on ../css/protium-ui.css tokens.
   Layout mirrors encode-hash (sidebar + content), with tool-specific bits. */

.page { flex: 1; min-height: 0; padding: 24px 32px; overflow: hidden; }
.layout { height: 100%; max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: stretch; }

/* Sidebar */
.sidebar { height: 100%; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; }
.side-section { font-size: 12.5px; font-weight: 700; color: var(--text); padding: 12px 8px 6px; margin-top: 8px; border-top: 1px solid var(--border-faint); text-transform: uppercase; letter-spacing: 0.03em; }
.side-section:first-child { margin-top: 0; border-top: 0; padding-top: 2px; }
.side-group { margin-bottom: 12px; }
.side-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); padding: 4px 8px; margin-bottom: 2px; }
.side-item { display: block; width: 100%; text-align: left; font: inherit; font-size: 13.5px; color: var(--text-muted); background: transparent; border: 0; border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; transition: background var(--t), color var(--t); }
.side-item:hover { background: var(--surface-2); color: var(--text); }
.side-item.is-active { background: var(--accent-soft); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }

/* Content */
.content { min-width: 0; height: 100%; overflow-y: auto; }
.tool-head { margin-bottom: 18px; }
.tool-head h1 { font-family: var(--font-display); font-size: 27px; letter-spacing: -0.01em; margin-bottom: 5px; }
.tool-head p { color: var(--text-muted); font-size: 15px; }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px 26px; }
.card h3 { font-size: 14px; font-weight: 600; }
.field { display: block; }
.field > span { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.note { color: var(--text-muted); font-size: 13px; margin-top: 12px; }
.note.is-error { color: var(--accent); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Result rows (shared with the encode-hash look) */
.result { margin-top: 16px; background: var(--field); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; }
.result:empty { display: none; }
.r-line { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--border-faint); font-size: 14px; align-items: center; }
.r-line:last-child { border-bottom: 0; }
.r-line .k { color: var(--text-muted); }
.r-line .v { color: var(--text); font-weight: 600; text-align: right; }

/* Segmented control + option toggles */
.du-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.du-toolbar .opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; user-select: none; }
.du-toolbar .opt input { accent-color: var(--accent); width: 15px; height: 15px; }
.du-toolbar .opt code { font-family: var(--font-mono); font-weight: 600; color: var(--text); }
.du-actions { margin-top: 12px; }

textarea.du-area {
  width: 100%; min-height: 120px; resize: vertical;
  background: var(--field); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 12px 14px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.55; box-sizing: border-box;
}
textarea.du-area:focus { outline: none; border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }

.du-iolabel > span { font-size: 13px; color: var(--text-muted); }
.du-out {
  width: 100%; min-height: 70px;
  background: var(--field); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 14px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; box-sizing: border-box;
}
.du-out .du-placeholder { color: var(--text-faint); }
.eh-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* --- Regex tester ------------------------------------------------------- */
.rx-pat { display: flex; align-items: center; gap: 4px; background: var(--field); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 8px 12px; }
.rx-pat:focus-within { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }
.rx-slash { color: var(--text-faint); font-family: var(--font-mono); font-size: 15px; }
.rx-input { flex: 1; border: 0; background: transparent; color: var(--text); font-family: var(--font-mono); font-size: 14px; outline: none; }
.rx-flags-echo { color: var(--accent); font-family: var(--font-mono); font-size: 14px; min-width: 8px; }
.rx-status { margin-top: 12px; font-size: 13px; color: var(--text-muted); min-height: 18px; }
.rx-status.is-ok { color: var(--text-muted); }
.rx-status.is-error { color: var(--accent); font-weight: 500; }
.rx-hl mark { background: var(--accent-soft); color: var(--text); border-radius: 3px; box-shadow: inset 0 0 0 1px var(--accent-ring); padding: 0 1px; }
.rx-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.rx-row { background: var(--surface-2); border: 1px solid var(--border-faint); border-radius: var(--r-md); padding: 9px 12px; font-size: 13px; }
.rx-idx { color: var(--text-faint); font-family: var(--font-mono); font-size: 11.5px; margin-right: 10px; }
.rx-match { font-family: var(--font-mono); color: var(--text); word-break: break-all; }
.rx-groups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.rx-grp { font-size: 12px; color: var(--text-muted); background: var(--field); border: 1px solid var(--border-faint); border-radius: var(--r-sm); padding: 2px 8px; font-family: var(--font-mono); }
.rx-grp b { color: var(--accent); }
.rx-grp i { color: var(--text-faint); }

/* --- Colour converter --------------------------------------------------- */
.col-in-row { display: flex; gap: 10px; align-items: center; }
.col-in-row .pt-input { flex: 1; font-family: var(--font-mono); }
.col-pick { width: 42px; height: 42px; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--field); cursor: pointer; }
.col-pick::-webkit-color-swatch-wrapper { padding: 3px; }
.col-pick::-webkit-color-swatch { border: 0; border-radius: 6px; }
.col-swatch { margin-top: 16px; height: 90px; border-radius: var(--r-md); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 13px; }
.col-swatch.is-bad { background: var(--field) !important; color: var(--accent); }

.col-contrast { margin-top: 12px; }
.col-preview { border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 20px; display: flex; align-items: baseline; gap: 14px; }
.col-preview .cp-big { font-size: 30px; font-weight: 700; }
.col-preview .cp-small { font-size: 14px; }
.col-ratio { margin-top: 12px; font-size: 15px; color: var(--text-muted); }
.col-ratio b { color: var(--text); font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 20px; }
.wcag-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wcag-cell { background: var(--surface-2); border: 1px solid var(--border-faint); border-radius: var(--r-md); padding: 12px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wcag-lbl { font-size: 13px; color: var(--text-muted); margin-right: auto; }
.wcag-badge { font-size: 12px; font-weight: 700; border-radius: var(--r-sm); padding: 3px 9px; }
.wcag-badge.ok { color: #6fe0aa; background: rgba(52, 199, 134, 0.12); border: 1px solid rgba(52, 199, 134, 0.4); }
.wcag-badge.no { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-ring); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .wcag-grid { grid-template-columns: 1fr; }
}
