:root {
  color-scheme: light;
  --ink: #1f2923;
  --muted: #657169;
  --paper: #f5f3eb;
  --panel: #fffef9;
  --line: #d9ded8;
  --accent: #176b4d;
  --accent-hover: #0f513a;
  --accent-soft: #dcece3;
  --danger: #a23b32;
  --warning: #fff1d5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, #dce9df 0, transparent 32rem),
    linear-gradient(180deg, #f9f7f0, var(--paper));
}

button, input, textarea { font: inherit; }

button {
  border: 0;
  border-radius: 0.7rem;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

button:hover { background: var(--accent-hover); }
button:active { transform: translateY(1px); }

button.secondary {
  color: var(--accent);
  background: var(--accent-soft);
}

button.secondary:hover { background: #c9e2d4; }
button.full { width: 100%; }

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.25rem 0 5rem;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

h1, h2, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 0.8rem; font-family: Georgia, serif; font-size: clamp(2.4rem, 6vw, 5.25rem); line-height: 0.98; letter-spacing: -0.045em; }
h2 { margin-bottom: 0.45rem; font-size: 1.18rem; }
.lede { max-width: 690px; color: var(--muted); font-size: 1.08rem; line-height: 1.6; }
.eyebrow { margin-bottom: 0.65rem; color: var(--accent); font-size: 0.73rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }

.status {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
  font-weight: 750;
}

.status.online { border-color: #acd0b9; color: var(--accent); background: var(--accent-soft); }
.panel { border: 1px solid var(--line); border-radius: 1.15rem; padding: 1.4rem; background: rgba(255, 254, 249, 0.92); box-shadow: 0 18px 60px rgba(42, 54, 46, 0.06); }
.auth-panel { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.auth-panel p, .panel > p { color: var(--muted); line-height: 1.5; }
.inline-form { display: flex; gap: 0.65rem; min-width: min(100%, 430px); }
.inline-form input { flex: 1; }
.token-entry { display: grid; flex: 1; gap: 0.35rem; }
.field-help { color: var(--muted); font-size: 0.72rem; font-weight: 500; }
.field-help code { color: var(--ink); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.9fr); gap: 1.25rem; align-items: start; }
.sidebar { display: grid; gap: 1.25rem; position: sticky; top: 1.25rem; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.version { border-radius: 999px; padding: 0.35rem 0.65rem; color: var(--accent); background: var(--accent-soft); font-size: 0.78rem; font-weight: 800; }

form { display: grid; gap: 1rem; }
label { display: grid; gap: 0.45rem; color: #37423b; font-size: 0.84rem; font-weight: 750; }
.hint { float: right; color: var(--muted); font-weight: 500; }
input, textarea { width: 100%; border: 1px solid #cdd5ce; border-radius: 0.7rem; padding: 0.72rem 0.8rem; color: var(--ink); background: white; outline: none; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23, 107, 77, 0.12); }
.form-actions { display: flex; align-items: center; gap: 0.9rem; color: var(--muted); font-size: 0.85rem; }
.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { min-width: 0; }
.warning { margin: 1rem 0 0; border-radius: 0.75rem; padding: 0.8rem; color: #76521e !important; background: var(--warning); font-size: 0.8rem; }

.share-list { display: grid; }
.share-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; border-top: 1px solid var(--line); padding: 0.85rem 0; }
.share-item:first-child { border-top: 0; }
.share-item div { display: grid; gap: 0.25rem; min-width: 0; }
.share-item strong { overflow: hidden; text-overflow: ellipsis; }
.share-item span, .empty { color: var(--muted); font-size: 0.76rem; }
.text-button { padding: 0; color: var(--muted); background: transparent; font-size: 0.8rem; }
.text-button:hover { color: var(--accent); background: transparent; }
.text-button.danger { color: var(--danger); }
.toast { position: fixed; right: 1.25rem; bottom: 1.25rem; transform: translateY(1rem); border-radius: 0.8rem; padding: 0.8rem 1rem; color: white; background: var(--ink); opacity: 0; pointer-events: none; transition: 160ms ease; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 800px) {
  .shell { padding-top: 1.75rem; }
  .hero, .auth-panel { display: grid; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

@media (max-width: 520px) {
  .inline-form, .copy-row { display: grid; }
  .panel { padding: 1rem; }
}
