*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f11;
  --surface: #1a1a1f;
  --surface2: #242429;
  --border: #2e2e36;
  --text: #e8e8f0;
  --muted: #888896;
  --accent: #7c6af7;
  --accent-h: #9080ff;
  --green: #4caf7d;
  --red: #e05c6e;
  --green-bg: #162a1f;
  --red-bg: #2a1219;
  --r: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
header {
  height: 54px;
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }

nav { display: flex; gap: 2px; }

.tab-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  transition: all .15s;
}
.tab-btn:hover,
.tab-btn.active { color: var(--text); background: var(--surface2); }

/* ── Layout ── */
main { padding: 36px 40px; max-width: 1600px; margin: 0 auto; }
.tool { display: none; }
.tool.active { display: block; }

/* ── Shared: buttons ── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: 11px 36px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  min-width: 110px;
}
.btn-primary:hover { background: var(--accent-h); }

.btn-ghost {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 20px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.btn-ghost:hover { color: var(--text); border-color: #55556a; }

/* ── Shared: page heading ── */
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.page-sub   { font-size: 13.5px; color: var(--muted); margin-bottom: 28px; }

/* ── Shared: input group ── */
.input-group { display: flex; flex-direction: column; gap: 8px; }

.input-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}

textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  padding: 14px;
  resize: vertical;
  min-height: 190px;
  outline: none;
  transition: border-color .15s;
}
textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: #3e3e4a; }

/* ── Shared: toggle ── */
.toggle-row   { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.toggle-label { font-size: 12px; color: var(--muted); }

.toggle {
  appearance: none;
  width: 32px; height: 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  position: relative;
  transition: background .2s;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: all .2s;
}
.toggle:checked { background: var(--accent); border-color: var(--accent); }
.toggle:checked::after { left: 16px; background: #fff; }

/* ═══════════════════════════════════════
   POMODORO
═══════════════════════════════════════ */
.pomo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding-top: 12px;
}

.mode-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 4px;
  gap: 2px;
}

.mode-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 22px;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: all .15s;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active { background: var(--accent); color: #fff; }

.timer-ring { position: relative; width: 260px; height: 260px; }
.timer-ring svg { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }

.ring-bg    { fill: none; stroke: var(--surface2); stroke-width: 6; }
.ring-track {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-display {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
}

.timer-time  { font-size: 58px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.timer-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }

.pomo-controls { display: flex; gap: 10px; }

.session-dots { display: flex; gap: 10px; }

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  transition: all .25s;
}
.dot.done    { background: var(--accent); border-color: var(--accent); }
.dot.current { border-color: var(--accent); }

.session-info { font-size: 13px; color: var(--muted); }

/* ═══════════════════════════════════════
   TEXT DIFF
═══════════════════════════════════════ */
.diff-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.diff-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }

.diff-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.diff-result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.diff-stats { display: flex; gap: 10px; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-add { background: var(--green-bg); color: var(--green); }
.badge-rem { background: var(--red-bg);   color: var(--red);   }

.diff-lines {
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
}

.diff-line { display: flex; min-height: 26px; }
.diff-line:hover { filter: brightness(1.12); }

.line-num {
  min-width: 46px;
  text-align: right;
  padding: 2px 10px 2px 4px;
  color: var(--muted);
  user-select: none;
  font-size: 11px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.line-sign {
  min-width: 22px;
  text-align: center;
  padding: 2px 0;
  flex-shrink: 0;
  font-weight: 700;
}

.line-content {
  padding: 2px 14px;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-all;
}

.diff-line.added     { background: var(--green-bg); }
.diff-line.added     .line-sign { color: var(--green); }
.diff-line.removed   { background: var(--red-bg); }
.diff-line.removed   .line-sign { color: var(--red); }
.diff-line.unchanged .line-sign { color: transparent; }

.diff-separator {
  padding: 4px 16px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.diff-empty {
  padding: 52px;
  text-align: center;
  color: #3e3e4a;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ═══════════════════════════════════════
   JSON FORMATTER
═══════════════════════════════════════ */
.json-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }

.json-stats { display: flex; gap: 6px; margin-left: auto; }

.json-stat-pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--muted);
}

.json-error {
  display: none;
  background: var(--red-bg);
  border: 1px solid #6b2530;
  border-radius: var(--r);
  padding: 11px 16px;
  margin-bottom: 16px;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12.5px;
  color: var(--red);
}

.json-output-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.json-output-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.json-copy-btn { padding: 4px 14px; font-size: 12px; }

.json-output {
  margin: 0;
  padding: 16px 18px;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre;
  overflow-x: auto;
  min-height: 120px;
  max-height: 540px;
  overflow-y: auto;
  color: var(--text);
}

.json-placeholder { color: #3e3e4a; }

.j-key  { color: #a78bfa; }
.j-str  { color: #6ee7a0; }
.j-num  { color: #f9a74b; }
.j-bool { color: #60b8f8; }
.j-null { color: #e05c6e; }

/* ═══════════════════════════════════════
   REGEX TESTER
═══════════════════════════════════════ */
.rx-pattern-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.rx-pattern-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color .15s;
}
.rx-pattern-wrap:focus-within { border-color: var(--accent); }

.rx-slash {
  padding: 0 10px;
  color: var(--muted);
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 17px;
  user-select: none;
  flex-shrink: 0;
}

.rx-pattern-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 14px;
  padding: 11px 0;
  outline: none;
  min-width: 0;
}

.rx-flags { display: flex; gap: 2px; padding-right: 8px; flex-shrink: 0; }

.rx-flag {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  transition: all .15s;
}
.rx-flag:hover { color: var(--text); background: var(--surface2); }
.rx-flag.active { color: var(--accent); background: rgba(124, 106, 247, 0.15); }

.rx-error {
  display: none;
  background: var(--red-bg);
  border: 1px solid #6b2530;
  border-radius: var(--r);
  padding: 11px 16px;
  margin-bottom: 16px;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12.5px;
  color: var(--red);
}

.rx-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 16px;
}

.rx-output-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.rx-count {
  display: none;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
}

.rx-highlight {
  margin: 0;
  padding: 14px 18px;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 220px;
  overflow-y: auto;
  color: var(--text);
}

.rx-highlight mark {
  background: rgba(124, 106, 247, 0.3);
  color: #d4c8ff;
  border-radius: 2px;
  padding: 0 1px;
}

.rx-placeholder { color: #3e3e4a; }

.rx-match-list {
  display: none;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}

.rx-match-list-header {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.rx-match-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12.5px;
}
.rx-match-item:last-child { border-bottom: none; }
.rx-match-item:hover { background: var(--surface2); }

.rx-match-num  { color: var(--muted); font-size: 11px; min-width: 28px; }
.rx-match-val  { color: #c4b5fd; }
.rx-match-idx  { color: var(--muted); font-size: 11px; margin-right: auto; }

.rx-match-groups { display: flex; gap: 6px; flex-wrap: wrap; }

.rx-group {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--muted);
}
.rx-group span { color: var(--text); }

/* ═══════════════════════════════════════
   MARKDOWN PREVIEWER
═══════════════════════════════════════ */
.md-actions { display: flex; gap: 10px; margin-bottom: 16px; }

.md-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: calc(100vh - 220px);
  min-height: 480px;
}

.md-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}

.md-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.md-editor {
  flex: 1;
  resize: none;
  min-height: 0;
  border: none !important;
  border-radius: 0 !important;
  padding: 16px 18px !important;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
  background: transparent !important;
}

.md-preview {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.md-placeholder { color: #3e3e4a; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

/* Preview typography */
.md-preview h1,
.md-preview h2,
.md-preview h3,
.md-preview h4,
.md-preview h5,
.md-preview h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.25;
  color: var(--text);
}
.md-preview h1 { font-size: 1.9em; padding-bottom: 0.3em; border-bottom: 1px solid var(--border); }
.md-preview h2 { font-size: 1.45em; padding-bottom: 0.2em; border-bottom: 1px solid var(--border); }
.md-preview h3 { font-size: 1.2em; }
.md-preview h4 { font-size: 1em; }
.md-preview h1:first-child,
.md-preview h2:first-child { margin-top: 0; }

.md-preview p  { margin: 0.85em 0; }
.md-preview p:first-child { margin-top: 0; }

.md-preview a  { color: var(--accent); text-decoration: none; }
.md-preview a:hover { text-decoration: underline; }

.md-preview strong { font-weight: 700; }
.md-preview em     { font-style: italic; }
.md-preview del    { color: var(--muted); }

.md-preview code {
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 0.88em;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}

.md-preview pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 1em 0;
}
.md-preview pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.6;
}

.md-preview blockquote {
  border-left: 3px solid var(--accent);
  margin: 1em 0;
  padding: 4px 0 4px 18px;
  color: var(--muted);
}

.md-preview ul,
.md-preview ol  { margin: 0.8em 0; padding-left: 1.8em; }
.md-preview li  { margin: 0.3em 0; }

.md-preview hr  {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.md-preview img { max-width: 100%; border-radius: var(--r); }

.md-preview table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 13px; }
.md-preview th,
.md-preview td   { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.md-preview th   { background: var(--surface2); font-weight: 600; }

/* ═══════════════════════════════════════
   BASE64
═══════════════════════════════════════ */
.b64-io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.b64-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}

.b64-file-row input[type="file"] { display: none; }

.output-textarea {
  background: var(--surface2) !important;
  color: var(--muted) !important;
  cursor: default;
}

/* ═══════════════════════════════════════
   URL ENCODER
═══════════════════════════════════════ */
.url-params {
  display: none;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-top: 16px;
}

.url-params-header {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
}

.url-params-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12.5px;
  background: var(--surface);
}
.url-params-table th,
.url-params-table td {
  padding: 7px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.url-params-table tr:last-child td { border-bottom: none; }
.url-params-table th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.url-params-table td:first-child { color: var(--accent); }

/* ═══════════════════════════════════════
   HASH GENERATOR
═══════════════════════════════════════ */
.hash-results {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}

.hash-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12px;
}
.hash-row:last-child { border-bottom: none; }

.hash-algo {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  min-width: 62px;
  flex-shrink: 0;
}

.hash-val {
  flex: 1;
  word-break: break-all;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.hash-copy { padding: 4px 12px; font-size: 11px; flex-shrink: 0; }

.hash-empty {
  padding: 36px;
  text-align: center;
  color: #3e3e4a;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ═══════════════════════════════════════
   JWT DECODER
═══════════════════════════════════════ */
.jwt-output {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.jwt-panel {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}

.jwt-panel-header {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.jwt-pre {
  margin: 0;
  padding: 14px 16px;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
  color: var(--text);
}

.jwt-sig-val {
  padding: 14px 16px;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 11.5px;
  word-break: break-all;
  color: var(--muted);
  line-height: 1.5;
}

.jwt-status {
  display: none;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.jwt-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.jwt-badge-green { background: var(--green-bg); color: var(--green); }
.jwt-badge-red   { background: var(--red-bg);   color: var(--red);   }

/* ═══════════════════════════════════════
   COLOR PICKER
═══════════════════════════════════════ */
.cp-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.cp-sidebar {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cp-swatch {
  position: relative;
  width: 100%;
  height: 190px;
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  background: #7c6af7;
  transition: box-shadow .15s;
}
.cp-swatch:hover { box-shadow: 0 0 0 2px var(--accent); }
.cp-swatch input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}

.cp-hex-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 15px;
  padding: 9px 14px;
  outline: none;
  transition: border-color .15s;
  text-align: center;
  letter-spacing: 0.08em;
}
.cp-hex-input:focus { border-color: var(--accent); }

.cp-alpha-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.cp-alpha-label { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.cp-alpha-row input[type="range"] { flex: 1; accent-color: var(--accent); min-width: 0; }
.cp-alpha-val { font-size: 11px; color: var(--muted); width: 32px; text-align: right; flex-shrink: 0; }

.cp-section-label {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  margin-bottom: 8px;
}

.cp-swatches { display: flex; flex-wrap: wrap; gap: 7px; }

.cp-recent-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: transform .12s, border-color .12s;
  flex-shrink: 0;
}
.cp-recent-dot:hover { transform: scale(1.18); border-color: rgba(255,255,255,0.4); }

.cp-no-recent { font-size: 12px; color: #3e3e4a; }

.cp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.cp-formats {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.cp-format-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.cp-format-row:last-child { border-bottom: none; }

.cp-fmt-label {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  min-width: 38px;
  flex-shrink: 0;
}

.cp-fmt-val {
  flex: 1;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12.5px;
  color: var(--text);
}

.cp-copy-btn { padding: 4px 12px; font-size: 11px; flex-shrink: 0; }

.cp-contrast-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cp-contrast-chip {
  border-radius: var(--r);
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #7c6af7;
}

.cp-chip-text { font-size: 30px; font-weight: 700; line-height: 1; }

.cp-chip-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.cp-chip-ratio { font-size: 13px; font-weight: 600; }

.cp-chip-badges { display: flex; gap: 4px; }

.cp-wcag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
}
.cp-wcag-pass { background: rgba(76, 175, 125, 0.25); color: #4caf7d; }
.cp-wcag-fail { background: rgba(224, 92, 110, 0.25); color: #e05c6e; }

.cp-chip-label { font-size: 11px; opacity: .65; margin-top: auto; }

.cp-chip-white .cp-chip-text,
.cp-chip-white .cp-chip-ratio,
.cp-chip-white .cp-chip-label { color: #fff; }

.cp-chip-black .cp-chip-text,
.cp-chip-black .cp-chip-ratio,
.cp-chip-black .cp-chip-label { color: #000; }


.version { font-size: 11px; font-weight: 400; opacity: .45; margin-left: 6px; letter-spacing: .02em; }

/* ═══════════════════════════════════════
   CRON
═══════════════════════════════════════ */
.cron-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.cron-expr-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 18px;
  padding: 12px 18px;
  outline: none;
  letter-spacing: .1em;
  transition: border-color .15s;
  min-width: 0;
}
.cron-expr-input:focus { border-color: var(--accent); }
.cron-expr-input::placeholder { color: #3e3e4a; }

.cron-desc {
  display: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 20px;
}

.cron-builder {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.cron-field { display: flex; flex-direction: column; gap: 6px; }

.cron-field-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.cron-field-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 16px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s;
  text-align: center;
  width: 100%;
}
.cron-field-input:focus { border-color: var(--accent); }

.cron-field-hint {
  font-size: 10.5px;
  color: #3e3e4a;
  text-align: center;
}

.cron-syntax-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
.cron-syntax-hint code {
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11.5px;
  color: var(--accent);
}

.cron-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.cron-presets-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.cron-preset-btn { padding: 7px 14px; font-size: 12.5px; }

.cron-runs {
  display: none;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}

.cron-runs-header {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.cron-runs-list { padding: 4px 0; }

.cron-run-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.cron-run-row:last-child { border-bottom: none; }
.cron-run-row:hover { background: var(--surface2); }

.cron-run-num {
  min-width: 28px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.cron-run-time {
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 13px;
  color: var(--text);
}

/* ═══════════════════════════════════════
   RESPONSIVE — TABLET  (≤ 900 px)
═══════════════════════════════════════ */
@media (max-width: 900px) {
  header { padding: 0 20px; gap: 16px; }
  main   { padding: 28px 20px; }

  .cron-builder { grid-template-columns: repeat(3, 1fr); }
}

/* ═══════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 680 px)
═══════════════════════════════════════ */
@media (max-width: 680px) {
  header {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px 0;
    gap: 0;
  }
  .logo { padding: 4px 0 10px; }
  nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0;
    border-top: 1px solid var(--border);
    padding-top: 4px;
    padding-bottom: 4px;
  }
  nav::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }

  main { padding: 20px 14px; }

  /* Two-column grids → single column */
  .diff-inputs    { grid-template-columns: 1fr; }
  .b64-io         { grid-template-columns: 1fr; }
  .jwt-output     { grid-template-columns: 1fr; }

  /* Markdown stacked */
  .md-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .md-panel    { min-height: 300px; }
  .md-editor   { min-height: 300px !important; }

  /* Actions wrap */
  .diff-actions { flex-wrap: wrap; }
  .json-actions { flex-wrap: wrap; }
  .md-actions   { flex-wrap: wrap; }
  .toggle-row   { margin-left: 0; }

  /* Hash rows wrap on tiny screens */
  .hash-row  { flex-wrap: wrap; gap: 6px; }
  .hash-val  { min-width: 0; word-break: break-all; }

  /* Color picker stacks */
  .cp-layout  { flex-direction: column; }
  .cp-sidebar { width: 100%; }
  .cp-swatch  { height: 120px; }
  .cp-contrast-pair { grid-template-columns: 1fr 1fr; }

  /* Cron builder */
  .cron-builder { grid-template-columns: repeat(2, 1fr); }

  /* Pomodoro timer scale down */
  .timer-ring,
  .timer-ring svg { width: 220px; height: 220px; }
  .timer-time     { font-size: 50px; }

  /* Buttons less padding */
  .btn-primary { min-width: auto; padding: 10px 24px; }
}
