/* The editor page's own chrome: one strip above WordCanvas. Colours follow the drive app
   (lib/theme.dart: ink #0B141A, accent #0E7A85, accentBright #4FC9C4, divider #DDE4E7). */
:root {
  --ink: #0B141A;
  --charcoal: #0E1A22;
  --accent: #0E7A85;
  --accent-bright: #4FC9C4;
  --text: #E6EEF1;
  --text-muted: #93A5AE;
  --divider: #1C2B34;
  --error: #FF8A80;
  --bar-h: 44px;
}
html, body { margin: 0; height: 100%; background: #F6F9FA; font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #0B141A; }
body { display: flex; flex-direction: column; }

#bar {
  flex: none; height: var(--bar-h); display: flex; align-items: center; gap: 12px; padding: 0 12px;
  background: var(--ink); color: var(--text); border-bottom: 1px solid var(--divider);
}
#bar[hidden], #standalone[hidden], #loading[hidden] { display: none; }
#bar .name { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 40vw; }
#bar .state { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
#bar .state.error { color: var(--error); }
#bar .spacer { flex: 1; }
button, label.primary {
  font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 6px; cursor: pointer;
  border: 1px solid #2A3B45; background: var(--charcoal); color: var(--text);
}
button:hover, label.primary:hover { border-color: var(--accent-bright); }
button:focus-visible, label.primary:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
button.primary, label.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:disabled { opacity: .55; cursor: default; }
button[hidden] { display: none; }

#editor { flex: 1; min-height: 0; position: relative; }

#standalone {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  text-align: center; padding: 24px; color: var(--text-muted);
  background: linear-gradient(135deg, #071015, #0B141A 50%, #0D2027);
}
#standalone h1 { margin: 0; font-size: 22px; color: #fff; }
#standalone p { max-width: 46ch; margin: 0; }
#standalone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }

#loading {
  position: fixed; inset: var(--bar-h) 0 0 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; background: rgba(246, 249, 250, .92); color: #5C6B72;
}
#loading .bar { width: 120px; height: 3px; border-radius: 3px; background: #DDE4E7; overflow: hidden; }
#loading .bar::after { content: ""; display: block; width: 40%; height: 100%; background: var(--accent-bright); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { #loading .bar::after { animation: none; width: 100%; } }
