/* Settings, arranged like iOS: a list of sections on the left, the chosen one on the
   right. On a phone the list is the whole screen and a section slides over it.
   Every rule starts :root[data-theme] to outrank student-mono.css. */

:root[data-theme] .st-shell {
  display: block; width: 100%; max-width: 1080px; margin: 0 auto;
  padding: 0 16px 120px;
}

/* ---- The list ---------------------------------------------------------- */
:root[data-theme] .st-title {
  margin: 10px 4px 18px; font: 400 clamp(34px, 7vw, 44px)/1.05 var(--mono-serif);
  color: var(--ag-text);
}
:root[data-theme] .st-me {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px;
  border: 1px solid var(--ag-hairline); border-radius: 22px; background: var(--ag-bg);
  text-align: left; cursor: pointer; color: inherit;
  transition: border-color .2s, background-color .2s;
}
:root[data-theme] .st-me:hover { border-color: var(--ag-hairline-strong); }
:root[data-theme] .st-me .set-avatar {
  width: 58px !important; height: 58px !important; flex: none; font-size: 24px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--hue-blue) !important; color: #ffffff !important; font-weight: 600;
}
:root[data-theme] .st-me-text { flex: 1; min-width: 0; }
:root[data-theme] .st-me-text h2 { margin: 0; font-size: 19px; font-weight: 600; color: var(--ag-text); overflow-wrap: anywhere; }
:root[data-theme] .st-me-text p { margin: 2px 0 0; font-size: 14.5px; color: var(--ag-text-3); overflow-wrap: anywhere; }
:root[data-theme] .st-me .set-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

/* Grouped rows, the iOS inset-list look: one rounded container, hairlines between. */
:root[data-theme] .st-group {
  margin-top: 18px; border: 1px solid var(--ag-hairline); border-radius: 18px;
  background: var(--ag-bg); overflow: hidden;
}
:root[data-theme] .st-row {
  width: 100%; display: flex; align-items: center; gap: 13px; min-height: 54px;
  padding: 8px 14px; border: 0; background: transparent; color: var(--ag-text);
  text-align: left; text-decoration: none; cursor: pointer; font: inherit;
  position: relative; transition: background-color .18s;
}
/* The hairline starts after the icon, the way iOS indents it. */
:root[data-theme] .st-row + .st-row::before {
  content: ''; position: absolute; top: 0; left: 59px; right: 0; height: 1px;
  background: var(--ag-hairline);
}
:root[data-theme] .st-row:hover { background: var(--mono-soft); }
:root[data-theme] .st-row:focus-visible, :root[data-theme] .st-me:focus-visible {
  outline: 2px solid var(--hue-blue); outline-offset: -2px;
}
:root[data-theme] .st-row-label { flex: 1; font-size: 16px; font-weight: 500; }
:root[data-theme] .st-row-value { font-size: 15px; color: var(--ag-text-3); }
:root[data-theme] .st-chev { font-size: 20px; color: var(--ag-text-3); }
:root[data-theme] .st-out .st-row-label { color: var(--hue-red); }

/* The coloured square behind each icon: the one place the list uses colour. */
:root[data-theme] .st-tile {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 9px; background: var(--tile); color: #ffffff;
}
:root[data-theme] .st-tile .material-symbols-outlined {
  font-size: 19px; font-variation-settings: 'wght' 500, 'FILL' 1;
}

/* The selected row, on a laptop where list and detail sit side by side. */
:root[data-theme] .st-row.is-on { background: var(--mono-soft-2); }
:root[data-theme] .st-me.is-on { border-color: var(--hue-blue); }

/* ---- The detail -------------------------------------------------------- */
:root[data-theme] .st-detail { display: none; }
:root[data-theme] .st-pane[hidden] { display: none !important; }
:root[data-theme] .st-pane { animation: st-in .38s var(--mono-ease) both; }
@keyframes st-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

:root[data-theme] .st-pane-h {
  display: flex; align-items: center; gap: 12px; margin: 6px 0 18px;
  font: 400 clamp(28px, 5vw, 34px)/1.1 var(--mono-serif); color: var(--ag-text);
}
:root[data-theme] .st-pane-h .st-tile { width: 38px; height: 38px; border-radius: 11px; }
:root[data-theme] .st-pane-h .st-tile .material-symbols-outlined { font-size: 22px; }

:root[data-theme] .st-back {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: 0 0 6px -6px;
  padding: 0 8px; border: 0; border-radius: 12px; background: none;
  color: var(--hue-blue); font: 500 16px var(--ag-font); cursor: pointer;
}
:root[data-theme] .st-back .material-symbols-outlined { font-size: 20px; }

/* Buttons that do something take the blue, like iOS actions. */
:root[data-theme] .st-go {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--hue-blue); color: #ffffff; font: 600 15.5px var(--ag-font);
  cursor: pointer; transition: transform .15s var(--mono-ease), opacity .2s;
}
:root[data-theme] .st-go:active { transform: scale(.975); }
:root[data-theme] .st-go:disabled { opacity: .55; cursor: default; }
:root[data-theme] .st-go .material-symbols-outlined { font-size: 20px; }
:root[data-theme] .st-go-quiet {
  background: transparent; color: var(--hue-blue); border: 1px solid var(--ag-hairline-strong);
}
:root[data-theme] #btn-upgrade-pro { background: var(--hue-amber); color: #1a1100; }

:root[data-theme] .st-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px 20px; padding-top: 18px;
}
:root[data-theme] .st-cta .set-note { flex: 1 1 240px; }
:root[data-theme] .set-benefits li .material-symbols-outlined { color: var(--hue-green) !important; }
:root[data-theme] .set-pill.is-pro { background: var(--hue-amber) !important; color: #1a1100 !important; border-color: var(--hue-amber) !important; }

/* ---- Phone: the list, then a section pushed over it -------------------- */
@media (max-width: 859px) {
  :root[data-theme] .st-shell.is-open .st-nav { display: none; }
  :root[data-theme] .st-shell.is-open .st-detail { display: block; }
  :root[data-theme] .st-row.is-on, :root[data-theme] .st-me.is-on { background: transparent; border-color: var(--ag-hairline); }
  :root[data-theme] .st-cta .st-go, :root[data-theme] .set-actions .st-go { width: 100%; }
}

/* ---- Laptop: side by side ---------------------------------------------- */
@media (min-width: 860px) {
  :root[data-theme] .st-shell {
    display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 36px;
    align-items: start; padding-top: 8px;
  }
  :root[data-theme] .st-nav { position: sticky; top: 72px; }
  :root[data-theme] .st-detail { display: block; padding-top: 70px; }
  :root[data-theme] .st-back { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-theme] .st-pane { animation: none; }
}
