:root {
  --bg: #f4f7f7;
  --surface: #ffffff;
  --surface-soft: #fbfcfc;
  --border: #e4ebea;
  --ink: #16302c;
  --muted: #6a807c;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: #ecfbf8;
  --accent-ring: #14b8a6;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.app-header {
  height: 58px; flex: none;
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: baseline; gap: 9px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  align-self: center; box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.header-spacer { flex: 1; }

.capacity-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--accent-soft); border: 1px solid #cdeee8;
  border-radius: 999px; padding: 7px 16px; font-size: 13px; color: var(--ink);
}
.capacity-chip b { color: var(--accent-strong); font-weight: 700; }
.capacity-chip .divider { width: 1px; height: 14px; background: #bfe6df; }

/* ---------- Segmented view switch ---------- */
.segmented {
  display: inline-flex; gap: 2px;
  background: #eef2f2; border: 1px solid var(--border);
  border-radius: 11px; padding: 3px;
}
.seg-btn {
  border: none; background: transparent; color: var(--muted);
  padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all .12s;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active {
  background: var(--surface); color: var(--accent-strong); font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 48, 44, 0.12);
}

/* ---------- Body ---------- */
.body { flex: 1; display: grid; grid-template-columns: 264px 1fr; min-height: 0; }

.sidebar {
  background: var(--surface-soft);
  border-right: 1px solid var(--border);
  padding: 18px; overflow-y: auto;
}
.sidebar h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin: 0 0 14px; font-weight: 700;
}
.sidebar .hint { font-size: 12px; color: var(--muted); margin: 16px 2px 0; line-height: 1.5; }

.cat-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink);
  border-radius: 12px; padding: 12px; margin-bottom: 10px; cursor: pointer;
  font-size: 14px; transition: all .12s;
}
.cat-item:hover { border-color: #bfe3df; box-shadow: 0 2px 10px rgba(13, 148, 136, 0.10); }
.cat-item.armed { border-color: var(--accent-ring); background: var(--accent-soft); }
.cat-swatch {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ---------- Viewer ---------- */
.viewer { position: relative; background: var(--bg); }
.viewer canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.actions { position: absolute; bottom: 16px; right: 16px; z-index: 10; }
.actions button {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  border-radius: 10px; padding: 9px 15px; cursor: pointer; font-size: 13px; font-weight: 500;
  box-shadow: 0 2px 8px rgba(15, 48, 44, 0.06); transition: all .12s;
}
.actions button:hover { border-color: var(--accent-ring); color: var(--accent-strong); }

.walk-hint {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 10; font-size: 12px; color: var(--muted);
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: 9px; padding: 8px 15px;
}
