/* ==========================================================================
   Albums — shared design tokens (Apple Human Interface inspired)
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  /* System colors — light */
  --blue: #007aff;
  --blue-hover: #0068d9;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --yellow: #ffcc00;
  --purple: #af52de;
  --pink: #ff2d55;

  --label: #1d1d1f;
  --label-2: rgba(60, 60, 67, .72);
  --label-3: rgba(60, 60, 67, .45);
  --label-4: rgba(60, 60, 67, .22);

  --fill: rgba(120, 120, 128, .16);
  --fill-2: rgba(120, 120, 128, .10);
  --fill-3: rgba(118, 118, 128, .07);

  --separator: rgba(60, 60, 67, .14);
  --separator-strong: rgba(60, 60, 67, .24);

  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --bg-3: #ececf0;
  --bg-elevated: #ffffff;

  --sidebar: rgba(236, 236, 240, .72);
  --toolbar: rgba(255, 255, 255, .78);
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .88);
  --glass-border: rgba(255, 255, 255, .6);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 1px rgba(0,0,0,.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.06);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.18), 0 8px 20px rgba(0,0,0,.08);
  --shadow-sheet: 0 40px 100px rgba(0,0,0,.28), 0 0 0 .5px rgba(0,0,0,.12);

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-2xl: 28px;

  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-spring: cubic-bezier(.34, 1.36, .64, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #0a84ff;
    --blue-hover: #3d9bff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --yellow: #ffd60a;

    --label: #f5f5f7;
    --label-2: rgba(235, 235, 245, .7);
    --label-3: rgba(235, 235, 245, .42);
    --label-4: rgba(235, 235, 245, .18);

    --fill: rgba(120, 120, 128, .36);
    --fill-2: rgba(120, 120, 128, .24);
    --fill-3: rgba(118, 118, 128, .16);

    --separator: rgba(84, 84, 88, .5);
    --separator-strong: rgba(84, 84, 88, .8);

    --bg: #1c1c1e;
    --bg-2: #111113;
    --bg-3: #2c2c2e;
    --bg-elevated: #242426;

    --sidebar: rgba(36, 36, 40, .72);
    --toolbar: rgba(28, 28, 30, .78);
    --glass: rgba(40, 40, 44, .66);
    --glass-strong: rgba(44, 44, 48, .86);
    --glass-border: rgba(255, 255, 255, .08);

    --shadow-md: 0 4px 14px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.55), 0 8px 20px rgba(0,0,0,.3);
    --shadow-sheet: 0 40px 100px rgba(0,0,0,.6), 0 0 0 .5px rgba(255,255,255,.1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --blue: #0a84ff; --blue-hover: #3d9bff; --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --yellow: #ffd60a;
  --label: #f5f5f7; --label-2: rgba(235,235,245,.7); --label-3: rgba(235,235,245,.42); --label-4: rgba(235,235,245,.18);
  --fill: rgba(120,120,128,.36); --fill-2: rgba(120,120,128,.24); --fill-3: rgba(118,118,128,.16);
  --separator: rgba(84,84,88,.5); --separator-strong: rgba(84,84,88,.8);
  --bg: #1c1c1e; --bg-2: #111113; --bg-3: #2c2c2e; --bg-elevated: #242426;
  --sidebar: rgba(36,36,40,.72); --toolbar: rgba(28,28,30,.78); --glass: rgba(40,40,44,.66); --glass-strong: rgba(44,44,48,.86); --glass-border: rgba(255,255,255,.08);
  --shadow-md: 0 4px 14px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55), 0 8px 20px rgba(0,0,0,.3);
  --shadow-sheet: 0 40px 100px rgba(0,0,0,.6), 0 0 0 .5px rgba(255,255,255,.1);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  color: var(--label);
  background: var(--bg-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.006em;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: default; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
svg.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }
::selection { background: color-mix(in srgb, var(--blue) 30%, transparent); }

/* ---------- Typography ---------- */
.t-large-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.022em; line-height: 1.15; }
.t-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.018em; }
.t-headline { font-size: 13px; font-weight: 600; }
.t-sub { color: var(--label-2); }
.t-caption { font-size: 11px; color: var(--label-2); }
.t-tertiary { color: var(--label-3); }
.t-num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 12px; border-radius: 7px;
  font-weight: 500; font-size: 13px; white-space: nowrap;
  background: var(--bg-elevated); color: var(--label);
  box-shadow: 0 0 0 .5px var(--separator-strong), var(--shadow-sm);
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: color-mix(in srgb, var(--bg-elevated) 92%, var(--label)); }
.btn:active { transform: scale(.97); }
.btn .i { font-size: 15px; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(0,122,255,.3), inset 0 .5px 0 rgba(255,255,255,.25); }
.btn-primary:hover { background: var(--blue-hover); }
.btn-plain { background: transparent; box-shadow: none; color: var(--blue); }
.btn-plain:hover { background: var(--fill-3); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--label-2); }
.btn-ghost:hover { background: var(--fill-2); color: var(--label); }
.btn-lg { height: 36px; padding: 0 18px; font-size: 14px; border-radius: 9px; }
.btn-xl { height: 50px; padding: 0 26px; font-size: 17px; font-weight: 600; border-radius: 14px; }
.btn-icon { width: 28px; padding: 0; }
.btn-danger { color: var(--red); }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------- Segmented control ---------- */
.segmented {
  display: inline-flex; padding: 2px; border-radius: 8px; background: var(--fill-2);
  position: relative; gap: 0;
}
.segmented button {
  height: 24px; padding: 0 12px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--label);
  position: relative; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.segmented button + button::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--separator);
}
.segmented button.on { background: var(--bg-elevated); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
.segmented button.on::before, .segmented button.on + button::before { opacity: 0; }
.segmented .count { color: var(--label-3); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px;
  border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-orange { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.pill-green { color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.pill-blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 13%, transparent); }
.pill-gray { color: var(--label-2); background: var(--fill-2); }

/* ---------- Text fields ---------- */
.field {
  height: 28px; padding: 0 9px; border-radius: 7px; border: 0; outline: 0;
  background: var(--bg-elevated); box-shadow: 0 0 0 .5px var(--separator-strong), inset 0 1px 1px rgba(0,0,0,.03);
  transition: box-shadow .15s;
}
.field:focus { box-shadow: 0 0 0 .5px var(--blue), 0 0 0 3.5px color-mix(in srgb, var(--blue) 30%, transparent); }
.search {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 7px;
  background: var(--fill-2); color: var(--label-3); min-width: 200px;
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--label); }
.search input::placeholder { color: var(--label-3); }

/* ---------- Switch ---------- */
.switch { width: 38px; height: 22px; border-radius: 11px; background: var(--fill); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2), 0 0 0 .5px rgba(0,0,0,.04); transition: transform .25s var(--ease-spring); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(16px); }

/* ---------- Materials ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}

/* ---------- Thumbnails (mock photo tiles) ---------- */
.ph { background: var(--fill-2); background-size: cover; background-position: center; }

/* ---------- Design-review navigator (removed in the real app) ---------- */
.dnav {
  position: fixed; z-index: 9999; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 5px;
  border-radius: 14px; background: rgba(20, 20, 22, .82); color: #fff;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0,0,0,.35), 0 0 0 .5px rgba(255,255,255,.12);
  font-size: 12px; max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none;
}
.dnav::-webkit-scrollbar { display: none; }
.dnav .lbl { padding: 0 8px 0 6px; color: rgba(255,255,255,.5); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.dnav button { height: 26px; padding: 0 10px; border-radius: 9px; color: rgba(255,255,255,.75); white-space: nowrap; font-weight: 500; cursor: pointer; }
.dnav button:hover { background: rgba(255,255,255,.1); color: #fff; }
.dnav button.on { background: #fff; color: #000; }
.dnav .sep { width: 1px; height: 16px; background: rgba(255,255,255,.18); margin: 0 3px; flex: none; }
.dnav.hidden { transform: translate(-50%, 120px); }
@media (max-width: 700px) { .dnav { bottom: auto; top: 8px; } }
