:root {
  --scheme: light;
  --text: #202d40;
  --page: #f5f7fb;
  --surface: #ffffff;
  --border: #e0e5ed;
  --input-border: #c7cfdd;
  --muted: #657185;
  --button-text: #383082;
  --accent: #583ec5;
  --hover: #eeeafb;
  --focus: #8170df;
  --notice: #eae6fb;
  --error: #ac2634;
}
:root[data-theme="dark"] {
  --scheme: dark;
  --text: #edf0f7;
  --page: #191b20;
  --surface: #24272e;
  --border: #3e4350;
  --input-border: #606778;
  --muted: #b5bdcc;
  --button-text: #d2c5ff;
  --accent: #bda7ff;
  --hover: #37304e;
  --focus: #b59aff;
  --notice: #302b43;
  --error: #ff9da9;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
  --scheme: dark;
  --text: #edf0f7;
  --page: #191b20;
  --surface: #24272e;
  --border: #3e4350;
  --input-border: #606778;
  --muted: #b5bdcc;
  --button-text: #d2c5ff;
  --accent: #bda7ff;
  --hover: #37304e;
  --focus: #b59aff;
  --notice: #302b43;
  --error: #ff9da9;
  }
}
:root { font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--page); color-scheme: var(--scheme); }
* { box-sizing: border-box; }
body { margin: 0; }
header { display: flex; gap: 10px; align-items: center; background: var(--surface); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.brand { background: #583ec5; color: white; border-radius: 10px; padding: 10px; font-weight: 750; flex-shrink: 0; }
.header-title { min-width: 0; }
h1 { font-size: 20px; margin: 0; overflow-wrap: anywhere; }
header p { margin: 0; color: var(--muted); font-size: 12px; }
#reload { margin-left: auto; font-size: 20px; flex-shrink: 0; }
main { padding: 10px 12px; max-width: 700px; margin: auto; }
button, input { font: inherit; font-size: 13px; line-height: 1.4; border: 1px solid var(--input-border); border-radius: 5px; padding: 5px 8px; }
input { min-width: 0; width: 100%; background: var(--surface); color: var(--text); }
input::placeholder { color: var(--muted); opacity: 1; }
button { background: var(--surface); color: var(--button-text); cursor: pointer; }
button:hover:enabled { background: var(--hover); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.search { margin-top: 10px; }
#login { margin-top: 10px; }
.notice { background: var(--notice); padding: 4px 8px; border-radius: 6px; font-size: 12px; margin: 0 -5px; overflow-wrap: anywhere; }
.hint, footer { color: var(--muted); font-size: 12px; }
.hint, #status { margin: 6px 0; }
#status { white-space: pre-line; overflow-wrap: anywhere; }
#status:empty { display: none; }
#status.error { color: var(--error); }
ul { list-style: none; padding: 0; margin: 0; }
li { margin: 6px 0; }
.template { display: block; text-align: left; width: 100%; padding: 6px 8px; border: 2px solid var(--border); border-radius: 6px; color: var(--text); }
.template:hover:enabled { border-color: var(--focus); }
.title { display: block; font-size: 13px; font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
footer { margin-top: 12px; }
#preview { border-top: 1px solid var(--border); margin-top: 12px; }
h2 { font-size: 14px; margin: 10px 0 6px; }
#preview p { color: var(--muted); font-size: 12px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
[hidden] { display: none !important; }
