/* EROffice brand layer — the Erebros Teams "obsidian" language: ember on void, carved
   corners, Inter for text, JetBrains Mono for small utility labels. Used by the document
   list, the top bar and the dialogs, and to re-accent GenOffice's own chrome. */

@font-face {
  font-family: 'ER Inter';
  src: url('/er/web/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'ER Inter';
  src: url('/er/web/fonts/inter-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'ER Mono';
  src: url('/er/web/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2212;
}
@font-face {
  font-family: 'ER Mono';
  src: url('/er/web/fonts/jetbrains-mono-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'ER Fraunces';
  src: url('/er/web/fonts/fraunces-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --er-void: #0a0a0b;
  --er-bg: #0c0c0e;
  --er-panel: #141417;
  --er-panel-2: #1a1a1e;
  --er-line: rgba(231, 228, 223, 0.08);
  --er-line-bright: rgba(231, 228, 223, 0.16);
  --er-text: #e7e4df;
  --er-muted: #8b8884;
  --er-faint: #5e5b58;
  --er-ember: #d8410f;
  --er-ember-hi: #ff6b2c;
  --er-ember-soft: rgba(216, 65, 15, 0.14);
  --er-on-ember: #0a0a0b;
  --er-focus: rgba(255, 107, 44, 0.55);
  --er-ok: #5fb88a;
  --er-danger: #e0533a;
  /* per-app marks, muted so ember stays the only loud colour */
  --er-sheets: #5fb88a;
  --er-docs: #6c9cf0;
  --er-slides: #e8894a;
  --er-pdf: #e0655a;
  --er-markdown: #a58bd9;
  --er-html: #d9b44a;
  --er-radius: 10px;
  --er-radius-sm: 8px;
  --er-font: 'ER Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --er-mono: 'ER Mono', ui-monospace, Menlo, Consolas, monospace;
  --er-display: 'ER Fraunces', Georgia, serif;
  --er-bar-h: 40px;
  --er-z-bar: 40;
  --er-z-dialog: 2147483000;
}

/* Erebros Teams "navy": brass on deep navy (S-Forge, Hermes Swarm). */
:root[data-er-theme='navy'] {
  --er-void: #0a111e;
  --er-bg: #0b1220;
  --er-panel: #101c2e;
  --er-panel-2: #152238;
  --er-line: rgba(122, 147, 189, 0.18);
  --er-line-bright: #3a5075;
  --er-text: #e9eef7;
  --er-muted: #8093ac;
  --er-faint: #586b86;
  --er-ember: #e9c85b;
  --er-ember-hi: #f2d777;
  --er-ember-soft: rgba(233, 200, 91, 0.14);
  --er-on-ember: #0a111e;
  --er-focus: rgba(233, 200, 91, 0.5);
  --er-ok: #41b8aa;
  --er-danger: #e5674e;
  --er-sheets: #41b8aa;
  --er-docs: #7c9ee8;
  --er-slides: #e0a24a;
}
/* Light: paper and ink, the ember accent stays. */
:root[data-er-theme='light'] {
  --er-void: #ffffff;
  --er-bg: #f5f5f4;
  --er-panel: #ffffff;
  --er-panel-2: #f1f0ee;
  --er-line: rgba(23, 23, 26, 0.09);
  --er-line-bright: rgba(23, 23, 26, 0.18);
  --er-text: #17171a;
  --er-muted: #5c5a57;
  --er-faint: #85827e;
  --er-ember-soft: rgba(216, 65, 15, 0.10);
  --er-on-ember: #ffffff;
  --er-focus: rgba(216, 65, 15, 0.45);
  color-scheme: light;
}

/* ------------------------------------------------------------------ shared controls */

.er-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--er-radius-sm);
  border: 1px solid var(--er-line-bright);
  background: transparent;
  color: var(--er-text);
  font: 500 13px/1 var(--er-font);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.er-btn:hover { background: color-mix(in srgb, var(--er-text) 6%, transparent); border-color: color-mix(in srgb, var(--er-text) 26%, transparent); }
.er-btn:focus-visible { outline: 2px solid var(--er-focus); outline-offset: 2px; }
.er-btn:disabled { opacity: 0.45; cursor: default; }
.er-btn svg { width: 16px; height: 16px; flex: none; }
.er-btn--primary { background: var(--er-ember); border-color: transparent; color: var(--er-on-ember); font-weight: 600; }
.er-btn--primary:hover { background: var(--er-ember-hi); border-color: transparent; }
.er-btn--ghost { border-color: transparent; color: var(--er-muted); }
.er-btn--ghost:hover { color: var(--er-text); }
.er-btn--danger { color: var(--er-danger); }

.er-input {
  height: 36px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 12px;
  border-radius: var(--er-radius-sm);
  border: 1px solid var(--er-line-bright);
  background: var(--er-void);
  color: var(--er-text);
  font: 14px/1 var(--er-font);
  transition: border-color 150ms ease;
}
.er-input:focus { outline: none; border-color: var(--er-ember); box-shadow: 0 0 0 3px var(--er-ember-soft); }
.er-input::placeholder { color: var(--er-faint); }

.er-label {
  font: 500 10.5px/1 var(--er-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--er-muted);
}

.er-kind {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  flex: none;
  font: 700 10px/1 var(--er-mono);
  letter-spacing: 0.04em;
  color: var(--er-void);
}
.er-kind[data-app='sheets'] { background: var(--er-sheets); }
.er-kind[data-app='docs'] { background: var(--er-docs); }
.er-kind[data-app='slides'] { background: var(--er-slides); }
.er-kind[data-app='pdf'] { background: var(--er-pdf); }
.er-kind[data-app='markdown'] { background: var(--er-markdown); }
.er-kind[data-app='html'] { background: var(--er-html); font-size: 8.5px; }
.er-kind[data-app=''] { background: var(--er-panel-2); color: var(--er-muted); border: 1px solid var(--er-line-bright); }

/* ------------------------------------------------------------------ dropdowns (language, theme) */
.er-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin: 0 4px;
  color: var(--er-muted);
}
.er-select svg { position: absolute; left: 9px; width: 14px; height: 14px; pointer-events: none; }
.er-select::after {
  content: '';
  position: absolute;
  right: 10px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.er-select select {
  appearance: none;
  height: 100%;
  padding: 0 28px 0 29px;
  border: 1px solid var(--er-line-bright);
  border-radius: var(--er-radius-sm);
  background: transparent;
  color: var(--er-text);
  font: 500 12.5px/1 var(--er-font);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.er-select:hover { color: var(--er-text); }
.er-select select:hover { background: color-mix(in srgb, var(--er-text) 6%, transparent); border-color: color-mix(in srgb, var(--er-text) 26%, transparent); }
.er-select select:focus-visible { outline: 2px solid var(--er-focus); outline-offset: 2px; }
.er-select option { background: var(--er-panel); color: var(--er-text); }

/* ------------------------------------------------------------------ dialogs */

.er-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--er-z-dialog);
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 5, 6, 0.62);
  backdrop-filter: blur(2px);
  animation: er-fade 150ms ease;
}
.er-dialog {
  width: min(560px, 100%);
  max-height: min(640px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  background: var(--er-panel);
  color: var(--er-text);
  border: 1px solid var(--er-line-bright);
  border-radius: var(--er-radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  font: 14px/1.5 var(--er-font);
  animation: er-rise 180ms ease;
}
.er-dialog--small { width: min(440px, 100%); }
.er-dialog header { padding: 18px 20px 6px; }
.er-dialog h2 { margin: 6px 0 0; font: 600 17px/1.3 var(--er-font); color: var(--er-text); }
.er-dialog .er-dialog-body { padding: 10px 20px; overflow: auto; }
.er-dialog footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--er-line);
}
.er-dialog footer .er-spacer { flex: 1; }
.er-dialog p { margin: 0 0 8px; color: var(--er-muted); }
.er-dialog .er-message { color: var(--er-text); white-space: pre-wrap; }

.er-files { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--er-line); border-radius: var(--er-radius-sm); overflow: hidden; }
.er-files li + li { border-top: 1px solid var(--er-line); }
.er-files button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: var(--er-text);
  font: 14px/1.3 var(--er-font);
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.er-files button:hover { background: color-mix(in srgb, var(--er-text) 4%, transparent); }
.er-files button[aria-selected='true'] { background: var(--er-ember-soft); box-shadow: inset 2px 0 0 var(--er-ember); }
.er-files button:focus-visible { outline: 2px solid var(--er-focus); outline-offset: -2px; }
.er-files .er-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.er-files .er-dir { color: var(--er-faint); }
.er-files .er-meta { font: 12px/1 var(--er-mono); color: var(--er-faint); white-space: nowrap; }
.er-empty { padding: 24px 12px; text-align: center; color: var(--er-faint); }
.er-warn { color: var(--er-slides); font-size: 13px; margin-top: 8px; min-height: 1.3em; }

@keyframes er-fade { from { opacity: 0; } }
@keyframes er-rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .er-dialog-backdrop, .er-dialog { animation: none; }
  .er-btn, .er-files button, .er-input { transition: none; }
}

/* ------------------------------------------------------------------ notice (file ready) */
.er-notice {
  position: fixed;
  right: 16px;
  bottom: 44px;
  z-index: var(--er-z-dialog);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 16px;
  background: var(--er-panel);
  color: var(--er-text);
  border: 1px solid var(--er-line-bright);
  border-radius: var(--er-radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  font: 14px/1.2 var(--er-font);
  animation: er-rise 180ms ease;
}
