/* ============================================================
   UTILITYSUITE.IO — RETRO DESKTOP DESIGN SYSTEM
   Vintage 1990s desktop-OS aesthetic for a modern utility dashboard
============================================================ */

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CSS Variables ──────────────────────────────────────── */
/* Mac OS 9.2 "Platinum" appearance: light gray 3D-beveled chrome,
   pinstriped active title bars, blue selection highlight. */
:root {
  --font-ui:   "Charcoal", "Geneva", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Monaco", "Courier New", Courier, monospace;

  /* Platinum surface palette */
  --plat-face:    #dcdcdc;  /* standard gray control/window surface */
  --plat-hi:      #ffffff;  /* top-left highlight bevel */
  --plat-hi2:     #f3f3f3;  /* inner highlight */
  --plat-sh:      #808080;  /* bottom-right shadow bevel */
  --plat-sh2:     #b4b4b4;  /* inner shadow */
  --plat-frame:   #555555;  /* outer dark frame line */
  --win-bg:       #dcdcdc;  /* window body background */
  --win-content:  #ffffff;  /* content / list backgrounds */

  /* Selection / accent (Platinum default "Blue" appearance) */
  --highlight:    #3a6ea5;
  --highlight-lt: #b6cce4;
  --highlight-dk: #244d7a;

  --desktop-bg:  #7c8aa0;
  --desktop-pat: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);

  --menubar-h:   22px;
  --titlebar-stripe: repeating-linear-gradient(
                       to bottom,
                       #f3f3f3 0px, #f3f3f3 1px,
                       #c9c9c9 1px, #c9c9c9 2px);
  --titlebar-inactive: #ededed;
  --scrolltrack: #cfcfcf;

  /* Legacy compat vars referenced in tool JS template strings */
  --text-tertiary: #999;
  --text-secondary: #555;
  --text-primary: #000;
}

/* ── Base ───────────────────────────────────────────────── */
html, body {
  height: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  color: #000;
  background: var(--desktop-bg);
  overflow: hidden;
  user-select: none;
  cursor: default;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
input, textarea, select, button { font-family: var(--font-ui); }

/* ── Crawlable SEO index (off-screen, still in DOM & accessible) ── */
#seo-index {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* ── Per-page crawlable content (off-screen, still in DOM & accessible) ── */
.seo-content {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  border: 0;
  padding: 0;
  margin: -1px;
}

/* ── Menu Bar ───────────────────────────────────────────── */
#menubar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--menubar-h);
  background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 55%, #dcdcdc 100%);
  border-bottom: 1px solid #555;
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 0 #ffffff;
  display: flex;
  align-items: stretch;
  z-index: 9999;
}
.mi {
  padding: 0 11px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
}
.mi:hover, .mi.active { background: var(--highlight); color: #fff; }
.mi-apple { font-size: 18px; }
#mb-clock {
  margin-left: auto;
  padding: 0 12px;
  font-size: 12px;
  font-weight: bold;
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* ── Dropdowns ──────────────────────────────────────────── */
.dropdown {
  display: none;
  position: fixed;
  top: var(--menubar-h);
  background: #ffffff;
  border: 1px solid #555;
  box-shadow: 2px 3px 6px rgba(0,0,0,0.35);
  z-index: 99999;
  min-width: 220px;
  padding: 2px 0;
}
.dropdown.open { display: block; }
.dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 18px 4px 14px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  gap: 24px;
}
.dd-item:hover { background: var(--highlight); color: #fff; }
.dd-item.off { color: #aaa; cursor: default; }
.dd-item.off:hover { background: transparent; color: #aaa; }
.dd-item kbd { font-family: var(--font-ui); font-size: 13px; color: #888; font-weight: normal; }
.dd-item:hover kbd { color: #dce7f2; }
.dd-sep { border-top: 1px solid #c4c4c4; border-bottom: 1px solid #fff; margin: 3px 0; }
.dd-header {
  padding: 5px 14px 4px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #666;
  background: linear-gradient(to bottom, #e8e8e8, #d4d4d4);
  border-top: 1px solid #fff;
  border-bottom: 1px solid #aaa;
  cursor: default;
  pointer-events: none;
  user-select: none;
}
.dd-header:hover { color: #666; }
.dropdown .dd-header:first-child { border-top: none; }
/* Indent items so links sit visually beneath their section header */
.dropdown .dd-item { padding-left: 26px; }

/* ── Desktop ────────────────────────────────────────────── */
#desktop {
  position: fixed;
  top: var(--menubar-h); left: 0; right: 0; bottom: 0;
  background-color: var(--desktop-bg);
  background-image: var(--desktop-pat);
  background-size: 4px 4px;
}
#desktop-rail {
  position: absolute;
  top: 8px; right: 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Icons ──────────────────────────────────────────────── */
.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: auto;
  min-width: 80px;
  padding: 6px;
  cursor: pointer;
}
.icon svg { width: 48px; height: 48px; margin-bottom: 5px; flex-shrink: 0; }
.icon-lbl {
  font-size: 13px;
  text-align: center;
  line-height: 1.3;
  padding: 1px 6px;
  white-space: nowrap;
  word-break: normal;
}

/* Bigger icons on the main desktop rail */
#desktop-rail { gap: 26px; }
#desktop-rail .icon { min-width: 104px; padding: 8px; }
#desktop-rail .icon svg { width: 84px; height: 84px; margin-bottom: 8px; }
#desktop-rail .icon-lbl { font-size: 15px; }
/* Desktop icons */
.d-icon .icon-lbl { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.7); }
.d-icon:hover .icon-lbl, .d-icon.sel .icon-lbl { background: var(--highlight); color: #fff; text-shadow: none; }
.d-icon.sel svg { filter: brightness(0.78) saturate(1.1); }
/* Window icons */
.w-icon .icon-lbl { color: #000; }
.w-icon:hover .icon-lbl, .w-icon.sel .icon-lbl { background: var(--highlight); color: #fff; }
.w-icon.sel svg { filter: brightness(0.85); }

/* ── Window Chrome ──────────────────────────────────────── */
.window {
  position: absolute;
  background: var(--win-bg);
  border: 1px solid var(--plat-frame);
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a8a8a8, 3px 4px 9px rgba(0,0,0,0.32);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  min-height: 80px;
}
.window.inactive .titlebar {
  background: var(--titlebar-inactive) !important;
  background-image: none !important;
}
.window.inactive .win-title { color: #888; }
.window.inactive .wc, .window.inactive .wz { visibility: hidden; }

.titlebar {
  height: 21px;
  flex-shrink: 0;
  background: var(--titlebar-stripe);
  border-bottom: 1px solid #888;
  box-shadow: inset 0 1px 0 #ffffff;
  display: flex;
  align-items: center;
  padding: 0 6px;
  cursor: move;
  position: relative;
  gap: 6px;
}
.wc, .wz {
  width: 13px; height: 13px;
  border: 1px solid #6a6a6a;
  border-radius: 2px;
  background: linear-gradient(to bottom, #fdfdfd, #c6c6c6);
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #9c9c9c;
  flex-shrink: 0;
  cursor: pointer;
  z-index: 2;
}
.wc:active, .wz:active {
  background: linear-gradient(to bottom, #a8a8a8, #cfcfcf);
  box-shadow: inset 1px 1px 0 #8a8a8a, inset -1px -1px 0 #ffffff;
}
.wz { margin-left: auto; position: relative; }
.wz.zoomed::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 7px; height: 7px;
  border: 1px solid #6a6a6a;
  background: #efefef;
}
.win-title {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  background: var(--titlebar-inactive);
  padding: 0 10px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  pointer-events: none;
  max-width: calc(100% - 100px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toolbar strip */
.toolbar {
  min-height: 38px;
  flex-shrink: 0;
  border-bottom: 1px solid #888;
  background: linear-gradient(to bottom, #ededed, #d4d4d4);
  box-shadow: inset 0 1px 0 #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  flex-wrap: wrap;
}
.tb-sep { width: 1px; height: 20px; background: #aaa; box-shadow: 1px 0 0 #fff; margin: 0 7px; flex-shrink: 0; }

/* Tab strip */
.tab-strip {
  display: flex;
  border-bottom: 1px solid #888;
  background: linear-gradient(to bottom, #e4e4e4, #cfcfcf);
  flex-shrink: 0;
  overflow-x: auto;
}
.tab {
  padding: 5px 20px;
  font-size: 13px;
  cursor: pointer;
  border-right: 1px solid #aaa;
  box-shadow: inset 1px 0 0 #fff;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.tab:hover { background: rgba(255,255,255,0.4); }
.tab.active {
  background: var(--win-content);
  font-weight: bold;
  border-bottom: 1px solid var(--win-content);
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}

/* Window body */
.win-body { flex: 1; overflow: auto; position: relative; }
/* Split body */
.win-body.split { display: flex; overflow: hidden; }
.split-col { flex: 1; overflow: auto; display: flex; flex-direction: column; }
.split-col + .split-col { border-left: 1px solid #888; }

/* Status bar */
.win-status {
  height: 24px;
  flex-shrink: 0;
  border-top: 1px solid #888;
  background: linear-gradient(to bottom, #ededed, #d8d8d8);
  box-shadow: inset 0 1px 0 #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 12px;
  color: #444;
  overflow: hidden;
}
.win-status-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-status-r { flex-shrink: 0; margin-left: 12px; color: #666; white-space: nowrap; }

/* Resize grip */
.win-resize {
  position: absolute;
  bottom: 0; right: 0;
  width: 15px; height: 15px;
  cursor: se-resize;
  z-index: 5;
  background:
    linear-gradient(to bottom, #ededed, #d4d4d4);
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  box-shadow:
    inset -2px -2px 0 #fff,
    inset -3px -3px 0 #9a9a9a,
    inset -5px -5px 0 #fff,
    inset -6px -6px 0 #9a9a9a;
}

/* ── Custom Scrollbars (Platinum) ────────────────────────── */
.win-body::-webkit-scrollbar,
.split-col::-webkit-scrollbar { width: 16px; height: 16px; }
.win-body::-webkit-scrollbar-track,
.split-col::-webkit-scrollbar-track {
  background: var(--scrolltrack);
  border-left: 1px solid #9a9a9a;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18);
}
.win-body::-webkit-scrollbar-thumb,
.split-col::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #eaeaea, #c2c2c2);
  border: 1px solid #7a7a7a;
  border-radius: 2px;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #9c9c9c;
}
.win-body::-webkit-scrollbar-thumb:hover,
.split-col::-webkit-scrollbar-thumb:hover { background: linear-gradient(to bottom, #f2f2f2, #cccccc); }
.win-body::-webkit-scrollbar-button,
.split-col::-webkit-scrollbar-button {
  background: linear-gradient(to bottom, #ededed, #cfcfcf);
  border: 1px solid #7a7a7a;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #9c9c9c;
  height: 16px; width: 16px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.mac-btn {
  font-family: var(--font-ui);
  font-size: 13px;
  background: linear-gradient(to bottom, #fcfcfc, #d4d4d4);
  border: 1px solid #6e6e6e;
  border-radius: 4px;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a0a0a0;
  padding: 3px 16px;
  cursor: pointer;
  min-width: 64px;
  line-height: 20px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #000;
}
.mac-btn:hover { background: linear-gradient(to bottom, #ffffff, #dcdcdc); }
.mac-btn:active {
  background: linear-gradient(to bottom, #a8a8a8, #cccccc);
  box-shadow: inset 1px 1px 0 #8a8a8a, inset -1px -1px 0 #ffffff;
}
.mac-btn:disabled {
  color: #aaa;
  cursor: default;
  background: #dcdcdc;
  box-shadow: none;
}
.mac-btn:disabled:hover { background: #dcdcdc; }
.mac-btn.default {
  border-color: #3a6ea5;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a0a0a0, 0 0 0 2px var(--highlight-lt), 0 0 0 3px var(--highlight);
}

/* Toggle buttons (case types, harmony selectors) */
.toggle-btn {
  font-family: var(--font-ui);
  font-size: 13px;
  background: linear-gradient(to bottom, #fcfcfc, #d8d8d8);
  border: 1px solid #6e6e6e;
  border-radius: 4px;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a0a0a0;
  padding: 7px 12px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #000;
}
.toggle-btn:hover { background: linear-gradient(to bottom, #ffffff, #e0e0e0); }
.toggle-btn.active {
  background: linear-gradient(to bottom, var(--highlight), var(--highlight-dk));
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.35), inset -1px -1px 0 rgba(0,0,0,0.3);
}
.toggle-btn .preview {
  font-size: 12px;
  opacity: 0.6;
  font-style: italic;
  font-family: var(--font-mono);
}
.toggle-btn.active .preview { opacity: 0.85; }

/* ── Form Controls ───────────────────────────────────────── */
.mac-input {
  font-family: var(--font-mono);
  font-size: 14px;
  border: 1px solid #7a7a7a;
  background: #fff;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18);
  padding: 5px 8px;
  outline: none;
  line-height: 22px;
  color: #000;
  user-select: text;
  cursor: text;
}
.mac-input:focus { border-color: var(--highlight); box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18), 0 0 0 2px var(--highlight-lt); }

.mac-select {
  font-family: var(--font-ui);
  font-size: 13px;
  border: 1px solid #6e6e6e;
  border-radius: 4px;
  background: linear-gradient(to bottom, #fcfcfc, #d8d8d8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0L5 6L10 0Z' fill='%23000'/%3E%3C/svg%3E") no-repeat right 8px center;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a0a0a0;
  padding: 5px 28px 5px 8px;
  outline: none;
  color: #000;
  cursor: pointer;
  appearance: none;
}
.mac-select:focus { border-color: var(--highlight); box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a0a0a0, 0 0 0 2px var(--highlight-lt); }

.mac-textarea {
  font-family: var(--font-mono);
  font-size: 14px;
  border: 1px solid #7a7a7a;
  background: #fff;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18);
  padding: 8px 10px;
  outline: none;
  resize: none;
  line-height: 1.6;
  color: #000;
  user-select: text;
  cursor: text;
  width: 100%;
}
.mac-textarea:focus { border-color: var(--highlight); box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18), 0 0 0 2px var(--highlight-lt); }

input[type="color"] {
  border: 1px solid #7a7a7a;
  width: 42px; height: 32px;
  padding: 1px 2px;
  cursor: pointer;
  background: #fff;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18);
  vertical-align: middle;
}
input[type="datetime-local"] {
  font-family: var(--font-mono);
  font-size: 14px;
  border: 1px solid #7a7a7a;
  background: #fff;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18);
  padding: 6px 10px;
  outline: none;
  color: #000;
  user-select: text;
  cursor: text;
  width: 100%;
}
input[type="datetime-local"]:focus { border-color: var(--highlight); box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18), 0 0 0 2px var(--highlight-lt); }
input[type="number"] {
  -moz-appearance: textfield;
  font-family: var(--font-mono);
  font-size: 18px;
  border: 1px solid #7a7a7a;
  background: #fff;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18);
  padding: 7px 10px;
  outline: none;
  color: #000;
  width: 100%;
  cursor: text;
  user-select: text;
}
input[type="number"]:focus { border-color: var(--highlight); box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18), 0 0 0 2px var(--highlight-lt); }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Panel Labels ─────────────────────────────────────────── */
.panel-lbl {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  background: linear-gradient(to bottom, #ededed, #dcdcdc);
  border-bottom: 1px solid #aaa;
  box-shadow: inset 0 1px 0 #ffffff;
  flex-shrink: 0;
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1px;
  background: #aaaaaa;
  border: 1px solid #999;
  margin: 12px;
}
.stat-card { background: #fff; padding: 12px 12px; text-align: center; }
.stat-val {
  font-size: 28px;
  font-weight: bold;
  font-family: var(--font-mono);
  line-height: 1.2;
  margin-bottom: 3px;
}
.stat-lbl { font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Info rows ───────────────────────────────────────────── */
.info-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 12px;
  font-size: 14px;
}
.info-item { display: flex; align-items: center; gap: 6px; }
.info-item strong { font-family: var(--font-mono); }

/* ── HR ─────────────────────────────────────────────────── */
.mac-hr { border: none; border-top: 1px solid #ccc; margin: 0; }

/* ── Pill ─────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border: 1px solid currentColor;
  font-size: 13px;
  font-family: var(--font-mono);
}
.pill-blue  { color: #0000bb; border-color: #0000bb; background: #e8e8ff; }
.pill-green { color: #006600; border-color: #006600; background: #e8f5e8; }

/* ── Toast ───────────────────────────────────────────────── */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: #000;
  color: #fff;
  padding: 7px 22px;
  font-size: 14px;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 #000;
  z-index: 999999;
  transition: transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}
.copy-toast.show { transform: translateX(-50%) translateY(0); }

/* ── Progress Bar ─────────────────────────────────────────── */
.mac-progress { border: 1px solid #7a7a7a; height: 16px; background: #fff; box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18); border-radius: 3px; overflow: hidden; }
.mac-progress-fill {
  height: 100%;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.35) 0px, rgba(255,255,255,0.35) 6px, transparent 6px, transparent 12px),
    linear-gradient(to bottom, #6f9fcf, var(--highlight));
  transition: width 0.1s linear;
}

/* ── Dialog ──────────────────────────────────────────────── */
#dialog-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 100000;
  align-items: center;
  justify-content: center;
}
#dialog-overlay.open { display: flex; }
.dialog-box { background: var(--win-bg); border: 1px solid var(--plat-frame); box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a8a8a8, 4px 5px 14px rgba(0,0,0,0.4); padding: 16px 20px; width: 340px; max-width: 95vw; }
.dialog-row { display: flex; gap: 14px; margin-bottom: 10px; }
.dialog-icon { font-size: 34px; flex-shrink: 0; }
.dialog-text { font-size: 12px; line-height: 1.6; }
.dialog-text strong { display: block; font-size: 13px; margin-bottom: 4px; }
.dialog-btns { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid #ccc; padding-top: 10px; margin-top: 6px; }

/* ── Ad Slots ─────────────────────────────────────────────── */
.ad-slot { border: 1px dashed #bbb; background: #fafafa; color: #ccc; font-size: 10px; text-align: center; flex-shrink: 0; }
.ad-slot::before { content: "Advertisement"; }
.ad-slot-banner { height: 36px; width: 100%; line-height: 36px; }
.ad-slot-rect   { height: 60px; width: 100%; line-height: 60px; }

/* =============================================================
   TOOL-SPECIFIC STYLES
============================================================= */

/* ── JSON Formatter ─────────────────────────────────────── */
.code-area {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  background: #1c1c1e;
  color: #e5e5ea;
  border: none;
  padding: 12px 14px;
  resize: none;
  width: 100%;
  height: 100%;
  flex: 1;
  outline: none;
  user-select: text;
  cursor: text;
}
.output-area {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  background: #1c1c1e;
  color: #e5e5ea;
  padding: 12px 14px;
  overflow: auto;
  white-space: pre;
  flex: 1;
  cursor: pointer;
}
.json-key  { color: #ff6eb4; }
.json-str  { color: #98fb98; }
.json-num  { color: #87ceeb; }
.json-bool { color: #ffd700; }
.json-null { color: #ffa07a; }

#statusBar { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-valid   { color: #248a3d; }
.status-invalid { color: #cc2015; }
.status-empty   { color: #888; }

/* ── Color Palette ───────────────────────────────────────── */
.palette-strip { display: flex; height: 80px; border: 1px solid #888; }
.palette-swatch {
  flex: 1; cursor: pointer; transition: flex 0.15s;
  display: flex; align-items: flex-end; padding: 6px;
}
.palette-swatch:hover { flex: 1.5; }
.swatch-hex {
  font-family: var(--font-mono); font-size: 12px;
  background: rgba(0,0,0,0.5); color: #fff;
  padding: 3px 6px; opacity: 0; transition: opacity 0.15s;
}
.palette-swatch:hover .swatch-hex { opacity: 1; }

.color-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.color-card { border: 1px solid #888; cursor: pointer; width: 120px; }
.color-card-swatch { height: 70px; }
.color-card-info { padding: 6px 8px; background: #f8f8f8; border-top: 1px solid #999; }
.color-card-hex { font-family: var(--font-mono); font-size: 13px; font-weight: bold; }
.color-card-name { font-size: 12px; color: #666; }

.export-area {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
  background: #1c1c1e; color: #e5e5ea; border: none;
  padding: 10px 12px; resize: none; width: 100%; outline: none;
  user-select: text; cursor: text;
}

/* ── World Clocks ─────────────────────────────────────────── */
.world-clock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px; background: #aaaaaa; border: 1px solid #999;
}
.world-clock-card { background: #fff; padding: 10px 12px; text-align: center; }
.world-clock-city { font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
.world-clock-time { font-size: 20px; font-family: var(--font-mono); font-weight: bold; }
.world-clock-date { font-size: 12px; color: #999; }

/* ── Converter layouts ───────────────────────────────────── */
.conv-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: end; }
.conv-label { font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.06em; color: #666; margin-bottom: 7px; }
.swap-btn {
  width: 42px; height: 42px; border: 1px solid #888; background: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px; flex-shrink: 0;
}
.swap-btn:hover { background: var(--highlight); border-color: var(--highlight-dk); }
.swap-btn:hover svg { stroke: #fff; }
.swap-btn svg { stroke: #000; width: 18px; height: 18px; fill: none; stroke-width: 2.5; }

/* ── Result Display ──────────────────────────────────────── */
.result-display { border: 1px solid #888; background: #f8f8f8; padding: 14px 16px; text-align: center; }
.result-val { font-size: 36px; font-weight: bold; font-family: var(--font-mono); letter-spacing: -1px; }
.result-unit { font-size: 14px; color: #666; margin-top: 4px; }

.tz-time { font-size: 34px; font-weight: bold; font-family: var(--font-mono); letter-spacing: -1px; line-height: 1.1; }
.tz-date { font-size: 14px; color: #666; margin-top: 4px; }

/* ── Quick Ref ───────────────────────────────────────────── */
.quick-ref {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px; background: #aaaaaa; border: 1px solid #999;
}
.ref-item { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; font-size: 14px; background: #fff; }
.ref-from { color: #666; font-family: var(--font-mono); }
.ref-to   { font-weight: bold; font-family: var(--font-mono); }

/* ── Case + Harmony grids ────────────────────────────────── */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; padding: 12px; }
.harmony-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Output box (case converter) ─────────────────────────── */
.output-box {
  border: 1px solid #888; background: #f8f8f8;
  padding: 12px; min-height: 100px;
  font-size: 15px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  cursor: pointer; user-select: text;
}
.output-box:hover { background: #f0f0f0; }

/* ── Icon grid (Finder view) ──────────────────────────────── */
.icon-grid { display: flex; flex-wrap: wrap; gap: 22px; padding: 18px; }

/* ── Welcome hint (centered card on empty desktop) ───────── */
#welcome-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--win-bg);
  border: 1px solid var(--plat-frame);
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a8a8a8, 3px 4px 12px rgba(0,0,0,0.35);
  padding: 20px 26px;
  max-width: 380px;
  width: calc(100% - 32px);
  text-align: center;
  z-index: 50;
  pointer-events: auto;
}
#welcome-hint h2 { font-size: 18px; margin-bottom: 10px; }
#welcome-hint p  { font-size: 14px; line-height: 1.55; margin-bottom: 10px; color: #333; }
#welcome-hint .hint-arrow { font-size: 26px; margin-bottom: 4px; animation: bob 1.2s ease-in-out infinite; }
#welcome-hint .hint-close {
  margin-top: 6px;
  font-size: 12px;
  color: #777;
  cursor: pointer;
  text-decoration: underline;
}
@keyframes bob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}

/* ── Shutdown / Restart screen ───────────────────────────── */
#offscreen {
  position: fixed;
  inset: 0;
  background: #000;
  color: #fff;
  font-family: Monaco, monospace;
  font-size: 14px;
  letter-spacing: 1px;
  z-index: 1000000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
#offscreen.show { display: flex; }
#offscreen .restart-btn {
  margin-top: 22px;
  background: #fff;
  color: #000;
  border: 1.5px solid #fff;
  padding: 8px 22px;
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0;
}
#offscreen .restart-btn:hover { background: #ddd; }

/* ── Responsive — Tablet ──────────────────────────────────── */
@media (max-width: 900px) {
  .window {
    /* keep windows on-screen when sized for desktop initial coords */
    max-width: calc(100vw - 16px);
  }
}

/* ── Responsive — Phone ───────────────────────────────────── */
@media (max-width: 680px) {
  html, body { overflow: hidden; }
  .win-body.split { flex-direction: column; overflow: auto; }
  .split-col + .split-col { border-left: none; border-top: 1px solid #888; }
  .conv-row { grid-template-columns: 1fr; }
  .case-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  #desktop-rail { display: none; }

  /* Menubar: scrollable so all category tabs fit */
  #menubar {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
  }
  #menubar::-webkit-scrollbar { display: none; }
  .mi { padding: 0 8px; font-size: 13px; flex-shrink: 0; }
  #mb-clock { padding: 0 8px; font-size: 12px; flex-shrink: 0; }

  /* Dropdown: full-width sheet on phone, scrollable */
  .dropdown {
    left: 0 !important;
    right: 0;
    width: 100vw;
    min-width: 0;
    max-height: calc(100vh - var(--menubar-h) - 8px);
    overflow-y: auto;
    box-shadow: 0 2px 0 #000;
  }
  .dd-item { padding: 10px 16px; font-size: 15px; }

  /* Windows: full-screen sheets on phone, override inline coords */
  .window {
    top: var(--menubar-h) !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - var(--menubar-h)) !important;
    max-width: 100vw;
    border-width: 0;
    box-shadow: none;
  }
  .win-resize { display: none; }
  .wz { display: none; }
  .win-title { font-size: 13px; max-width: calc(100% - 60px); }

  /* About: fit on screen */
  #win-about {
    height: auto !important;
    max-height: calc(100vh - var(--menubar-h));
    overflow: auto;
  }

  /* Icon grid: tighter spacing inside folder windows */
  .icon-grid { gap: 14px; padding: 14px; }
  .icon { min-width: 72px; padding: 4px; }
  .icon svg { width: 42px; height: 42px; }
  .icon-lbl { font-size: 12px; }

  #welcome-hint { max-width: 92vw; padding: 18px 18px; }
  #welcome-hint h2 { font-size: 16px; }
  #welcome-hint p { font-size: 13px; }
}
