/* ============================================================
   LeadLog — weinnovatee
   Industrial-utilitarian dark theme
   ============================================================ */

:root {
  --bg: #111111;
  --surface: #1C1C1C;
  --surface-2: #232323;
  --surface-3: #2A2A2A;
  --line: #2E2E2E;
  --line-soft: #1F1F1F;
  --accent: #D4A847;
  --accent-dim: #8a6d2c;
  --text: #F0EDE6;
  --text-dim: #888888;
  --text-faint: #5A5A5A;
  --success: #4CAF50;
  --danger: #E05252;

  --stage-new:        #6B7280;
  --stage-contacted:  #4A7BA8;
  --stage-proposal:   #8C6FB0;
  --stage-negotiation:#D4A847;
  --stage-won:        #4CAF50;
  --stage-lost:       #E05252;

  --serif: 'DM Serif Display', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 4px;
  --radius-lg: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button { font-family: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 1px dashed var(--accent);
  outline-offset: 2px;
}

/* ---------- Stage / shell ---------- */
.stage {
  min-height: 100vh;
  background: var(--bg);
}

.app-shell {
  display: flex;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
}

/* MOBILE: stack, single view at a time */
@media (max-width: 899px) {
  .app-shell { display: block; }
}

/* ---------- Left rail (lead list on desktop, full view on mobile) ---------- */
.app-rail {
  width: 100%;
  max-width: 420px;
  flex: 0 0 420px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--bg);
  overflow: hidden;
}
@media (max-width: 899px) {
  .app-rail {
    max-width: none;
    flex: none;
    border-right: none;
    position: relative;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .app-rail.is-hidden { display: none; }
}

.app-rail .rail-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 899px) {
  .app-rail .rail-scroll { overflow: visible; height: auto; }
}

/* ---------- Main pane (detail / form / empty on desktop) ---------- */
.app-main {
  flex: 1 1 auto;
  min-width: 0;
  background: #0d0d0d;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  position: relative;
}
@media (max-width: 899px) {
  .app-main {
    display: none;
    height: auto;
    min-height: 100vh;
    background: var(--bg);
  }
  .app-main.is-active { display: flex; }
}

.app-main .main-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 899px) {
  .app-main .main-scroll { overflow: visible; }
}

/* ---------- App header (lives in left rail) ---------- */
.app-header {
  position: relative;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}
.app-header .brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.app-header .brand img {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
  object-position: left center;
}
.app-header .brand .tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 2px;
}
.app-header .meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  text-align: right;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.app-header .meta .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 6px;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.92); }
}

.view {
  animation: fadeIn 240ms ease-out;
}
@media (min-width: 900px) {
  .app-main > .view {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
  }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   DIRECTORY VIEW
   ============================================================ */

.directory-head {
  padding: 22px 20px 8px;
}
.directory-head .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 0 0 4px;
}
.directory-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}
.directory-head .sub {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}
.directory-head .sub b { color: var(--accent); font-weight: 500; }

.filter-bar {
  margin-top: 16px;
  padding: 0 20px 14px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-pill {
  flex: 0 0 auto;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 160ms ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-pill .count {
  font-size: 10px;
  color: var(--text-faint);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 999px;
}
.filter-pill.active {
  background: var(--accent);
  color: #1a1300;
  border-color: var(--accent);
}
.filter-pill.active .count { background: rgba(0,0,0,0.18); color: #1a1300; }
.filter-pill:not(.active):hover { color: var(--text); border-color: #3a3a3a; }

.lead-list {
  padding: 4px 20px 120px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 900px) {
  .lead-list { padding-bottom: 32px; }
}

.lead-card.is-selected {
  background: #1f1f1f;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim) inset, 0 8px 24px rgba(0,0,0,0.4);
}

.lead-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--stage-color, var(--accent));
  border-radius: var(--radius-lg);
  padding: 16px 16px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  text-align: left;
  width: 100%;
  color: inherit;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
  cursor: pointer;
}
.lead-card:hover { background: #1f1f1f; }
.lead-card:active { transform: scale(0.985); }

.lead-card .name {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.1;
  margin: 0;
  grid-column: 1;
}
.lead-card .company {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
  grid-column: 1;
  margin-top: 2px;
}
.lead-card .prob {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  text-align: right;
  font-family: var(--mono);
  font-weight: 500;
}
.lead-card .prob .pct {
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}
.lead-card .prob .lbl {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-top: 4px;
}

.lead-card .footer {
  grid-column: 1 / -1;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lead-card .meta-row {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lead-card .meta-row .sep { opacity: 0.5; }
.lead-card .meta-row svg { display: block; }

.stage-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 8px 4px 7px;
  border-radius: 3px;
  background: color-mix(in oklab, var(--stage-color, var(--accent)) 16%, transparent);
  color: color-mix(in oklab, var(--stage-color, var(--accent)) 85%, #fff);
  border: 1px solid color-mix(in oklab, var(--stage-color, var(--accent)) 30%, transparent);
}
.stage-tag::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--stage-color, var(--accent));
}

.empty-state {
  margin: 40px 20px;
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
}
.empty-state .title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text);
  margin-bottom: 6px;
}

/* ---------- New-lead buttons ---------- */
.new-lead-btn {
  display: none;
  background: var(--accent);
  color: #1a1300;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  align-items: center;
  gap: 6px;
  transition: transform 120ms ease, box-shadow 200ms ease;
}
.new-lead-btn:hover { box-shadow: 0 6px 20px rgba(212,168,71,0.3); }
.new-lead-btn:active { transform: translateY(1px); }
@media (min-width: 900px) {
  .new-lead-btn { display: inline-flex; }
}

/* ---------- FAB (mobile only) ---------- */
.fab {
  position: fixed;
  bottom: 22px;
  right: 20px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1300;
  border: none;
  font-size: 28px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(212,168,71,0.35), 0 0 0 1px rgba(0,0,0,0.2);
  z-index: 30;
}
@media (min-width: 900px) {
  .fab { display: none; }
}
.fab::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.4;
  animation: fabPulse 2.4s ease-out infinite;
}
@keyframes fabPulse {
  0% { transform: scale(0.95); opacity: 0.5; }
  100% { transform: scale(1.25); opacity: 0; }
}
.fab:active { transform: scale(0.94); }

/* ============================================================
   DETAIL VIEW
   ============================================================ */

.detail-head {
  padding: 16px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 160ms ease;
}
.icon-btn:hover { background: var(--surface); border-color: var(--accent-dim); }
.icon-btn.text {
  width: auto;
  border-radius: 999px;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  gap: 6px;
}

/* ---------- Empty main pane state (desktop, nothing selected) ---------- */
.empty-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}
.empty-main .glyph {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  color: var(--text-faint);
}
.empty-main h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.empty-main p {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
  letter-spacing: 0.04em;
}
.empty-main .marks {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.detail-hero {
  padding: 18px 20px 18px;
  border-bottom: 1px solid var(--line-soft);
}
@media (min-width: 900px) {
  .detail-head { padding: 24px 40px 0; }
  .detail-hero { padding: 24px 40px 26px; }
  .detail-stats { padding: 22px 40px 24px; }
  .section { padding: 28px 40px 4px; }
  .detail-foot { padding: 32px 40px 80px; }
  .form-head { padding: 24px 40px 0; }
  .form-body { padding: 8px 40px 24px; max-width: 720px; }
  .save-bar { padding: 14px 40px 22px; }
  .detail-hero .name { font-size: 48px; }
  .detail-hero .contact { flex-direction: row; gap: 20px; flex-wrap: wrap; }
  .form-body h1 { font-size: 40px; }
}
.detail-hero .lead-id {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.detail-hero .name {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.02;
  margin: 6px 0 4px;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.detail-hero .company {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.detail-hero .contact {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-hero .contact a {
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed transparent;
  width: fit-content;
}
.detail-hero .contact a svg { color: var(--accent); }
.detail-hero .contact a:hover { border-bottom-color: var(--accent-dim); }

.detail-stats {
  padding: 16px 20px 6px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 18px;
}
.detail-stats .stage-wrap { display: flex; flex-direction: column; gap: 6px; }
.detail-stats .label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.detail-stats .stage-tag { font-size: 11px; padding: 6px 10px 6px 9px; }

.prob-block { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.prob-block .top {
  display: flex; align-items: baseline; justify-content: space-between;
}
.prob-block .pct {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}
.prob-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.prob-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 999px;
  transition: width 360ms cubic-bezier(.2,.7,.3,1);
  box-shadow: 0 0 12px rgba(212,168,71,0.4);
}

/* ---------- Sections in detail ---------- */
.section {
  padding: 22px 20px 4px;
}
.section + .section { padding-top: 18px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.005em;
}
.section-head .count-chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  padding: 3px 8px;
  border-radius: 3px;
}

/* Audio item */
.audio-item {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.audio-item + .audio-item { margin-top: 10px; }
.audio-item .label-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.audio-item .label-row .nm {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.audio-item .label-row .nm svg { color: var(--accent); flex: 0 0 auto; }
.audio-item .label-row .nm span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.audio-item .label-row .dur {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}
.audio-item audio {
  width: 100%;
  height: 36px;
}
.audio-item audio::-webkit-media-controls-panel {
  background-color: #2a2a2a;
}

/* Image grid */
.img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.img-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  cursor: zoom-in;
}
.img-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.img-tile:hover img { opacity: 0.92; }

/* Notes */
.notes-block {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}
.notes-block .quote-mark {
  font-family: var(--serif);
  color: var(--accent);
  font-size: 28px;
  line-height: 0;
  margin-right: 4px;
  vertical-align: -10px;
}

.empty-inline {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}

.detail-foot {
  padding: 26px 20px 80px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}

.danger-btn {
  background: transparent;
  border: 1px solid #3a2222;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  width: 100%;
  margin-top: 14px;
  transition: all 160ms ease;
}
.danger-btn:hover { background: rgba(224,82,82,0.08); border-color: var(--danger); }

/* ============================================================
   FORM VIEW
   ============================================================ */

.form-head {
  padding: 16px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.form-body {
  padding: 8px 20px 140px;
}
.form-body h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.05;
  margin: 14px 0 4px;
  letter-spacing: -0.01em;
}
.form-body .form-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.field {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
}
.field label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field .req { color: var(--accent); margin-left: 4px; }
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field textarea,
.field select {
  background: transparent;
  color: var(--text);
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 8px;
  font-family: var(--mono);
  font-size: 15px;
  width: 100%;
  border-radius: 0;
  transition: border-color 200ms ease;
}
.field input::placeholder, .field textarea::placeholder {
  color: var(--text-faint);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-bottom-color: var(--accent);
  outline: none;
}
.field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
  font-size: 14px;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23D4A847' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 22px;
  cursor: pointer;
}
.field select option { background: #1a1a1a; color: var(--text); }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Slider */
.slider-row {
  display: flex; align-items: center; gap: 14px;
  margin-top: 10px;
}
.slider-row .val {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 22px;
  color: var(--accent);
  min-width: 64px;
  text-align: right;
  letter-spacing: -0.02em;
}
input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 24px;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--slider-pct, 50%),
    var(--surface-2) var(--slider-pct, 50%),
    var(--surface-2) 100%
  );
  border-radius: 999px;
}
input[type="range"]::-moz-range-track {
  height: 4px; background: var(--surface-2); border-radius: 999px;
}
input[type="range"]::-moz-range-progress {
  height: 4px; background: var(--accent); border-radius: 999px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: -7px;
  border: 3px solid #111;
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px rgba(212,168,71,0.4);
  cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid #111;
  box-shadow: 0 0 0 1px var(--accent);
  cursor: grab;
}
input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.08); }

/* Upload zones */
.upload-zone {
  margin-top: 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  transition: all 160ms ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.upload-zone:hover { border-color: var(--accent-dim); color: var(--text); }
.upload-zone svg { color: var(--accent); }
.upload-zone .hint {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.attached-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.attached-list .att {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
}
.attached-list .att .nm {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; flex: 1;
}
.attached-list .att .nm svg { color: var(--accent); flex: 0 0 auto; }
.attached-list .att .nm span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attached-list .att .rm {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 16px;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.attached-list .att .rm:hover { color: var(--danger); background: rgba(224,82,82,0.08); }

.img-attached {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.img-attached .thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-soft);
}
.img-attached .thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-attached .thumb .rm {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

/* Save bar (sticky bottom of main pane) */
.save-bar {
  position: sticky;
  left: 0; right: 0; bottom: 0;
  padding: 14px 20px 18px;
  background: linear-gradient(180deg, transparent, #0d0d0d 28%);
  display: flex;
  gap: 10px;
  z-index: 25;
  flex: 0 0 auto;
}
@media (max-width: 899px) {
  .save-bar {
    position: fixed;
    background: linear-gradient(180deg, transparent, var(--bg) 28%);
  }
}
.save-bar button {
  flex: 1;
  height: 50px;
  border-radius: var(--radius-lg);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: none;
  transition: transform 120ms ease, box-shadow 200ms ease;
}
.save-bar .primary {
  background: var(--accent);
  color: #1a1300;
  box-shadow: 0 10px 24px rgba(212,168,71,0.28);
  font-weight: 500;
}
.save-bar .primary:active { transform: translateY(1px); }
.save-bar .ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  flex: 0 0 110px;
}

/* ============================================================
   IMAGE LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 160ms ease-out;
  padding: 20px;
}
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}
.lightbox .close {
  position: absolute;
  top: 18px; right: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 20px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #f0ede6;
  color: #111;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 50;
  animation: toastIn 200ms ease-out;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
