@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: rgba(255,255,255,.88);
  --surface-2: #eef5f3;
  --text: #13201e;
  --muted: #667571;
  --line: #dce7e3;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --primary-soft: #d9efeb;
  --danger: #b42318;
  --shadow: 0 16px 45px rgba(15, 46, 41, .08);
  --radius: 22px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1514;
  --surface: rgba(19, 31, 29, .92);
  --surface-2: #162521;
  --text: #edf7f4;
  --muted: #9fb1ac;
  --line: #263a35;
  --primary: #5cc8b9;
  --primary-strong: #7dd9cc;
  --primary-soft: #173a35;
  --danger: #ff8d86;
  --shadow: 0 18px 55px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-bottom: 180px; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 12%, transparent), transparent 28rem), var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 36%, transparent); outline-offset: 2px; }
.app-shell { max-width: 760px; margin: 0 auto; min-height: 100vh; padding: env(safe-area-inset-top) 18px calc(150px + env(safe-area-inset-bottom)); }
.topbar { display:flex; align-items:center; justify-content:space-between; padding:24px 2px 18px; }
.topbar h1 { font-size:clamp(1.7rem,6vw,2.25rem); margin:2px 0 0; letter-spacing:-.045em; }
.eyebrow,.section-kicker { margin:0; color:var(--primary); font-size:.72rem; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.top-actions { display:flex; gap:8px; }
.icon-btn,.secondary-btn,.text-btn,.primary-btn,.danger-btn { border:0; border-radius:14px; min-height:44px; font-weight:700; }
.icon-btn { width:44px; background:var(--surface); color:var(--text); border:1px solid var(--line); font-size:1.25rem; }
.status-card,.trip-card,.quick-card,.source-card { background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); border-radius:var(--radius); backdrop-filter:blur(18px); }
.status-card { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:15px; margin-bottom:14px; }
.status-main { display:flex; align-items:center; gap:12px; min-width:0; }
.status-dot { width:12px; height:12px; border-radius:50%; background:#d09a24; flex:0 0 auto; box-shadow:0 0 0 6px color-mix(in srgb,#d09a24 14%,transparent); }
.status-dot.online { background:#1f9d69; box-shadow:0 0 0 6px color-mix(in srgb,#1f9d69 14%,transparent); }
.status-dot.offline { background:#d07b24; box-shadow:0 0 0 6px color-mix(in srgb,#d07b24 14%,transparent); }
.status-dot.stale { background:#c64b3c; box-shadow:0 0 0 6px color-mix(in srgb,#c64b3c 14%,transparent); }
.status-card strong { display:block; font-size:.92rem; }
.status-card p { margin:3px 0 0; color:var(--muted); font-size:.78rem; line-height:1.35; }
.secondary-btn { padding:0 14px; background:var(--surface-2); color:var(--primary); border:1px solid var(--line); flex:0 0 auto; }
.trip-card,.quick-card { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px; margin-bottom:22px; }
.trip-card h2,.quick-card h2,.section-heading h2 { margin:4px 0 3px; font-size:1.05rem; letter-spacing:-.02em; }
.muted { color:var(--muted); margin:0; font-size:.84rem; line-height:1.45; }
.converter-section { margin-bottom:34px; }
.section-heading { display:flex; align-items:end; justify-content:space-between; padding:0 3px 10px; }
.text-btn { background:transparent; color:var(--primary); padding:0 4px; min-height:36px; }
.currency-manage-btn { min-height:40px; padding:0 14px; border-radius:14px; font-size:.9rem; }
.currency-list { display:grid; gap:10px; }
.currency-card { display:grid; grid-template-columns:auto minmax(0,1fr); gap:13px; align-items:center; padding:14px 15px; background:var(--surface); border:1px solid var(--line); border-radius:18px; box-shadow:0 8px 28px rgba(20,50,45,.045); transition:border-color .15s,transform .15s; }
.currency-card:focus-within { border-color:var(--primary); transform:translateY(-1px); }
.currency-flag { width:44px; height:44px; border-radius:14px; display:grid; place-items:center; background:var(--surface-2); font-size:1.45rem; }
.currency-main { min-width:0; }
.currency-meta { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:3px; }
.currency-code { font-weight:800; font-size:.9rem; }
.currency-name { color:var(--muted); font-size:.72rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.currency-input { width:100%; border:0; background:transparent; color:var(--text); padding:1px 0; font-size:clamp(1.35rem,7vw,1.9rem); font-weight:700; letter-spacing:-.035em; }
.currency-input::placeholder { color:color-mix(in srgb,var(--muted) 45%,transparent); }
.rate-note { margin-top:3px; font-size:.7rem; color:var(--muted); }
.bcr-rate-note {
  margin-top:7px;
  padding-top:7px;
  border-top:1px dashed var(--line);
  color:var(--primary);
  font-size:.68rem;
  line-height:1.35;
}
.bcr-rate-note strong { font-weight:800; }
.manual-badge { color:var(--primary); background:var(--primary-soft); font-size:.64rem; font-weight:800; padding:3px 7px; border-radius:999px; }
.quick-card { margin-top:8px; }
.source-card { padding:8px 16px; margin-bottom:12px; box-shadow:none; }
.source-row { display:flex; justify-content:space-between; gap:18px; padding:11px 0; font-size:.8rem; border-bottom:1px solid var(--line); }
.source-row:last-child { border-bottom:0; }
.source-row span { color:var(--muted); }
.source-row strong { text-align:right; }
.bottom-nav {
  position:fixed;
  left:50%;
  bottom:max(12px,env(safe-area-inset-bottom));
  transform:translateX(-50%);
  width:min(calc(100% - 28px),720px);
  min-height:72px;
  padding:7px;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  background:color-mix(in srgb,var(--surface) 94%,transparent);
  border:1px solid color-mix(in srgb,var(--line) 88%,transparent);
  border-radius:22px;
  box-shadow:0 16px 50px rgba(0,0,0,.15);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
  z-index:30;
}
.nav-btn {
  min-width:0;
  border:0;
  border-radius:15px;
  background:transparent;
  color:var(--muted);
  display:grid;
  place-items:center;
  align-content:center;
  gap:3px;
  padding:5px 6px;
  transition:background .18s ease,color .18s ease,transform .12s ease,box-shadow .18s ease;
}
.nav-btn:active { transform:scale(.97); }
.nav-icon {
  width:27px;
  height:27px;
  display:grid;
  place-items:center;
  line-height:0;
}
.nav-icon svg {
  width:100%;
  height:100%;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
}
.nav-btn small {
  font-size:.68rem;
  line-height:1.1;
  font-weight:700;
  white-space:nowrap;
}
.nav-btn.active {
  background:var(--primary-soft);
  color:var(--primary);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 18%,transparent);
}
html[data-theme="dark"] .bottom-nav {
  background:color-mix(in srgb,var(--surface) 96%,#07100f 4%);
  border-color:color-mix(in srgb,var(--line) 82%,var(--primary) 18%);
  box-shadow:0 18px 55px rgba(0,0,0,.34);
}
html[data-theme="dark"] .nav-btn:not(.active) {
  color:color-mix(in srgb,var(--text) 78%,var(--muted) 22%);
}
html[data-theme="dark"] .nav-btn.active {
  background:color-mix(in srgb,var(--primary-soft) 88%,var(--primary) 12%);
  color:var(--primary-strong);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 42%,transparent),0 6px 18px rgba(0,0,0,.16);
}
@media (min-width:700px) {
  .bottom-nav { min-height:78px; padding:8px; }
  .nav-btn { border-radius:17px; gap:4px; }
  .nav-icon { width:30px; height:30px; }
  .nav-btn small { font-size:.72rem; }
}
@media (max-width:390px) {
  .bottom-nav { width:min(calc(100% - 18px),720px); min-height:68px; padding:6px; border-radius:20px; }
  .nav-btn { padding:4px 3px; border-radius:14px; }
  .nav-icon { width:24px; height:24px; }
}
dialog { width:min(calc(100% - 24px),620px); max-height:min(82vh,760px); border:0; padding:0; border-radius:24px; color:var(--text); background:var(--surface); box-shadow:0 24px 80px rgba(0,0,0,.28); }
dialog::backdrop { background:rgba(4,14,12,.58); backdrop-filter:blur(3px); }
.dialog-card { padding:20px; max-height:82vh; overflow:auto; }
.dialog-head { display:flex; justify-content:space-between; align-items:start; margin-bottom:16px; }
.dialog-head h2 { margin:4px 0 0; font-size:1.35rem; }
.trip-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.trip-new-btn { width:100%; margin-bottom:14px; }
.custom-trip-help { margin:-2px 0 16px; }
.trip-option { text-align:left; padding:13px; background:var(--surface-2); color:var(--text); border:1px solid var(--line); border-radius:16px; }
.trip-option.active { border-color:var(--primary); background:var(--primary-soft); }
.trip-option strong { display:block; }
.trip-option small { color:var(--muted); }
hr { border:0; border-top:1px solid var(--line); margin:18px 0; }
.field { display:grid; gap:7px; margin:14px 0; font-size:.8rem; font-weight:700; color:var(--muted); }
.field input,.field select { width:100%; min-height:48px; border-radius:14px; border:1px solid var(--line); background:var(--surface-2); color:var(--text); padding:0 13px; }
.search-box {
  display:flex;
  gap:10px;
  align-items:center;
  min-height:56px;
  border:1px solid var(--line);
  background:var(--surface-2);
  border-radius:18px;
  padding:0 16px;
  margin:0;
  transition:border-color .15s, box-shadow .15s;
}
.search-box:focus-within {
  border-color:color-mix(in srgb,var(--primary) 55%,var(--line));
  box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 16%,transparent);
}
.search-box > span { flex:0 0 auto; color:var(--muted); }
.search-box input {
  flex:1;
  width:100%;
  min-width:0;
  min-height:0;
  height:auto;
  padding:0;
  border:0;
  border-radius:0;
  outline:none;
  box-shadow:none;
  background:transparent;
  color:var(--text);
  font:inherit;
}
.search-box input:focus,
.search-box input:focus-visible {
  border:0;
  outline:none;
  box-shadow:none;
}
.currency-picker-tools { display:grid; gap:10px; margin-bottom:12px; }
.currency-picker-actions { display:flex; justify-content:space-between; align-items:center; gap:10px; min-width:0; }
.currency-picker-hint { color:var(--muted); font-size:.72rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.currency-picker-action-buttons { display:flex; align-items:center; gap:7px; flex:0 0 auto; }
.picker-link-btn {
  min-height:36px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface-2);
  color:var(--primary);
  font-size:.76rem;
  font-weight:800;
  white-space:nowrap;
}
.clear-currencies-btn {
  min-height:36px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid color-mix(in srgb,var(--primary) 35%,var(--line));
  background:color-mix(in srgb,var(--primary) 9%,transparent);
  color:var(--primary);
  font-size:.76rem;
  font-weight:800;
  white-space:nowrap;
}
.clear-currencies-btn:active { transform:translateY(1px); background:var(--primary-soft); }
.currency-choice-state { min-width:42px; text-align:right; color:var(--primary); font-size:.72rem; letter-spacing:.04em; }
.currency-choice.trip-currency { border-color:color-mix(in srgb,var(--primary) 42%,var(--line)); }
.currency-choice.trip-currency .currency-choice-state { font-size:.62rem; }
@media (max-width:420px) {
  .currency-picker-actions { align-items:flex-start; }
  .currency-picker-hint { padding-top:8px; }
  .clear-currencies-btn,.picker-link-btn { min-height:32px; padding:0 11px; }
}
.currency-picker { display:grid; gap:7px; max-height:45vh; overflow:auto; padding-right:2px; }
.currency-choice { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 11px; border:1px solid var(--line); border-radius:13px; background:var(--surface); color:var(--text); }
.currency-choice .left { display:flex; align-items:center; gap:9px; text-align:left; min-width:0; }
.currency-choice small { display:block; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:250px; }
.currency-choice.selected { background:var(--primary-soft); border-color:var(--primary); }
.primary-btn,.danger-btn { width:100%; padding:0 16px; margin-top:10px; }
.primary-btn { background:var(--primary); color:white; }
html[data-theme="dark"] .primary-btn { color:#06221f; }
.danger-btn { background:color-mix(in srgb,var(--danger) 12%,transparent); color:var(--danger); border:1px solid color-mix(in srgb,var(--danger) 28%,transparent); }
.dialog-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.comparison,.info-box { border-radius:14px; padding:12px 13px; margin-top:12px; background:var(--primary-soft); color:var(--text); font-size:.82rem; line-height:1.5; }
.info-box p { margin:5px 0 0; color:var(--muted); }
.toast { position:fixed; left:50%; bottom:96px; transform:translate(-50%,18px); background:var(--text); color:var(--bg); padding:11px 15px; border-radius:999px; font-size:.8rem; font-weight:700; opacity:0; pointer-events:none; transition:.2s; z-index:100; max-width:calc(100% - 30px); text-align:center; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.hidden { display:none !important; }
@media (max-width:460px) {
  .app-shell { padding-left:13px; padding-right:13px; padding-bottom:calc(160px + env(safe-area-inset-bottom)); }
  .status-card { align-items:flex-start; }
  .status-card .secondary-btn { min-width:42px; font-size:0; padding:0 12px; }
  .status-card .secondary-btn::after { content:"↻"; font-size:1.2rem; }
  .trip-grid { grid-template-columns:1fr; }
  .dialog-actions { grid-template-columns:1fr; }
}
@media (display-mode:standalone) { #installBtn { display:none !important; } }

.module-hero {
  margin: 4px 2px 18px;
  padding: 0 2px;
}
.module-hero h2 {
  margin: 5px 0 5px;
  font-size: 1.55rem;
  letter-spacing: -.035em;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}
.tool-card {
  min-height: 126px;
  padding: 15px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 26px rgba(20,50,45,.045);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
}
.tool-card:active { transform: scale(.985); }
.tool-card strong { font-size: .88rem; line-height: 1.18; }
.tool-card small { color: var(--muted); font-size: .67rem; line-height: 1.2; }
.tool-icon {
  min-width: 48px;
  height: 48px;
  padding: 0 10px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 800;
}
.technical-note { margin-top: 18px; }
.unit-pair {
  display: grid;
  grid-template-columns: minmax(0,1fr) 48px minmax(0,1fr);
  gap: 9px;
  align-items: end;
}
.swap-btn {
  height: 48px;
  width: 48px;
  margin-bottom: 14px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 800;
}
.result-panel {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  display: grid;
  gap: 9px;
}
.result-panel > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}
.result-panel span, .result-panel small { color: var(--muted); font-size: .75rem; }
.result-panel strong { font-size: 1rem; text-align: right; }
.unit-result > strong { font-size: 1.7rem; color: var(--primary); text-align: left; }
.field-grid { display: grid; gap: 10px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.field-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.color-preview {
  height: 92px;
  border-radius: 18px;
  border: 1px solid var(--line);
  margin-bottom: 14px;
  background: #0F766E;
}
.tech-result:empty { display:none; }
.app-view.hidden { display:none !important; }

@media (max-width: 560px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tool-card { min-height: 112px; }
}
@media (max-width: 390px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .field-grid.two, .field-grid.three { grid-template-columns: 1fr; }
  .unit-pair { grid-template-columns: 1fr; }
  .swap-btn { margin: -2px auto 0; transform: rotate(90deg); }
  .nav-btn small { font-size:.61rem; }
}

.color-workspace { display:grid; gap:16px; }
.color-visual-column { display:grid; gap:14px; }
.color-wheel-wrap { display:grid; place-items:center; padding:4px 0; }
.color-wheel {
  position:relative;
  width:min(72vw,300px);
  aspect-ratio:1;
  border-radius:50%;
  background:conic-gradient(
    hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%),
    hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%)
  );
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12);
  touch-action:none;
}
.color-wheel::after {
  content:"";
  position:absolute;
  inset:18%;
  border-radius:50%;
  background:var(--surface);
  border:1px solid var(--line);
}
.color-wheel-center {
  position:absolute;
  inset:28%;
  z-index:2;
  display:grid;
  place-items:center;
  align-content:center;
  gap:3px;
  text-align:center;
  pointer-events:none;
}
.color-wheel-center strong { font-size:1.05rem; }
.color-wheel-center small { color:var(--muted); font-size:.7rem; }
.color-wheel-knob {
  position:absolute;
  z-index:3;
  width:22px; height:22px;
  border:3px solid white;
  border-radius:50%;
  background:transparent;
  box-shadow:0 2px 8px rgba(0,0,0,.35);
  transform:translate(-50%,-50%);
  pointer-events:none;
}
.color-sliders { display:grid; gap:10px; }
.range-field { display:grid; gap:7px; color:var(--muted); font-size:.78rem; font-weight:700; }
.range-field span { display:flex; justify-content:space-between; gap:12px; }
.range-field input { width:100%; accent-color:var(--primary); }
.color-tabs {
  display:flex;
  gap:7px;
  overflow-x:auto;
  padding-bottom:2px;
  scrollbar-width:none;
}
.color-tabs::-webkit-scrollbar { display:none; }
.color-tab {
  min-height:40px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface-2);
  color:var(--muted);
  font-size:.74rem;
  font-weight:800;
  white-space:nowrap;
}
.color-tab.active { background:var(--primary-soft); color:var(--primary); border-color:var(--primary); }
.color-panel { display:block; }
.gamut-warning {
  padding:11px 12px;
  border-radius:13px;
  background:color-mix(in srgb, #d97706 12%, transparent);
  border:1px solid color-mix(in srgb, #d97706 32%, transparent);
  color:#d97706;
  font-size:.76rem;
  line-height:1.4;
}

.color-picker-grid {
  display:grid;
  grid-template-columns:minmax(0, 220px) minmax(0,1fr);
  gap:16px;
  align-items:center;
}
.sv-plane {
  --picker-hue: 170;
  position:relative;
  min-height:220px;
  border-radius:18px;
  overflow:hidden;
  border:1px solid var(--line);
  touch-action:none;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, hsla(var(--picker-hue),100%,50%,0)),
    hsl(var(--picker-hue),100%,50%);
}
.sv-knob {
  position:absolute;
  width:22px;
  height:22px;
  border:3px solid #fff;
  border-radius:50%;
  box-shadow:0 2px 8px rgba(0,0,0,.45);
  transform:translate(-50%,-50%);
  pointer-events:none;
}
.color-axis-labels {
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font-size:.64rem;
  margin-top:6px;
}
@media (max-width:560px) {
  .color-picker-grid { grid-template-columns:1fr; }
  .sv-plane { min-height:190px; }
  .color-wheel { width:min(58vw,220px); }
}

.cable-tabs {
  display:flex;
  gap:8px;
  margin-bottom:12px;
}
.cable-tabs .color-tab { flex:1; }

::selection {
  background: rgba(47, 163, 150, 0.35);
  color: #ffffff;
}
input::selection,
textarea::selection {
  background: rgba(47, 163, 150, 0.42);
  color: #ffffff;
}

.currency-flag-image,
.picker-flag {
  display:inline-grid;
  place-items:center;
  flex:0 0 auto;
}
.currency-flag-image img {
  width:30px;
  height:22px;
  object-fit:cover;
  border-radius:4px;
  display:block;
}
.picker-flag {
  width:30px;
  height:22px;
  font-size:1.35rem;
}
.picker-flag img {
  width:30px;
  height:22px;
  object-fit:cover;
  border-radius:4px;
  display:block;
}
.flag-fallback { line-height:1; }

#tripName {
  display:flex;
  align-items:center;
  gap:8px;
}
.trip-flag {
  width:28px;
  height:20px;
  display:inline-grid;
  place-items:center;
  flex:0 0 auto;
  line-height:1;
}
.trip-flag img {
  width:28px;
  height:20px;
  object-fit:cover;
  border-radius:4px;
  display:block;
}
.trip-flag-fallback {
  font-size:1.15rem;
}

.trip-option-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:stretch;
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  background:var(--surface);
}
.trip-option-row.active {
  border-color:var(--primary);
  background:var(--primary-soft);
}
.trip-option-row .trip-option {
  border:0;
  border-radius:0;
  background:transparent;
  text-align:left;
  padding:14px 16px;
  color:var(--text);
}
.trip-option-title {
  display:flex;
  align-items:center;
  gap:8px;
}
.trip-option-row .trip-option small {
  display:block;
  margin-top:4px;
  color:var(--muted);
}
.trip-remove-btn {
  width:46px;
  min-height:100%;
  border:0;
  border-left:1px solid var(--line);
  background:transparent;
  color:var(--muted);
  font-size:1.35rem;
  font-weight:700;
}
.trip-remove-btn:active {
  background:color-mix(in srgb,var(--danger) 10%,transparent);
  color:var(--danger);
}


/* Color and resistor tools: touch-friendly controls shared by both themes. */
.simple-color-picker { display:flex; align-items:center; gap:16px; padding:16px; margin-top:16px; border:1px solid var(--line); border-radius:18px; background:var(--surface-2); cursor:pointer; }
.simple-color-picker input { width:80px; height:64px; padding:3px; border:1px solid var(--line); border-radius:12px; background:var(--surface); cursor:pointer; flex-shrink:0; }
.simple-color-picker small { display:block; margin-top:5px; color:var(--muted); font-size:.75rem; }
.color-input-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(115px,1fr)); gap:10px; }
.color-input-fields .field { margin:0; min-width:0; }
.input-error { color:var(--danger); font-size:.8rem; }
.conversion-heading { font-size:1rem; margin:18px 0 12px; }
.conversion-heading small { display:block; font-size:.75rem; font-weight:400; margin-top:5px; color:var(--muted); }
.color-outputs { display:grid; gap:8px; }
.color-output { display:grid; grid-template-columns:72px minmax(0,1fr) auto; align-items:center; gap:8px; border:1px solid var(--line); padding:10px; border-radius:12px; }
.color-output > span { font-size:.75rem; color:var(--muted); }
.color-output strong { font-size:.85rem; overflow-wrap:anywhere; user-select:text; }
.color-output button { font-size:.75rem; padding:0 10px; }
.stale-output { opacity:.45; }
.resistor-drawing { position:relative; min-height:110px; display:grid; place-items:center; }
.resistor-wire { position:absolute; height:5px; width:100%; background:linear-gradient(#d1d5db,#727c89); }
.resistor-body { position:relative; display:flex; align-items:stretch; justify-content:space-evenly; width:80%; max-width:360px; height:74px; padding:0 12px; background:linear-gradient(#e6d2b4,#ceb48c); border:2px solid #ac926d; border-radius:25px; }
.resistor-band { position:relative; width:28px; min-width:0; border:0; border-left:1px solid #0003; border-right:1px solid #0003; background:var(--band); padding:0; }
.resistor-band.selected { outline:3px solid var(--primary); outline-offset:5px; z-index:1; }
.resistor-band.tolerance-band { margin-left:14px; }
.resistor-value { text-align:center; padding:15px; border-radius:16px; background:var(--primary-soft); margin:4px 0 18px; }
.resistor-value > strong { display:block; font-size:1.8rem; color:var(--primary); }
.resistor-value small { font-size:1rem; }
.resistor-value > span { display:block; margin-top:7px; font-size:.8rem; }
.band-steps { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.band-step,.band-choice { min-height:56px; border:1px solid var(--line); background:var(--surface-2); color:var(--text); padding:10px; border-radius:12px; text-align:left; }
.band-step > span { display:block; font-size:.7rem; color:var(--muted); margin-bottom:7px; }
.band-step strong { display:flex; align-items:center; gap:7px; font-size:.82rem; }
.band-step i,.band-choice i { display:inline-block; width:21px; height:21px; border-radius:50%; border:1px solid #808080; flex-shrink:0; }
.band-step.active,.band-choice.active { border-color:var(--primary); box-shadow:inset 0 0 0 1px var(--primary); background:var(--primary-soft); }
.band-palette { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:16px; }
.band-choice { display:flex; gap:8px; align-items:center; font-size:.8rem; }
.band-choice small { display:block; color:var(--muted); font-size:.65rem; margin-top:3px; }
@media(max-width:400px){ .band-palette { grid-template-columns:repeat(2,minmax(0,1fr)); } .color-output { grid-template-columns:55px minmax(0,1fr) auto; padding:8px; } .resistor-band { width:22px; } }


/* Desktop layout v1.1.26 */
@media (min-width: 900px) {
  html { scroll-padding-bottom: 120px; }

  .app-shell {
    max-width: 1180px;
    padding-left: 28px;
    padding-right: 28px;
    padding-bottom: 128px;
  }

  .topbar {
    padding: 30px 4px 22px;
  }

  .topbar h1 {
    font-size: 2.35rem;
  }

  #currencyView {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
    grid-template-areas:
      "status status"
      "converter trip"
      "converter quick"
      "converter source";
    gap: 16px 22px;
    align-items: start;
  }

  #currencyView > .status-card { grid-area: status; margin: 0; }
  #currencyView > .trip-card { grid-area: trip; margin: 0; }
  #currencyView > .converter-section { grid-area: converter; margin: 0; }
  #currencyView > .quick-card { grid-area: quick; margin: 0; }
  #currencyView > .source-card { grid-area: source; margin: 0; }

  .status-card {
    padding: 18px 20px;
  }

  .trip-card,
  .quick-card {
    padding: 20px;
  }

  .section-heading {
    padding-bottom: 12px;
  }

  .currency-list {
    gap: 12px;
  }

  .currency-card {
    min-height: 94px;
    padding: 17px 18px;
    border-radius: 20px;
  }

  .currency-flag {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .currency-input {
    font-size: 1.8rem;
  }

  .source-card {
    padding: 10px 18px;
  }

  #unitsView .tool-grid,
  #technicalView .tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .tool-card {
    min-height: 142px;
    padding: 18px 14px;
  }

  .module-hero {
    margin-bottom: 22px;
  }

  .bottom-nav {
    width: min(calc(100% - 56px), 680px);
    min-height: 70px;
    bottom: 18px;
  }

  dialog {
    width: min(calc(100% - 48px), 720px);
  }

  .dialog-card {
    padding: 24px;
  }

  #unitDialog,
  #technicalDialog {
    width: min(calc(100% - 48px), 820px);
  }
}

@media (min-width: 1180px) {
  #currencyView {
    grid-template-columns: minmax(0, 1.6fr) minmax(340px, .75fr);
    gap: 18px 28px;
  }

  .tool-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
