/* ── Woltspace Design Tokens ─────────────────────────────── */

:root {
  --bg:         #EDE8DE;
  --surface:    #F5F1E8;
  --surface-2:  #FAF7F0;
  --border:     #D6CCBA;
  --border-2:   #C4B89E;
  --ink:        #18100A;
  --ink-2:      #5C4D3C;
  --ink-3:      #9A8878;
  --terra:      #C4531E;
  --terra-light:#F0D5C8;
  --amber:      #C98B2A;
  --amber-light:#F2E4C0;
  --green:      #3A6644;
  --green-light:#C8DECE;
  --cream:      #FAF7F0;

  --font-display: 'Preahvihear', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */

.sidebar {
  width: 272px;
  flex-shrink: 0;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease;
}
.sidebar.hidden {
  transform: translateX(-100%);
  width: 0;
  opacity: 0;
  pointer-events: none;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: none;
}
.sidebar-scroll::-webkit-scrollbar { display: none; }
.sidebar-bottom {
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 4px 0 8px;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.82);
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-emoji { font-size: 28px; line-height: 1; }

/* ── Sidebar nav ── */
.sidebar-nav { padding: 8px 12px 4px; }
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 8px;
  border-radius: 6px;
  margin-bottom: 2px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.sidebar-nav-item:hover { background: rgba(255,255,255,0.06); }
.sidebar-nav-item.active { background: rgba(255,255,255,0.08); }
.sidebar-nav-icon {
  width: 34px; height: 34px;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
}
.sidebar-nav-item:hover .sidebar-nav-icon,
.sidebar-nav-item.active .sidebar-nav-icon { color: rgba(255,255,255,0.75); }
.sidebar-nav-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
}
.sidebar-nav-item:hover .sidebar-nav-label,
.sidebar-nav-item.active .sidebar-nav-label { color: rgba(255,255,255,0.92); }

/* ── Nav badge ── */
.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  background: #5BC87A;
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  line-height: 1.6;
  display: none;
}
.nav-badge.visible { display: inline-block; }

/* ── Sidebar team section ── */
.sidebar-section { padding: 20px 24px 12px; }
.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-create-wolt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  background: var(--green);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  padding: 5px 9px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.sidebar-create-wolt span {
  font-size: 15px;
  line-height: 0.8;
  font-weight: 500;
}
.sidebar-create-wolt:hover {
  background: #477a52;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.24);
}
.sidebar-create-wolt:focus-visible {
  outline: 2px solid var(--green-light);
  outline-offset: 2px;
}

/* ── Wolt cards (sidebar) ── */
.wolt-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
  position: relative;
}
.wolt-card:hover { background: rgba(255,255,255,0.06); }
.wolt-card.active { background: rgba(255,255,255,0.08); }
.wolt-card.offline { opacity:.5; }
.wolt-card.offline .wolt-avatar { filter:grayscale(1); }
.wolt-card.offline:hover, .wolt-card.offline.active, .wolt-card.offline:focus-visible { opacity:.9; }
.sidebar-all-wolts { display:block; margin:6px 10px 2px; padding:8px 10px; border-radius:8px; color:rgba(255,255,255,.6); font-size:13px; text-decoration:none; }
.sidebar-all-wolts:hover { background:rgba(255,255,255,.08); color:#fff; }
.sidebar-wolts-quiet { padding:8px 20px; color:rgba(255,255,255,.4); font-size:13px; font-style:italic; }
.wolt-quick-session { margin-left:auto; width:24px; height:24px; flex:none; border-radius:7px; border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.06); color:#fff; cursor:pointer; opacity:0; }
.wolt-card:hover .wolt-quick-session,.wolt-quick-session:focus-visible { opacity:1; }
.wolt-quick-session:hover { background:var(--green); border-color:var(--green); }
@media (hover:none) { .wolt-quick-session { opacity:1; } }
.wolt-avatar {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.wolt-status-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: rgba(255,255,255,0.25);
}
.wolt-status-dot.running {
  background: #5BC87A;
  box-shadow: 0 0 6px rgba(91,200,122,0.5);
}
.wolt-info { min-width: 0; flex: 1; }
.wolt-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wolt-type {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.35);
}
/* Engine chip — hidden at rest, revealed on card hover; a pinned override
   stays visible because a deliberate divergence is worth surfacing. */
.wolt-engine-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  padding: 3px 6px;
  border: none;
  background: transparent;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  opacity: 0.5;                 /* always visible, quiet */
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.wolt-engine-btn .eng-model { font-size: 8px; color: rgba(255,255,255,0.4); }
.wolt-engine-btn.pinned { opacity: 0.8; }  /* deliberate override — a touch bolder */
.wolt-engine-btn:hover { opacity: 1; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.9); }
.wolt-engine-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; opacity: 1; }

/* ── Engine picker popover ── */
.engine-pop {
  position: fixed;
  z-index: 1000;
  min-width: 200px;
  background: #211d17;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.engine-pop-head {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 8px 10px 6px;
}
.engine-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  text-align: left;
}
.engine-opt:hover { background: rgba(255,255,255,0.07); }
.engine-radio { width: 12px; flex-shrink: 0; color: rgba(255,255,255,0.3); }
.engine-opt.sel .engine-radio { color: var(--amber); }
.engine-opt-label { white-space: nowrap; }
.engine-opt-sub {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.35);
}
.engine-pop-note {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255,255,255,0.38);
  padding: 7px 10px 5px;
  margin-top: 3px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* ── Creatures toggle ── */
.creatures-toggle, .connectors-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  cursor: pointer;
  user-select: none;
}
.creatures-toggle-label, .connectors-toggle-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.creatures-chevron, .connectors-chevron {
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  transition: transform 0.2s;
}
.creatures-chevron.open, .connectors-chevron.open { transform: rotate(180deg); }
.creatures-list, .connectors-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.creatures-list.open, .connectors-list.open { max-height: 300px; }
.creatures-list-inner, .connectors-list-inner { padding: 2px 12px 8px; }
.creature-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.creature-row.clickable { cursor: pointer; }
.creature-row.clickable:hover { background: rgba(255,255,255,0.06); }
.creature-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}
.creature-desc {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  margin-left: auto;
}

/* ── Sidebar footer ── */
.sidebar-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 10px 20px;
}
.sidebar-footer { display:flex; justify-content:center; gap:18px; }
.sidebar-footer a {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  text-decoration: none;
  transition: color 0.15s;
}
.sidebar-footer a:hover { color: rgba(255,255,255,0.5); }

/* ── MAIN ─────────────────────────────────────────────────── */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 36px 40px 24px;
  gap: 24px;
  flex-wrap: wrap;
}
.main-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.main-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Buttons ── */
.btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: #2a2018; }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); }

/* ── Filter strip ── */
.filter-strip {
  display: flex;
  gap: 6px;
  padding: 0 40px 20px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover { border-color: var(--border-2); color: var(--ink-2); }
.filter-chip.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.filter-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

/* ── App grid ── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 0 40px 40px;
}
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.app-card:hover {
  border-color: var(--border-2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.app-source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-decoration: none;
  padding: 2px 0;
  transition: color 0.15s;
}
.app-source-link:hover { color: var(--ink-2); }
.app-card-body { padding: 20px; }
.app-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.app-emoji {
  font-size: 28px;
  line-height: 1;
}
.app-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
}
.app-status.running { background: var(--green-light); color: var(--green); }
.app-status.stopped { background: var(--surface-2); color: var(--ink-3); }
.app-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.app-status.running .app-status-dot {
  background: var(--green);
  box-shadow: 0 0 4px rgba(58,102,68,0.4);
}
.app-name-link {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 300;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
}
.app-name-link:hover { color: var(--terra); }
.app-stack {
  display: flex;
  gap: 6px;
  margin: 8px 0 10px;
  flex-wrap: wrap;
}
.stack-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-3);
  border: 1px solid var(--border);
}
.app-desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 16px;
}
.app-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.app-wolt {
  display: flex;
  align-items: center;
  gap: 8px;
}
.keeper-btn {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  margin: -4px -8px;
  transition: background 0.15s;
}
.keeper-btn:hover {
  background: var(--green-light);
}
.app-wolt-avatar {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: var(--surface-2);
}
.app-wolt-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
}
.app-wolt-assign {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
}
.app-actions { display: flex; gap: 4px; }
.action-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.action-btn:hover { border-color: var(--border-2); color: var(--ink); }
.action-btn.stop { color: var(--terra); }
.action-btn.start { color: var(--green); }
.action-btn.shared { color: var(--green); }
.action-btn.share { color: var(--ink-3); }

/* ── New app card ── */
.app-card-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink-3);
  transition: all 0.15s;
  cursor: pointer;
  gap: 8px;
}
.app-card-new:hover {
  border-color: var(--border-2);
  background: var(--surface);
  color: var(--ink-2);
}
.new-icon { font-size: 28px; font-weight: 300; opacity: 0.5; }
.new-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}
.new-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.6;
}

/* ── Sessions view ── */
.sessions-filter-tabs {
  display: flex;
  gap: 6px;
  padding: 0 40px 16px;
  flex-wrap: wrap;
}
.sessions-toolbar {
  display: flex;
  gap: 10px;
  padding: 0 40px 24px;
  align-items: center;
}
.sessions-search-wrap {
  flex: 1;
  position: relative;
}
.sessions-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.sessions-search {
  width: 100%;
  height: 36px;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 0 12px 0 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.sessions-search::placeholder { color: var(--ink-3); }
.sessions-search:focus { border-color: var(--border-2); }
.sessions-sort {
  height: 36px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 0 26px 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.sessions-list { padding: 0 40px 40px; }
.sessions-group { margin-bottom: 28px; }
.sessions-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  margin-bottom: 4px;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  transition: background 0.12s;
}
.sessions-group-header:hover { background: var(--surface); }
.sessions-group-avatar {
  font-size: 16px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-shrink: 0;
}
.sessions-group-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.sessions-group-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sessions-group-chevron {
  margin-left: auto;
  margin-right: 6px;
  color: var(--ink-3);
  display: flex; align-items: center;
  transition: transform 0.2s;
  flex-shrink: 0;
  font-size: 11px;
}
.sessions-group-chevron.collapsed { transform: rotate(-90deg); }
.sessions-group-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.25s ease;
  overflow: hidden;
}
.sessions-group-body.collapsed { grid-template-rows: 0fr; }
.sessions-group-body > .sessions-group-inner { min-height: 0; }
.sessions-group-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* session row */
.session-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(120, 110, 90, 0.14);
  background: rgba(242, 236, 222, 0.88);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.session-row.offline { opacity: .62; }
.session-row:not(a) { cursor: default; }
.session-row:hover {
  background: rgba(248, 243, 230, 0.95);
  border-color: rgba(120, 110, 90, 0.26);
  box-shadow: 0 2px 10px rgba(50, 45, 30, 0.08);
}
.session-dot {
  width: 3px;
  height: auto;
  min-height: 22px;
  align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
  margin: 0;
}
.session-dot.running {
  background: var(--green);
  box-shadow: 0 0 8px rgba(58, 102, 68, 0.45);
  animation: session-pulse 2.8s ease-in-out infinite;
}
.session-dot.stopped {
  background: rgba(150, 138, 115, 0.55);
}
@keyframes session-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(58, 102, 68, 0.45); }
  50%      { opacity: 0.6; box-shadow: 0 0 3px rgba(58, 102, 68, 0.2); }
}
.session-body { flex: 1; min-width: 0; }
.session-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-title.untitled { font-style: italic; color: var(--ink-3); }
.session-sub {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-date {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 11.5px;
  color: rgba(80, 70, 50, 0.55);
  letter-spacing: 0;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 0;
}
.session-control {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.session-control-button, .session-confirm {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  background: transparent;
}
.session-control-button.stop {
  color: var(--terra);
  background: rgba(196, 83, 30, 0.12);
  border-color: rgba(196, 83, 30, 0.32);
}
.session-control-button.stop:hover {
  background: rgba(196, 83, 30, 0.22);
  border-color: rgba(196, 83, 30, 0.5);
}
.session-control-button.resume {
  color: var(--green);
  background: rgba(58, 102, 68, 0.1);
  border-color: rgba(58, 102, 68, 0.25);
}
.session-control-button.resume:hover {
  background: rgba(58, 102, 68, 0.2);
  border-color: rgba(58, 102, 68, 0.45);
}
.session-control-button.pending { cursor: wait; color: var(--ink-3); }
.session-confirm-label, .session-control-error { font-size: 11px; white-space: nowrap; color: var(--ink-3); }
.session-control-error { color: var(--terra); }
.session-confirm { width: auto; padding: 0 7px; font-size: 11px; }
.session-confirm.yes { color: var(--terra); border-color: rgba(196, 83, 30, .35); }
.session-confirm.no { color: var(--ink-3); border-color: var(--border); }
.session-row.compact { padding: 8px; gap: 10px; border: 0; background: transparent; backdrop-filter: none; }
.session-row.compact:hover { background: rgba(24,16,10,.05); box-shadow: none; }
.session-row.compact .session-sub { font-size: 12px; }
.wolts-sessions { border-top: 1px solid rgba(24,16,10,.08); padding: 6px 8px 8px; }
.wolts-sessions .session-row + .session-row { margin-top: 2px; }
@media (max-width: 620px) {
  .session-control-button, .session-confirm { min-width: 44px; height: 44px; }
}
@media (max-width: 900px) {
  .session-row { padding: 9px 10px; gap: 10px; }
  .session-title { font-size: 12px; }
  .session-date { font-size: 10.5px; }
  .session-control-button { font-size: 14px; border-radius: 8px; }
}
.sessions-toggle-running {
  height: 36px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.sessions-toggle-running:hover { border-color: var(--border-2); color: var(--ink-2); }
.sessions-toggle-running.active { border-color: var(--green); color: var(--green); }

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  color: var(--ink-3);
  text-align: center;
}
.empty-state-icon { font-size: 40px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-text {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ── Views ── */
.view { display: none; flex: 1; flex-direction: column; }
.view.active { display: flex; }

/* ── Modal ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface-2);
  border-radius: 14px;
  width: 460px;
  max-width: 90vw;
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
  overflow: hidden;
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 300;
}
.modal-close {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--surface); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-field { margin-bottom: 16px; }
.modal-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}
.modal-label-hint {
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}
.modal-input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.modal-input:focus { border-color: var(--border-2); }
.create-name-field .modal-input {
  font-family: var(--font-display);
  font-size: 17px;
  padding: 12px 14px;
}
.create-name-field .modal-input.invalid { border-color: var(--terra); }
.create-name-warning {
  margin: 6px 2px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--terra);
}
.create-name-warning[hidden] { display: none; }

/* ── Type picker (create wolt) ── */
.type-grid {
  display: grid;
  /* minmax(0, …): a card's model dropdown must not widen its column */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.type-card {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
  min-width: 0;
}
.type-card:hover { border-color: var(--border-2); }
.type-card.selected {
  border-color: var(--green);
  background: var(--green-light);
  box-shadow: 0 0 0 1.5px var(--green);
}
.type-card-emoji { font-size: 28px; margin-bottom: 8px; }
.type-card-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.type-card-hint {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 3px;
}
.type-card-model {
  min-height: 14px;
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.35;
  color: var(--ink-3);
}
.type-card-model[hidden], .type-card-select[hidden] { display: none; }
/* The model, as a quiet dropdown on the card. */
.type-card-select {
  display: block;
  width: auto;
  max-width: 100%;
  margin: 6px auto 0;
  padding: 3px 17px 3px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  text-align: center;
  text-align-last: center;
  text-overflow: ellipsis;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4'%3E%3Cpath d='M0 0l3.5 4L7 0z' fill='%238a8177'/%3E%3C/svg%3E") no-repeat right 5px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.type-card-select:hover,
.type-card-select:focus-visible {
  border-color: var(--border-2);
  color: var(--ink);
  outline: none;
}
.type-card.selected .type-card-select { color: var(--ink-2); }
/* Phone: one working style per row, so the model name has room. */
@media (max-width: 620px) {
  .type-grid { grid-template-columns: 1fr; }
  .type-card {
    display: grid;
    grid-template-columns: 34px minmax(64px, 1fr) minmax(0, auto);
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    padding: 10px 12px;
    text-align: left;
  }
  .type-card-emoji { grid-row: 1 / span 2; margin: 0; font-size: 26px; text-align: center; }
  .type-card-name { grid-column: 2; grid-row: 1; }
  .type-card-hint { grid-column: 2; grid-row: 2; margin-top: 0; }
  .type-card-model { grid-column: 3; grid-row: 1 / span 2; margin: 0; text-align: right; font-size: 12px; }
  .type-card-select {
    grid-column: 3;
    grid-row: 1 / span 2;
    justify-self: end;
    margin: 0;
    min-height: 44px;
    padding: 8px 16px 8px 6px;
    font-size: 16px;
    letter-spacing: 0;
    text-align: right;
    text-align-last: right;
  }
}
.modal-error {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--terra);
  margin-top: 8px;
  display: none;
}

/* ── Onboard banner ── */
.onboard-banner {
  margin: 0 40px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--amber-light);
  border: 1px solid var(--amber);
  border-radius: 8px;
  padding: 10px 16px;
  gap: 16px;
}
.onboard-banner-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}
.onboard-banner-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: var(--amber);
  color: white;
  cursor: pointer;
  white-space: nowrap;
}
.onboard-banner-btn:hover { opacity: 0.9; }

/* ── Hamburger (mobile) ── */
.hamburger {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 10;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--ink);
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .hamburger { display: flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main { width: 100%; }
  .main-header { padding: 60px 20px 20px; }
  .filter-strip, .sessions-toolbar { padding-left: 20px; padding-right: 20px; }
  .app-grid { padding: 0 20px 20px; }
  .sessions-list { padding: 0 20px 20px; }
  .onboard-banner { margin: 0 20px 16px; }
}

/* ── Loading skeleton ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

/* ── Z-index layers ── */
.sidebar { z-index: 2; }
.main { z-index: 1; position: relative; }
