/* ================================================================
   Shotlist — monotone design system
   cream white · light grey · dusty black
   ================================================================ */

:root {
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --surface-soft: #F1F0EC;
  --surface-hover: #F6F5F1;
  --border: #E8E7E3;
  --border-strong: #D9D8D2;
  --ink: #2B2A28;
  --ink-soft: #6E6C66;
  --ink-faint: #A3A19A;
  --danger: #8C3B32;
  --shadow-sm: 0 1px 2px rgba(43, 42, 40, 0.05);
  --shadow-md: 0 4px 16px rgba(43, 42, 40, 0.07);
  --shadow-lg: 0 12px 40px rgba(43, 42, 40, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

::selection { background: rgba(43, 42, 40, 0.12); }

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; color: inherit; }

/* ================= Header ================= */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(250, 249, 246, 0.86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wordmark-icon { color: var(--ink); border-radius: 7px; }

.editor-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.save-indicator {
  font-size: 12.5px;
  color: var(--ink-faint);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.save-indicator.visible { opacity: 1; }

.shot-count-pill {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
}

/* ================= Buttons ================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 8px 16px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              box-shadow 0.2s var(--ease), transform 0.1s var(--ease);
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: #45443f; }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-hover); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--surface-soft); color: var(--ink); }

.btn-danger {
  background: var(--danger);
  color: #FDFCFA;
}
.btn-danger:hover { background: #7a332b; }

/* ================= Dashboard ================= */

.dash-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 40px 96px;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.list-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px 18px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease),
              border-color 0.25s var(--ease);
}
.list-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.list-card h3 {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding-right: 130px;
  overflow-wrap: anywhere;
}

.list-card .card-desc {
  color: var(--ink-soft);
  font-size: 13.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
}

.list-card .card-meta {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-stats {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.card-edited {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.card-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.list-card:hover .card-actions,
.list-card:focus-within .card-actions { opacity: 1; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-faint);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--surface-soft); color: var(--ink); }
.icon-btn.icon-btn-danger:hover { color: var(--danger); }

/* ================= Empty states ================= */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 96px 24px;
  color: var(--ink-faint);
}
.empty-state h2 {
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 8px;
}
.empty-state p { color: var(--ink-soft); max-width: 380px; }
.empty-state .btn { margin-top: 14px; }

.empty-state-inline { padding: 48px 24px 24px; }

/* ================= Editor ================= */

.editor-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 44px 40px 120px;
}

.editor-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 36px;
}

.editor-title,
.editor-desc {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  margin-left: -8px;
  transition: background 0.2s var(--ease);
}
.editor-title:hover, .editor-desc:hover { background: rgba(43, 42, 40, 0.03); }
.editor-title:focus, .editor-desc:focus { background: rgba(43, 42, 40, 0.05); }

.editor-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.editor-title::placeholder { color: var(--ink-faint); }

.editor-desc {
  font-size: 15px;
  color: var(--ink-soft);
}
.editor-desc::placeholder { color: var(--ink-faint); }

/* ================= Shot cards ================= */

.shot-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.shot-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 20px 17px 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease),
              opacity 0.2s var(--ease);
}
.shot-card:hover { border-color: var(--border-strong); }

.shot-card.dragging {
  opacity: 0.35;
}


.drop-indicator {
  position: absolute;
  left: 44px;
  right: 0;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
  pointer-events: none;
  z-index: 10;
  transition: top 0.12s var(--ease);
}
.drop-indicator::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}

.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  touch-action: none;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-faint);
  cursor: grab;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.drag-handle:hover { background: var(--surface-soft); color: var(--ink); }
.drag-handle:active { cursor: grabbing; }

.shot-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  padding: 0 1px;
  flex-shrink: 0;
}

.shot-check {
  width: 21px;
  height: 21px;
  margin-right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  flex-shrink: 0;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
              color 0.2s var(--ease), transform 0.1s var(--ease);
}
.shot-check:hover { border-color: var(--ink-faint); color: var(--ink-faint); }
.shot-check:active { transform: scale(0.9); }
.shot-check.checked {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.shot-check.checked:hover { background: #45443f; border-color: #45443f; }

.shot-card.done { background: var(--surface-hover); }
.shot-card.done :is(.shot-num, .type-chip, .dur-btn, .audio-btn, .shot-textarea, .ref-strip, .audio-row) {
  opacity: 0.45;
}

.shot-row-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

.shot-collapse svg { transform: rotate(180deg); }

/* ---------- Completed shot: one-line row ---------- */

.shot-line {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 14px 7px 12px;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
              opacity 0.2s var(--ease);
}
.shot-line:hover { background: var(--surface); border-color: var(--border-strong); }
.shot-line.dragging { opacity: 0.35; }

.shot-line .shot-check { margin-top: 0; }

.shot-line-type {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
}

.shot-line-desc {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13.5px;
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: rgba(43, 42, 40, 0.25);
}

.shot-line-dur {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.shot-line-delete {
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.shot-line:hover .shot-line-delete { opacity: 1; }

.shot-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shot-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
}

.shot-duration {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px 5px 8px;
  cursor: text;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.shot-duration:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.shot-duration:focus-within { border-color: var(--ink-faint); }

.shot-duration-input {
  width: 38px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
}
.shot-duration-input::-webkit-outer-spin-button,
.shot-duration-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.shot-duration-input::placeholder { color: var(--ink-faint); }

.shot-duration-suffix {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}

/* camera-angle chip: styled face + invisible native select on top */
.type-chip {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.type-chip .type-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.type-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease);
}
.type-chip:hover .type-face {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--ink-soft);
}
.type-chip:focus-within .type-face { border-color: var(--ink-faint); }

.type-face.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  padding: 0 13px;
}
.type-chip:hover .type-face.active {
  background: #45443f;
  border-color: #45443f;
  color: var(--bg);
}

.shot-textarea {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-left: -10px;
  resize: none;
  outline: none;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  min-height: 32px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.shot-textarea:hover { background: rgba(43, 42, 40, 0.03); }
.shot-textarea:focus { background: var(--bg); border-color: var(--border); }
.shot-textarea::placeholder { color: var(--ink-faint); }

/* ---------- Duration chip ---------- */

.dur-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-faint);
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.1s var(--ease);
}
.dur-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--ink-soft);
}
.dur-btn:active { transform: scale(0.92); }

.dur-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  padding: 0 13px;
}
.dur-btn.active:hover { background: #45443f; border-color: #45443f; }

/* ---------- Audio icon button ---------- */

.audio-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--ink-faint);
  flex-shrink: 0;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.1s var(--ease);
}
.audio-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--ink-soft);
}
.audio-btn:active { transform: scale(0.92); }

.audio-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.audio-btn.active:hover { background: #45443f; border-color: #45443f; }

.type-chip[data-tip]:hover::after,
.audio-btn[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 300px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  white-space: pre-line;
  pointer-events: none;
  z-index: 30;
}
.type-chip[data-tip]:hover::before,
.audio-btn[data-tip]:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: var(--ink);
  pointer-events: none;
  z-index: 29;
}

.notes-btn.active { width: auto; min-width: 30px; padding: 0 11px; gap: 5px; }
.notes-count { font-size: 11.5px; font-weight: 600; }

/* ---------- Notes editor ---------- */

.notes-row {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.notes-row:focus-within {
  background: var(--bg);
  border-color: var(--border);
}

.notes-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  line-height: 1.4;
  padding: 5px 0;
  color: var(--ink);
}
.notes-input + .notes-input { border-top: 1px solid var(--border); }
.notes-input::placeholder { color: var(--ink-faint); }

/* ---------- Audio row ---------- */

.audio-row {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  cursor: text;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.audio-row:hover { background: var(--surface-hover); }
.audio-row:focus-within {
  background: var(--bg);
  border-color: var(--border);
}

.audio-row-icon {
  display: flex;
  align-items: center;
  color: var(--ink-faint);
  padding-top: 4px;
  flex-shrink: 0;
}

.audio-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  resize: none;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 21px;
  color: var(--ink);
}
.audio-input::placeholder { color: var(--ink-faint); }

/* ---------- Reference images ---------- */

.ref-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s var(--ease), outline-color 0.2s var(--ease);
  outline: 2px dashed transparent;
  outline-offset: 4px;
}
.ref-strip.drag-over {
  background: var(--surface-soft);
  outline-color: var(--border-strong);
}

.ref-thumb {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.ref-thumb:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* fallback tile when the URL isn't a direct image (e.g. an Instagram post) */
.ref-thumb.ref-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
}
.ref-thumb.ref-link-card:hover { background: var(--surface-hover); }

.ref-link-icon {
  display: flex;
  color: var(--ink-soft);
}
.ref-link-icon svg { width: 15px; height: 15px; }

.ref-link-domain {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.ref-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(43, 42, 40, 0.65);
  color: #FDFCFA;
  opacity: 0;
  transition: opacity 0.15s var(--ease), background 0.15s var(--ease);
  cursor: pointer;
}
.ref-thumb:hover .ref-thumb-remove { opacity: 1; }
.ref-thumb-remove:hover { background: rgba(43, 42, 40, 0.9); }

.ref-add {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-faint);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
              background 0.2s var(--ease);
}
.ref-add:hover {
  border-color: var(--ink-faint);
  color: var(--ink-soft);
  background: var(--surface-soft);
}

.shot-delete {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.shot-card:hover .shot-delete,
.shot-card:focus-within .shot-delete { opacity: 1; }

/* ================= Scene rows ================= */

.scene-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 0 12px 0 2px;
}
.scene-row:first-child { margin-top: 0; }
.scene-row.dragging { opacity: 0.35; }

.scene-title {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.scene-title:hover { background: rgba(43, 42, 40, 0.03); }
.scene-title:focus { background: rgba(43, 42, 40, 0.05); color: var(--ink); }
.scene-title::placeholder {
  color: var(--ink-faint);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.scene-stats {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-right: 2px;
}

.scene-chevron svg {
  transition: transform 0.2s var(--ease);
}
.scene-row.collapsed .scene-chevron svg {
  transform: rotate(-90deg);
}

.scene-delete {
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.scene-row:hover .scene-delete,
.scene-row:focus-within .scene-delete { opacity: 1; }

.add-shot-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: -2px 0 4px 40px;
  padding: 5px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.add-shot-inline:hover { color: var(--ink); background: var(--surface-soft); }
.add-shot-inline svg { width: 11px; height: 11px; }

/* ================= Add shot / scene ================= */

.add-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.btn-add-shot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 2;
  padding: 14px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
              background 0.2s var(--ease);
}
.btn-add-shot:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
  background: var(--surface);
}

.btn-add-scene { flex: 1; }

/* ================= Modals ================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 42, 40, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in 0.18s var(--ease);
  padding: 24px;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  animation: modal-in 0.22s var(--ease);
}

.modal h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.modal-text { color: var(--ink-soft); font-size: 14px; }

.field { display: block; margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field-label em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-faint);
}

.field input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input:focus {
  border-color: var(--ink-faint);
  box-shadow: 0 0 0 3px rgba(43, 42, 40, 0.07);
}
.field input::placeholder { color: var(--ink-faint); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal-overlay.alert [data-close] { display: none; }

/* ================= Sharing ================= */

/* share UI is hidden unless a sync API was detected */
.share-ui { display: none !important; }
body.sync-enabled .share-ui { display: inline-flex !important; }

.icon-btn.shared { color: var(--ink); }

.shared-badge {
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.shared-badge svg { width: 11px; height: 11px; }

.share-link-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.share-link-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink-soft);
  outline: none;
}
.share-link-row input:focus { border-color: var(--ink-faint); }

#btn-stop-sync { margin-right: auto; }

/* ================= Animations ================= */

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.shot-card.just-added { animation: card-in 0.25s var(--ease); }

[hidden] { display: none !important; }

/* ================= Touch devices ================= */

@media (hover: none) {
  /* hover-revealed controls must always be visible on touch */
  .card-actions,
  .shot-delete,
  .scene-delete,
  .shot-line-delete,
  .ref-thumb-remove { opacity: 1; }

  .ref-thumb-remove { width: 24px; height: 24px; }
}

@media (hover: none) and (pointer: coarse) {
  /* iOS zooms into focused fields below 16px — keep editable text at 16px */
  .shot-textarea,
  .audio-input,
  .notes-input,
  .editor-desc,
  .scene-title,
  .field input,
  .share-link-row input { font-size: 16px; }

  .shot-duration-input { font-size: 15px; width: 46px; }

  .scene-title::placeholder { font-size: 14px; }

  /* larger touch targets */
  .drag-handle { width: 34px; height: 34px; }
  .icon-btn { width: 34px; height: 34px; }
  .shot-check { width: 24px; height: 24px; }
}

/* ================= Small screens ================= */

@media (max-width: 720px) {
  .app-header { padding: 10px 14px; }
  .header-actions { gap: 8px; }
  .editor-header-right { gap: 8px; }

  .dash-main { padding: 20px 14px 72px; }
  .list-grid { grid-template-columns: 1fr; gap: 12px; }
  .list-card { padding: 18px 18px 14px; }

  .editor-main { padding: 20px 14px 96px; }
  .editor-title { font-size: 22px; }
  .editor-meta { margin-bottom: 22px; }

  .shot-card { padding: 12px 14px 14px 8px; }
  .shot-row-left { gap: 6px; }
  .shot-line { gap: 8px; padding: 7px 12px 7px 8px; }

  .scene-row { margin-top: 14px; padding-right: 2px; }
  .scene-stats { font-size: 11px; }

  .add-shot-inline { margin-left: 28px; }

  .btn { padding: 7px 12px; font-size: 13px; }
  .btn-add-shot { padding: 12px; font-size: 13px; }

  .modal { padding: 22px 18px; }
  .modal-overlay { padding: 14px; }
}

@media (max-width: 460px) {
  .wordmark span { display: none; }
  .save-indicator { display: none; }
  .shot-count-pill { font-size: 11.5px; padding: 3px 9px; }
}
