:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6860;
  --border: #e3e1db;
  --accent: #f38020;
  --accent-text: #ffffff;
  --danger: #c0392b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --surface: #1f1e1c;
    --text: #ecebe8;
    --muted: #9a978f;
    --border: #33312d;
    --danger: #e57366;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 32px 16px; }
header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
small { font-weight: normal; font-size: 0.8rem; }
section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
}
form { display: flex; gap: 8px; flex-wrap: wrap; }
input[type="email"], textarea {
  flex: 1 1 240px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: inherit;
  font: inherit;
}
textarea { flex-basis: 100%; resize: vertical; }
input[type="file"] { flex: 1 1 200px; min-width: 0; }
button {
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: default; }
button.link { background: none; color: var(--muted); padding: 4px 8px; font-weight: normal; }
button.link:hover { color: var(--text); }
button.delete { color: var(--danger); }
.muted { color: var(--muted); }
.list { list-style: none; padding: 0; margin: 16px 0 0; }
.list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.list li > div { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.list .meta { font-size: 0.8rem; color: var(--muted); white-space: normal; }
.list a { color: inherit; }
.list .empty { color: var(--muted); border-top: 0; }
#flash {
  margin: 20px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}
#flash.error { border-color: var(--danger); color: var(--danger); }
footer { margin-top: 32px; font-size: 0.8rem; text-align: center; }

.arch p { margin: 0 0 12px; }
.arch-scroll { overflow-x: auto; margin: 0 -4px; }
.arch svg { display: block; width: 100%; min-width: 560px; height: auto; font-family: inherit; }
.arch .boundary { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 6 5; opacity: 0.7; }
.arch .boundary-label { fill: var(--accent); font-size: 13px; font-weight: 600; }
.arch .node rect { fill: var(--bg); stroke: var(--border); stroke-width: 1.5; }
.arch .node line { stroke: var(--border); }
.arch .node-muted rect { stroke-dasharray: 4 4; }
.arch .name { fill: var(--text); font-size: 15px; font-weight: 700; }
.arch .role { fill: var(--muted); font-size: 12px; }
.arch .limit { fill: var(--text); font-size: 12px; }
.arch .dot { fill: var(--accent); }
.arch .dot-alt { fill: var(--text); }
.arch .edges path { fill: none; stroke: var(--muted); stroke-width: 1.5; marker-end: url(#arrow); }
.arch .arrowhead { fill: var(--muted); }
.arch .edge-labels text { fill: var(--muted); font-size: 11px; }
.arch .arch-hint { display: none; margin: 8px 0 0; font-size: 0.8rem; }
@media (max-width: 620px) { .arch .arch-hint { display: block; } }
.i18n-pending body { visibility: hidden; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lang-switch { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.lang-switch a { color: var(--muted); text-decoration: none; padding: 2px 4px; border-radius: 4px; }
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="page"] { color: var(--accent); font-weight: 600; }
