﻿/* PresentTool™ Dashboard — view: settings (v3.7.0)
   Single-page scroll layout · sticky anchor-rail on desktop ·
   list-index on mobile. */

.view-settings {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}

/* ─── Anchor rail (desktop sidebar) ────────────────────── */
.settings-rail {
  background: var(--pt-surface-0);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-md);
  padding: 12px 0;
  position: sticky;
  top: 80px;
  box-shadow: var(--pt-shadow-card);
}
.settings-rail .rail-eyebrow {
  font-family: var(--pt-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pt-text-subtle);
  padding: 6px 16px 8px;
}
.settings-rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--pt-text-muted);
  font-weight: 500;
  text-decoration: none;
  border-left: 2px solid transparent;
  cursor: pointer;
}
.settings-rail a:hover {
  background: var(--pt-surface-1);
  color: var(--pt-text);
  text-decoration: none;
}
.settings-rail a.is-active {
  background: var(--pt-accent-soft);
  color: var(--pt-primary);
  border-left-color: var(--pt-primary);
  font-weight: 600;
}
.settings-rail a svg {
  width: 15px; height: 15px;
  flex: 0 0 15px;
}

/* ─── Content column ──────────────────────────────────── */
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.settings-content > header {
  margin-bottom: 4px;
}

/* ─── Section cards ───────────────────────────────────── */
.settings-section {
  background: var(--pt-surface-0);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-md);
  padding: 28px 32px;
  scroll-margin-top: 80px;
  box-shadow: var(--pt-shadow-card);
}
.settings-section .sec-head {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.settings-section .sec-head h2 {
  font-family: var(--pt-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 4px;
  letter-spacing: -0.015em;
  color: var(--pt-text);
}
.settings-section .sec-head .sub {
  font-size: 13px;
  color: var(--pt-text-muted);
  font-family: var(--pt-serif);
  font-style: italic;
  line-height: 1.45;
}

/* ─── Row primitive (label + body) ────────────────────── */
.set-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--pt-border);
  align-items: start;
}
.set-row:first-of-type { border-top: 0; padding-top: 4px; }
.set-row .row-lbl {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pt-text);
}
.set-row .row-lbl .desc {
  display: block;
  font-weight: 400;
  font-style: italic;
  font-family: var(--pt-serif);
  font-size: 12px;
  color: var(--pt-text-muted);
  margin-top: 4px;
  line-height: 1.5;
}
.set-row .row-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  position: relative;
}
.set-row .row-body.row-inline {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Save indicator pill */
.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--pt-mono);
  font-size: 11px;
  color: var(--pt-success);
  background: rgba(45,122,79,0.10);
  border: 1px solid rgba(45,122,79,0.22);
  padding: 3px 9px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.save-indicator.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.save-indicator svg { width: 11px; height: 11px; }
.save-indicator.is-error {
  color: var(--pt-destructive);
  background: rgba(176,58,46,0.08);
  border-color: rgba(176,58,46,0.22);
}
.save-indicator.is-saving {
  color: var(--pt-text-muted);
  background: var(--pt-surface-2);
  border-color: var(--pt-border);
}

/* Avatar + upload row */
.avatar-large {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--pt-primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pt-sans);
  font-size: 28px;
  font-weight: 600;
  flex: 0 0 80px;
  letter-spacing: 0.02em;
}
.avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.studio-logo-slot {
  width: 88px; height: 88px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pt-accent-soft), var(--pt-surface-2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pt-primary);
  font-family: var(--pt-serif);
  font-style: italic;
  font-size: 32px;
  font-weight: 500;
  border: 1px dashed var(--pt-border-strong);
  flex: 0 0 88px;
  overflow: hidden;
}
.studio-logo-slot img {
  width: 100%; height: 100%;
  object-fit: contain;
}

/* Language toggle (NL/EN segment) */
.lang-toggle {
  display: inline-flex;
  background: var(--pt-surface-2);
  border: 1px solid var(--pt-border);
  border-radius: 7px;
  padding: 3px;
  gap: 2px;
}
.lang-toggle button {
  background: transparent;
  border: 0;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--pt-text-muted);
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--pt-sans);
}
.lang-toggle button.is-active {
  background: var(--pt-surface-0);
  color: var(--pt-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Toggle switch */
.pt-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
}
.pt-toggle .track {
  width: 36px; height: 20px;
  background: var(--pt-border-strong);
  border-radius: 999px;
  position: relative;
  transition: background 0.15s ease;
  flex: 0 0 36px;
}
.pt-toggle .track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: left 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.pt-toggle.is-on .track { background: var(--pt-primary); }
.pt-toggle.is-on .track::after { left: 18px; }

/* Model + freq chips */
.model-chip-row,
.freq-radio-row {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--pt-border);
  border-radius: 8px;
  background: var(--pt-surface-0);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--pt-text);
}
.model-chip .lbl-sub {
  font-family: var(--pt-mono);
  font-size: 10px;
  color: var(--pt-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}
.model-chip > div { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.model-chip.is-active {
  border-color: var(--pt-primary);
  background: var(--pt-accent-soft);
  color: var(--pt-primary);
  box-shadow: 0 0 0 2px var(--pt-accent-soft);
}
.model-chip.is-active .lbl-sub { color: var(--pt-primary); opacity: 0.8; }
.model-chip svg { width: 14px; height: 14px; }

.freq-pill {
  padding: 7px 14px;
  border: 1px solid var(--pt-border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--pt-text-muted);
  background: var(--pt-surface-0);
  cursor: pointer;
  font-weight: 500;
}
.freq-pill.is-active {
  background: var(--pt-accent-soft);
  color: var(--pt-primary);
  border-color: var(--pt-accent-mid);
  font-weight: 600;
}

/* Notification rows */
.notif-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--pt-border);
  align-items: center;
}
.notif-row:first-of-type { border-top: 0; padding-top: 4px; }
.notif-row .left .ttl {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pt-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-row .left .ttl svg { width: 14px; height: 14px; color: var(--pt-primary); }
.notif-row .left .desc {
  font-size: 12.5px;
  color: var(--pt-text-muted);
  font-family: var(--pt-serif);
  font-style: italic;
  line-height: 1.5;
  margin-top: 4px;
}

/* Sessions table */
.sessions-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-md);
  overflow: hidden;
}
.sessions-table th, .sessions-table td {
  text-align: left;
  padding: 13px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--pt-border);
  vertical-align: middle;
}
.sessions-table th {
  font-family: var(--pt-mono);
  font-weight: 500;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pt-text-muted);
  background: var(--pt-surface-1);
}
.sessions-table tr:last-child td { border-bottom: 0; }
.sessions-table .device {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sessions-table .device .ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--pt-surface-2);
  color: var(--pt-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
}
.sessions-table .device .ico.is-current {
  background: var(--pt-accent-soft);
  color: var(--pt-primary);
}
.sessions-table .device .ico svg { width: 16px; height: 16px; }
.sessions-table .device .name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--pt-text);
}
.sessions-table .device .meta {
  font-family: var(--pt-mono);
  font-size: 11px;
  color: var(--pt-text-muted);
  display: block;
  margin-top: 2px;
}

/* Danger zone (privacy + sessions) */
.danger-zone {
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid rgba(176,58,46,0.20);
  background: rgba(176,58,46,0.04);
  border-radius: var(--pt-radius-md);
}
.danger-zone h3 {
  font-family: var(--pt-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  color: var(--pt-destructive);
  margin: 0 0 6px;
}
.danger-zone p {
  font-size: 12.5px;
  color: var(--pt-text-muted);
  margin: 0 0 14px;
  line-height: 1.55;
  font-family: var(--pt-serif);
  font-style: italic;
}
.danger-zone .row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px dashed rgba(176,58,46,0.18);
  flex-wrap: wrap;
}
.danger-zone .row:first-of-type { border-top: 0; padding-top: 0; }
.danger-zone .row .left { flex: 1; min-width: 200px; }
.danger-zone .row .left .ttl {
  font-weight: 600;
  color: var(--pt-text);
  font-size: 13.5px;
  margin-bottom: 2px;
}
.danger-zone .row .left .desc {
  font-size: 12px;
  color: var(--pt-text-muted);
  font-family: var(--pt-serif);
  font-style: italic;
  line-height: 1.5;
}

/* ─── Password change inline form ─────────────────────── */
.password-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--pt-surface-1);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-sm);
}
.password-form .field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.password-form .field-row label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--pt-text-muted);
}
.password-form .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ─── Delete-account modal ────────────────────────────── */
.set-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,18,14,0.55);
  backdrop-filter: blur(2px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: pt-modal-fade 0.16s ease-out;
}
.set-modal {
  background: var(--pt-surface-0);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-lg);
  box-shadow: var(--pt-shadow-modal);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.set-modal.is-destructive .head h3 { color: var(--pt-destructive); }
.set-modal .head {
  padding: 22px 24px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.set-modal .head h3 {
  font-family: var(--pt-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 4px;
  letter-spacing: -0.015em;
}
.set-modal .head .sub {
  font-size: 12.5px;
  color: var(--pt-text-muted);
}
.set-modal .head .close {
  background: transparent;
  border: 0;
  width: 28px; height: 28px;
  border-radius: 6px;
  color: var(--pt-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.set-modal .head .close:hover { background: var(--pt-surface-2); color: var(--pt-text); }
.set-modal .head .close svg { width: 14px; height: 14px; }
.set-modal .body {
  padding: 4px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.set-modal .body p { font-size: 13.5px; line-height: 1.55; margin: 0; }
.set-modal .body p.muted { color: var(--pt-text-muted); }
.set-modal .body p b { color: var(--pt-text); font-weight: 600; }
.set-modal .foot {
  padding: 14px 24px 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--pt-border);
  background: var(--pt-surface-1);
  flex-wrap: wrap;
}
.set-modal .cooldown-callout {
  padding: 12px 14px;
  background: rgba(160,114,42,0.08);
  border: 1px solid rgba(160,114,42,0.22);
  border-radius: var(--pt-radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--pt-text);
}
.set-modal .cooldown-callout .ico { color: var(--pt-warning); flex: 0 0 16px; padding-top: 1px; }
.set-modal .cooldown-callout .ico svg { width: 16px; height: 16px; }
.set-modal .cooldown-callout b { color: var(--pt-warning); font-weight: 600; }
.set-modal .cooldown-callout em {
  font-family: var(--pt-serif);
  font-style: italic;
  color: var(--pt-text-muted);
}
.set-modal .field-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--pt-text-muted);
  display: block;
  margin-bottom: 4px;
}

/* ─── Mobile responsive ──────────────────────────────── */
@media (max-width: 920px) {
  .view-settings {
    grid-template-columns: 1fr;
  }
  .settings-rail {
    position: static;
    display: flex;
    flex-direction: column;
    padding: 6px 0;
  }
  .settings-rail .rail-eyebrow { display: none; }
  .settings-rail a {
    padding: 14px 18px;
    font-size: 14px;
    border-left: 0;
    border-bottom: 1px solid var(--pt-border);
  }
  .settings-rail a:last-child { border-bottom: 0; }
  .settings-rail a.is-active {
    background: var(--pt-accent-soft);
    border-left: 0;
  }
  .settings-rail a::after {
    content: '›';
    margin-left: auto;
    color: var(--pt-text-subtle);
    font-size: 18px;
  }
  .settings-rail a.is-active::after { color: var(--pt-primary); }
}

@media (max-width: 768px) {
  .settings-section {
    padding: 22px 20px;
  }
  .set-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 0;
  }
  .sessions-table thead { display: none; }
  .sessions-table, .sessions-table tbody, .sessions-table tr, .sessions-table td {
    display: block;
    width: 100%;
  }
  .sessions-table tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--pt-border);
  }
  .sessions-table td {
    padding: 4px 0;
    border: 0;
  }
  .notif-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .danger-zone .row { flex-direction: column; align-items: flex-start; }
  .danger-zone .row .btn { width: 100%; justify-content: center; }
  .set-modal { max-width: 100%; }
  .set-modal-overlay { padding: 0; }
  .set-modal { max-height: 100vh; border-radius: 0; }
}

/* ── Language segmented control ──────────────────────────── */
.lang-seg { display: inline-flex; border: 1px solid var(--pt-border); border-radius: 6px; overflow: hidden; }
.lang-seg-btn { font-family: var(--pt-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; padding: 5px 12px; background: var(--pt-surface-0); color: var(--pt-text-muted); border: 0; cursor: pointer; }
.lang-seg-btn.is-active { background: var(--pt-primary); color: white; }
.lang-seg-btn:hover:not(.is-active) { background: var(--pt-surface-2); }

/* ── Dark mode pref row ───────────────────────────────────── */
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--pt-border); }
.pref-label { display: flex; flex-direction: column; gap: 2px; }
.pref-title { font-size: 13.5px; font-weight: 600; color: var(--pt-text); }
.pref-desc { font-family: var(--pt-serif); font-style: italic; font-size: 12px; color: var(--pt-text-muted); }
.toggle-btn { position: relative; width: 40px; height: 22px; background: var(--pt-surface-2); border: 1px solid var(--pt-border); border-radius: 11px; cursor: pointer; flex-shrink: 0; transition: background 0.18s, border-color 0.18s; }
.toggle-btn.is-on { background: var(--pt-primary); border-color: var(--pt-primary); }
.toggle-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: white; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform 0.18s; }
.toggle-btn.is-on .toggle-knob { transform: translateX(18px); }
