/* ══════════════════════════════════════
   Settings & About pages
   Phase 3 · Nugget Nihongo
══════════════════════════════════════ */

/* ══ SETTINGS PAGE ══════════════════════════════ */

#settingsPage,
#aboutPage {
  padding: 1rem 0 calc(var(--nav-h) + 1rem + var(--safe-bottom));
  max-width: 640px;
  margin: 0 auto;
}

/* Section heading */
.sp-section {
  margin-bottom: 0.25rem;
}

.sp-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1.25rem 1rem 0.4rem;
}

/* Row list */
.sp-list {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  margin: 0 0.75rem;
}

.sp-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: default;
  transition: background 0.15s;
}

.sp-row:last-child {
  border-bottom: none;
}

.sp-row.sp-row--tap {
  cursor: pointer;
}

.sp-row.sp-row--tap:hover {
  background: var(--surface-2);
}

.sp-row.sp-row--tap:active {
  background: var(--surface-3);
}

.sp-row-icon {
  font-size: 1.1rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.sp-row-label {
  flex: 1;
}

.sp-row-label .sp-row-title {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text);
}

.sp-row-label .sp-row-sub {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 1px;
}

.sp-row-ctrl {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Toggle switch */
.sp-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--surface-3);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}

.sp-toggle::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  top: 3px;
  left: 3px;
  transition: transform 0.25s, background 0.25s;
  opacity: 0.7;
}

.sp-toggle:checked {
  background: var(--accent);
}

.sp-toggle:checked::before {
  transform: translateX(18px);
  background: #fff;
  opacity: 1;
}

/* Select dropdown inside settings */
.sp-select {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-size: var(--text-sm);
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  outline: none;
}

/* Chevron link */
.sp-chevron {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Danger row */
.sp-row.sp-row--danger .sp-row-title {
  color: var(--error-text);
}

/* Version pill */
.sp-version-pill {
  font-size: var(--text-xs);
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
}

/* ══ ⋯ MORE BOTTOM-SHEET ══════════════════════ */

/* ══ HEADER — icon action buttons ══════════ */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { border-color: var(--border-2); color: var(--accent-hot); }
.icon-btn:active { background: var(--surface-3); transform: scale(0.94); }

/* ══ LAINNYA BOTTOM SHEET (Claude Design) ══ */
#moreSheetOverlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(7,5,3,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: flex-end;
}
#moreSheetOverlay.open { display: flex; }

#moreSheet {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-2); border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  box-shadow: 0 -12px 60px rgba(0,0,0,0.55);
  animation: sheet-up 0.28s cubic-bezier(0.34,1.56,0.64,1);
  max-height: 82vh; overflow-y: auto;
}

@keyframes sheet-up {
  from { transform: translateY(110%); }
  to   { transform: translateY(0); }
}

.ms-handle-wrap {
  display: flex; justify-content: center; padding: 0.6rem 0 0.25rem;
}
.ms-handle {
  width: 44px; height: 5px; border-radius: 100px;
  background: var(--border-2);
}

/* User row */
.ms-user-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.9rem 1.25rem 1rem;
}
.ms-avatar {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; color: #1a0f00;
  flex-shrink: 0; box-shadow: var(--shadow-glow);
}
.ms-user-info { flex: 1; min-width: 0; }
.ms-user-name { font-size: 0.95rem; font-weight: 700; color: var(--text-bright, var(--text)); }
.ms-user-sub  { font-size: 0.68rem; color: var(--muted); margin-top: 1px; }
.ms-login-btn {
  padding: 0.55rem 1rem; border-radius: 100px;
  background: var(--grad); color: #1a0f00;
  border: none; font-weight: 700; font-size: 0.8rem; cursor: pointer;
  white-space: nowrap; box-shadow: var(--shadow-glow);
  transition: opacity 0.15s;
}
.ms-login-btn:active { opacity: 0.85; }

/* Theme selector */
.ms-theme-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 1.25rem 0.4rem;
}
.ms-theme-seg {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 4px;
  margin: 0 1.25rem 0.25rem;
  padding: 4px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ms-theme-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 0.65rem 0.5rem; border-radius: 10px; cursor: pointer;
  background: transparent; border: none;
  color: var(--muted); font-size: 0.72rem; font-weight: 600;
  font-family: var(--font-ui); transition: all 0.18s;
}
.ms-theme-btn.active {
  background: var(--surface-3);
  color: var(--accent-hot);
  box-shadow: var(--shadow-sm);
}

/* Divider */
.ms-divider {
  height: 1px; background: var(--border);
  margin: 0.75rem 0;
}

/* Nav items */
.ms-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer; transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ms-item:hover  { background: var(--surface-2); }
.ms-item:active { background: var(--surface-3); }

.ms-icon-wrap {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0;
}
/* Keep old .ms-icon for backward compat */
.ms-icon { width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0; }

.ms-item-text { flex: 1; min-width: 0; }
.ms-label { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.ms-sub   { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.ms-chevron { color: var(--muted-2, var(--muted)); flex-shrink: 0; }

.ms-app-info {
  text-align: center; font-size: 0.65rem; color: var(--muted-2, var(--muted));
  padding: 0.25rem 1rem 0.5rem;
}



/* ══ ABOUT PAGE ══════════════════════════════ */

.ab-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 1.5rem;
  text-align: center;
}

.ab-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-family: var(--font-jp);
  color: #fff;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-glow);
}

.ab-hero-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.ab-hero-version {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 0.25rem;
}

.ab-section {
  padding: 0 1rem 1.5rem;
}

.ab-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.6rem;
  padding: 0.5rem 0 0;
}

.ab-body {
  font-size: var(--text-base);
  color: var(--text);
  line-height: 1.7;
}

.ab-body p + p {
  margin-top: 0.75rem;
}

/* Pillars table */
.ab-pillars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ab-pillar {
  background: var(--surface);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
}

.ab-pillar-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.ab-pillar-sub {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 2px;
}

/* Citation collapsible */
.ab-cite-toggle {
  background: none;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-size: var(--text-sm);
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 0.5rem;
  transition: background 0.15s;
}

.ab-cite-toggle:hover { background: var(--surface-2); }

.ab-cite-list {
  display: none;
  margin-top: 0.5rem;
  background: var(--surface);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.7;
  max-height: 250px;
  overflow-y: auto;
}

.ab-cite-list.open { display: block; }

/* Attribution box */
.ab-attribution {
  background: var(--surface);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.6;
  margin-top: 0.5rem;
}

.ab-attribution a {
  color: var(--accent);
  text-decoration: none;
}

/* Credits grid */
.ab-credits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.ab-credit-tag {
  font-size: var(--text-xs);
  color: var(--muted);
  background: var(--surface);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
}
