/* FinalTake app-level styles. Consumes RisingSwamp tokens.css. */

html, body { height: 100%; overflow: hidden; }
body {
  background:
    radial-gradient(ellipse at 50% -20%, rgba(0, 245, 255, 0.03), transparent 55%),
    #07090c;
}

/* ─── macOS frame ─────────────────────────────────────────────────── */
.ft-stage {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 24px;
}
.ft-win {
  width: min(1440px, 100%);
  height: min(900px, 100%);
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 30px 80px rgba(0,0,0,0.6), 0 8px 20px rgba(0,0,0,0.4);
  position: relative;
  isolation: isolate;
}
.ft-titlebar {
  height: 38px;
  flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 14px;
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 5;
  -webkit-app-region: drag;
}
.ft-lights { display: inline-flex; gap: 8px; align-items: center; }
.ft-light {
  width: 12px; height: 12px; border-radius: 50%;
  border: 0.5px solid rgba(0,0,0,0.3);
}
.ft-light.red    { background: #ff5f57; }
.ft-light.yellow { background: #febc2e; }
.ft-light.green  { background: #28c840; }

.ft-titletext {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: -0.005em;
  display: inline-flex; gap: 10px; align-items: center;
}
.ft-titletext .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); }
.ft-titletext .badge {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent);
  padding: 2px 7px; border: 1px solid var(--accent-dim); border-radius: 100px;
  background: var(--accent-dim);
}

.ft-theme-switch {
  margin-left: auto;
  display: inline-flex; gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  -webkit-app-region: no-drag;
}
.ft-theme-btn {
  appearance: none; background: transparent; border: none;
  padding: 4px 10px; border-radius: 100px;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted); cursor: pointer;
  transition: color var(--motion-duration-base) var(--motion-ease-organic),
    background-color var(--motion-duration-base) var(--motion-ease-organic);
}
.ft-theme-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-dim); }
.ft-theme-btn:hover { color: var(--text-primary); }

/* ─── Body layout ─────────────────────────────────────────────────── */
.ft-body { flex: 1; min-height: 0; display: flex; position: relative; }

.ft-sidebar {
  width: 224px; flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 0 10px;
  overflow: hidden;
}
.ft-sb-brand {
  padding: 0 20px 18px;
  display: flex; align-items: center; gap: 10px;
}
.ft-sb-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  position: relative; flex-shrink: 0;
}
.ft-sb-mark::after {
  content: "▶"; position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--bg); font-size: 8px; line-height: 1;
  padding-left: 1px;
}
.ft-sb-name {
  font-family: var(--sans); font-size: 15px;
  font-weight: 500; letter-spacing: -0.015em;
  color: var(--text-primary);
}
.ft-sb-name em {
  font-style: normal; color: var(--accent); font-family: var(--mono);
  font-weight: 400; font-size: 14px;
}
.ft-sb-group-label {
  padding: 14px 20px 6px;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-muted); opacity: 0.7;
}
.ft-sb-item {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 20px;
  font-family: var(--sans); font-size: 13px;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition:
    color var(--motion-duration-base) var(--motion-ease-organic),
    background-color var(--motion-duration-base) var(--motion-ease-organic),
    border-color var(--motion-duration-base) var(--motion-ease-organic);
}
.ft-sb-item:hover { color: var(--text-primary); background: var(--dim); }
.ft-sb-item.active {
  color: var(--text-primary);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}
.ft-sb-item .ico {
  width: 14px; height: 14px; color: inherit;
  flex-shrink: 0;
  opacity: 0.7;
}
.ft-sb-item.active .ico { opacity: 1; color: var(--accent); }
.ft-sb-item .meta {
  margin-left: auto;
  font-family: var(--mono); font-size: 10px;
  color: var(--text-muted); letter-spacing: 0.05em;
}

.ft-sb-workspace {
  margin: auto 10px 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.ft-sb-workspace .k { font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); }
.ft-sb-workspace .v { font-family: var(--mono); font-size: 11px; color: var(--text-secondary); word-break: break-all; line-height: 1.4; }
.ft-sb-workspace .status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-top: 4px; }
.ft-sb-workspace .status::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ─── Main ───────────────────────────────────────────────────────── */
.ft-main {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

.ft-crumb {
  height: 34px; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
}
.ft-crumb a { color: var(--text-secondary); cursor: pointer; }
.ft-crumb a:hover { color: var(--accent); }
.ft-crumb .sep { opacity: 0.5; }
.ft-crumb .now { color: var(--text-primary); }
.ft-crumb .right { margin-left: auto; display: inline-flex; gap: 14px; align-items: center; color: var(--text-muted); }
.ft-crumb .right .ok::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); margin-right: 6px; vertical-align: middle; }

.ft-scroll {
  flex: 1; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.ft-scroll::-webkit-scrollbar { width: 10px; }
.ft-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; border: 3px solid var(--bg); }

.ft-screen { padding: 32px 40px 56px; max-width: 1180px; margin: 0 auto; }

/* ─── Page head ─────────────────────────────────────────────────── */
.ft-pagehead { display: flex; flex-direction: column; gap: 8px; margin-bottom: 32px; }
.ft-pagehead .kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-muted); }
.ft-pagehead h1 { font-family: var(--sans); font-size: 36px; font-weight: 500; letter-spacing: -0.025em; margin: 0; color: var(--text-primary); line-height: 1.05; }
.ft-pagehead p { margin: 0; color: var(--text-tertiary); font-size: 15px; line-height: 1.6; max-width: 62ch; }
.ft-pagehead .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }

/* ─── Buttons ───────────────────────────────────────────────────── */
.ft-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; height: 36px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 8px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: -0.005em; line-height: 1; cursor: pointer;
  transition:
    background-color var(--motion-duration-base) var(--motion-ease-organic),
    color var(--motion-duration-base) var(--motion-ease-organic),
    border-color var(--motion-duration-base) var(--motion-ease-organic),
    box-shadow var(--motion-duration-base) var(--motion-ease-organic);
}
.ft-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ft-btn--primary { background: var(--accent); color: var(--bg); }
.ft-btn--primary:hover { box-shadow: var(--glow-primary); }
.ft-btn--secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.ft-btn--secondary:hover { background: var(--surface2); border-color: var(--accent); color: var(--accent); }
.ft-btn--ghost { background: transparent; color: var(--text-secondary); }
.ft-btn--ghost:hover { color: var(--accent); background: var(--accent-dim); }
.ft-btn--danger { background: transparent; color: #e87878; border-color: #4a2d2d; }
.ft-btn--danger:hover { background: rgba(232, 120, 120, 0.08); border-color: #8a4444; }
.ft-btn--lg { height: 44px; padding: 0 22px; font-size: 14px; }
.ft-btn--record { background: #e85454; color: #fff; }
.ft-btn--record:hover { box-shadow: 0 0 16px rgba(232, 84, 84, 0.5); }
.ft-btn--record::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.8);
}

/* ─── Tags ──────────────────────────────────────────────────────── */
.ft-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 100px;
  background: var(--dim); color: var(--text-secondary);
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.4;
  white-space: nowrap;
}
.ft-tag--accent { background: var(--accent-dim); color: var(--accent); }
.ft-tag--ok { background: var(--accent-dim); color: var(--accent); }
.ft-tag--warn { background: rgba(255, 204, 136, 0.1); color: var(--phen-glory); }
.ft-tag--muted { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.ft-tag--dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 8px currentColor;
}
.ft-tag--live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #e85454; box-shadow: 0 0 8px #e85454;
  animation: ft-pulse 1.4s ease-in-out infinite;
}
@keyframes ft-pulse { 50% { opacity: 0.35; } }

/* ─── Inputs ────────────────────────────────────────────────────── */
.ft-input {
  appearance: none; width: 100%; height: 40px;
  padding: 0 14px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--sans); font-size: 14px;
  outline: none;
  transition: border-color var(--motion-duration-base) var(--motion-ease-organic),
    box-shadow var(--motion-duration-base) var(--motion-ease-organic);
}
.ft-input::placeholder { color: var(--text-muted); }
.ft-input:hover { border-color: var(--text-muted); }
.ft-input:focus-visible { box-shadow: var(--focus-ring); border-color: transparent; }
.ft-input--mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; }

.ft-label {
  display: flex; flex-direction: column; gap: 8px;
}
.ft-label .lbl {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  color: var(--text-secondary); letter-spacing: 0.02em;
}
.ft-label .hint {
  font-family: var(--mono); font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ─── Panel card ────────────────────────────────────────────────── */
.ft-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.ft-panel-hd { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.ft-panel-hd h3 { font-family: var(--sans); font-size: 16px; font-weight: 500; margin: 0; color: var(--text-primary); letter-spacing: -0.01em; }

/* ─── Status dots ───────────────────────────────────────────────── */
.ft-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ft-dot--ok { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.ft-dot--warn { background: var(--phen-glory); box-shadow: 0 0 8px var(--phen-glory); }
.ft-dot--fail { background: #e85454; box-shadow: 0 0 8px rgba(232,84,84,0.5); }
.ft-dot--idle { background: var(--text-muted); }

/* ─── Tweaks panel ──────────────────────────────────────────────── */
.ft-tweaks {
  position: fixed; right: 24px; bottom: 24px;
  width: 300px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; z-index: 50;
  display: none; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
.ft-tweaks.open { display: flex; }
.ft-tweaks h4 { font-family: var(--sans); font-size: 13px; font-weight: 500; margin: 0; color: var(--text-primary); display: flex; justify-content: space-between; }
.ft-tweaks h4 .k { font-family: var(--mono); font-size: 9px; color: var(--text-muted); letter-spacing: 0.2em; text-transform: uppercase; }
.ft-tweaks label { display: flex; flex-direction: column; gap: 6px; font-family: var(--sans); font-size: 12px; color: var(--text-tertiary); }
.ft-tweaks .row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-secondary); }

/* ─── Utility ───────────────────────────────────────────────────── */
.ft-fadein { animation: ft-fadein 400ms var(--motion-ease-organic) both; }
@keyframes ft-fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.ft-mono { font-family: var(--mono); }
.ft-muted { color: var(--text-muted); }
.ft-divider { height: 1px; background: var(--border); margin: 16px 0; }

/* Narrow a scrollbar variant */
.ft-scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.ft-scroll-thin::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; border: none; }
.ft-scroll-thin { scrollbar-width: thin; }

/* ─── Accent swatches ──────────────────────────────────────────── */
/* Override the base accent per-theme for user-selected accent */
html[data-accent="citron"] {
  --accent: #d4f05c;
  --accent-dim: rgba(212, 240, 92, 0.14);
  --accent-glow: rgba(212, 240, 92, 0.35);
  --glow-primary: 0 0 10px var(--accent-glow), 0 0 20px rgba(212, 240, 92, 0.14);
}
html[data-accent="coral"] {
  --accent: #ff8a6a;
  --accent-dim: rgba(255, 138, 106, 0.14);
  --accent-glow: rgba(255, 138, 106, 0.35);
  --glow-primary: 0 0 10px var(--accent-glow), 0 0 20px rgba(255, 138, 106, 0.14);
}
html[data-accent="violet"] {
  --accent: #b78cff;
  --accent-dim: rgba(183, 140, 255, 0.14);
  --accent-glow: rgba(183, 140, 255, 0.35);
  --glow-primary: 0 0 10px var(--accent-glow), 0 0 20px rgba(183, 140, 255, 0.14);
}

/* Tiny page-head kicker fix (used by pagehead .kicker) */
.kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-muted); }
