/* ── Icon Editor (light/v3 theme) ──────────────────────────── */

:root {
  --ice-brand:      var(--iav-brand, #14a3a3);
  --ice-brand-ink:  var(--iav-brand-ink, #0d7a7a);
  --ice-brand-soft: var(--iav-brand-soft, #e6f4f4);
  --ice-brand-soft2:var(--iav-brand-soft2, #d2ecec);
  --ice-ink:        var(--iav-ink, #15252b);
  --ice-text:       var(--iav-text, #44555f);
  --ice-muted:      var(--iav-muted, #8794a0);
  --ice-faint:      var(--iav-faint, #aab4bd);
  --ice-line:       var(--iav-line, #e7ecef);
  --ice-line-soft:  var(--iav-line-soft, #eef2f4);
  --ice-bg:         var(--iav-bg, #ffffff);
  --ice-bg-soft:    var(--iav-bg-soft, #f3f7f8);
  --ice-radius:     var(--iav-radius, 12px);
  --ice-radius-lg:  var(--iav-radius-lg, 18px);
  --ice-shadow-sm:  var(--iav-shadow-sm, 0 1px 2px rgba(20,40,50,.05), 0 1px 3px rgba(20,40,50,.04));
  --ice-shadow-md:  var(--iav-shadow-md, 0 6px 18px rgba(20,50,60,.08));
  --ice-shadow-lg:  var(--iav-shadow-lg, 0 18px 50px rgba(12,60,70,.18));
  /* short-name aliases used by twb-* tool workbench components */
  --brand:       var(--ice-brand);
  --brand-ink:   var(--ice-brand-ink);
  --brand-soft:  var(--ice-brand-soft);
  --brand-soft-2:var(--ice-brand-soft2);
  --ink:         var(--ice-ink);
  --text:        var(--ice-text);
  --muted:       var(--ice-muted);
  --faint:       var(--ice-faint);
  --line:        var(--ice-line);
  --line-soft:   var(--ice-line-soft);
  --bg-soft:     var(--ice-bg-soft);
  --shadow-sm:   var(--ice-shadow-sm);
  --ring:        0 0 0 3px rgba(20,163,163,.20);
  --font-display:"Baloo 2", system-ui, sans-serif;
  --font-body:   "Mulish", system-ui, sans-serif;
}

/* ── Shell / alert ─────────────────────────────────────────── */
.ie-shell { margin-bottom: 4px; }

.ice-alert {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--ice-radius);
  background: #fff5f5;
  border: 1px solid #f3caca;
  color: #7a2d2d;
  font-weight: 600;
  font-size: 14px;
}

.ice-wrap {
  display: flex;
  flex-direction: column;
  background: var(--ice-bg);
  font-family: "Montserrat", sans-serif;
  color: var(--ice-ink);
  font-size: 13px;
  overflow: hidden;
  border: 1px solid var(--ice-line);
  border-radius: var(--ice-radius-lg);
  box-shadow: var(--ice-shadow-lg);
  height: 640px;
  max-height: calc(100vh - 220px);
  min-height: 520px;
}

/* ── Topbar ────────────────────────────────────────────────── */
.ice-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 50px;
  background: #fff;
  border-bottom: 1px solid var(--ice-line);
  flex-shrink: 0;
}
.ice-topbar-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ice-ink);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Buttons ───────────────────────────────────────────────── */
.ice-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--ice-line);
  background: #fff;
  color: var(--ice-text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  line-height: 1;
}
.ice-btn:hover  { background: var(--ice-brand-soft); border-color: var(--ice-brand-soft2); color: var(--ice-brand-ink); }
.ice-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ice-btn:disabled:hover { background: #fff; border-color: var(--ice-line); color: var(--ice-text); }
.ice-btn.primary { background: var(--ice-brand); border-color: var(--ice-brand); color: #fff; }
.ice-btn.primary:hover { background: var(--ice-brand-ink); border-color: var(--ice-brand-ink); color: #fff; }
.ice-btn.icon-only { padding: 6px; min-width: 32px; justify-content: center; }

/* ── Body ──────────────────────────────────────────────────── */
.ice-body { display: flex; flex: 1; overflow: hidden; }

/* ── Tool Strip ────────────────────────────────────────────── */
.ice-tools {
  width: 42px;
  background: var(--ice-bg-soft);
  border-right: 1px solid var(--ice-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 2px;
  flex-shrink: 0;
}
.ice-tool-sep { width: 26px; height: 1px; background: var(--ice-line); margin: 4px 0; }
.ice-tool-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ice-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.ice-tool-btn:hover { background: var(--ice-brand-soft); color: var(--ice-brand-ink); }
.ice-tool-btn.active { background: var(--ice-brand); color: #fff; border-color: var(--ice-brand); }

/* ── Icon library rail ─────────────────────────────────────── */
.ice-rail {
  width: 42px;
  flex-shrink: 0;
  background: var(--ice-bg-soft);
  border-right: 1px solid var(--ice-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  transition: width 0.18s ease;
}
.ice-rail.expanded { width: 220px; align-items: stretch; }
.ice-rail #ice-rail-toggle { margin: 10px 0; flex-shrink: 0; }
.ice-rail.expanded #ice-rail-toggle { align-self: center; background: var(--ice-brand); color: #fff; border-color: var(--ice-brand); }

.ice-rail-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-top: 1px solid var(--ice-line);
}
.ice-rail.expanded .ice-rail-panel { display: flex; }

.ice-rail-search { padding: 10px 10px 6px; flex-shrink: 0; }
.ice-rail-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--ice-line);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: var(--ice-ink);
}
.ice-rail-search input:focus { border-color: var(--ice-brand); }

.ice-rail-grid {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  align-content: start;
}
.ice-rail-grid::-webkit-scrollbar { width: 6px; }
.ice-rail-grid::-webkit-scrollbar-thumb { background: var(--ice-line); border-radius: 6px; }

.ice-rail-chip {
  aspect-ratio: 1;
  border: 1px solid var(--ice-line);
  border-radius: 8px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 6px;
  color: var(--ice-ink);
  transition: all 0.12s;
}
.ice-rail-chip:hover { border-color: var(--ice-brand); background: var(--ice-brand-soft); }
.ice-rail-chip svg { width: 100%; height: 100%; pointer-events: none; }

.ice-rail-msg {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 11px;
  color: var(--ice-muted);
  padding: 18px 6px;
  line-height: 1.5;
}

.ice-rail-foot {
  padding: 8px;
  border-top: 1px solid var(--ice-line);
  flex-shrink: 0;
}
.ice-rail-upload {
  width: 100%;
  padding: 8px;
  border: 1px dashed var(--ice-brand-soft2);
  border-radius: 8px;
  background: #fff;
  color: var(--ice-brand-ink);
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.ice-rail-upload:hover { border-color: var(--ice-brand); background: var(--ice-brand-soft); }

/* ── Canvas ────────────────────────────────────────────────── */
.ice-canvas-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--ice-bg-soft);   /* default = white mode, solid, no checkerboard */
}
/* Checkerboard only in transparent mode */
.ice-canvas-area.bg-checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, var(--ice-line) 25%, transparent 25%),
    linear-gradient(-45deg, var(--ice-line) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--ice-line) 75%),
    linear-gradient(-45deg, transparent 75%, var(--ice-line) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.ice-canvas-area.bg-dark { background: #15252b; }

.ice-canvas-scroll {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
  padding: 48px;
  box-sizing: border-box;
}
.ice-svg-host {
  display: inline-block;
  line-height: 0;
  transform-origin: top left;
  flex-shrink: 0;
  background: #fff;
  border-radius: var(--ice-radius);
  box-shadow: var(--ice-shadow-md);
}
.ice-svg-host.bg-transparent { background: transparent; box-shadow: none; }
.ice-svg-host.bg-dark { background: #1a1a1a; }
.ice-svg-host svg { display: block; overflow: hidden; }

/* ── Zoom bar ──────────────────────────────────────────────── */
.ice-zoom-bar {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  background: #fff;
  border: 1px solid var(--ice-line);
  box-shadow: var(--ice-shadow-md);
  border-radius: 10px;
  padding: 4px 6px;
}
.ice-zoom-label { font-size: 11px; color: var(--ice-muted); min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; }

/* ── Properties Panel ──────────────────────────────────────── */
.ice-props {
  width: 240px;
  background: #fff;
  border-left: 1px solid var(--ice-line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.ice-props::-webkit-scrollbar { width: 7px; }
.ice-props::-webkit-scrollbar-thumb { background: var(--ice-line); border-radius: 6px; }

/* ── Panel sections ────────────────────────────────────────── */
.ice-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ice-line-soft);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ice-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ice-faint);
}

/* ── Right-panel accordion ─────────────────────────────────── */
.ice-accordion { border: none; }
.ice-accordion .accordion-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ice-line-soft);
  border-radius: 0;
}
.ice-accordion .accordion-item:last-child { border-bottom: none; }
.ice-accordion .accordion-header { margin: 0; }
.ice-accordion .accordion-button {
  padding: 12px 14px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ice-faint);
  background: transparent;
  box-shadow: none;
  border-radius: 0 !important;
}
.ice-accordion .accordion-button:not(.collapsed) {
  color: var(--ice-brand-ink) !important;
  background-color: var(--ice-brand-soft) !important;
  box-shadow: none !important;
}
.ice-accordion .accordion-button:focus {
  box-shadow: none !important;
  border-color: transparent !important;
}
.ice-accordion .accordion-button::after {
  width: 12px;
  height: 12px;
  background-size: 12px;
}
.ice-accordion .accordion-body {
  padding: 4px 14px 14px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ice-accordion .ice-subsec {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ice-accordion .ice-subsec + .ice-subsec {
  padding-top: 9px;
  border-top: 1px solid var(--ice-line-soft);
}

/* ── Preset swatches ───────────────────────────────────────── */
.ice-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ice-preset {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.ice-preset:hover  { transform: scale(1.2); border-color: var(--ice-brand); }
.ice-preset.active { border-color: var(--ice-brand); box-shadow: 0 0 0 2px var(--ice-brand-soft2); }
.ice-preset.light  { border-color: var(--ice-line); }
.ice-preset.light:hover { border-color: var(--ice-brand); }

/* ── Background toggle ─────────────────────────────────────── */
.ice-btn-group { display: flex; gap: 4px; }
.ice-toggle {
  flex: 1;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid var(--ice-line);
  background: var(--ice-bg-soft);
  color: var(--ice-muted);
  font-size: 11px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.ice-toggle:hover  { background: var(--ice-brand-soft); color: var(--ice-brand-ink); }
.ice-toggle.active { background: var(--ice-brand); border-color: var(--ice-brand); color: #fff; }

/* ── Transform grid ────────────────────────────────────────── */
.ice-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.ice-grid-2 .ice-btn { justify-content: center; font-size: 11px; padding: 6px 4px; }

/* ── Color row (recolor + element) ────────────────────────────*/
.ice-color-row { display: flex; align-items: center; gap: 7px; }
.ice-swatch {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--ice-line);
  cursor: pointer;
  position: relative; overflow: hidden;
  flex-shrink: 0; background: #fff;
}
.ice-swatch input[type="color"] {
  position: absolute; inset: -6px;
  opacity: 0; cursor: pointer;
  width: calc(100% + 12px); height: calc(100% + 12px);
}
.ice-swatch-bg { position: absolute; inset: 0; pointer-events: none; border-radius: 7px; }
.ice-swatch-none { position: absolute; inset: 0; pointer-events: none; }
.ice-swatch-none line { stroke: #e2564d; stroke-width: 1.5; }

.ice-hex {
  flex: 1;
  background: #fff;
  border: 1px solid var(--ice-line);
  border-radius: 8px;
  color: var(--ice-ink);
  font-size: 12px;
  font-family: "Courier New", monospace;
  padding: 6px 8px;
  outline: none; min-width: 0;
}
.ice-hex:focus { border-color: var(--ice-brand); }

.ice-none-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ice-muted); cursor: pointer; user-select: none;
}
.ice-none-toggle input[type="checkbox"] { accent-color: var(--ice-brand); cursor: pointer; }

.ice-field { display: flex; flex-direction: column; gap: 6px; }
.ice-field-label { font-size: 11px; font-weight: 700; color: var(--ice-text); }

/* Stroke width */
.ice-sw-row { display: flex; align-items: center; gap: 8px; }
.ice-sw-row input[type="range"] { flex: 1; accent-color: var(--ice-brand); cursor: pointer; }
.ice-sw-val { font-size: 12px; color: var(--ice-text); min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }

/* Element empty state */
.ice-el-empty {
  font-size: 11px; color: var(--ice-muted); text-align: center;
  line-height: 1.7; padding: 6px 0;
}

/* ── Dropdown ──────────────────────────────────────────────── */
.ice-dropdown-wrap { position: relative; }
.ice-dropdown {
  position: absolute; right: 0; top: 100%; margin-top: 4px;
  background: #fff; border: 1px solid var(--ice-line);
  border-radius: var(--ice-radius); overflow: hidden;
  z-index: 200; min-width: 130px;
  box-shadow: var(--ice-shadow-lg);
}
.ice-dropdown-item {
  display: block; width: 100%;
  padding: 9px 14px; background: transparent; border: none;
  color: var(--ice-text); font-size: 12px; font-family: inherit;
  cursor: pointer; text-align: left; transition: background 0.12s;
}
.ice-dropdown-item:hover { background: var(--ice-bg-soft); color: var(--ice-brand-ink); }

/* ── Divider ───────────────────────────────────────────────── */
.ice-hr { height: 1px; background: var(--ice-line-soft); }

/* ── PNG export bg row ─────────────────────────────────────── */
.ice-png-bg-row {
  display: flex; align-items: center;
  padding: 8px 14px;
  font-size: 11px; color: var(--ice-text);
  cursor: pointer; user-select: none;
}
.ice-png-bg-row input[type="checkbox"] { accent-color: var(--ice-brand); cursor: pointer; margin-right: 6px; }

/* ── Apply-all ─────────────────────────────────────────────── */
.ice-apply-all {
  display: block; width: 100%;
  padding: 7px 10px;
  background: #fff; border: 1px solid var(--ice-line);
  border-radius: 8px; color: var(--ice-muted);
  font-size: 11px; cursor: pointer;
  text-align: left; font-family: inherit;
  transition: all 0.15s;
}
.ice-apply-all:hover { background: var(--ice-brand-soft); color: var(--ice-brand-ink); border-color: var(--ice-brand); }

/* ── Fullscreen / maximize mode ───────────────────────────────*/
.ice-wrap:fullscreen,
.ice-wrap:-webkit-full-screen,
.ice-wrap.ice-fullscreen {
  width: 100vw;
  max-height: 100vh;
  border: none;
  border-radius: 0;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ice-props { display: none; }
  .ice-tools { display: none; }
  .ice-rail { display: none; }
  .ice-topbar-title { display: none; }
}

/* ── Canvas hint bar ───────────────────────────────────────── */
.ice-hint {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--ice-line);
  border-radius: 20px;
  font-size: 11px;
  color: var(--ice-muted);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--ice-shadow-sm);
  backdrop-filter: blur(4px);
}
.ice-hint--sel {
  color: var(--ice-brand-ink);
  border-color: var(--ice-brand-soft2);
  background: rgba(230,244,244,0.95);
}
.ice-hint b { color: var(--ice-ink); }
.ice-hint svg { flex-shrink: 0; }

/* ── Color section selection card / note ───────────────────── */
.ice-sel-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  background: var(--ice-brand-soft);
  border: 1px solid var(--ice-brand-soft2);
  border-radius: 8px;
  margin-bottom: 10px;
}
.ice-sel-card__info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ice-brand-ink);
  min-width: 0;
}
.ice-sel-card__info b { color: var(--ice-ink); }
.ice-sel-card__info svg { flex-shrink: 0; color: var(--ice-brand); }
.ice-sel-card__x {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--ice-muted);
  cursor: pointer;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  padding: 0;
}
.ice-sel-card__x:hover { background: rgba(0,0,0,0.07); color: var(--ice-ink); }

.ice-sel-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 11px;
  color: var(--ice-muted);
  line-height: 1.5;
  margin: 0 0 10px;
  padding: 0;
}
.ice-sel-note svg { flex-shrink: 0; margin-top: 1px; }

/* ── Transfer notice toast ───────────────────────────────────────────────── */
.ice-transfer-notice {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #006D77;
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 99999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  animation: ice-notice-in 0.3s ease;
  pointer-events: none;
}
.ice-transfer-notice--out {
  animation: ice-notice-out 0.4s ease forwards;
}
@keyframes ice-notice-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes ice-notice-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(6px); }
}

/* ── Match-color checkbox ─────────────────────────────────────────────────── */
.ice-match-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  font-size: 11.5px;
  color: #3a5060;
  cursor: pointer;
  user-select: none;
}
.ice-match-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #006D77;
  cursor: pointer;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.ice-empty-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 664px;
  max-height: calc(100vh - 140px);
  min-height: 420px;
  border: 1px solid var(--ice-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--ice-shadow-lg);
}
.ice-empty-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

/* ── Match-color hint text ────────────────────────────────────────────────── */
.ice-match-hint {
  font-size: 10.5px;
  color: #7a9ba8;
  margin: 2px 0 0 0;
  line-height: 1.4;
}

/* ================================================================
   IE-WINDOW SHELL — shared chrome for both editors
   Uses --ice-* tokens already defined above.
   ================================================================ */

/* ---------- Window container ---------- */
.ie-window {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ice-line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--ice-shadow-lg);
  background: #fff;
  height: 664px;
  max-height: calc(100vh - 140px);
  min-height: 560px;
  position: relative;
  font-family: var(--iav-font-body, "Mulish", system-ui, sans-serif);
}
.ie-window--full {
  position: fixed;
  inset: 0;
  z-index: 1080;
  height: 100vh !important;
  max-height: none;
  min-height: 0;
  border-radius: 0;
  border: 0;
}
.ie-window--min { height: auto !important; min-height: 0; max-height: none; }
.ie-window--min .ie-toolbar,
.ie-window--min .ie-body,
.ie-window--min .ie-statusbar { display: none !important; }
.ie-window--min .ie-minbar { display: flex !important; }

.ie-scrim {
  position: fixed; inset: 0;
  background: rgba(12,40,46,.52); z-index: 1079;
  backdrop-filter: blur(2px);
}

/* ---------- Title bar ---------- */
.ie-titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  height: 46px;
  flex-shrink: 0;
  background: linear-gradient(var(--ice-bg-soft), #eef3f4);
  border-bottom: 1px solid var(--ice-line);
}
.ie-lights { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ie-light {
  width: 13px; height: 13px; border-radius: 50%; border: 0; padding: 0;
  cursor: pointer; transition: .12s; position: relative;
}
.ie-light:hover { transform: scale(1.12); filter: brightness(1.05); }
.ie-light:disabled { cursor: default; opacity: .55; }
.ie-light--r { background: #ff5f57; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.ie-light--y { background: #febc2e; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.ie-light--g { background: #28c840; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }

.ie-tabstrip { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.ie-tab {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 320px;
  background: #fff; border: 1px solid var(--ice-line); border-bottom-color: #fff;
  border-radius: 9px 9px 0 0; padding: 8px 14px; margin-bottom: -1px;
  font-family: "Baloo 2", system-ui, sans-serif; font-weight: 700; font-size: 13.5px; color: var(--ice-ink);
  box-shadow: 0 -1px 0 rgba(0,0,0,.02);
}
.ie-tab svg { width: 15px; height: 15px; color: var(--ice-brand); flex-shrink: 0; }
.ie-tab__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ie-tab__ext { color: var(--ice-muted); font-weight: 600; flex-shrink: 0; }
.ie-tab__badge {
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ice-brand-ink); background: var(--ice-brand-soft); border-radius: 20px; padding: 3px 9px;
}

/* Visual / Code mode toggle */
.ie-modeswitch {
  display: flex; gap: 3px; background: rgba(20,50,60,.07);
  border-radius: 9px; padding: 3px; flex-shrink: 0;
}
.ie-modeswitch button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent;
  border-radius: 7px; padding: 6px 13px; font-weight: 700; font-size: 12.5px;
  color: var(--ice-text); transition: .12s; cursor: pointer; white-space: nowrap;
  font-family: inherit;
}
.ie-modeswitch button svg { width: 14px; height: 14px; }
.ie-modeswitch button:hover { color: var(--ice-brand-ink); background: rgba(255,255,255,.5); }
.ie-modeswitch button.is-on { background: var(--ice-brand); color: #fff; box-shadow: 0 1px 4px rgba(0,109,119,.3); }
.ie-modeswitch button.is-on svg { color: rgba(255,255,255,.85); }

.ie-winctrls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ie-winctrls button {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; display: grid; place-items: center; color: var(--ice-muted);
  cursor: pointer; transition: .12s;
}
.ie-winctrls button:hover { background: #fff; border-color: var(--ice-line); color: var(--ice-ink); }
.ie-winctrls button.is-on { background: var(--ice-brand-soft); color: var(--ice-brand-ink); border-color: var(--ice-brand-soft2); }
.ie-winctrls button svg { width: 16px; height: 16px; }

/* ---------- Toolbar (command row) ---------- */
.ie-toolbar {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 14px; flex-shrink: 0;
  background: #fff; border-bottom: 1px solid var(--ice-line);
}
.ie-tgroup { display: flex; align-items: center; gap: 5px; }
.ie-tsep { width: 1px; height: 24px; background: var(--ice-line); flex-shrink: 0; }
.ie-tspacer { flex: 1; }

.ie-tbtn {
  height: 36px; min-width: 36px; padding: 0 8px; border-radius: 9px;
  border: 1px solid var(--ice-line); background: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--ice-text); cursor: pointer; transition: .12s;
  font-weight: 700; font-size: 13px; white-space: nowrap; font-family: inherit;
}
.ie-tbtn span { display: inline; }
.ie-tbtn:hover:not(:disabled) { border-color: var(--ice-brand); background: var(--ice-brand-soft); color: var(--ice-brand-ink); }
.ie-tbtn:disabled { opacity: .4; cursor: default; }
.ie-tbtn svg { width: 16px; height: 16px; flex-shrink: 0; }
.ie-tbtn.is-on { border-color: var(--ice-brand); background: var(--ice-brand-soft); color: var(--ice-brand-ink); }

.ie-zoomgrp { border: 1px solid var(--ice-line); border-radius: 9px; padding: 2px; gap: 1px; }
.ie-zoomgrp .ie-tbtn { border: 0; height: 32px; min-width: 32px; border-radius: 7px; }
.ie-zoomval {
  border: 0; background: transparent; font-weight: 800; font-size: 12.5px;
  color: var(--ice-ink); min-width: 52px; text-align: center; cursor: pointer;
  font-family: inherit;
}
.ie-zoomval:hover { color: var(--ice-brand-ink); }

.ie-export {
  height: 36px; padding: 0 13px; border-radius: 9px; border: 0;
  background: var(--ice-brand); color: #fff;
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: 13px; cursor: pointer; transition: .12s; font-family: inherit;
}
.ie-export:hover:not(:disabled) { background: var(--ice-brand-ink); }
.ie-export:disabled { opacity: .45; cursor: default; }
.ie-export svg { width: 16px; height: 16px; }
.ie-export__chev { width: 14px !important; height: 14px !important; opacity: .85; }

.ie-dl { position: relative; }
.ie-dlmenu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 400;
  background: #fff; border: 1px solid var(--ice-line); border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  padding: 6px; min-width: 220px;
}
.ie-dlmenu__lbl {
  font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ice-faint); padding: 5px 10px 7px;
}
.ie-dlmenu__sep {
  height: 1px; background: var(--ice-line); margin: 4px 0;
}

/* Row button (SVG / JSX) */
.ie-dlmenu__row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border: 0; border-radius: 9px;
  background: transparent; cursor: pointer; text-align: left;
  font-family: inherit; transition: background .1s, color .1s;
  color: var(--ice-text);
}
.ie-dlmenu__row:hover { background: var(--ice-bg-soft); color: var(--ice-brand-ink); }
.ie-dlmenu__row:hover .ie-dlmenu__row-ic { background: var(--ice-brand-soft); color: var(--ice-brand-ink); }
.ie-dlmenu__row-ic {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--ice-bg-soft); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: .1s; color: var(--ice-ink);
}
.ie-dlmenu__row-ic svg { width: 15px; height: 15px; }
.ie-dlmenu__row-body { flex: 1; }
.ie-dlmenu__row-body strong { display: block; font-size: 13px; font-weight: 700; line-height: 1.2; }
.ie-dlmenu__row-body small { font-size: 11px; color: var(--ice-faint); font-weight: 400; }
.ie-dlmenu__row-arr { width: 14px; height: 14px; flex-shrink: 0; opacity: .35; transition: opacity .1s; }
.ie-dlmenu__row:hover .ie-dlmenu__row-arr { opacity: .7; }

/* PNG section */
.ie-dlmenu__sec { padding: 4px 0; }
.ie-dlmenu__sec-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 6px;
}
.ie-dlmenu__sec-ic {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--ice-bg-soft); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--ice-ink);
}
.ie-dlmenu__sec-ic svg { width: 15px; height: 15px; }
.ie-dlmenu__sec-lbl { font-size: 13px; font-weight: 700; color: var(--ice-text); }
.ie-dlmenu__sec-sub { font-size: 11px; color: var(--ice-faint); margin-left: 2px; }
.ie-dlmenu__sizes {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  list-style: none; margin: 0; padding: 0 0 2px;
}
.ie-dlmenu__sizes button {
  border: 1px solid var(--ice-line); border-radius: 7px; padding: 6px 0;
  background: #fff; font-weight: 600; font-size: 11.5px; color: var(--ice-text);
  cursor: pointer; transition: .1s; text-align: center; display: block; width: 100%;
  font-family: inherit; white-space: nowrap;
}
.ie-dlmenu__sizes button:hover { border-color: var(--ice-brand); color: var(--ice-brand-ink); background: var(--ice-brand-soft); }
.ie-dlmenu__sizes button.is-on { border-color: var(--ice-brand); background: var(--ice-brand-soft); color: var(--ice-brand-ink); font-weight: 700; }

/* Format switcher (SVG / PNG / JPEG / WebP / Base64) */
.ie-dlmenu__formats {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 0 2px 6px;
}
.ie-dlmenu__fmt {
  border: 1px solid var(--ice-line); border-radius: 999px; padding: 5px 11px;
  background: #fff; font-weight: 700; font-size: 11.5px; color: var(--ice-text);
  cursor: pointer; transition: .1s; font-family: inherit; white-space: nowrap;
}
.ie-dlmenu__fmt:hover { border-color: var(--ice-brand); color: var(--ice-brand-ink); background: var(--ice-brand-soft); }
.ie-dlmenu__fmt.is-on { border-color: var(--ice-brand); background: var(--ice-brand); color: #fff; }

/* Uploaded file preview thumbnail (checkerboard shows transparency) */
.files-item__preview {
  width: 40px; height: 40px; min-width: 40px; margin-right: 12px;
  border-radius: 6px; border: 1px solid var(--ice-line);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, var(--ice-bg-soft) 25%, transparent 25%),
    linear-gradient(-45deg, var(--ice-bg-soft) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--ice-bg-soft) 75%),
    linear-gradient(-45deg, transparent 75%, var(--ice-bg-soft) 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.files-item__preview img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- 3-column body ---------- */
.ie-body {
  flex: 1; min-height: 0; position: relative;
  display: grid; grid-template-columns: 232px 1fr 300px;
}
.ie-body--code { grid-template-columns: 220px 1fr 1fr; }
.ie-body--norail { grid-template-columns: 0 1fr 300px; }
.ie-body--code.ie-body--norail { grid-template-columns: 0 1fr 1fr; }
.ie-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ie-rail { border-right: 1px solid var(--ice-line); background: var(--ice-bg-soft); overflow: hidden; }
.ie-panel { border-left: 1px solid var(--ice-line); background: #fff; overflow-y: auto; }
.ie-panel::-webkit-scrollbar { width: 8px; }
.ie-panel::-webkit-scrollbar-thumb { background: var(--ice-line); border-radius: 6px; }
.ie-stage { background: #eef4f5; position: relative; }
.ie-raildim { display: none; }

/* ---------- Left rail: icon picker ---------- */
.ie-rail__hd {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 10px;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 700; font-size: 14.5px; color: var(--ice-ink);
  flex-shrink: 0;
}
.ie-rail__hd svg { width: 17px; height: 17px; color: var(--ice-brand); }
.ie-search {
  display: flex; align-items: center; gap: 8px; margin: 0 14px 10px;
  border: 1px solid var(--ice-line); border-radius: 10px; padding: 0 10px;
  background: #fff; transition: .14s; flex-shrink: 0;
}
.ie-search:focus-within { border-color: var(--ice-brand); box-shadow: 0 0 0 3px rgba(20,163,163,.20); }
.ie-search svg { width: 16px; height: 16px; color: var(--ice-muted); flex-shrink: 0; }
.ie-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  padding: 9px 0; font: inherit; font-size: 13.5px; color: var(--ice-ink); min-width: 0;
}
.ie-search__x {
  width: 22px; height: 22px; border: 0; background: transparent; border-radius: 6px;
  display: grid; place-items: center; color: var(--ice-muted); cursor: pointer; flex-shrink: 0;
}
.ie-search__x:hover { background: var(--ice-bg-soft); color: var(--ice-ink); }
.ie-search__x svg { width: 14px; height: 14px; }
.ie-rail__grid {
  flex: 1; overflow-y: auto; padding: 4px 12px 12px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; align-content: start;
}
.ie-rail__grid::-webkit-scrollbar { width: 7px; }
.ie-rail__grid::-webkit-scrollbar-thumb { background: var(--ice-line); border-radius: 6px; }
.ie-chip {
  aspect-ratio: 1; border: 1px solid transparent; border-radius: 10px; background: #fff;
  display: grid; place-items: center; color: var(--ice-ink); cursor: pointer; transition: .12s;
}
.ie-chip svg { width: 22px; height: 22px; }
.ie-chip:hover { border-color: var(--ice-brand-soft2); background: var(--ice-brand-soft); color: var(--ice-brand-ink); transform: translateY(-1px); }
.ie-chip.is-on { border-color: var(--ice-brand); background: var(--ice-brand-soft); color: var(--ice-brand-ink); }
.ie-rail__empty { grid-column: 1/-1; text-align: center; color: var(--ice-muted); font-size: 13px; font-weight: 600; padding: 24px 6px; }
.ie-rail__foot { padding: 11px 14px; border-top: 1px solid var(--ice-line); flex-shrink: 0; }
.ie-upload {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px dashed var(--ice-brand-soft2); border-radius: 10px; padding: 11px; background: #fff;
  font-weight: 700; font-size: 13.5px; color: var(--ice-brand-ink); cursor: pointer; transition: .14s;
  font-family: inherit;
}
.ie-upload:hover { border-color: var(--ice-brand); background: var(--ice-brand-soft); }
.ie-upload svg { width: 16px; height: 16px; }

/* ---------- Centre canvas / stage ---------- */
.ie-canvas {
  flex: 1; display: grid; place-items: center; overflow: hidden;
  position: relative; padding: 28px;
}
.ie-canvas--white { background: #fff; }
.ie-canvas--dark  { background: #15252b; }
.ie-canvas--none  { background: #eef4f5; }
.ie-canvas--checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg,#e7ecef 25%,transparent 25%),
    linear-gradient(-45deg,#e7ecef 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#e7ecef 75%),
    linear-gradient(-45deg,transparent 75%,#e7ecef 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.ie-art {
  width: 300px; height: 300px; max-width: 78%; max-height: 78%;
  filter: drop-shadow(0 10px 26px rgba(20,50,60,.14));
  transition: transform .12s ease;
}
.ie-art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ie-art [data-el] { cursor: pointer; }
.ie-art [data-el]:hover { opacity: .82; }

/* canvas hint */
.ie-canvas-hint {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 30px;
  background: rgba(21,37,43,.86); color: #fff; font-size: 12.5px; font-weight: 600;
  pointer-events: none; backdrop-filter: blur(4px); max-width: calc(100% - 28px); white-space: nowrap;
}
.ie-canvas-hint svg { width: 14px; height: 14px; flex-shrink: 0; }
.ie-canvas-hint b { font-weight: 800; }

/* ---------- Empty state inside canvas ---------- */
.ie-empty { text-align: center; max-width: 340px; padding: 20px; }
.ie-empty__ic {
  width: 72px; height: 72px; border-radius: 20px; background: var(--ice-brand-soft);
  color: var(--ice-brand); display: grid; place-items: center; margin: 0 auto 16px;
}
.ie-empty__ic svg { width: 34px; height: 34px; }
.ie-empty h3 { font-size: 20px; color: var(--ice-ink); margin-bottom: 8px; }
.ie-empty p { font-size: 14px; color: var(--ice-text); line-height: 1.55; margin-bottom: 18px; }
.ie-empty__row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.ie-empty__chip {
  width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--ice-line);
  background: #fff; display: grid; place-items: center; color: var(--ice-ink);
  cursor: pointer; transition: .12s;
}
.ie-empty__chip:hover { border-color: var(--ice-brand); background: var(--ice-brand-soft); color: var(--ice-brand-ink); transform: translateY(-2px); }
.ie-empty__chip svg { width: 24px; height: 24px; }

/* ---------- Right inspector panel sections ---------- */
.ie-sec { padding: 16px 18px; border-bottom: 1px solid var(--ice-line-soft); }
.ie-sec__hd { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.ie-sec__hd svg { width: 15px; height: 15px; color: var(--ice-brand); }
.ie-sec__hd h4 {
  font-family: "Baloo 2", system-ui, sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: .02em; color: var(--ice-ink); margin: 0;
}

/* Stroke / Fill segmented control */
.ie-seg { display: flex; gap: 4px; background: var(--ice-bg-soft); border-radius: 9px; padding: 3px; margin-bottom: 11px; }
.ie-seg button {
  flex: 1; border: 0; background: transparent; border-radius: 7px;
  padding: 7px 0; font-weight: 700; font-size: 12.5px; color: var(--ice-muted);
  cursor: pointer; transition: .12s; font-family: inherit;
}
.ie-seg button.is-on { background: #fff; color: var(--ice-brand-ink); box-shadow: var(--ice-shadow-sm); }

/* 12-color swatch grid */
.ie-swgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 11px; }
.ie-sw {
  aspect-ratio: 1; border-radius: 8px; border: 1px solid rgba(0,0,0,.08);
  cursor: pointer; position: relative; transition: transform .1s;
}
.ie-sw:hover { transform: scale(1.12); }
.ie-sw--none { background: #fff; }
.ie-sw--none::before {
  content: ""; position: absolute; inset: 3px; border-radius: 4px;
  background: linear-gradient(to top left, transparent 45%, #e2564d 46%, #e2564d 54%, transparent 55%);
}

/* Hex row */
.ie-hexrow { display: flex; gap: 8px; align-items: center; }
.ie-hex {
  flex: 1; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--ice-line); border-radius: 9px; padding: 7px 10px; min-width: 0;
}
.ie-hex input[type=color] { width: 24px; height: 24px; border: 0; padding: 0; background: 0; border-radius: 6px; cursor: pointer; flex-shrink: 0; }
.ie-hex input[type=text] {
  flex: 1; border: 0; outline: 0; font: inherit; font-size: 13px; font-weight: 700;
  color: var(--ice-ink); text-transform: uppercase; width: 100%; min-width: 0;
}
.ie-mini {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--ice-line);
  background: #fff; display: grid; place-items: center; color: var(--ice-text);
  cursor: pointer; flex-shrink: 0; transition: .12s;
}
.ie-mini:hover { border-color: var(--ice-brand); color: var(--ice-brand-ink); background: var(--ice-brand-soft); }
.ie-mini svg { width: 16px; height: 16px; }

/* Selected-element callout */
.ie-selcard {
  display: flex; align-items: center; gap: 11px;
  background: var(--ice-brand-soft); border: 1px solid var(--ice-brand-soft2);
  border-radius: 11px; padding: 10px 12px; margin-bottom: 12px;
}
.ie-selcard__sw { width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(0,0,0,.1); flex-shrink: 0; }
.ie-selcard__meta { flex: 1; min-width: 0; }
.ie-selcard__meta b { display: block; font-family: "Baloo 2", system-ui, sans-serif; font-size: 14px; color: var(--ice-ink); }
.ie-selcard__meta span { font-size: 12px; color: var(--ice-brand-ink); font-weight: 600; }
.ie-selcard__x {
  width: 28px; height: 28px; border-radius: 7px; border: 0;
  background: rgba(255,255,255,.7); display: grid; place-items: center;
  color: var(--ice-brand-ink); cursor: pointer; flex-shrink: 0;
}
.ie-selcard__x:hover { background: #fff; }
.ie-selcard__x svg { width: 15px; height: 15px; }

/* Note shown when nothing is selected */
.ie-selnote {
  font-size: 12.5px; color: var(--ice-muted); font-weight: 600;
  line-height: 1.5; display: flex; gap: 8px; align-items: flex-start;
  margin-bottom: 12px;
}
.ie-selnote svg { width: 15px; height: 15px; color: var(--ice-brand); flex-shrink: 0; margin-top: 1px; }

/* Dim the inspector panel when no icon is loaded */
.ie-window--empty .ie-needs-doc { opacity: .4; pointer-events: none; }

/* Slider / range */
.ie-field + .ie-field { margin-top: 14px; }
.ie-field__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.ie-field__top label { font-size: 13px; font-weight: 700; color: var(--ice-text); }
.ie-field__top b { font-size: 13px; font-weight: 800; color: var(--ice-brand-ink); }
.ie-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px;
  border-radius: 6px; background: var(--ice-line); outline: 0;
}
.ie-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%;
  background: var(--ice-brand); border: 2px solid #fff; box-shadow: var(--ice-shadow-sm); cursor: pointer;
}
.ie-range::-moz-range-thumb {
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--ice-brand); border: 2px solid #fff; cursor: pointer;
}

/* Weight / style / transform chips */
.ie-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ie-chips--4 { display: grid; grid-template-columns: repeat(4, 1fr); }
.ie-chips--3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.ie-pill {
  border: 1px solid var(--ice-line); border-radius: 9px; padding: 9px 6px; background: #fff;
  font-weight: 700; font-size: 12.5px; color: var(--ice-text); cursor: pointer; transition: .12s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit;
}
.ie-pill:hover:not(:disabled) { border-color: var(--ice-brand-soft2); background: var(--ice-brand-soft); }
.ie-pill:disabled { opacity: .45; cursor: default; }
.ie-pill.is-on { border-color: var(--ice-brand); background: var(--ice-brand-soft); color: var(--ice-brand-ink); }
.ie-pill svg { width: 15px; height: 15px; }
.ie-pill__line { width: 22px; height: 0; border-top-color: currentColor; border-top-style: solid; }

/* ---------- Status bar ---------- */
.ie-statusbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 14px; flex-shrink: 0; flex-wrap: wrap;
  background: var(--ice-bg-soft); border-top: 1px solid var(--ice-line);
}
.ie-status__doc { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.ie-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ice-text); }
.ie-stat svg { width: 14px; height: 14px; color: var(--ice-muted); }
.ie-stat--muted { color: var(--ice-muted); font-weight: 600; }
.ie-stat--sel { color: var(--ice-brand-ink); }
.ie-stat--sel svg { color: var(--ice-brand); }
.ie-stat--private { color: var(--ice-muted); opacity: .75; letter-spacing: -.01em; }
.ie-stat--ok  { color: #218f50; }
.ie-stat--ok svg  { color: #218f50; }
.ie-stat--err { color: #c0392b; }
.ie-stat--err svg { color: #c0392b; }
.ie-status__bg { display: flex; align-items: center; gap: 9px; }
.ie-status__lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--ice-muted); }
.ie-status__lbl svg { width: 14px; height: 14px; }
.ie-bgseg { display: flex; gap: 3px; background: #fff; border: 1px solid var(--ice-line); border-radius: 8px; padding: 3px; }
.ie-bgseg button {
  border: 0; background: transparent; border-radius: 6px; padding: 5px 10px;
  font-weight: 700; font-size: 11.5px; color: var(--ice-muted); cursor: pointer; transition: .1s;
  font-family: inherit;
}
.ie-bgseg button:hover { color: var(--ice-brand-ink); }
.ie-bgseg button.is-on { background: var(--ice-brand-soft); color: var(--ice-brand-ink); }

/* ---------- Minimised strip ---------- */
.ie-minbar { display: none; }
.ie-window--min .ie-minbar {
  display: flex !important; align-items: center; gap: 11px; width: 100%;
  padding: 16px 18px; border: 0; background: #fff; cursor: pointer; text-align: left;
  font-family: "Baloo 2", system-ui, sans-serif; font-weight: 700; font-size: 14px; color: var(--ice-ink); transition: .12s;
}
.ie-window--min .ie-minbar:hover { background: var(--ice-bg-soft); }
.ie-minbar svg { width: 18px; height: 18px; color: var(--ice-brand); }
.ie-minbar em { margin-left: auto; font-style: normal; font-weight: 700; font-size: 12.5px; color: var(--ice-brand-ink); }

/* ================================================================
   SE-* — SVG Code Editor panels (inside the shared ie-window shell)
   ================================================================ */

/* Directory column */
.se-dir { background: var(--ice-bg-soft); border-right: 1px solid var(--ice-line); }
.se-dir__hd {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 10px; flex-shrink: 0;
  font-family: "Baloo 2", system-ui, sans-serif; font-weight: 700; font-size: 14.5px; color: var(--ice-ink);
  border-bottom: 1px solid var(--ice-line);
}
.se-dir__hd svg { width: 17px; height: 17px; color: var(--ice-brand); }
.se-dir__search {
  display: flex; align-items: center; gap: 8px; margin: 10px 14px;
  border: 1px solid var(--ice-line); border-radius: 10px; padding: 0 10px;
  background: #fff; transition: .14s; flex-shrink: 0;
}
.se-dir__search:focus-within { border-color: var(--ice-brand); box-shadow: 0 0 0 3px rgba(20,163,163,.20); }
.se-dir__search svg { width: 16px; height: 16px; color: var(--ice-muted); flex-shrink: 0; }
.se-dir__search input {
  flex: 1; border: 0; outline: 0; background: transparent; padding: 9px 0;
  font: inherit; font-size: 13px; color: var(--ice-ink); min-width: 0;
}
.se-dir__grid {
  flex: 1; overflow-y: auto; padding: 8px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-content: start;
}
.se-dir__grid::-webkit-scrollbar { width: 7px; }
.se-dir__grid::-webkit-scrollbar-thumb { background: var(--ice-line); border-radius: 6px; }
/* icon-box items inside the directory */
.se-dir__grid .icon-box {
  aspect-ratio: 1; border: 1px solid var(--ice-line); border-radius: 10px; background: #fff;
  display: grid; place-items: center; cursor: pointer; padding: 6px;
  color: var(--ice-ink); transition: .12s; margin: 0; float: none; width: auto; height: auto;
}
.se-dir__grid .icon-box:hover { border-color: var(--ice-brand); background: var(--ice-brand-soft); }
.se-dir__grid .icon-box.active { border-color: var(--ice-brand); background: var(--ice-brand-soft); }
.se-dir__grid .icon-box svg { width: 22px; height: 22px; }
.se-dir__empty {
  grid-column: 1/-1; text-align: center; color: var(--ice-muted);
  font-size: 12px; font-weight: 600; padding: 20px 6px;
}

/* Code editor column */
.se-code { background: #1e2a30; }
.se-code__hd {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: #111517; border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0; color: #8794a0; font-size: 13px; font-weight: 700;
}
.se-code__hd svg { width: 15px; height: 15px; color: var(--ice-brand); flex-shrink: 0; }
.se-code__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ice-muted);
  flex-shrink: 0; transition: background .2s;
}
.se-code__dot--ok  { background: #28c840; }
.se-code__dot--err { background: #ff5f57; }
.se-code__editor { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.se-code__editor .CodeMirror { height: 100%; font-size: 13px; }

/* Preview / output column */
.se-out { background: #fff; border-left: 1px solid var(--ice-line); }
.se-out__hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 14px; height: 46px; flex-shrink: 0; background: #fff;
  border-bottom: 1px solid var(--ice-line);
}
.se-out__tabs { display: flex; gap: 3px; }
.se-out__tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; border-radius: 7px; padding: 6px 11px;
  font-weight: 700; font-size: 12.5px; color: var(--ice-muted);
  cursor: pointer; transition: .12s; font-family: inherit; white-space: nowrap;
}
.se-out__tabs button svg { width: 14px; height: 14px; }
.se-out__tabs button:hover { color: var(--ice-brand-ink); }
.se-out__tabs button.is-on { background: var(--ice-brand-soft); color: var(--ice-brand-ink); }
.se-out__zoom { display: flex; align-items: center; gap: 3px; }
.se-out__zoom button {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; display: grid; place-items: center; color: var(--ice-muted);
  cursor: pointer; transition: .12s;
}
.se-out__zoom button:hover { background: var(--ice-bg-soft); border-color: var(--ice-line); color: var(--ice-ink); }
.se-out__zoom button svg { width: 14px; height: 14px; }
.se-out__zoomval { font-size: 11.5px; font-weight: 700; color: var(--ice-ink); min-width: 40px; text-align: center; }
.se-out__body { flex: 1; min-height: 0; overflow: hidden; position: relative; }

/* Preview canvas — background is controlled by .ie-canvas--* modifier */
.se-prev__canvas { width: 100%; height: 100%; display: grid; place-items: center; padding: 28px; overflow: hidden; }

/* React code view */
.se-react { height: 100%; display: flex; flex-direction: column; }
.se-react__code {
  flex: 1; min-height: 0; margin: 0; padding: 0; overflow: hidden; background: #1e2a30;
}
.se-react__code .CodeMirror { height: 100%; font-size: 13px; }
.se-react__foot {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: #111517; border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0;
}
.se-react__foot button {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: 8px; font-weight: 700; font-size: 12.5px; cursor: pointer; transition: .12s;
  font-family: inherit;
}
.se-react__foot button:first-child { background: var(--ice-brand); border: 0; color: #fff; }
.se-react__foot button:first-child:hover { background: var(--ice-brand-ink); }
.se-react__foot button:last-child { background: #23333d; border: 1px solid #3a5060; color: #c9d6dc; }
.se-react__foot button:last-child:hover { background: #2c3e48; }

/* ================================================================
   RESPONSIVE — shared for both editors
   ================================================================ */
@media (max-width: 1040px) {
  .ie-window { height: 600px; max-height: calc(100vh - 120px); }
  .ie-body { grid-template-columns: 1fr 280px; }
  .ie-body--code { grid-template-columns: 1fr 1fr; }
  .ie-body--norail { grid-template-columns: 1fr 280px; }
  .ie-rail,
  .se-dir {
    position: absolute; top: 0; left: 0; bottom: 0; z-index: 12; width: 264px;
    box-shadow: var(--ice-shadow-lg); border-right: 1px solid var(--ice-line);
    transform: translateX(-100%); transition: transform .2s ease; display: flex;
  }
  .ie-body:not(.ie-body--norail) .ie-rail,
  .ie-body:not(.ie-body--norail) .se-dir { transform: translateX(0); }
  .ie-body--norail .ie-rail,
  .ie-body--norail .se-dir { display: flex; }
  .ie-body:not(.ie-body--norail) .ie-raildim {
    display: block; position: absolute; inset: 0; z-index: 11;
    border: 0; background: rgba(12,40,46,.28); cursor: pointer;
  }
}

@media (max-width: 760px) {
  .ie-window { height: auto; max-height: none; min-height: 0; }
  .ice-empty-shell { height: auto; max-height: none; min-height: 0; padding: 32px 0; }
  .ie-window--full { height: 100vh !important; max-height: none; }
  .ie-titlebar { gap: 10px; padding: 0 10px; }
  .ie-tab { max-width: 150px; padding: 7px 11px; }
  .ie-toolbar { overflow-x: auto; flex-wrap: nowrap; padding: 9px 10px; gap: 6px; scrollbar-width: none; }
  .ie-toolbar::-webkit-scrollbar { display: none; }
  .ie-tspacer { display: none; }
  .ie-tbtn--wide span { display: none; }
  .ie-tgroup, .ie-tbtn, .ie-export, .ie-zoomgrp, .ie-tsep { flex-shrink: 0; }
  .ie-dlmenu { right: auto; left: 0; }
  .ie-body, .ie-body--norail, .ie-body--code { display: flex; flex-direction: column; grid-template-columns: none; }
  .ie-canvas { min-height: 280px; }
  .ie-panel { border-left: 0; border-top: 1px solid var(--ice-line); overflow: visible; }
  .ie-statusbar { gap: 8px 12px; padding: 9px 12px; }
  .ie-status__bg { width: 100%; justify-content: space-between; }
  .ie-bgseg { flex: 1; justify-content: space-between; }
  .se-dir { width: 86%; max-width: 320px; }
  .se-out { display: none; }
}

@media (max-width: 420px) {
  .ie-modeswitch button span { display: none; }
  .ie-modeswitch button { padding: 6px 8px; }
  .ie-tab__ext { display: none; }
}

/* ── cv-iconbtn (small icon action button used in tool columns) ── */
.cv-iconbtn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--ice-line); background: #fff; display: grid; place-items: center; color: var(--ice-text); transition: .14s; cursor: pointer; }
.cv-iconbtn:hover { border-color: var(--ice-brand); color: var(--ice-brand-ink); background: var(--ice-brand-soft); }
.cv-iconbtn svg { width: 16px; height: 16px; }

/* ── Tool Workbench (TWB) — Image Converter & Image Compressor ── */

.twb-setup { display: flex; align-items: center; gap: 16px; padding: 11px 14px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.twb-grp { display: flex; align-items: center; gap: 9px; min-width: 0; }
.twb-grp__lbl { font-family: var(--font-display); font-weight: 700; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.twb-spacer { flex: 1; min-width: 8px; }
.twb-grp__note { font-weight: 600; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.twb-seg { display: flex; gap: 3px; background: rgba(20,50,60,.07); border-radius: 9px; padding: 3px; }
.twb-seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; border-radius: 7px; padding: 7px 13px; font-weight: 700; font-size: 12.5px; color: var(--text); cursor: pointer; transition: .12s; white-space: nowrap; }
.twb-seg button svg { width: 14px; height: 14px; }
.twb-seg button:hover:not(:disabled) { color: var(--brand-ink); }
.twb-seg button.is-on { background: #fff; color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.twb-seg button:disabled { opacity: .38; cursor: default; }

.twb-select { position: relative; display: inline-flex; align-items: center; }
.twb-select select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 8px 30px 8px 12px; font-family: var(--font-body); font-weight: 700; font-size: 13px; color: var(--ink); cursor: pointer; transition: .12s; }
.twb-select select:hover { border-color: var(--brand); }
.twb-select select:focus { outline: 0; border-color: var(--brand); box-shadow: var(--ring); }
.twb-select svg { position: absolute; right: 9px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }

.twb-kb { display: inline-flex; align-items: center; gap: 7px; }
.twb-kb input { width: 78px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-family: var(--font-body); font-weight: 700; font-size: 13px; color: var(--ink); background: #fff; }
.twb-kb input:focus { outline: 0; border-color: var(--brand); box-shadow: var(--ring); }
.twb-kb__unit { font-weight: 700; font-size: 12.5px; color: var(--muted); }

.twb-slider { display: inline-flex; align-items: center; gap: 11px; min-width: 190px; }
.twb-slider input[type=range] { -webkit-appearance: none; appearance: none; width: 140px; height: 5px; border-radius: 5px; background: linear-gradient(var(--brand), var(--brand)) no-repeat, var(--line); background-size: var(--pct, 60%) 100%; cursor: pointer; }
.twb-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); box-shadow: var(--shadow-sm); cursor: pointer; }
.twb-slider input[type=range]::-moz-range-thumb { width: 17px; height: 17px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); cursor: pointer; }
.twb-slider__val { font-weight: 800; font-size: 13px; color: var(--brand-ink); min-width: 38px; text-align: right; }

.twb-go { height: 38px; padding: 0 18px; border-radius: 9px; border: 0; background: var(--brand); color: #fff; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 13.5px; cursor: pointer; transition: .12s; white-space: nowrap; }
.twb-go:hover:not(:disabled) { background: var(--brand-ink); }
.twb-go:disabled { opacity: .42; cursor: default; }
.twb-go svg { width: 16px; height: 16px; }

/* body grid: two equal columns (source · output) */
.ie-body--tool { grid-template-columns: 1fr 1fr; }
.twb-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #fff; }
.twb-col + .twb-col { border-left: 1px solid var(--line); }
.twb-col__hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.twb-col__hd .twb-hl { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--ink); }
.twb-col__hd .twb-hl svg { width: 16px; height: 16px; color: var(--brand); }
.twb-col__body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }

/* drop zone */
.twb-drop { flex: 1; margin: 16px; border: 2px dashed var(--line); border-radius: 14px; background: var(--bg-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 24px; cursor: pointer; transition: .16s; }
.twb-drop:hover, .twb-drop.is-drag { border-color: var(--brand); background: var(--brand-soft); }
.twb-drop.is-err { border-color: #e2564d; background: #fdeeec; }
.twb-drop__ic { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--brand); display: grid; place-items: center; margin-bottom: 15px; box-shadow: var(--shadow-sm); }
.twb-drop.is-err .twb-drop__ic { color: #d8463b; }
.twb-drop__ic svg { width: 29px; height: 29px; }
.twb-drop h3 { font-family: var(--font-display); font-size: 18px; color: var(--ink); margin: 0 0 5px; }
.twb-drop p { font-size: 13px; color: var(--muted); margin: 0; }
.twb-drop__or { margin: 12px 0; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--faint); }
.twb-drop .btn { pointer-events: none; }
.twb-drop__hint { margin-top: 16px; font-size: 12px; font-weight: 600; color: var(--faint); display: inline-flex; gap: 6px; align-items: center; }
.twb-drop__hint svg { width: 14px; height: 14px; }
.twb-drop__err { margin-top: 12px; color: #c0392b; font-weight: 700; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.twb-drop__err svg { width: 15px; height: 15px; }

/* uploaded file card */
.twb-file { margin: 16px; display: flex; gap: 13px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 13px; box-shadow: var(--shadow-sm); flex-shrink: 0; }
.twb-thumb { width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; background-color: #f0f5f6; background-image: linear-gradient(45deg, #e1eaeb 25%, transparent 25%), linear-gradient(-45deg, #e1eaeb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e1eaeb 75%), linear-gradient(-45deg, transparent 75%, #e1eaeb 75%); background-size: 12px 12px; background-position: 0 0, 0 6px, 6px -6px, -6px 0; }
.twb-thumb img, .twb-thumb svg { max-width: 84%; max-height: 84%; display: block; }
.twb-file__meta { min-width: 0; flex: 1; }
.twb-file__nm { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.twb-file__sub { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.twb-chip { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand-soft); padding: 3px 7px; border-radius: 5px; }
.twb-file__acts { display: flex; gap: 6px; flex-shrink: 0; }

/* secondary action (e.g. Edit in icon editor) */
.twb-aside { margin: 0 16px 16px; }
.twb-handoff { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: .14s; }
.twb-handoff:hover { border-color: var(--brand); background: var(--brand-soft); }
.twb-handoff__ic { width: 36px; height: 36px; border-radius: 9px; background: #fff; color: var(--brand); display: grid; place-items: center; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.twb-handoff__ic svg { width: 18px; height: 18px; }
.twb-handoff__tx { min-width: 0; flex: 1; }
.twb-handoff__tx b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--ink); }
.twb-handoff__tx span { font-size: 12px; color: var(--muted); }
.twb-handoff > svg { width: 17px; height: 17px; color: var(--muted); margin-left: auto; flex-shrink: 0; }

/* preview canvas (checkerboard) */
.twb-canvas { flex: 1; display: grid; place-items: center; padding: 24px; min-height: 240px; background-color: #f7fafa; background-image: linear-gradient(45deg, #e4eced 25%, transparent 25%), linear-gradient(-45deg, #e4eced 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e4eced 75%), linear-gradient(-45deg, transparent 75%, #e4eced 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.twb-art { display: grid; place-items: center; transition: transform .15s; filter: drop-shadow(0 8px 22px rgba(20,50,60,.14)); }
.twb-art svg, .twb-art img { display: block; max-width: 240px; max-height: 240px; }
.twb-art--white { background: #fff; padding: 14px; border-radius: 8px; }
.twb-empty { text-align: center; color: var(--muted); padding: 20px; }
.twb-empty svg { width: 44px; height: 44px; opacity: .45; margin-bottom: 12px; }
.twb-empty p { font-size: 13.5px; font-weight: 600; margin: 0; }

/* base64 output */
.twb-b64 { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 14px; gap: 11px; }
.twb-b64 textarea { flex: 1; min-height: 150px; resize: none; border: 1px solid var(--line); border-radius: 11px; padding: 13px; font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.55; color: var(--text); background: var(--bg-soft); word-break: break-all; }
.twb-b64 textarea:focus { outline: 0; border-color: var(--brand); box-shadow: var(--ring); }
.twb-b64__acts { display: flex; gap: 9px; }
.twb-b64__acts button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 0; font-weight: 700; font-size: 13px; color: var(--text); cursor: pointer; transition: .12s; }
.twb-b64__acts button:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.twb-b64__acts button svg { width: 15px; height: 15px; }

/* output footer */
.twb-foot { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
.twb-foot .twb-spacer { min-width: 0; }
.twb-dlbtn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--ink); color: #fff; border-radius: 10px; padding: 11px 20px; font-family: var(--font-display); font-weight: 700; font-size: 14px; cursor: pointer; transition: .12s; }
.twb-dlbtn:hover:not(:disabled) { background: #20343c; }
.twb-dlbtn:disabled { opacity: .4; cursor: default; }
.twb-dlbtn svg { width: 16px; height: 16px; }
.twb-foot__spec { font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* compressor: progress ring + savings bars */
.twb-progress { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; padding: 24px; text-align: center; }
.twb-progress__ring { width: 52px; height: 52px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: twb-spin .8s linear infinite; }
@keyframes twb-spin { to { transform: rotate(360deg); } }
.twb-progress__track { width: 78%; max-width: 280px; height: 8px; border-radius: 5px; background: var(--line-soft); overflow: hidden; }
.twb-progress__fill { height: 100%; background: var(--brand); border-radius: 5px; transition: width .18s linear; }
.twb-progress__lbl { font-weight: 700; color: var(--muted); font-size: 13px; }

.twb-savings { display: flex; align-items: center; gap: 18px; padding: 18px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
.twb-savings__pct { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; color: #1f8a4c; display: flex; flex-direction: column; }
.twb-savings__pct small { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #4a9a6a; margin-top: 4px; }
.twb-bars { flex: 1; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.twb-bar { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 11px; font-size: 12px; font-weight: 700; }
.twb-bar__k { color: var(--muted); }
.twb-bar__track { height: 9px; border-radius: 5px; background: var(--line-soft); overflow: hidden; }
.twb-bar__fill { height: 100%; border-radius: 5px; }
.twb-bar__fill--orig { background: #c9d3d6; }
.twb-bar__fill--new { background: #1f8a4c; }
.twb-bar__v { color: var(--ink); font-weight: 800; white-space: nowrap; }

/* ie-stat privacy note tint */
.ie-stat--priv svg { color: var(--brand); }

/* ── Target-size preset chips inside setup bar ─────────────────────────── */
.twb-size-presets { display: flex; gap: 4px; flex-wrap: wrap; }
.twb-size-preset { border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 5px 10px; font-family: var(--font-body); font-weight: 700; font-size: 12px; color: var(--text); cursor: pointer; transition: .12s; white-space: nowrap; }
.twb-size-preset:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.twb-size-preset.is-on { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }

/* ── HowTo steps ────────────────────────────────────────────────────────── */
.cmp-howto { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; max-width: 720px; margin: 0 auto; }
.cmp-howto__step { display: flex; gap: 20px; align-items: flex-start; padding: 22px 0; border-bottom: 1px solid var(--ice-line); }
.cmp-howto__step:last-child { border-bottom: 0; }
.cmp-howto__n { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-family: var(--font-display); font-weight: 800; font-size: 16px; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.cmp-howto__step div strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.cmp-howto__step div p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ── Target-size section copy ───────────────────────────────────────────── */
.cmp-targetsize-copy { max-width: 720px; margin: 0 auto; }
.cmp-targetsize-copy p { font-size: 15px; color: var(--text); line-height: 1.75; margin: 0 0 14px; }
.cmp-targetsize-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.cmp-targetsize-chips .twb-chip { font-size: 12px; padding: 5px 11px; }

/* contextual next-steps strip */
.twb-next { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; padding: 15px 18px; border: 1px solid var(--brand-soft-2); background: var(--brand-soft); border-radius: 14px; }
.twb-next__lbl { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; color: var(--brand-ink); font-size: 14px; white-space: nowrap; }
.twb-next__lbl svg { width: 17px; height: 17px; }
.twb-next__chips { display: flex; gap: 9px; flex-wrap: wrap; }
.twb-nextchip { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--brand-soft-2); border-radius: 9px; padding: 8px 13px; font-family: var(--font-body); font-weight: 700; font-size: 12.5px; color: var(--brand-ink); cursor: pointer; transition: .12s; }
.twb-nextchip:hover { border-color: var(--brand); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.twb-nextchip svg { width: 15px; height: 15px; }

/* twb responsive */
@media (max-width: 760px) {
  /* Override inline height:520px on tool pages */
  #cv-window,
  #cmp-window { height: auto !important; min-height: 0; }

  .ie-body--tool { display: flex; flex-direction: column; grid-template-columns: none; }
  .twb-col + .twb-col { border-left: 0; border-top: 1px solid var(--line); }
  .twb-col__body { min-height: 260px; }
  .twb-setup { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; gap: 14px; scrollbar-width: none; }
  .twb-setup::-webkit-scrollbar { display: none; }
  .twb-grp, .twb-seg, .twb-select, .twb-go, .twb-slider, .twb-kb { flex-shrink: 0; }
  .twb-spacer { display: none; }
  .twb-next { flex-direction: column; align-items: flex-start; }

  /* Hide desktop window controls — lights still work */
  .ie-window .ie-winctrls { display: none; }

  /* Status bar — hide the long privacy note on narrow screens */
  .ie-stat--priv { display: none; }
}

/* Small phones */
@media (max-width: 520px) {
  /* Titlebar: truncate tab name tighter */
  .ie-tab { max-width: 140px; }
  .ie-tab__ext { display: none; }

  /* Setup bar items — slimmer pills */
  .twb-seg button { padding: 6px 10px; font-size: 11.5px; }
  .twb-go { padding: 0 14px; font-size: 12.5px; height: 36px; }

  /* Drop zone — compact */
  .twb-drop { padding: 22px 16px; }
  .twb-drop h3 { font-size: 16px; }
  .twb-drop__or,
  .twb-drop .btn { display: none; }

  /* Savings — stack vertically */
  .twb-savings { flex-direction: column; align-items: flex-start; gap: 10px; }
  .twb-savings__pct { font-size: 28px; flex-direction: row; align-items: baseline; gap: 8px; }
  .twb-savings__pct small { margin-top: 0; }
  .twb-bars { width: 100%; }

  /* Footer — wrap spec above button */
  .twb-foot { flex-wrap: wrap; row-gap: 8px; }
  .twb-foot__spec { width: 100%; }
  .twb-dlbtn { width: 100%; justify-content: center; }

  /* Base64 actions — stack */
  .twb-b64__acts { flex-direction: column; }
}

/* Extra-small phones */
@media (max-width: 380px) {
  .twb-seg button { padding: 5px 8px; font-size: 11px; }
  .twb-file { gap: 10px; padding: 10px; }
  .twb-thumb { width: 46px; height: 46px; }
}
