/* Rant.net: calm, plain styling. Colors, type and spacing are variables so a
   style guide or theme can replace them later without touching the markup. */

:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #22262b;
  --muted: #5d6670;
  --border: #d5d8dc;
  --accent: #2b6c7d;
  --accent-text: #ffffff;
  --accent-soft: #e5f0f3;
  --warn-bg: #fdf3dd;
  --warn-border: #e2c071;
  --care-bg: #eaf1f8;
  --care-border: #9bb7d4;
  --error: #a3322b;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-letter: Georgia, "Times New Roman", serif;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1d21;
    --surface: #23272c;
    --text: #e8eaed;
    --muted: #a3acb5;
    --border: #3b4148;
    --accent: #6bb4c6;
    --accent-text: #10252b;
    --accent-soft: #223a42;
    --warn-bg: #3a3320;
    --warn-border: #8a7433;
    --care-bg: #1f2f40;
    --care-border: #4a6a8d;
    --error: #ff8a80;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.wrap {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { margin: 0; padding: 14px 0; font-size: 1.25rem; font-weight: 700; letter-spacing: 0.01em; }

.intro { padding: 28px 0 8px; }
h1 { margin: 0 0 8px; font-size: 1.9rem; line-height: 1.2; }
h2 { margin: 0 0 8px; font-size: 1.3rem; }
h3 { margin: 0 0 6px; font-size: 1.05rem; }
.lead { margin: 0; color: var(--muted); max-width: 40rem; }

.notice-box {
  margin: 20px 0;
  padding: 14px 16px;
  border: 1px solid var(--care-border);
  border-radius: var(--radius);
  background: var(--care-bg);
}
.notice-box h2, .notice-box h3 { margin-top: 0; }
.notice-box ul { margin: 6px 0 0; padding-left: 1.2rem; }
.notice-box li + li { margin-top: 4px; }
.notice-box p { margin: 6px 0 0; }
.notice-box.check { background: var(--warn-bg); border-color: var(--warn-border); }
.notice-box.privacy { font-size: 0.95rem; }
.notice-box.safety { font-size: 1.05rem; }
.notice-box.error { border-color: var(--error); background: var(--surface); }

.field { margin: 16px 0; }
label, .optional-title { display: block; font-weight: 600; margin-bottom: 4px; }
.optional-title { color: var(--muted); font-weight: 500; margin: 24px 0 0; }
.hint { margin: 0 0 6px; color: var(--muted); font-size: 0.95rem; }

textarea, input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
textarea { resize: vertical; }
textarea[readonly] { background: var(--bg); color: var(--muted); }
#letter, #original { font-family: var(--font-letter); font-size: 1.05rem; line-height: 1.5; }

textarea:focus, input:focus, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.counter { margin: 4px 0 0; font-size: 0.9rem; color: var(--muted); text-align: right; }
.counter.over { color: var(--error); font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; }
.status { color: var(--muted); }

button {
  min-height: 44px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-text); }
button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.result { margin: 36px 0 0; padding-top: 8px; border-top: 1px solid var(--border); }
.columns { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 52rem) {
  .columns { grid-template-columns: 1fr 1fr; }
}

.notes { margin: 20px 0; }
.notes ul, .check ul { padding-left: 1.2rem; }
.notes p { margin: 0 0 6px; color: var(--muted); }

.site-footer { margin-top: 48px; padding: 20px 0 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 0; max-width: 44rem; }

[hidden] { display: none !important; }
