:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-muted: #f1f0ec;
  --text-primary: #1a1a18;
  --text-secondary: #6b6a64;
  --text-muted: #9a9890;
  --border: #e4e2dc;
  --border-strong: #c9c7bf;
  --accent: #3a6df0;
  --accent-bg: #eaf0fe;
  --danger: #d1453b;
  --danger-bg: #fbebea;
  --radius: 8px;
  --radius-lg: 12px;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

header.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-bottom: 0.5px solid var(--border);
}

header.nav .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}

header.nav .brand-icon {
  width: 26px;
  height: 26px;
  display: block;
}

header.nav nav a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 16px;
}

header.nav nav a.active {
  color: var(--text-primary);
  font-weight: 600;
}

.link-button {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 16px;
  background: none;
  border: none;
  padding: 0;
  height: auto;
  cursor: pointer;
}
.link-button:hover { background: none; color: var(--text-primary); }

h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 600; margin: 0; }
p.lead { color: var(--text-secondary); font-size: 14px; margin: 0 0 1.5rem; }

.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
}

.card.selected {
  border: 2px solid var(--accent);
}

button, .btn {
  font-family: inherit;
  font-size: 14px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button:hover { background: var(--surface-muted); }

button.primary {
  background: var(--text-primary);
  color: #fff;
  border: none;
}
button.primary:hover { opacity: 0.9; background: var(--text-primary); }

button:disabled {
  background: var(--surface-muted);
  color: var(--text-muted);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 1;
}
button:disabled:hover { background: var(--surface-muted); }

button.danger { color: var(--danger); border-color: var(--danger-bg); }

button.full { width: 100%; }

input[type=text], input[type=email], input[type=password], textarea, input[type=file] {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
}

textarea { min-height: 100px; resize: vertical; }

label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius);
  background: var(--accent-bg);
  color: var(--accent);
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.empty-box {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  width: 380px;
  max-width: 90vw;
}

#status { margin-top: 12px; font-size: 13px; color: var(--text-secondary); }

audio { width: 100%; margin-top: 12px; }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.divider { border-top: 0.5px solid var(--border); margin: 1.5rem 0 1rem; }

.legal-content { font-size: 13px; color: var(--text-secondary); }
.legal-content h1 { font-size: 18px; color: var(--text-primary); margin: 0 0 12px; }
.legal-content h2 { font-size: 15px; color: var(--text-primary); margin: 20px 0 6px; }
.legal-content p { margin: 0 0 10px; }
.legal-content ul, .legal-content ol { padding-left: 1.2rem; margin: 0 0 10px; }
.legal-content li { margin-bottom: 4px; }
.legal-content hr { border: none; border-top: 0.5px solid var(--border); margin: 20px 0; }
