/* ============================================================
   tommasocardile.com — iOS 17+ design system
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* iOS semantic backgrounds (light) */
  --bg:           #F2F2F7;
  --bg-2:         #FFFFFF;
  --bg-3:         #F9F9FB;
  --grouped-bg:   #F2F2F7;
  --grouped-bg-2: #FFFFFF;

  /* iOS labels (light) */
  --label:         #000000;
  --label-2:       rgba(60, 60, 67, 0.60);
  --label-3:       rgba(60, 60, 67, 0.30);
  --label-4:       rgba(60, 60, 67, 0.18);
  --separator:     rgba(60, 60, 67, 0.29);
  --separator-opaque: #C6C6C8;

  /* System colors */
  --blue:    #007AFF;
  --green:   #34C759;
  --red:     #FF3B30;
  --orange:  #FF9500;
  --yellow:  #FFCC00;
  --purple:  #AF52DE;
  --pink:    #FF2D55;
  --teal:    #5AC8FA;
  --indigo:  #5856D6;
  --gray:    #8E8E93;
  --gray-2:  #AEAEB2;
  --gray-3:  #C7C7CC;
  --gray-4:  #D1D1D6;
  --gray-5:  #E5E5EA;
  --gray-6:  #F2F2F7;

  /* Materials (light) */
  --thin-glass: rgba(255, 255, 255, 0.65);
  --reg-glass:  rgba(255, 255, 255, 0.78);
  --thick-glass:rgba(255, 255, 255, 0.92);

  /* Spring easing */
  --spring: cubic-bezier(0.25, 1, 0.5, 1);
  --spring-bouncy: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Radii */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Typography stack */
  --sf: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* App canvas */
  --canvas-max: 460px;

  /* Bar metrics */
  --status-h: 44px;
  --nav-h:    48px;
  --tab-h:    72px;
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #000000;
    --bg-2:         #1C1C1E;
    --bg-3:         #2C2C2E;
    --grouped-bg:   #000000;
    --grouped-bg-2: #1C1C1E;

    --label:    #FFFFFF;
    --label-2:  rgba(235, 235, 245, 0.60);
    --label-3:  rgba(235, 235, 245, 0.30);
    --label-4:  rgba(235, 235, 245, 0.18);
    --separator: rgba(84, 84, 88, 0.65);
    --separator-opaque: #38383A;

    --gray:    #8E8E93;
    --gray-2:  #636366;
    --gray-3:  #48484A;
    --gray-4:  #3A3A3C;
    --gray-5:  #2C2C2E;
    --gray-6:  #1C1C1E;

    --thin-glass:  rgba(28, 28, 30, 0.62);
    --reg-glass:   rgba(28, 28, 30, 0.78);
    --thick-glass: rgba(28, 28, 30, 0.92);
  }
}

/* ---------- Theme override classes (manual toggle) ---------- */
html[data-theme="light"] {
  --bg:#F2F2F7; --bg-2:#FFFFFF; --bg-3:#F9F9FB; --grouped-bg:#F2F2F7; --grouped-bg-2:#FFFFFF;
  --label:#000000; --label-2:rgba(60,60,67,0.60); --label-3:rgba(60,60,67,0.30); --label-4:rgba(60,60,67,0.18);
  --separator:rgba(60,60,67,0.29); --separator-opaque:#C6C6C8;
  --gray-4:#D1D1D6; --gray-5:#E5E5EA; --gray-6:#F2F2F7;
  --thin-glass:rgba(255,255,255,0.65); --reg-glass:rgba(255,255,255,0.78); --thick-glass:rgba(255,255,255,0.92);
}
html[data-theme="dark"] {
  --bg:#000000; --bg-2:#1C1C1E; --bg-3:#2C2C2E; --grouped-bg:#000000; --grouped-bg-2:#1C1C1E;
  --label:#FFFFFF; --label-2:rgba(235,235,245,0.60); --label-3:rgba(235,235,245,0.30); --label-4:rgba(235,235,245,0.18);
  --separator:rgba(84,84,88,0.65); --separator-opaque:#38383A;
  --gray-4:#3A3A3C; --gray-5:#2C2C2E; --gray-6:#1C1C1E;
  --thin-glass:rgba(28,28,30,0.62); --reg-glass:rgba(28,28,30,0.78); --thick-glass:rgba(28,28,30,0.92);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  background: #000;
}
body {
  margin: 0;
  font-family: var(--sf);
  font-size: 17px;
  line-height: 1.4;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "kern";
  letter-spacing: -0.01em;
}
img, video, iframe { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; padding: 0; }
::selection { background: var(--blue); color: #fff; }

/* ---------- Backdrop wallpaper for desktop framing ---------- */
.ios-backdrop {
  position: fixed; inset: 0;
  z-index: -1;
  background:
    radial-gradient(at 25% 20%, rgba(0, 122, 255, 0.18) 0%, transparent 55%),
    radial-gradient(at 80% 80%, rgba(175, 82, 222, 0.16) 0%, transparent 55%),
    radial-gradient(at 50% 50%, rgba(255, 45, 85, 0.08) 0%, transparent 60%),
    linear-gradient(160deg, #1C1C1E 0%, #000 100%);
}
@media (prefers-color-scheme: light) {
  .ios-backdrop {
    background:
      radial-gradient(at 25% 20%, rgba(0, 122, 255, 0.10) 0%, transparent 55%),
      radial-gradient(at 80% 80%, rgba(255, 149, 0, 0.10) 0%, transparent 55%),
      linear-gradient(160deg, #E5E5EA 0%, #C6C6C8 100%);
  }
}
html[data-theme="light"] .ios-backdrop {
  background:
    radial-gradient(at 25% 20%, rgba(0, 122, 255, 0.10) 0%, transparent 55%),
    radial-gradient(at 80% 80%, rgba(255, 149, 0, 0.10) 0%, transparent 55%),
    linear-gradient(160deg, #E5E5EA 0%, #C6C6C8 100%);
}
html[data-theme="dark"] .ios-backdrop {
  background:
    radial-gradient(at 25% 20%, rgba(0, 122, 255, 0.18) 0%, transparent 55%),
    radial-gradient(at 80% 80%, rgba(175, 82, 222, 0.16) 0%, transparent 55%),
    linear-gradient(160deg, #1C1C1E 0%, #000 100%);
}

/* ---------- App canvas (the "phone") ---------- */
.app {
  position: relative;
  width: 100%;
  max-width: var(--canvas-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
@media (min-width: 720px) {
  .app {
    margin: 28px auto;
    border-radius: 44px;
    overflow: hidden;
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
    box-shadow:
      0 24px 60px rgba(0,0,0,0.45),
      0 0 0 8px rgba(20,20,22,0.85),
      0 0 0 9px rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
  }
}

/* ---------- Status bar ---------- */
.status-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--status-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  font-family: var(--sf);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--label);
  background: var(--thin-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding-top: env(safe-area-inset-top);
}
.status-bar .clock { font-variant-numeric: tabular-nums; }
.status-bar .right { display: inline-flex; align-items: center; gap: 6px; }
.status-bar .right svg { display: block; }

/* ---------- Navigation bar ---------- */
.nav-bar {
  position: sticky;
  top: var(--status-h);
  z-index: 40;
  min-height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6px 16px;
  background: var(--thin-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid var(--separator);
}
.nav-bar .leading,
.nav-bar .trailing { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }
.nav-bar .leading { justify-self: start; }
.nav-bar .trailing { justify-self: end; }
.nav-bar .title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--label);
  text-align: center;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  max-width: 60vw;
}
.nav-bar .back {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--blue);
  font-size: 17px;
  font-weight: 400;
  padding: 6px 4px;
  transition: opacity .15s var(--spring);
}
.nav-bar .back:active { opacity: 0.4; }
.nav-bar .back svg { width: 14px; height: 22px; }
.nav-bar .icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  color: var(--blue);
  border-radius: 8px;
  transition: background .15s var(--spring), opacity .15s var(--spring);
}
.nav-bar .icon-btn:active { opacity: 0.4; background: var(--gray-5); }

/* Large title (iOS 11+ style) */
.large-title {
  padding: 8px 20px 12px;
  font-family: var(--sf);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--label);
}

/* ---------- Tab bar (bottom) ---------- */
.tab-bar {
  position: sticky;
  bottom: 0;
  z-index: 50;
  margin-top: auto;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--reg-glass);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 0.5px solid var(--separator);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  font-size: 10px;
  letter-spacing: 0;
  color: var(--label-2);
  padding-top: 6px;
  transition: color .15s var(--spring), transform .15s var(--spring);
}
.tab svg { width: 26px; height: 26px; stroke-width: 1.6; }
.tab:active { transform: scale(0.92); }
.tab.is-active { color: var(--blue); }
.tab.is-active svg { stroke-width: 2; }

/* ---------- Content ---------- */
.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}
.section {
  padding: 8px 0 24px;
}
.section-header {
  padding: 24px 20px 8px;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--label-2);
  font-weight: 500;
}
.section-footer {
  padding: 8px 20px 20px;
  font-size: 13px;
  color: var(--label-2);
  line-height: 1.4;
}

/* ---------- Inset grouped list (iOS Settings-style) ---------- */
.list {
  background: var(--bg-2);
  margin: 0 16px;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 0.5px 0 var(--separator) inset;
}
.list .row {
  display: flex; align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  position: relative;
  font-size: 17px;
  color: var(--label);
  letter-spacing: -0.01em;
  transition: background .12s var(--spring);
}
.list .row + .row::before {
  content: "";
  position: absolute;
  left: 16px; right: 0; top: 0;
  height: 0.5px;
  background: var(--separator);
}
.list a.row:active,
.list button.row:active { background: var(--gray-5); }
.list .row .lead-icon {
  width: 30px; height: 30px;
  margin-right: 12px;
  border-radius: 7px;
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.list .row .lead-icon svg { width: 18px; height: 18px; stroke-width: 2; }
.list .row .label-stack { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.list .row .label-stack .label { color: var(--label); font-size: 17px; }
.list .row .label-stack .sub { color: var(--label-2); font-size: 14px; margin-top: 2px; }
.list .row .value {
  margin-left: auto;
  color: var(--label-2);
  font-size: 17px;
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.list .row .chevron {
  margin-left: 6px;
  color: var(--label-3);
}
.list .row .chevron svg { width: 12px; height: 18px; stroke-width: 2; }
.list .row.tappable { cursor: pointer; }

/* Color tokens for lead icons */
.tint-blue   { background: var(--blue); }
.tint-green  { background: var(--green); }
.tint-red    { background: var(--red); }
.tint-orange { background: var(--orange); }
.tint-yellow { background: var(--yellow); }
.tint-purple { background: var(--purple); }
.tint-pink   { background: var(--pink); }
.tint-teal   { background: var(--teal); }
.tint-indigo { background: var(--indigo); }
.tint-gray   { background: var(--gray); }

/* ---------- Cards ---------- */
.card {
  margin: 8px 16px;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
@media (prefers-color-scheme: dark) {
  .card { box-shadow: 0 0 0 0.5px var(--separator); }
}
.card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--gray-5);
}
.card-image img,
.card-image video,
.card-image iframe {
  width: 100%; height: 100%;
  object-fit: cover;
  border: 0;
}
.card-image .badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.card-body { padding: 14px 16px 16px; }
.card-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 6px;
}
.card-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--label);
  margin: 0 0 4px;
}
.card-sub {
  font-size: 14px;
  color: var(--label-2);
  margin: 0 0 8px;
}
.card-body p {
  font-size: 15px;
  color: var(--label);
  margin: 0;
  line-height: 1.45;
}
a.card { display: block; transition: transform .2s var(--spring); }
a.card:hover { transform: translateY(-2px); }
a.card:active { transform: scale(0.985); }

/* ---------- Hero card (Home) ---------- */
.hero {
  margin: 8px 16px 12px;
  padding: 24px;
  background: linear-gradient(155deg, var(--blue) 0%, var(--purple) 100%);
  color: #fff;
  border-radius: var(--r-xl);
  box-shadow: 0 14px 40px rgba(0, 80, 200, 0.32);
}
.hero h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.hero .role {
  margin-top: 8px;
  font-size: 15px;
  opacity: 0.92;
  letter-spacing: -0.01em;
}
.hero .meta {
  margin-top: 22px;
  font-size: 12px;
  font-family: var(--mono);
  opacity: 0.75;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  transition: transform .12s var(--spring), opacity .12s var(--spring);
}
.btn:active { transform: scale(0.96); opacity: 0.9; }
.btn-secondary {
  background: var(--gray-5);
  color: var(--label);
}
.btn-tinted {
  background: rgba(0, 122, 255, 0.15);
  color: var(--blue);
}
.btn-block { display: flex; width: 100%; }
.btn-row {
  display: flex; gap: 10px; padding: 0 16px;
}

/* ---------- Filter bar (segmented) ---------- */
.segmented {
  margin: 10px 16px 4px;
  display: flex;
  background: var(--gray-5);
  padding: 2px;
  border-radius: 9px;
  font-size: 13px;
}
.segmented button {
  flex: 1;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--label);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background .15s var(--spring), color .15s var(--spring);
}
.segmented button.is-active {
  background: var(--bg-2);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Search field */
.search {
  margin: 10px 16px;
  position: relative;
}
.search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 0;
  background: var(--gray-5);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  color: var(--label);
  letter-spacing: -0.01em;
}
.search input::placeholder { color: var(--label-2); }
.search input:focus { outline: none; background: var(--bg-2); box-shadow: 0 0 0 0.5px var(--separator); }
.search svg {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--label-2);
  pointer-events: none;
}

/* Chips */
.chip-row {
  display: flex; gap: 8px;
  padding: 4px 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--gray-5);
  border-radius: 999px;
  font-size: 13px;
  color: var(--label);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.chip.is-active { background: var(--blue); color: #fff; }

/* ---------- Photo grid (Archive) ---------- */
.library-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 14px;
  padding: 0 16px 8px;
}
.library-album {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  color: var(--label);
}
.library-album-cover {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: var(--gray-5);
  box-shadow:
    0 0 0 0.5px var(--separator),
    0 10px 24px rgba(0, 0, 0, 0.08);
}
.library-album-cover::before,
.library-album-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.library-album-cover::before {
  z-index: 2;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 34%);
}
.library-album-cover::after {
  z-index: 3;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.18);
}
.library-album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s var(--spring), opacity .2s var(--spring);
}
.library-album:active .library-album-cover img {
  transform: scale(0.985);
  opacity: 0.9;
}
.library-album-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.library-album-count {
  margin-top: -4px;
  font-size: 14px;
  color: var(--label-2);
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  margin: 0 16px 18px;
  padding: 2px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--separator-opaque);
  box-shadow:
    0 0 0 0.5px var(--separator),
    0 10px 24px rgba(0, 0, 0, 0.06);
}
.photo-grid .photo {
  aspect-ratio: 1 / 1;
  background: var(--gray-5);
  position: relative;
  overflow: hidden;
}
.photo-grid .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .22s var(--spring), opacity .18s var(--spring);
}
.photo-grid .photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 36%);
  pointer-events: none;
}
.photo-grid .photo:active img {
  opacity: 0.88;
  transform: scale(0.985);
}

/* Album cover */
.album {
  margin: 0 16px 12px;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px;
  background: transparent;
  border-radius: 18px;
}
.album-cover {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--gray-5);
  box-shadow:
    0 0 0 0.5px var(--separator),
    0 10px 24px rgba(0, 0, 0, 0.08);
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-info .album-title { font-size: 17px; font-weight: 600; color: var(--label); letter-spacing: -0.02em; }
.album-info .album-sub  { font-size: 14px; color: var(--label-2); margin-top: 3px; }
.album-info .album-meta { font-family: var(--mono); font-size: 11px; color: var(--label-3); margin-top: 5px; letter-spacing: 0.08em; text-transform: uppercase; }

@media (min-width: 480px) {
  .library-index {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .photo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Stats card ---------- */
.stats {
  margin: 8px 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.stat {
  background: var(--bg-2);
  border-radius: var(--r-md);
  padding: 16px;
}
.stat .num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--label);
  line-height: 1;
}
.stat .num .plus { font-size: 0.55em; vertical-align: super; font-weight: 600; }
.stat .label {
  font-size: 12px;
  color: var(--label-2);
  margin-top: 8px;
  line-height: 1.35;
  letter-spacing: -0.005em;
}
.stat.tint-card .num { color: var(--blue); }
.stat .icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: grid; place-items: center;
  margin-bottom: 12px;
  color: #fff;
}
.stat .icon svg { width: 16px; height: 16px; stroke-width: 2; }

/* ---------- Notification / now-playing-style banner ---------- */
.banner {
  margin: 10px 16px;
  padding: 14px 16px;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.banner .icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.banner .body { flex: 1; min-width: 0; }
.banner .title { font-weight: 600; font-size: 15px; color: var(--label); letter-spacing: -0.01em; }
.banner .sub { font-size: 13px; color: var(--label-2); margin-top: 2px; }
.banner .time { font-size: 11px; color: var(--label-3); align-self: flex-start; font-family: var(--mono); letter-spacing: 0.04em; }

/* ---------- Notes-style writing surface ---------- */
.notes {
  background: var(--bg-2);
  margin: 0 16px;
  border-radius: var(--r-lg);
  padding: 24px 22px 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.notes h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--label);
}
.notes .date {
  font-size: 13px;
  color: var(--label-2);
  margin-bottom: 14px;
}
.notes p {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 12px;
  color: var(--label);
  letter-spacing: -0.005em;
}
.notes p strong { font-weight: 600; }

/* ---------- Avatar ---------- */
.avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  overflow: hidden;
  margin: 8px auto 12px;
  background: var(--gray-5);
  border: 0.5px solid var(--separator);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head { text-align: center; padding: 16px 16px 4px; }
.profile-head .display-name {
  font-size: 22px; font-weight: 700; letter-spacing: -0.025em; color: var(--label);
}
.profile-head .display-role {
  font-size: 14px; color: var(--label-2); margin-top: 2px;
}

/* ---------- Sheet (modal that slides up) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0;
  z-index: 90;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--spring);
}
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(100%);
  width: min(100%, var(--canvas-max));
  z-index: 100;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.30);
  transition: transform .35s var(--spring);
  max-height: 86vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.is-open { transform: translateX(-50%) translateY(0); }
.sheet .grabber {
  width: 36px; height: 5px;
  background: var(--gray-3);
  border-radius: 3px;
  margin: 8px auto 4px;
}
.sheet .sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 0.5px solid var(--separator);
}
.sheet .sheet-head .title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.sheet .sheet-head button { color: var(--blue); font-size: 17px; }

/* ---------- Misc ---------- */
.spacer-xs { height: 8px; }
.spacer-sm { height: 16px; }
.spacer-md { height: 24px; }
.spacer-lg { height: 48px; }

.text-center { text-align: center; }
.text-secondary { color: var(--label-2); }
.text-mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; }

/* Toggle */
.toggle {
  width: 51px; height: 31px;
  background: var(--gray-4);
  border-radius: 999px;
  position: relative;
  transition: background .25s var(--spring);
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 27px; height: 27px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform .25s var(--spring), background .25s var(--spring);
}
.toggle.is-on { background: var(--green); }
.toggle.is-on::after { transform: translateX(20px); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
