/* ClipHeaven dashboard: the "mid · shaded" look. */
:root {
  --page: linear-gradient(180deg, #eaedf3 0%, #dde1ea 100%);
  --page-flat: #e3e6ed;
  --surface: linear-gradient(180deg, #f8f9fc 0%, #eef1f6 100%);
  --surface-flat: #f3f5f9;
  --border: #d3d8e2;
  --ink: #121726;
  --ink-soft: #363c4e;
  --muted: #4a5163;
  --hero: linear-gradient(155deg, #3d4663 0%, #2a3047 50%, #1f2336 100%);
  --hero-muted: #c8cddb;
  --hero-track: #454d68;
  --thumb: linear-gradient(170deg, #3a4260 0%, #1f2336 100%);
  --soft: #dfe2f7;
  --soft-ink: #2f2a85;
  --accent: #4f46e5;
  --accent-ink: #4338ca;
  --accent-fill: linear-gradient(180deg, #635bf0 0%, #4338ca 100%);
  --good: #047857;
  --good-soft: #d1fae5;
  --bad: #b42318;
  --bad-soft: #fee4e2;
  --lift: 0 1px 2px rgba(23, 30, 52, 0.06), 0 8px 20px rgba(23, 30, 52, 0.08);
  --hero-lift: 0 14px 30px rgba(31, 35, 52, 0.30), 0 2px 6px rgba(31, 35, 52, 0.18);
  --btn-lift: 0 10px 22px rgba(67, 56, 202, 0.32);
  --tab-lift: 0 -8px 24px rgba(23, 30, 52, 0.07);
}

* { box-sizing: border-box; }
html { background: var(--page-flat); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 104px);
}

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--hero); box-shadow: var(--lift); display: grid; place-items: center; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.3px; text-transform: uppercase; }
.title { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; margin: 2px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--lift); font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: #9aa1b5; }
.dot.on { background: #10b981; }
.dot.wait { background: #f59e0b; }

/* cards */
.stack { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--lift); padding: 14px; }
.hero { background: var(--hero); color: #fff; border-radius: 20px; padding: 18px; box-shadow: var(--hero-lift); display: flex; flex-direction: column; gap: 12px; }
.hero .eyebrow { color: var(--hero-muted); }
.hero .big { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; }
.hero .line { font-size: 13px; color: var(--hero-muted); line-height: 1.4; }
.hero .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.bar { height: 8px; background: var(--hero-track); border-radius: 4px; overflow: hidden; }
.bar > div { height: 8px; background: var(--accent); border-radius: 4px; transition: width 0.6s ease; }
.bar.busy > div { width: 35%; animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.problem { background: rgba(254, 228, 226, 0.12); border: 1px solid rgba(254, 228, 226, 0.35); border-radius: 10px; padding: 10px; font-size: 13px; color: #fde2df; }

/* buttons */
.btn { height: 46px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--lift); font-size: 14px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; text-decoration: none; }
.btn.primary { height: 56px; border: none; border-radius: 16px; background: var(--accent-fill); box-shadow: var(--btn-lift); color: #fff; font-size: 17px; font-weight: 700; width: 100%; }
.btn.light { background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22); color: #fff; box-shadow: none; height: 40px; }
.btn.small { height: 32px; border-radius: 16px; font-size: 12px; font-weight: 700; padding: 0 12px; box-shadow: none; }
.btn.soft { background: var(--soft); color: var(--soft-ink); border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible, .tab:focus-visible, .chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.stat { padding: 12px 14px; }
.stat b { display: block; font-size: 22px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 500; }

.section { display: flex; justify-content: space-between; align-items: baseline; margin: 30px 0 12px; }
.section h2 { font-size: 17px; font-weight: 700; margin: 0; }
.section a, .section button.link { font-size: 13px; font-weight: 600; text-decoration: none; background: none; border: none; color: var(--accent-ink); padding: 8px 0; }

/* lists: one card, thin lines between rows */
.list { padding: 0; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; min-height: 56px; }
.row + .row { border-top: 1px solid var(--border); }
.row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row .name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.meta { font-size: 12px; font-weight: 600; color: var(--muted); }
.mini { width: 40px; height: 71px; border-radius: 8px; background: var(--thumb); flex-shrink: 0; overflow: hidden; }
.pic { display: block; width: 100%; height: 100%; object-fit: cover; }
.round { width: 40px; height: 40px; border-radius: 20px; border: none; background: var(--soft); color: var(--soft-ink); display: grid; place-items: center; flex-shrink: 0; text-decoration: none; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.tile .shot { position: relative; overflow: hidden; height: 236px; border-radius: 12px; background: var(--thumb); padding: 10px; display: flex; flex-direction: column; justify-content: space-between; }
.tile .shot .pic { position: absolute; inset: 0; }
.tile .shot > :not(.pic) { position: relative; }
.tile .shot.has-pic .foot { background: rgba(14, 18, 32, 0.55); margin: -10px; padding: 8px 10px; border-radius: 0 0 12px 12px; }
.tile .box { align-self: flex-start; background: #fff; color: #0e1220; border-radius: 8px; padding: 6px 8px; font-size: 11px; font-weight: 800; line-height: 1.25; }
.tile .foot { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.badge.ready { background: var(--good-soft); color: #065f46; }
.badge.posted { background: var(--hero-track); color: #e3e6ef; }
.tile .meta { padding: 0 4px; }
.tile .actions .btn { flex: 1; }
details.more { font-size: 12px; color: var(--ink-soft); padding: 0 4px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); padding: 4px 0; }
details.more li { margin: 4px 0; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chip { height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--border); background: var(--surface-flat); color: var(--ink-soft); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { background: #2a3045; color: #fff; border-color: #2a3045; }

.state { width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; font-weight: 800; }
.state.ok { background: var(--good-soft); color: var(--good); }
.state.bad { background: var(--bad-soft); color: var(--bad); }
.state.going { background: var(--soft); color: var(--soft-ink); }
.run .what { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.chev { color: var(--muted); font-size: 18px; }

.empty { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; padding: 22px 16px; }

/* login */
.login { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.login label { font-size: 14px; font-weight: 600; }
.login input { height: 50px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-flat); padding: 0 14px; font-size: 15px; width: 100%; }
.login p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.error { color: var(--bad); font-size: 14px; font-weight: 600; }

/* bottom menu */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: #f5f7fa; box-shadow: var(--tab-lift); border-top: 1px solid var(--border); padding: 8px 0 calc(env(safe-area-inset-bottom) + 8px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); z-index: 5; }
.tab { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; min-height: 48px; }
.tab.on { color: var(--accent-ink); font-weight: 700; }

/* Make clips panel */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; border: none; background: rgba(18, 23, 38, 0.45); }
.sheet { position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: var(--surface-flat);
  border-radius: 24px 24px 0 0; box-shadow: var(--hero-lift); display: flex; flex-direction: column; gap: 16px;
  padding: 10px max(20px, env(safe-area-inset-left)) calc(env(safe-area-inset-bottom) + 20px) max(20px, env(safe-area-inset-right)); }
.grip { width: 40px; height: 5px; border-radius: 3px; background: var(--border); align-self: center; }
.sheet h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 24px; }
.stepper b { font-size: 40px; font-weight: 800; min-width: 60px; text-align: center; }
.stepper .round { font-size: 24px; font-weight: 700; width: 48px; height: 48px; border-radius: 24px; }
.round:disabled { opacity: 0.4; }
input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.picks .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; opacity: 0.8; }
.addrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.addrow input { flex: 1 1 140px; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: #fff; padding: 0 12px; font-size: 15px; }
.segs { display: inline-flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.seg { height: 42px; padding: 0 12px; border: none; background: transparent; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.seg.on { background: #2a3045; color: #fff; }
.addrow .btn.small { height: 44px; border-radius: 12px; padding: 0 16px; }
.btn.plain { background: none; border: none; box-shadow: none; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); transform: translateX(-50%); background: #1f2336; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--hero-lift); max-width: calc(100% - 40px); z-index: 10; }
