/* ==========================================================================
   Settings (modules/features/settings.js)
   While Settings is open (body.settings-mode) its menu covers the app's
   sidebar: back, title, search, then Personal / Workspace / Help. Every page
   is the same: a title and one line about it, a divider, then rows with the
   label on the left and the control on the right.
   Component styles (rows, toggles, members table…) are in settings.js.
   ========================================================================== */

.sv-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── The menu, inside the sidebar ──────────────────────────────────────── */

.ss-panel {
  display: none;
}

/* The app's own menu items are hidden, not just covered: Safari on iPhone
   drew them through the panel */
body.settings-mode .sidebar-nav > :not(#settings-sidebar) {
  visibility: hidden;
}

body.settings-mode .ss-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  overflow: hidden;
}

.ss-head {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--header-height, 56px);
  flex-shrink: 0;
  padding: 0 10px;
  border-bottom: 1px solid var(--border-color);
}

.ss-back {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.ss-back:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.ss-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary);
}

.ss-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  margin: 10px 10px 4px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-muted);
  cursor: text;
}

.ss-search:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.ss-search .sv-icon {
  width: 14px;
  height: 14px;
}

.ss-search input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
}

.ss-search input:focus {
  border: 0;
  box-shadow: none;
}

.ss-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.ss-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 10px 16px;
}

.ss-group {
  margin: 14px 8px 4px;
  font-size: 12px;
  font-weight: 550;
  color: var(--text-muted);
}

.ss-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
}

.ss-item .sv-icon {
  color: var(--text-muted);
}

.ss-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.ss-item.is-active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
}

.ss-item.is-active .sv-icon {
  color: var(--text-primary);
}

.ss-item[hidden],
.ss-group[hidden],
.ss-empty[hidden] {
  display: none;
}

.ss-empty {
  margin: 12px 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.ss-panel :is(.ss-back, .ss-item):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* ── Page frame ────────────────────────────────────────────────────────── */

.sv-root {
  width: 100%;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

.sv-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.sv-section[hidden] {
  display: none !important;
}

.sv-section--support:not([hidden]) {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 160px);
}

.sv-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.sv-page-header .sv-page-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.sv-page-header .sv-page-subtitle {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.sv-page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* A second block on the same page (e.g. "Delete account") */
.sv-group-title {
  margin: 40px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary);
}

/* A row group that continues the one above it (General → Currency) */
.sv-field-group--spaced {
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.sv-static-value {
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-all;
}

.sv-footnote {
  margin-top: 20px;
}

/* Phones: the menu is in the slide-in sidebar; this opens it */
.sv-mobile-menu {
  display: none;
}

@media (max-width: 900px) {
  .sv-content {
    padding: 16px 16px 48px;
  }

  .sv-mobile-menu {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    margin: 0 0 12px -6px;
    padding: 0 8px 0 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 550;
    color: var(--text-muted);
    cursor: pointer;
  }

  .sv-mobile-menu:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
  }

  .sv-page-header .sv-page-title {
    font-size: 20px;
  }
}

/* ── Members: seats beside search ──────────────────────────────────────── */

.sv-seats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
  margin-left: auto;
}

.sv-seats-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sv-seats-label span {
  font-weight: 600;
  color: var(--text-primary);
}

/* ── What's new ────────────────────────────────────────────────────────── */

.sv-release {
  padding: 4px 0 24px;
}

.sv-release + .sv-release {
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.sv-release-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.sv-release-version {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary);
}

.sv-release-date {
  font-size: 13px;
  color: var(--text-muted);
}

.sv-release-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sv-release-items li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.sv-release-tag {
  flex-shrink: 0;
  min-width: 68px;
  padding: 1px 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.sv-release-tag--new { background: rgba(47, 95, 208, 0.10); color: var(--color-primary); }
.sv-release-tag--improved { background: rgba(22, 150, 90, 0.10); color: #16965a; }
.sv-release-tag--fixed { background: rgba(198, 132, 26, 0.12); color: #a86d10; }

/* ── Confirm before deleting ───────────────────────────────────────────── */

.sv-confirm {
  position: fixed;
  inset: 0;
  z-index: 10080;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 17, 23, 0.4);
  animation: sv-fade 0.15s ease both;
}

.sv-confirm-card {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.sv-confirm-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 650;
  color: var(--text-primary);
}

.sv-confirm-body {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.sv-confirm-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.sv-confirm-label strong {
  color: var(--text-primary);
  word-break: break-word;
}

.sv-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.sv-confirm .sv-danger-btn--filled:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@keyframes sv-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* The plan badge sits at its natural width above the plan name */
.sv-billing-plan-left .sv-plan-chip {
  align-self: flex-start;
}

/* ── Help & support chat: answers can have bold, lists and paragraphs ──── */

.sv-chat-answer p {
  margin: 0 0 8px;
}

.sv-chat-answer p:last-child,
.sv-chat-answer ul:last-child,
.sv-chat-answer ol:last-child {
  margin-bottom: 0;
}

.sv-chat-answer ul,
.sv-chat-answer ol {
  margin: 4px 0 8px;
  padding-left: 20px;
}

.sv-chat-answer li {
  margin-bottom: 3px;
}

/* Body text is already 550, so bold has to be clearly heavier to show */
.sv-chat-answer strong {
  font-weight: 750;
  color: var(--text-primary);
}
