:root {
  color-scheme: light dark;
  --page: #f8faf9;
  --paper: #fff;
  --ink: #202823;
  --muted: #56655e;
  --line: #d4dfd8;
  --accent: #195b43;
  --alert: #9a3523;
  font-family: Roboto, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #161b19;
    --paper: #1c231f;
    --ink: #ebf3ec;
    --muted: #adbbaf;
    --line: #39463d;
    --accent: #9bd7b9;
    --alert: #ffab98;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
}
.sheet {
  display: flex;
  flex-direction: column;
  width: min(100%, 52rem);
  height: 100vh;
  height: 100dvh;
  margin-inline: auto;
  background: var(--paper);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: calc(0.9rem + env(safe-area-inset-top)) max(1.2rem, env(safe-area-inset-right)) 0.9rem max(1.2rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}
h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}
#status {
  margin: 0.17rem 0 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.3;
}
#status[data-error] { color: var(--alert); }
button {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--paper);
  color: var(--accent);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:active:enabled { background: var(--page); }
button:disabled { color: var(--muted); cursor: default; }
textarea {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  padding: 1.3rem max(1.2rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1.2rem, env(safe-area-inset-left));
  margin: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  resize: none;
  background: var(--paper);
  color: var(--ink);
  caret-color: var(--accent);
  font: inherit;
  font-size: 1.125rem;
  line-height: 1.6;
}
textarea::placeholder { color: var(--muted); opacity: 1; }
@media (min-width: 52rem) {
  .sheet { border-inline: 1px solid var(--line); }
  header { padding-inline: 2.5rem; }
  textarea { padding: 2rem 2.5rem; }
}
