:root {
  --bg: #f4f0e8;
  --bg-2: #ffffff;
  --text: #2a2620;
  --text-muted: #6b6359;
  --text-faint: #9c9285;
  --accent: #2d6e7e;
  --accent-2: #4a98a8;
  --accent-soft: #e6efee;
  --border: #e2dcd0;
  --danger: #c93434;
  --success: #38784a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 720px; margin: 0 auto; padding: 24px 24px 60px; }

header.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0; border-bottom: 1px solid var(--border); margin-bottom: 36px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Fraunces', Georgia, serif; font-size: 19px; font-weight: 500; color: var(--text);
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #2d6e7e 0%, #4a98a8 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 14px;
}
.session-info { font-size: 14px; color: var(--text-muted); }
.session-info button {
  background: transparent; border: 0; color: var(--accent); cursor: pointer;
  font-size: 14px; padding: 0; margin-left: 12px;
}

h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 32px; font-weight: 500; letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.subtitle { color: var(--text-muted); margin: 0 0 32px; font-size: 15px; }

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 22px;
}
.card h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px; font-weight: 500; margin: 0 0 6px;
}
.card .hint { color: var(--text-muted); font-size: 14px; margin: 0 0 20px; }

.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em;
}
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); font-family: inherit; font-size: 15px;
  transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
}
.field .help { font-size: 13px; color: var(--text-faint); margin-top: 6px; }

.btn {
  display: inline-block;
  background: var(--accent); color: #fff;
  border: 0; border-radius: 8px;
  padding: 12px 22px; font-size: 15px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.btn:hover { background: #235665; }
.btn:disabled { background: var(--text-faint); cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--accent-soft); border-color: var(--accent); }

.alert {
  padding: 12px 14px; border-radius: 8px; font-size: 14px;
  margin-bottom: 18px;
}
.alert.error   { background: #fbeaea; color: var(--danger); border: 1px solid #f4cccc; }
.alert.success { background: #e7f3eb; color: var(--success); border: 1px solid #bfddc9; }
.alert.info    { background: var(--accent-soft); color: #1f5160; border: 1px solid #c4dde2; }

.key-status {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--accent-soft);
  border-radius: 8px; font-size: 14px; color: #1f5160;
  margin-bottom: 14px;
}
.key-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.key-status.unset .dot { background: var(--text-faint); }

details.walkthrough {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0; margin-top: 14px; background: #fbf8f2;
}
details.walkthrough summary {
  padding: 14px 18px; cursor: pointer; font-weight: 500;
  font-size: 15px; color: var(--text); list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
details.walkthrough summary::after {
  content: '＋'; color: var(--text-faint); transition: transform 0.2s;
}
details.walkthrough[open] summary::after { content: '−'; }
details.walkthrough .body { padding: 0 22px 22px; font-size: 14.5px; line-height: 1.65; }
details.walkthrough h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 16px; font-weight: 500; margin: 18px 0 6px;
}
details.walkthrough ol { padding-left: 20px; margin: 8px 0 0; }
details.walkthrough li { margin: 8px 0; }
details.walkthrough .callout {
  background: #fff5e6; border: 1px solid #ecd9b3; border-radius: 8px;
  padding: 12px 14px; margin: 16px 0; font-size: 14px;
}
details.walkthrough code {
  background: #fff; padding: 2px 6px; border-radius: 4px;
  font-family: ui-monospace, Menlo, monospace; font-size: 13px;
  border: 1px solid var(--border);
}

footer.app-footer {
  margin-top: 50px; padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-faint);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
footer.app-footer a { color: var(--text-muted); }

.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;
}
