/* ============================================================
   Tool-specific styles
   ============================================================ */

/* ---------- calculator ---------- */

.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(250px, .6fr);
  gap: 14px;
  align-items: start;
}
.calc-panel { padding: 18px; }
.calc-screen {
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(500px 160px at 80% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    var(--bg-soft);
  padding: 18px 18px 15px;
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}
.calc-expression {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  text-align: right;
  font-family: var(--mono);
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  letter-spacing: -.01em;
  color: var(--text);
  caret-color: var(--accent);
}
.calc-expression::placeholder { color: var(--faint); }
.calc-preview {
  text-align: right;
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -.035em;
  color: var(--accent);
  min-height: 1.4em;
  overflow-wrap: anywhere;
  transition: color .2s;
}
.calc-preview.error { color: var(--bad); font-size: 1rem; font-weight: 400; font-family: var(--font); }

.calc-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 14px; }
.calc-key {
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  display: grid;
  place-items: center;
  transition: background .15s, transform .1s, border-color .15s, color .15s;
  user-select: none;
}
.calc-key:hover { background: var(--panel-3); border-color: var(--line-strong); }
.calc-key:active { transform: scale(.95); }
.calc-key.fn { color: var(--accent-2); font-size: 12.5px; }
.calc-key.op { color: var(--accent); font-size: 16px; }
.calc-key.warn { color: var(--bad); font-size: 12px; }
.calc-key.eq {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2)));
  color: #fff;
  font-size: 17px;
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.calc-key.eq:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2))); }

.calc-history { padding: 18px; position: sticky; top: 90px; }
.calc-history-list { list-style: none; margin: 0; padding: 0; max-height: 430px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.history-item {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 9px 10px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: background .15s;
}
.history-item:hover { background: var(--panel-2); }
.history-expr { font-family: var(--mono); font-size: 10.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-val { font-family: var(--mono); font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-hint { font-size: 11px; color: var(--faint); line-height: 1.6; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 13px; }
.calc-hint code { font-family: var(--mono); font-size: 10.5px; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; color: var(--muted); }

/* ---------- converter ---------- */

.conv-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.conv-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 26px;
}
.conv-side { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.conv-side-label { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); font-weight: 600; }
.conv-input-wrap { position: relative; }
.conv-number {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  padding: 4px 0 10px;
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  letter-spacing: -.03em;
  outline: none;
  transition: border-color .2s;
  border-radius: 0;
}
.conv-number:focus { border-color: var(--accent); }
.conv-number::-webkit-outer-spin-button, .conv-number::-webkit-inner-spin-button { -webkit-appearance: none; }
.conv-number[type=number] { -moz-appearance: textfield; appearance: textfield; }
.conv-result {
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  letter-spacing: -.03em;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 1.7em;
}
.conv-result small { font-size: 12px; color: var(--faint); font-family: var(--font); letter-spacing: 0; margin-left: 6px; }
.conv-swap {
  align-self: center;
  width: 38px;
  height: 38px;
  margin-top: 12px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: transform .25s var(--ease), color .2s, border-color .2s;
}
.conv-swap:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); transform: rotate(180deg); }
.conv-swap .icon { width: 17px; height: 17px; }
.conv-formula {
  margin-top: 14px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  min-height: 1.5em;
}
.conv-popular { margin-top: 14px; }
.conv-pop-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 20px; }
.conv-pop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  min-width: 0;
}
.conv-pop-row:last-child { border-bottom: 0; }
.conv-pop-unit { color: var(--faint); font-size: 11.5px; flex: none; }
.conv-pop-val { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-pop-row button { border: 0; background: transparent; padding: 0; color: inherit; display: flex; gap: 10px; align-items: baseline; min-width: 0; cursor: pointer; }
.conv-pop-row button:hover .conv-pop-val { color: var(--accent); }

/* ---------- timer ---------- */

.timer-shell { max-width: 690px; margin: 0 auto; }
.timer-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.timer-note { font-size: 11.5px; color: var(--faint); }
.timer-panel {
  padding: 26px;
  background:
    radial-gradient(550px 300px at 50% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    var(--panel);
}
.ring-wrap { width: min(266px, 72vw); height: min(266px, 72vw); margin: 2px auto 24px; position: relative; }
.timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: var(--panel-2); stroke-width: 9; }
.ring-progress {
  fill: none;
  stroke: url(#timerGradient);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset .25s linear;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 45%, transparent));
}
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.timer-display {
  font-family: var(--mono);
  font-size: clamp(2.4rem, 7vw, 3.15rem);
  font-weight: 500;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.timer-status { font-size: 10px; text-transform: uppercase; letter-spacing: .18em; color: var(--faint); font-weight: 600; }
.timer-status.running { color: var(--accent); }
.timer-status.done { color: var(--warn); }
.timer-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 18px; }
.timer-inputs { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
.timer-input-group { display: flex; align-items: center; gap: 6px; }
.timer-input-group input {
  width: 64px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  padding: 9px 6px;
  text-align: center;
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
}
.timer-input-group input:focus { border-color: var(--accent); }
.timer-input-group input:disabled { opacity: .45; }
.timer-input-group span { font-size: 11px; color: var(--faint); }
.timer-actions { display: flex; gap: 8px; justify-content: center; }
.timer-actions .btn.primary { min-width: 132px; }

.stopwatch-panel { text-align: center; padding: 38px 26px 26px; }
.stopwatch-display {
  font-family: var(--mono);
  font-size: clamp(3rem, 9vw, 4.6rem);
  font-weight: 400;
  letter-spacing: -.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 6px 0 8px;
}
.stopwatch-sub { font-size: 10px; text-transform: uppercase; letter-spacing: .18em; color: var(--faint); }
.stopwatch-actions { display: flex; justify-content: center; gap: 8px; margin: 26px 0 8px; }
.stopwatch-actions .btn.primary { min-width: 112px; }
.laps { margin-top: 22px; border-top: 1px solid var(--line); max-height: 240px; overflow-y: auto; text-align: left; }
.lap-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 12px; }
.lap-row:last-child { border-bottom: 0; }
.lap-num { color: var(--faint); font-family: var(--mono); font-size: 10.5px; width: 52px; flex: none; }
.lap-delta { color: var(--faint); font-family: var(--mono); font-size: 11px; width: 100px; text-align: right; }
.lap-total { font-family: var(--mono); font-size: 12.5px; margin-left: auto; }
.timer-tip { text-align: center; font-size: 11px; color: var(--faint); margin-top: 0; }

/* ---------- notes ---------- */

.notes-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 13px;
  height: clamp(470px, calc(100vh - 250px), 790px);
}
.notes-side { padding: 12px; display: flex; flex-direction: column; overflow: hidden; }
.notes-toolbar { display: flex; gap: 7px; align-items: center; margin-bottom: 9px; }
.notes-search { position: relative; flex: 1; }
.notes-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); pointer-events: none; }
.notes-search input { padding-left: 31px; font-size: 12.5px; padding-top: 8px; padding-bottom: 8px; }
.notes-scroll { flex: 1; overflow-y: auto; padding-right: 2px; display: flex; flex-direction: column; gap: 2px; }
.note-item {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 10px 11px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background .15s;
  position: relative;
}
.note-item:hover { background: var(--panel-2); }
.note-item.active { background: var(--panel-2); }
.note-item.active::before {
  content: "";
  position: absolute; left: 0; top: 24%; bottom: 24%;
  width: 2px; border-radius: 2px; background: var(--accent);
}
.note-item-title { font-size: 12.8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.note-item-snippet { font-size: 10.8px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.note-item-time { font-size: 9.5px; color: var(--faint); opacity: .8; padding-left: 4px; margin-top: 2px; }
.notes-editor { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.note-meta {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 17px;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px; color: var(--faint);
  flex: none;
}
.note-meta .spacer { flex: 1; }
.note-body {
  flex: 1; width: 100%;
  border: 0; outline: none; resize: none;
  background: transparent;
  padding: 24px 28px;
  font-size: 15.5px; line-height: 1.75;
  color: var(--text);
  font-family: var(--font);
}
.note-body::placeholder { color: var(--faint); }
.notes-empty { flex: 1; display: grid; place-items: center; }

/* ---------- tasks ---------- */

.tasks-shell { max-width: 840px; margin: 0 auto; }
.tasks-panel { padding: 24px; }
.tasks-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.tasks-progress-label { font-size: 11.5px; color: var(--faint); margin-top: 10px; display: flex; justify-content: space-between; }
.progress-track { height: 5px; border-radius: 5px; background: var(--panel-2); overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s var(--ease); }
.tasks-form { display: flex; gap: 8px; margin: 22px 0 14px; }
.tasks-form .input { flex: 1; }
.tasks-form .btn { padding-left: 16px; padding-right: 16px; }
.task-filters { display: flex; gap: 2px; margin-bottom: 6px; }
.task-filters button {
  border: 0; background: transparent; color: var(--faint);
  font-size: 11px; font-weight: 600; padding: 6px 10px; border-radius: 7px;
  letter-spacing: .02em;
}
.task-filters button:hover { color: var(--text); }
.task-filters button.active { color: var(--text); background: var(--panel-2); }
.task-filters .count { opacity: .6; font-family: var(--mono); font-size: 9.5px; margin-left: 4px; }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.task-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); animation: taskIn .25s var(--ease) both; }
@keyframes taskIn { from { opacity: 0; transform: translateY(-3px); } }
.task-item:last-child { border-bottom: 0; }
.task-check {
  width: 21px; height: 21px; flex: none;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  display: grid; place-items: center;
  color: transparent;
  transition: background .18s, border-color .18s, color .18s, transform .1s;
}
.task-check:hover { border-color: var(--accent); }
.task-check .icon { width: 12px; height: 12px; }
.task-item.done .task-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.task-text { flex: 1; font-size: 13.5px; overflow-wrap: anywhere; }
.task-item.done .task-text { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.task-del { opacity: 0; color: var(--faint); transition: opacity .15s, color .15s, background .15s; }
.task-item:hover .task-del { opacity: 1; }
.task-del:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.task-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 13px; }
.task-footer span { font-size: 11px; color: var(--faint); }
.tasks-empty { padding: 54px 20px; }

/* ---------- password ---------- */

.pass-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 14px; align-items: start; }
.pass-main { padding: 26px; }
.pass-output {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(460px 150px at 90% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    var(--bg-soft);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 112px;
}
.pass-code {
  flex: 1;
  font-family: var(--mono);
  font-size: clamp(1.05rem, 2.5vw, 1.5rem);
  line-height: 1.45;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
  user-select: all;
}
.pass-tools { display: flex; flex-direction: column; gap: 5px; }
.pass-actions { display: flex; gap: 8px; margin-top: 14px; }
.strength { margin-top: 22px; }
.strength-bars { display: flex; gap: 4px; }
.strength-bars span { height: 5px; flex: 1; border-radius: 4px; background: var(--panel-2); transition: background .25s; }
.strength-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; font-size: 11px; color: var(--faint); }
.strength-label { font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: 9.5px; }
.strength-label.weak { color: var(--bad); }
.strength-label.fair { color: var(--warn); }
.strength-label.strong { color: var(--good); }
.strength-label.fortress { color: var(--accent); }
.pass-controls { padding: 24px; }
.length-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.length-row .field-label { margin: 0; }
.length-value { font-family: var(--mono); font-size: 18px; color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 22px; }
.switch-list { display: flex; flex-direction: column; gap: 2px; margin-top: 20px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; font-size: 12.5px; cursor: pointer; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row span small { display: block; font-size: 10px; color: var(--faint); margin-top: 1px; }
.switch {
  position: relative; width: 34px; height: 19px; flex: none;
  border-radius: 20px; background: var(--panel-3); border: 1px solid var(--line);
  transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--muted); transition: transform .2s var(--ease), background .2s;
}
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row input:checked + .switch { background: color-mix(in srgb, var(--accent) 40%, transparent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.switch-row input:checked + .switch::after { transform: translateX(15px); background: #fff; }
.pass-tip { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--faint); line-height: 1.6; }

/* ---------- randomizer ---------- */

.random-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.random-card { display: flex; flex-direction: column; min-height: 292px; }
.random-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 18px 0 20px; }
.random-result { font-family: var(--mono); font-size: 2.2rem; letter-spacing: -.04em; line-height: 1; text-align: center; }
.random-result.small { font-size: 1.35rem; }
.random-result-sub { font-size: 11px; color: var(--faint); text-align: center; }
.dice-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.die-chip {
  min-width: 36px; height: 36px; padding: 0 8px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  font-family: var(--mono); font-size: 13px;
  animation: dieIn .3s var(--ease) both;
}
@keyframes dieIn { from { opacity: 0; transform: scale(.7) rotate(-8deg); } }
.random-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.random-controls .select { width: auto; min-width: 92px; padding-top: 7px; padding-bottom: 7px; font-size: 12px; }
.random-controls .input { width: 74px; padding-top: 7px; padding-bottom: 7px; font-size: 12px; text-align: center; }
.coin {
  width: 106px; height: 106px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 34% 28%, #fde68a, #f59e0b 55%, #b45309 100%);
  color: #4a2c00;
  font-family: var(--mono); font-size: 2rem; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: inset 0 -8px 18px rgba(120, 53, 15, .35), 0 18px 40px -18px rgba(245, 158, 11, .5);
  transform-style: preserve-3d;
}
.coin.flipping { animation: coinFlip .75s var(--ease); }
@keyframes coinFlip {
  0% { transform: rotateY(0) translateY(0); }
  45% { transform: rotateY(720deg) translateY(-26px) scale(1.04); }
  100% { transform: rotateY(1440deg) translateY(0); }
}
.pick-area { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.pick-area .textarea { flex: 1; min-height: 96px; font-size: 12.5px; }
.pick-result { text-align: center; font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; min-height: 1.5em; overflow-wrap: anywhere; }
.pick-meta { text-align: center; font-size: 10.5px; color: var(--faint); }
.number-stage .random-result { font-size: 3rem; }

/* ---------- text lab ---------- */

.text-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.text-panel { display: flex; flex-direction: column; min-height: 470px; padding: 20px; }
.text-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.text-panel-head .panel-title { margin: 0; }
.text-area { flex: 1; width: 100%; min-height: 220px; resize: none; line-height: 1.7; font-size: 13.5px; }
.text-area[readonly] { color: var(--muted); }
.text-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--faint); }
.text-stats b { color: var(--muted); font-weight: 600; font-family: var(--mono); font-size: 10.5px; }
.text-toolbar { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.text-toolbar .chip { font-size: 10.5px; padding: 4px 9px; }
.text-toolbar .chip.wide { border-color: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--muted); }
.text-mini { display: flex; gap: 4px; }

/* ---------- color ---------- */

.color-layout { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 14px; align-items: start; }
.color-main { padding: 20px; }
.color-preview {
  height: 176px; border-radius: 13px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  transition: background .3s;
  position: relative;
  overflow: hidden;
}
.color-preview::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.14), transparent 45%);
  pointer-events: none;
}
.color-preview strong { font-size: 1.75rem; letter-spacing: -.03em; font-family: var(--mono); font-weight: 600; position: relative; z-index: 1; }
.color-preview span { font-size: 11px; opacity: .72; position: relative; z-index: 1; }
.color-picker-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.color-swatch-input { width: 44px; height: 38px; padding: 3px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; flex: none; }
.color-swatch-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch-input::-webkit-color-swatch { border: 0; border-radius: 6px; }
.color-hex-input { flex: 1; font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.color-values { margin-top: 16px; display: flex; flex-direction: column; }
.color-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.color-row:last-child { border-bottom: 0; }
.color-row-label { width: 48px; flex: none; font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 600; }
.color-row code { flex: 1; font-family: var(--mono); font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-grid { display: grid; gap: 14px; }
.shades { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.shade { height: 42px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .1); cursor: pointer; transition: transform .15s var(--ease); padding: 0; }
.shade:hover { transform: scale(1.12); z-index: 1; }
.harmony-list { display: flex; flex-direction: column; gap: 7px; }
.harmony-item { display: flex; align-items: center; gap: 10px; font-size: 11.5px; }
.harmony-color { width: 27px; height: 27px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .12); flex: none; cursor: pointer; padding: 0; }
.harmony-name { color: var(--faint); width: 82px; flex: none; }
.harmony-hex { font-family: var(--mono); font-size: 11px; margin-left: auto; color: var(--muted); }
.contrast-list { display: flex; flex-direction: column; gap: 8px; }
.contrast-item { display: flex; align-items: center; gap: 10px; font-size: 11.5px; }
.contrast-chip { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 9px; font-weight: 700; flex: none; }
.contrast-ratio { font-family: var(--mono); font-size: 12px; }
.contrast-badges { margin-left: auto; display: flex; gap: 4px; }
.badge { font-size: 8.5px; padding: 2px 5px; border-radius: 4px; font-weight: 700; letter-spacing: .03em; }
.badge.pass { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.badge.fail { color: var(--faint); background: var(--panel-2); }
.color-random { margin-left: auto; }

/* ---------- world clock / time ---------- */

.clock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 9px; }
.clock-card {
  padding: 15px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel);
  position: relative;
  overflow: hidden;
  transition: border-color .2s;
}
.clock-card:hover { border-color: var(--line-strong); }
.clock-card.local {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%), var(--panel);
}
.clock-city { font-size: 11.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.clock-city .live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.clock-card.local .live-dot { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 15%, transparent); }
.clock-time { font-family: var(--mono); font-size: 1.3rem; letter-spacing: -.02em; margin-top: 7px; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 10px; color: var(--faint); margin-top: 1px; }
.clock-offset {
  position: absolute; top: 13px; right: 14px;
  font-size: 8.5px; font-family: var(--mono);
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
}
.time-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.date-tool { display: flex; flex-direction: column; gap: 12px; }
.date-tool .input { font-size: 12.5px; }
.date-result { font-family: var(--mono); font-size: 1.6rem; letter-spacing: -.03em; color: var(--accent); min-height: 1.5em; }
.date-result small { font-family: var(--font); font-size: 11px; color: var(--faint); letter-spacing: 0; }
.date-sub { font-size: 11px; color: var(--faint); }
.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.countdown-display { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-unit { min-width: 62px; padding: 10px 8px; border-radius: 10px; background: var(--panel-2); text-align: center; }
.cd-unit b { display: block; font-family: var(--mono); font-size: 1.35rem; font-weight: 500; letter-spacing: -.03em; }
.cd-unit span { font-size: 8.5px; text-transform: uppercase; letter-spacing: .13em; color: var(--faint); }
.countdown-target { font-size: 11px; color: var(--faint); text-align: center; }
.countdown-card { grid-column: span 2; }

/* ---------- responsive tools ---------- */

@media (max-width: 980px) {
  .calc-layout { grid-template-columns: 1fr; }
  .calc-history { position: static; }
  .calc-history-list { max-height: 220px; }
  .notes-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .pass-layout { grid-template-columns: 1fr; }
  .color-layout { grid-template-columns: 1fr; }
  .text-layout { grid-template-columns: 1fr; }
  .text-panel { min-height: 380px; }
  .countdown-card { grid-column: auto; }
}

@media (max-width: 760px) {
  .conv-panel { grid-template-columns: 1fr; gap: 6px; padding: 20px; }
  .conv-swap { justify-self: end; margin: 2px 0; }
  .conv-result { border-bottom: 1px solid var(--line); }
  .notes-layout { grid-template-columns: 1fr; height: auto; }
  .notes-side { max-height: 250px; }
  .notes-editor { height: 460px; }
  .note-body { padding: 18px 18px; }
  .random-grid { grid-template-columns: 1fr; }
  .time-tools { grid-template-columns: 1fr; }
  .date-tool .date-grid { grid-template-columns: 1fr 1fr; }
  .color-grid { grid-template-columns: 1fr; }
  .task-del { opacity: 1; }
}

@media (max-width: 520px) {
  .calc-keys { gap: 5px; }
  .calc-key { height: 43px; }
  .timer-panel, .stopwatch-panel { padding: 20px 14px; }
  .timer-input-group input { width: 52px; }
  .stopwatch-display { font-size: 2.9rem; }
  .pass-actions { flex-wrap: wrap; }
  .date-grid { grid-template-columns: 1fr; }
  .clock-grid { grid-template-columns: 1fr 1fr; }
  .clock-time { font-size: 1.08rem; }
  .clock-card { padding: 12px; }
  .clock-offset { top: 10px; right: 10px; }
  .shades { gap: 3px; }
  .shade { height: 34px; }
}
