/* ENOS Owner Console — canonical brand tokens, light + dark
   (docs/mockups/enos-brand-guidelines/index.html · TOKENS-ADOPTION.md).
   Product-surface DNA: serif display voice, orb identity, generous air. */

@font-face {
  font-family: "ENOS Sans";
  src: url("/fonts/ENOSSans-Regular.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "ENOS Sans";
  src: url("/fonts/ENOSSans-Italic.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "ENOS Serif";
  src: url("/fonts/ENOSSerif-Regular.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "ENOS Serif";
  src: url("/fonts/ENOSSerif-Italic.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "ENOS Mono";
  src: url("/fonts/ENOSMono-Regular.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  /* brand */
  --enos-brand-orange: #f39f22; /* Subconscious */
  --enos-brand-coral: #ed5c44;  /* Conscious */
  --enos-brand-teal: #066e6a;   /* Ego */
  --enos-brand-sage: #a4b672;   /* user / all-minds accent */
  --danger: #d4544a;
  /* radii */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --pill: 999px;
  --sans: "ENOS Sans", -apple-system, "Segoe UI", sans-serif;
  --serif: "ENOS Serif", Georgia, serif;
  --mono: "ENOS Mono", ui-monospace, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --raised: #ffffff;
  --sunken: oklch(0.98 0 0);
  --fill: oklch(0.968 0 0);
  --fill-strong: oklch(0.94 0 0);
  --ink: oklch(0.16 0 0);
  --ink-2: oklch(0.44 0 0);
  --ink-3: oklch(0.62 0 0);
  --line: oklch(0.922 0 0);
  --line-2: oklch(0.95 0 0);
  --shadow-sm: 0 1px 2px rgba(15, 15, 15, 0.05), 0 1px 3px rgba(15, 15, 15, 0.06);
  --shadow-lg: 0 18px 44px -12px rgba(15, 15, 15, 0.16);
  --teal-text: var(--enos-brand-teal);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --panel: #0c0c0c;
  --raised: #121212;
  --sunken: #050505;
  --fill: #1a1a1a;
  --fill-strong: #232323;
  --ink: oklch(0.965 0 0);
  --ink-2: oklch(0.74 0 0);
  --ink-3: oklch(0.56 0 0);
  --line: #232323;
  --line-2: #1a1a1a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 18px 48px -12px rgba(0, 0, 0, 0.7);
  --teal-text: #12a49d; /* teal lifted for dark-bg legibility */
}

* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}
.hidden { display: none !important; }
code, .mono { font-family: var(--mono); font-size: 0.85em; }

.display {
  font-family: var(--serif);
  font-weight: 420;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* identity orbs */
.orb { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.orb-sub { background: var(--enos-brand-orange); }
.orb-mind { background: var(--enos-brand-coral); }
.orb-deep { background: var(--enos-brand-teal); }
.orbs-sm { display: inline-flex; gap: 3px; margin-right: 7px; }
.orbs-sm .orb { width: 7px; height: 7px; }
.login-orbs { display: flex; gap: 6px; justify-content: center; margin-bottom: 1.2rem; }
.login-orbs .orb { width: 12px; height: 12px; }

/* lockup */
.lockup { display: inline-flex; align-items: center; gap: 5px; }
.wordmark { font-weight: 700; letter-spacing: 0.14em; font-size: 1rem; }
.rule-sm { width: 1px; height: 15px; background: var(--ink); opacity: 0.2; margin: 0 4px; }
.desc-sm { font-size: 0.92rem; font-weight: 450; color: var(--ink-3); }

/* Login */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--sunken); }
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 2.8rem 2.8rem 2.4rem; width: min(400px, 92vw); text-align: center;
}
.login-card h1 { font-size: 1.7rem; }
.login-hint { color: var(--ink-3); font-size: 0.88rem; margin: 0.7rem 0 1.6rem; }
.login-card input {
  width: 100%; padding: 0.75rem 1rem; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--sunken); color: var(--ink); font-size: 0.95rem; font-family: var(--sans);
  outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-card input:focus { border-color: var(--ink-3); box-shadow: var(--shadow-sm); }
.login-card button {
  width: 100%; margin-top: 0.9rem; padding: 0.75rem; border-radius: var(--r); border: none;
  background: var(--ink); color: var(--bg); font-weight: 600; cursor: pointer; font-size: 0.95rem;
  font-family: var(--sans); transition: opacity 0.15s ease;
}
.login-card button:hover { opacity: 0.85; }
.login-error { color: var(--danger); font-size: 0.8rem; margin-top: 0.9rem; min-height: 1em; }

/* Shell */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 1.6rem; border-bottom: 1px solid var(--line-2);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.topbar-meta { color: var(--ink-3); font-size: 0.76rem; display: flex; gap: 0.6rem; align-items: center; font-family: var(--mono); }
#refresh-btn, #theme-btn {
  background: var(--fill); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: var(--r-sm); cursor: pointer; padding: 0.28rem 0.6rem; font-size: 0.85rem;
  transition: background 0.15s ease;
}
#refresh-btn:hover, #theme-btn:hover { background: var(--fill-strong); color: var(--ink); }

.hero { max-width: 1500px; margin: 0 auto; padding: 2.2rem 1.6rem 0.4rem; }
.hero .display { font-size: 2rem; }
.headline { color: var(--ink-2); font-size: 1rem; margin-top: 0.5rem; }

/* Needs-you panel */
.panel-needs { border-left: 3px solid var(--enos-brand-sage); }
.need { display: flex; gap: 0.7rem; align-items: baseline; padding: 0.42rem 0; border-bottom: 1px solid var(--line-2); }
.need:last-child { border-bottom: none; }
.need-tag {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.1em; flex: 0 0 auto;
  padding: 0.14rem 0.5rem; border-radius: var(--pill); border: 1px solid var(--line); color: var(--ink-3);
}
.need-urgent .need-tag { border-color: var(--danger); color: var(--danger); }
.need-decide .need-tag { border-color: var(--enos-brand-orange); color: color-mix(in oklab, var(--enos-brand-orange) 85%, var(--ink)); }
.need-review .need-tag { border-color: var(--teal-text); color: var(--teal-text); }
.need-text { color: var(--ink); }
.allquiet { color: var(--ink-3); font-style: italic; }

/* panel summaries + collapsed detail */
.summary { color: var(--ink); font-size: 0.9rem; margin-bottom: 0.5rem; }
.detail summary {
  cursor: pointer; color: var(--ink-3); font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.12em; padding: 0.2rem 0; user-select: none;
}
.detail[open] summary { margin-bottom: 0.4rem; }

.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 1.2rem;
  padding: 1.2rem 1.6rem 2.4rem; max-width: 1500px; margin: 0 auto;
}
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 1.2rem; align-content: start; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem 1.35rem; min-height: 120px;
}
.panel-wide { grid-column: 1 / -1; }
.panel h2 {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--ink-3); margin-bottom: 0.85rem; font-weight: 600;
}
.panel-body { font-size: 0.86rem; line-height: 1.6; color: var(--ink-2); }
.unreachable { color: var(--ink-3); font-style: italic; }

.row { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.3rem 0; border-bottom: 1px solid var(--line-2); }
.row:last-child { border-bottom: none; }
.row .k { color: var(--ink-3); white-space: nowrap; }
.row .v { text-align: right; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 0.45em; vertical-align: 1px; }
.dot-ok { background: var(--enos-brand-sage); }
.dot-bad { background: var(--danger); }
.dot-warn { background: var(--enos-brand-orange); }
.dot-dim { background: var(--ink-3); }

.lane-subconscious { color: var(--enos-brand-orange); }
.lane-conscious, .lane-mind { color: var(--enos-brand-coral); }
.lane-ego, .lane-deepmind { color: var(--teal-text); }

.gate {
  display: inline-flex; align-items: center; gap: 0.4em; margin: 0.2rem 0.5rem 0.2rem 0;
  padding: 0.26rem 0.75rem; border: 1px solid var(--line); border-radius: var(--pill);
  font-size: 0.76rem; background: var(--sunken); color: var(--ink-3);
}
.gate-done { border-color: color-mix(in oklab, var(--enos-brand-sage) 50%, transparent); color: color-mix(in oklab, var(--enos-brand-sage) 80%, var(--ink)); }
.gate-active { border-color: color-mix(in oklab, var(--enos-brand-orange) 50%, transparent); color: color-mix(in oklab, var(--enos-brand-orange) 80%, var(--ink)); }
.gate-needed { border-color: color-mix(in oklab, var(--danger) 50%, transparent); color: var(--danger); }

a { color: var(--teal-text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Agent pane */
.agent {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem 1.35rem; display: flex; flex-direction: column;
  min-height: 420px; max-height: calc(100vh - 140px); position: sticky; top: 4.2rem;
}
.agent h2 { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--ink-3); margin-bottom: 0.85rem; font-weight: 600; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; padding-bottom: 0.6rem; }
.msg { padding: 0.65rem 0.85rem; border-radius: var(--r); font-size: 0.85rem; line-height: 1.6; white-space: pre-wrap; }
.msg-enos { background: var(--sunken); border: 1px solid var(--line-2); border-left: 2px solid var(--enos-brand-sage); color: var(--ink-2); }
.msg-user { background: var(--fill); color: var(--ink); align-self: flex-end; max-width: 90%; }
.msg-pending { color: var(--ink-3); font-style: italic; }
.chat-form { display: flex; gap: 0.5rem; margin-top: 0.7rem; }
.chat-form input {
  flex: 1; padding: 0.65rem 0.9rem; border-radius: var(--pill); border: 1px solid var(--line);
  background: var(--sunken); color: var(--ink); font-family: var(--sans); outline: none;
  transition: border-color 0.15s ease;
}
.chat-form input:focus { border-color: var(--ink-3); }
.chat-form button {
  width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--ink);
  color: var(--bg); cursor: pointer; font-weight: 600; transition: opacity 0.15s ease;
}
.chat-form button:hover { opacity: 0.85; }
