/* Settings: sticky section menu beside setting cards; also the shared panel pieces (refs, memories, voices, threads). */
.settings-web { max-width: 1120px; }
.st-head { margin-bottom: 26px; }
.st-head h1 { font-family: var(--display); font-weight: 700; font-size: 34px; margin: 0 0 6px; letter-spacing: -.03em; }
.st-head p { margin: 0; }
.st-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 40px; align-items: start; }
.st-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; }
.st-me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--side); }
.st-me div { min-width: 0; display: flex; flex-direction: column; }
.st-me strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-me small { font-size: 12px; color: var(--muted); }
.st-group { display: flex; flex-direction: column; gap: 1px; }
.st-group-label { padding: 0 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.st-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none; justify-content: flex-start; box-shadow: none; }
.st-link .icon { width: 17px; height: 17px; color: var(--muted); }
.st-link:hover { background: var(--hover); color: var(--ink); box-shadow: none; }
.st-link:active { transform: none; }
.st-link.active { background: var(--raise); color: var(--ink); font-weight: 650; }
.st-link.active .icon { color: var(--b2); }
.st-link.signout { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; padding-top: 12px; }
.st-mobile-nav { display: none; }
.st-content { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.st-title h2 { margin: 0; font-family: var(--display); font-size: 22px; letter-spacing: -.02em; }
.st-title p { margin: 4px 0 0; font-size: 14px; }
.st-panel { display: flex; flex-direction: column; gap: 18px; }
.st-panel .skeleton { padding: 0; }

.st-card, .set-group { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.set-group { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.st-card-head { padding: 18px 20px 4px; }
.st-card-head h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.st-card-head p { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.st-rows { display: flex; flex-direction: column; padding: 4px 20px; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 0; }
.st-row + .st-row, .st-rows > * + .st-actions, .st-form .st-row + .st-row { border-top: 1px solid var(--line); }
.st-row.stack { flex-direction: column; align-items: stretch; gap: 12px; }
.st-label { min-width: 0; flex: 1; }
.st-label strong { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.st-label p { margin: 3px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.st-row.danger .st-label strong { color: var(--danger); }
.st-control { flex: none; display: flex; align-items: center; gap: 8px; max-width: 55%; }
.st-control input:not([type="checkbox"]), .st-control select { width: 300px; max-width: 100%; }
.st-control code { font-size: 12px; padding: 4px 8px; border-radius: 8px; background: var(--raise); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 0; }
.st-form { display: flex; flex-direction: column; }
.pill.ok { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.pill .icon { width: 12px; height: 12px; stroke-width: 2.6; }

.st-identity { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 18px; background: linear-gradient(120deg, color-mix(in srgb, var(--b1) 12%, var(--card)), color-mix(in srgb, var(--b3) 10%, var(--card))); border: 1px solid var(--line); }
.st-identity h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--display); font-size: 20px; }
.st-identity p { margin: 2px 0; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; box-shadow: 0 8px 24px color-mix(in srgb, var(--b2) 30%, transparent); }

.st-plan { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px; border-radius: 18px; color: #fff; background: var(--brand); box-shadow: 0 12px 34px color-mix(in srgb, var(--b2) 30%, transparent); }
.st-plan small { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.st-plan h3 { margin: 2px 0; font-family: var(--display); font-size: 26px; }
.st-plan p { margin: 0; opacity: .92; }
.st-plan .button.brand { background: #fff; color: #111; box-shadow: none; }
.st-plan button.ghost { background: rgba(255, 255, 255, .18); color: #fff; border-color: transparent; }
.st-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 10px 0 16px; }
.st-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; background: var(--side); }
.st-stat strong { font-family: var(--display); font-size: 22px; }
.st-stat small { font-size: 12.5px; color: var(--muted); }
.st-activity { display: flex; align-items: center; gap: 12px; padding: 11px 0; font-size: 14px; }
.st-activity + .st-activity { border-top: 1px solid var(--line); }
.st-activity .grow { display: flex; flex-direction: column; min-width: 0; }
.st-activity strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-activity small { font-size: 12px; }
.st-activity .plus { color: var(--success); font-weight: 700; }

.st-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.st-theme { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 10px 12px; border-radius: 14px; background: var(--side); color: var(--ink); border: 2px solid transparent; box-shadow: none; font-weight: 600; }
.st-theme:hover { box-shadow: none; background: var(--hover); }
.st-theme.on { border-color: var(--b2); }
.st-swatch { display: grid; grid-template-columns: 1fr 2fr; grid-template-rows: 1fr 1fr; gap: 5px; height: 74px; padding: 7px; border-radius: 10px; background: #fff; border: 1px solid #e8e8ec; }
.st-swatch i { border-radius: 5px; background: #ececf0; }
.st-swatch i:first-child { grid-row: span 2; background: #f3f3f5; }
.st-theme.dark .st-swatch { background: #131314; border-color: #2c2e31; }
.st-theme.dark .st-swatch i { background: #26282a; }
.st-theme.dark .st-swatch i:first-child { background: #1b1c1d; }
.st-theme.system .st-swatch { background: linear-gradient(110deg, #fff 50%, #131314 50%); }
.st-keys { display: inline-flex; gap: 4px; }
.st-keys kbd { min-width: 26px; padding: 3px 7px; border-radius: 7px; border: 1px solid var(--strong-line); border-bottom-width: 2px; background: var(--card); font: 600 12px var(--sans); text-align: center; }

.tag { font-size: 9px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--link) 14%, transparent); color: var(--link); }
.tag.pro { background: var(--brand); color: #fff; }
.row.end { justify-content: flex-end; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.ref { position: relative; margin: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--raise); }
.ref img { width: 100%; height: 100%; object-fit: cover; }
.ref .icon-button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; background: rgba(0, 0, 0, .5); color: #fff; }
.ref.add { flex-direction: column; gap: 4px; border: 1.5px dashed var(--strong-line); color: var(--muted); box-shadow: none; font-weight: 600; font-size: 12.5px; }
.mem-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--side); font-size: 14px; }
.mem-row.link { width: 100%; justify-content: flex-start; color: var(--ink); font-weight: 500; box-shadow: none; border: 0; }
.mem-row.link:hover { background: var(--hover); box-shadow: none; }
.mem-row.link .icon { width: 15px; height: 15px; color: var(--muted); }
.voice-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.voice-row + .voice-row { padding-top: 12px; border-top: 1px solid var(--line); }
.voice-row select { width: min(260px, 52%); padding: 7px 10px; }
.thread { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 80%; padding: 10px 13px; border-radius: 16px 16px 16px 5px; background: var(--side); font-size: 14px; white-space: pre-wrap; }
.msg.me { align-self: flex-end; border-radius: 16px 16px 5px 16px; background: color-mix(in srgb, var(--link) 12%, var(--card)); }

@media (max-width: 980px) {
  .st-layout { grid-template-columns: 1fr; }
  .st-nav { display: none; }
  .st-mobile-nav { display: block; width: 100%; margin-bottom: 16px; }
}
@media (max-width: 640px) {
  .st-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .st-control { max-width: none; }
  .st-control input:not([type="checkbox"]), .st-control select { width: 100%; }
  .st-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-themes { gap: 8px; }
}
.st-row.stack .st-control { max-width: none; }
.st-row.stack .st-themes { width: 100%; max-width: 560px; }
