/* Estudio - mobile first, touch first.
 *
 * Rules this stylesheet keeps:
 *   - every tappable thing is at least 44px, because she is using a phone
 *     one-handed and a missed tap costs money
 *   - the action bar is sticky and always shows the cost before she commits
 *   - dark, because the content is photographs and a bright chrome fights them
 *   - no framework: this is seven chip rows and two image grids
 */

:root {
  --bg: #111113;
  --surface: #1a1a1e;
  --surface-2: #232329;
  --line: #2e2e36;
  --text: #f2f2f4;
  --muted: #9a9aa4;
  --accent: #d9a441;      /* warm, so it reads next to skin tones */
  --accent-ink: #1a1508;
  --danger: #e0655c;
  --ok: #6bbf7b;
  --radius: 14px;
  --tap: 44px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.screen {
  padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
  max-width: 720px;
  margin: 0 auto;
}

h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 13px; margin: 26px 0 10px; color: var(--muted);
     text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
p  { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
a { color: inherit; text-decoration: none; }

/* -- the one button ------------------------------------------------------ */

.upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  width: 100%; min-height: 220px;
  margin: 24px 0;
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: 20px;
  color: var(--text);
  font-size: 17px; font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload:active { background: var(--surface-2); border-color: var(--accent); }
.upload .glyph { font-size: 42px; line-height: 1; }
.upload .hint { font-size: 13px; font-weight: 400; color: var(--muted); }
input[type=file] { display: none; }

/* -- quick styles -------------------------------------------------------- */

.quick {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.quick::-webkit-scrollbar { display: none; }
.quick-card {
  flex: 0 0 132px; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer;
}
.quick-card img { width: 100%; height: 96px; object-fit: cover; display: block; background: var(--surface-2); }
.quick-card .name { padding: 8px 10px; font-size: 13px; font-weight: 600; }
.quick-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* -- multi-select rows --------------------------------------------------- */

.row { margin-bottom: 18px; }
.row-label {
  font-size: 11px; letter-spacing: 0.1em; color: var(--muted);
  text-transform: uppercase; font-weight: 700; margin-bottom: 8px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: var(--tap);
  padding: 10px 15px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 15px; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.chip:active { transform: scale(.97); }
/* Selected chips stay filled, so the screen always shows her current choice */
.chip.on {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent); font-weight: 600;
}

/* -- sticky action bar --------------------------------------------------- */

.bar {
  position: fixed; left: 0; right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom));
  background: rgba(17,17,19,.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom) * 0);
  z-index: 20;
}
.bar-inner { max-width: 720px; margin: 0 auto; }
.counter { font-size: 13px; color: var(--muted); margin-bottom: 8px; text-align: center; }
.counter strong { color: var(--text); }

.go {
  width: 100%; min-height: 52px;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 12px;
  font-size: 17px; font-weight: 700; cursor: pointer;
}
.go:disabled { background: var(--surface-2); color: var(--muted); }
.go.secondary { background: var(--surface-2); color: var(--text); margin-top: 8px; min-height: 46px; font-size: 15px; }

/* -- image grids --------------------------------------------------------- */

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.cell {
  position: relative; aspect-ratio: 4/5;
  background: var(--surface-2); border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  border: 2px solid transparent;
}
.cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cell.on { border-color: var(--accent); }
.cell .num {
  position: absolute; top: 8px; left: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.cell.on .num { background: var(--accent); color: var(--accent-ink); }

/* Shimmer placeholder: previews arrive one by one, and an empty slot that
   is visibly waiting reads as progress rather than as breakage. */
.cell.pending { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .35 } 50% { opacity: .7 } }

/* -- notices ------------------------------------------------------------- */

.notice {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 14px; margin: 12px 0;
  font-size: 14px; color: var(--muted);
}
.notice.bad { border-left-color: var(--danger); }
.notice strong { color: var(--text); }

.stat { display: flex; justify-content: space-between; padding: 12px 0;
        border-bottom: 1px solid var(--line); font-size: 15px; }
.stat span:last-child { color: var(--muted); }

/* -- bottom tabs --------------------------------------------------------- */

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(17,17,19,.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 60px;
  font-size: 11px; color: var(--muted);
}
.tab-i { font-size: 19px; line-height: 1; }
.tab.on { color: var(--accent); }

/* -- viewer -------------------------------------------------------------- */

.viewer {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8,8,10,.97);
  display: none; flex-direction: column;
}
.viewer.open { display: flex; }
.viewer img { flex: 1; width: 100%; object-fit: contain; min-height: 0; }
.viewer-actions {
  display: flex; gap: 8px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
}
.viewer-actions button, .viewer-actions a {
  flex: 1; min-height: var(--tap);
  background: var(--surface-2); color: var(--text);
  border: 0; border-radius: 10px; font-size: 15px;
  display: grid; place-items: center; cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
