/* iStyle · Glass — web app shell.
 * Window dimensions + the controls the iStyle component sheet doesn't cover.
 * Sized to match the Tk `sov ui` app: 1340×820, 300 / flex / 380 columns,
 * 38px titlebar.  Requires tokens.css + components.css first.
 */

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  font-family: var(--font-sans);
}
/* Main app fills the whole viewport (no floating window-in-a-window). */
.page {
  height: 100vh; width: 100vw;
  overflow: hidden;
}
.is-win {
  width: 100%; height: 100vh;
  max-width: none;
  display: flex; flex-direction: column;
  border-radius: 0;          /* override the iStyle window card chrome */
  box-shadow: none;
}

/* ── Titlebar centred title (block, not absolute, so the icon sits inline) */
.is-titlebar__title {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center;
  white-space: nowrap;
}

/* ── Body grid ─────────────────────────────────────────────────────────── */
.body {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 300px 1fr 380px;
  position: relative; z-index: 1;
}
.body.compact { grid-template-columns: 300px 1fr; }
.body.compact .rail--right { display: none; }

.rail { padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.rail--left  { }
.rail--right { gap: 14px; }
.centre {
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 18px;
  border-left: 1px solid var(--line-2);
  border-right: 1px solid var(--line-2);
  overflow: auto; min-width: 0;
}
.rail-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }

/* ── Drop zone (extends .is-drop) ──────────────────────────────────────── */
.dropzone { cursor: pointer; min-height: 64px; }
.zone-optional {
  font-size: 9.5px; color: var(--muted);
  border: 1px solid var(--line); padding: 1px 4px;
  border-radius: 3px; margin-left: auto;
}
.is-drop__body { font-size: 11px; }
.zone-hint { color: var(--muted); font-style: italic; font-size: 11px; }
.zone-file { display: flex; align-items: center; gap: 6px; }
.zone-file__name {
  font-family: var(--font-mono); font-size: 10.5px; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zone-file__size { font-size: 10px; color: var(--muted); }
.zone-file__x {
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ok); color: #fff; cursor: pointer; flex-shrink: 0;
}
.is-drop__release {
  color: var(--drop-hot); font-weight: 600; font-size: 11.5px;
  display: flex; align-items: center; gap: 4px;
}
.zone-err { color: var(--err); font-weight: 600; font-size: 11px; }

/* ── Recent ────────────────────────────────────────────────────────────── */
.recent {
  margin-top: 8px; padding: 10px 12px;
  background: rgba(255,255,255,0.30);
  border: 1px solid var(--line-2); border-radius: 10px;
  backdrop-filter: var(--blur);
}
.recent-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600; margin-bottom: 6px;
}
.recent-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; cursor: pointer;
}
.recent-row.sel .recent-name { color: var(--accent); }
.recent-name {
  font-family: var(--font-mono); flex: 1; font-size: 11px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent-when { color: var(--muted); font-size: 10.5px; }
.recent-empty { color: var(--muted); font-style: italic; font-size: 11px; }

/* ── Cycle subtitle ────────────────────────────────────────────────────── */
.cycle-sub { color: var(--ink-2); font-size: 13px; margin-top: 4px; }

/* ── Settings grid + controls ──────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.select-ctrl { padding-right: 4px; }
.select-ctrl select {
  all: unset; flex: 1; min-width: 0;
  font: 400 13px/1 var(--font-sans); color: var(--ink); cursor: pointer;
}
.check-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.check-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.check-row.disabled { opacity: 0.5; cursor: not-allowed; }
.check-row.disabled input { cursor: not-allowed; }

/* ── Action card ───────────────────────────────────────────────────────── */
/* Taller bar; the two action buttons grow to fill the track (no dead centre
   gap) and the status block is pinned to the right. */
.action-card { padding: 22px 22px; display: flex; align-items: center; gap: 14px; }
.action-card .is-btn {
  flex: 1; height: 46px; font-size: 14px; font-weight: 600;
  padding: 0 18px; justify-content: center;
}
.action-card .is-btn svg { width: 15px; height: 15px; }
.eta-holder { margin-left: 4px; text-align: right; white-space: nowrap; }
.eta-caption { font-size: 11px; color: var(--muted); }
.eta-value { font-weight: 600; font-size: 14px; color: var(--ink); }

/* ── Result card ───────────────────────────────────────────────────────── */
.result-card { padding: 16px 18px; }
.result-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600; color: var(--muted); margin-bottom: 8px;
}
.result-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.result-status-text { flex: 1; }
.result-name {
  font-size: 13px; color: var(--ink); margin-bottom: 12px;
  word-break: break-word;
}
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.reveal-btn { margin-top: 12px; width: 100%; height: 30px; justify-content: center; }

/* ── Spinner ───────────────────────────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Log card ──────────────────────────────────────────────────────────── */
.log-card { flex: 1; padding: 0; display: flex; flex-direction: column; min-height: 0; }
.log-head {
  padding: 12px 14px 8px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line-2);
}
.log-count { font-size: 10px; color: var(--muted); }
.log-copy { height: 22px; padding: 0 8px; font-size: 11px; }
.log-body { flex: 1; overflow: auto; padding: 6px; }
.log-body .is-log__t { white-space: nowrap; }

/* ── YAML picker modal ─────────────────────────────────────────────────── */
.modal-ov {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20,24,30,0.30);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal {
  width: 420px; max-width: 90vw; max-height: 70vh;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-xl); box-shadow: var(--sh-window);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-title { padding: 16px 18px 8px; font-weight: 600; font-size: 14px; }
.modal-list { overflow: auto; padding: 4px 10px; display: flex; flex-direction: column; gap: 4px; }
.modal-item {
  all: unset; cursor: pointer; padding: 9px 12px; border-radius: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink);
}
.modal-item:hover { background: var(--line-2); }
.modal-foot { padding: 10px 18px 16px; display: flex; justify-content: flex-end; gap: 8px; }

/* ── Titlebar ──────────────────────────────────────────────────────────── */
/* Fullscreen app: drop the macOS traffic-light dots (a window affordance) so
   the title bar reads as an app bar, not a draggable window. */
.is-titlebar__lights { display: none; }
.is-titlebar__right { z-index: 2; gap: 8px; }
.tb-sep { opacity: 0.35; }

/* The user identity + the Users/Logout controls "pop" in the theme's
   complementary tone (ember/amber — the warm half of the teal·ember palette
   used by the backdrop blobs). The identity is an amber-tinted box; the
   buttons are amber outline chips that fill solid on hover. */
:root { --ember: #B5731C; --ember-deep: #95590F; }

.tb-user {
  font-weight: 600; color: var(--ember-deep);
  padding: 3px 9px; border-radius: 999px;
  background: color-mix(in oklab, var(--ember) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--ember) 30%, var(--line));
}
.tb-btn {
  height: 24px; padding: 0 11px; font-size: 11px; font-weight: 600;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--ember) 55%, var(--line));
  background: color-mix(in oklab, var(--ember) 14%, transparent);
  color: var(--ember-deep);
  backdrop-filter: none;
  transition: background .12s, color .12s, border-color .12s, transform .06s;
}
.tb-btn:hover {
  background: var(--ember); color: #fff; border-color: transparent;
}
.tb-btn:active { transform: scale(0.96); }

/* ── Users management modal ────────────────────────────────────────────── */
.users-list { overflow: auto; padding: 4px 14px; display: flex; flex-direction: column; gap: 6px; max-height: 38vh; }
.users-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px;
}
.users-row .u-name { font-family: var(--font-mono); font-size: 12px; flex: 1; }
.users-row .u-role {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted);
}
.users-row .u-role.admin { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.u-del { all: unset; cursor: pointer; color: var(--err); font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.u-del:hover { background: color-mix(in oklab, var(--err) 12%, transparent); }
.u-del[disabled] { opacity: 0.3; cursor: not-allowed; }
.users-add { padding: 12px 14px 4px; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; }
.users-add input, .users-add select {
  all: unset; height: 30px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); font-size: 12px; color: var(--ink);
}
.users-err { color: var(--err); font-size: 11px; padding: 4px 14px 0; min-height: 14px; }
