/* The Start panel: photos, a Look, where it goes. Panel only.
   Tokens come from styles.css / home-riso.css: --ink-yellow means "selected",
   anything filled with an ink takes --ink-black text. Every line of text that
   matters sets its own colour. Heights use dvh, never vh. */

.start-panel-card {
  max-width: 520px;
  width: 100%;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  background: var(--studio-bg, #101113);
  border: 1px solid var(--studio-line, #2a2b2f);
  color: #f1f5f9;
}

.start-panel-card .modal-title {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f1f5f9;
}

.start-panel-card .modal-subtitle {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.start-step {
  border: 1px solid var(--studio-line, #2a2b2f);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.start-step-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  color: #f1f5f9;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.start-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink-yellow);
  color: var(--ink-black);
  font-size: 0.75rem;
  font-weight: 900;
  align-self: center;
}

.start-step-label {
  color: #f1f5f9;
}

.start-step-head small {
  margin-left: auto;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: #94a3b8;
}

/* ① photos */
.start-photo-tray {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  /* Taller than the 260px it replaced, even on a phone: more rows reachable without a scroll. */
  max-height: max(260px, 42dvh);
  overflow-y: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.start-photo-tray:empty {
  display: none;
}

.start-photo-item {
  position: relative;
  height: 104px;
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  user-select: none;
  /* pan-y, not none: a swipe on a photo scrolls the tray. A touch drag arms after a hold (app.js). */
  touch-action: pan-y;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.start-photo-item.picked {
  border-color: var(--ink-yellow);
}

.start-photo-item.holding {
  border-color: var(--ink-yellow);
  transform: scale(1.04);
}

.start-photo-item.drag-over {
  border-color: var(--ink-yellow);
  transform: scale(1.04);
}

.start-photo-thumb {
  width: 100%;
  height: 74px;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.start-photo-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink-yellow);
  color: var(--ink-black);
  border: 2px solid #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.start-photo-badge.unnumbered {
  background: rgba(15, 23, 42, 0.65);
  color: transparent;
}

.start-photo-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.95);
  height: 28px;
  padding: 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.start-photo-ctrl-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.start-photo-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.start-photo-ctrl-btn.remove-btn {
  color: #f87171;
  font-size: 0.95rem;
}

.start-add-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 2px dashed #64748b;
  border-radius: 10px;
  background: transparent;
  color: #f1f5f9;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.start-add-tile:hover {
  border-color: var(--ink-yellow);
  color: var(--ink-yellow);
}

/* Nothing chosen yet: the tile is the whole first step, and large. */
.start-add-tile.is-empty {
  min-height: 110px;
  margin-top: 0;
  font-size: 1rem;
}

/* ② Looks */
.start-look-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.start-look-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  padding: 8px;
  border: 2px solid var(--studio-line, #2a2b2f);
  border-radius: 10px;
  background: #17181b;
  cursor: pointer;
  text-align: left;
}

.start-look-card:hover {
  border-color: #64748b;
}

.start-look-card[aria-pressed="true"] {
  border-color: var(--ink-yellow);
  background: #22210f;
}

.start-look-art {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  background: #e8e0cf;
}

.start-look-card .nm {
  color: #f1f5f9;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.start-look-card .ds {
  color: #94a3b8;
  font-size: 0.68rem;
  line-height: 1.25;
}

.start-look-note {
  margin: 8px 0 0;
  font-size: 0.74rem;
  color: #cbd5e1;
}

.start-link-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.74rem;
  text-decoration: underline;
  cursor: pointer;
}

.start-link-btn:hover {
  color: #f1f5f9;
}

.start-layout-pills {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  width: fit-content;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.start-layout-pills[hidden] {
  display: none;
}

.start-pill {
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.start-pill.active {
  background: var(--ink-yellow);
  color: var(--ink-black);
}

/* ③ target */
.start-target-row {
  margin-bottom: 8px;
}

.start-target-row select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--studio-line, #2a2b2f);
  background: #17181b;
  color: #f1f5f9;
  font-size: 0.85rem;
}

.start-target-text {
  color: #f1f5f9;
  font-size: 0.88rem;
  font-weight: 600;
}

.start-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f1f5f9;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.start-check input[type="checkbox"] {
  accent-color: var(--ink-yellow);
  width: 16px;
  height: 16px;
}

/* actions */
.start-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 6px;
}

.start-go-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 0.96rem;
  font-weight: 900;
  border-radius: 12px;
  justify-content: center;
}

.start-go-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.start-actions .ig-secondary-btn {
  text-align: center;
  justify-content: center;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--studio-line, #2a2b2f);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.start-actions .ig-secondary-btn:hover {
  border-color: #64748b;
  color: #f1f5f9;
}

.start-foot {
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
}

@media (max-width: 520px) {
  .start-look-cards { gap: 6px; }
  .start-look-card {
    padding: 6px;
    align-items: center;
    text-align: center;
  }
  .start-look-art {
    max-width: 68px;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    margin: 0 auto;
  }
  .start-look-card .nm {
    font-size: 0.66rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .start-look-card .ds { display: none; }
}
