/* Blackout. System fonts only — the CSP forbids network requests. */

:root {
  --paper: #e8e6e1;
  --surface: #ffffff;
  --ink: #141414;
  --ink-soft: #55524c;
  --line: #cfccc4;
  --led: #2f9e44;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- header ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.wordmark-bar {
  display: inline-block;
  width: 0.95em;
  height: 0.78em;
  margin: 0 0.06em;
  background: var(--ink);
}

.netstatus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: help;
}

.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 6px 1px rgba(47, 158, 68, 0.55);
  animation: led-breathe 3s ease-in-out infinite;
}

@keyframes led-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .led { animation: none; }
}

.netstatus-label {
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* ---------- stage ---------- */

.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 0;
  overflow: auto;
}

.dropzone {
  max-width: 460px;
  width: 100%;
  padding: 56px 32px;
  border: 1px dashed var(--ink-soft);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
}

.dropzone:focus-visible,
.linklike:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.dropzone.dragover {
  border-style: solid;
  border-color: var(--ink);
}

.dropzone-title {
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}

.redacted-word {
  color: transparent;
  background: var(--ink);
  user-select: none;
  padding: 0 0.15em;
}

.dropzone-sub { color: var(--ink-soft); margin-bottom: 20px; }

.dropzone-note {
  color: var(--ink-soft);
  font-size: 12px;
  max-width: 34ch;
  margin: 0 auto;
}

.linklike {
  font: inherit;
  color: var(--ink);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* ---------- canvas ---------- */

.canvas-wrap {
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
  box-shadow: 0 1px 3px rgba(20, 20, 20, 0.18), 0 8px 28px rgba(20, 20, 20, 0.12);
}

#canvas {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  cursor: crosshair;
  touch-action: none;
  display: block;
}

/* ---------- toolbar ---------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-hint {
  color: var(--ink-soft);
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar button,
.toolbar select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--ink);
  padding: 6px 12px;
  cursor: pointer;
}

.toolbar button:disabled {
  border-color: var(--line);
  color: var(--line);
  cursor: default;
}

.toolbar button.primary {
  background: var(--ink);
  color: var(--surface);
}

.format-label { color: var(--ink-soft); }

@media (max-width: 640px) {
  .toolbar { flex-wrap: wrap; justify-content: center; }
  .toolbar-hint { display: none; }
  .netstatus-label { font-size: 11px; }
}
