/* ConeCadence — Cone-Lane Practice Strip */

:root {
  --turf: #2f6b4f;
  --turf-deep: #264f3b;
  --turf-line: rgba(244, 240, 230, 0.35);
  --chalk: #f4f0e6;
  --chalk-dim: rgba(244, 240, 230, 0.72);
  --cone: #f28c28;
  --cone-deep: #d9741a;
  --char: #2b2b28;
  --char-soft: #5f6b60;
  --row-radius: 12px;
  --stripe-w: 7px;
  --tab-h: 66px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--turf);
  color: var(--chalk);
  min-height: 100vh;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0 46px,
      rgba(244, 240, 230, 0.05) 46px 48px
    );
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; }

/* ---------- layout ---------- */

#views {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 26px);
}

.view { display: none; }
.view.active { display: block; animation: slide-in 160ms ease-out; }

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

.view-head { margin-bottom: 16px; }

.kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  margin-bottom: 3px;
}

.view-head h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  margin: 18px 0 8px;
}

/* ---------- stage dots ---------- */

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--char);
  flex: none;
}
.dot.st-queued { border-color: var(--char-soft); }
.dot.st-working { border-color: var(--cone); }
.dot.st-done { background: var(--cone); border-color: var(--cone); }

.stage-word {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- session ---------- */

.stage-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.stage-cell {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 11px;
  border-radius: var(--row-radius);
  background: rgba(244, 240, 230, 0.1);
  border: 1px solid rgba(244, 240, 230, 0.22);
}
.stage-cell .dot { border-color: var(--chalk); }
.stage-cell.st-cell-done .dot { background: var(--cone); border-color: var(--cone); }
.stage-cell.st-cell-working .dot { border-color: var(--cone); }

.stage-count {
  margin-left: auto;
  font-size: 17px;
  font-weight: 800;
}

.add-strip {
  display: block;
  width: 100%;
  background: var(--cone);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-align: left;
  padding: 17px 18px;
  border-radius: var(--row-radius);
  box-shadow: 0 3px 0 var(--cone-deep);
  margin-bottom: 18px;
}
.add-strip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cone-deep); }

.next-card {
  position: relative;
  background: var(--chalk);
  color: var(--char);
  border-radius: var(--row-radius);
  padding: 15px 16px 13px calc(var(--stripe-w) + 14px);
  overflow: hidden;
}
.next-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--stripe-w);
  background: var(--char);
}
.next-card.lane-working::before { background: var(--cone); }

.next-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.next-name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}
.next-cue {
  font-size: 14px;
  color: var(--char-soft);
  margin-bottom: 4px;
}
.next-target {
  font-size: 13px;
  color: var(--char-soft);
  font-style: italic;
}
.next-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- shared row buttons ---------- */

.btn-mini {
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1.5px solid var(--char);
  color: var(--char);
  background: transparent;
  white-space: nowrap;
}
.btn-mini:active { background: rgba(43, 43, 40, 0.08); }
.btn-mini.btn-cycle { border-color: var(--cone-deep); color: var(--cone-deep); }
.btn-mini.btn-danger { border-color: #b0483a; color: #b0483a; }
.btn-mini.btn-danger.confirming { background: #b0483a; color: var(--chalk); }

/* ---------- drills list ---------- */

.lane-group { margin-bottom: 16px; }

.lane-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.lane-group-head .dot { border-color: var(--chalk); }
.lane-group-head .dot.st-done { background: var(--cone); border-color: var(--cone); }
.lane-group-head .dot.st-working { border-color: var(--cone); }
.lane-group-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--chalk-dim);
}

.lane-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--chalk);
  color: var(--char);
  border-radius: var(--row-radius);
  padding: 10px 12px 10px calc(var(--stripe-w) + 12px);
  margin-bottom: 8px;
  overflow: hidden;
}
.lane-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--stripe-w);
}
.lane-row.lane-queued::before { background: var(--char); }
.lane-row.lane-working::before { background: var(--cone); }
.lane-row.lane-done::before {
  background: repeating-linear-gradient(
    -45deg,
    var(--char) 0 5px,
    var(--cone) 5px 10px
  );
  opacity: 0.75;
}

.lane-info { flex: 1; min-width: 0; }
.lane-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lane-cue {
  font-size: 12.5px;
  color: var(--char-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lane-row.lane-done .lane-name { text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: 0.65; }

.lane-actions { display: flex; gap: 6px; flex: none; }
.lane-actions .btn-mini { padding: 7px 10px; }

/* ---------- form (New) ---------- */

.form-card {
  background: var(--chalk);
  color: var(--char);
  border-radius: 14px;
  padding: 18px 16px 16px;
}

.field { margin-bottom: 15px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--char-soft);
  margin-bottom: 6px;
}
.field label .req { color: var(--cone-deep); }

.field input,
.field select,
.field textarea {
  width: 100%;
  font-size: 16px; /* prevents iOS zoom on focus */
  color: var(--char);
  background: #fff;
  border: 1.5px solid #d8d2c2;
  border-radius: 10px;
  padding: 12px 12px;
  outline: none;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--cone);
  box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.22);
}
.field input.invalid,
.field select.invalid {
  border-color: #b0483a;
  box-shadow: 0 0 0 3px rgba(176, 72, 58, 0.16);
}

.field-error {
  display: none;
  font-size: 12.5px;
  font-weight: 600;
  color: #b0483a;
  margin-top: 5px;
}
.field-error.show { display: block; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-main {
  flex: 1;
  background: var(--cone);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  padding: 14px 16px;
  border-radius: 11px;
  box-shadow: 0 3px 0 var(--cone-deep);
}
.btn-main:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cone-deep); }

.btn-ghost {
  padding: 14px 18px;
  border-radius: 11px;
  border: 1.5px solid var(--char);
  font-weight: 700;
  color: var(--char);
}

/* ---------- find ---------- */

.search-wrap { position: relative; margin-bottom: 12px; }

.search-wrap input {
  width: 100%;
  font-size: 16px;
  color: var(--char);
  background: var(--chalk);
  border: 0;
  border-radius: 12px;
  padding: 13px 42px 13px 14px;
  outline: none;
}
.search-wrap input:focus { box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.4); }

.search-clear {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--char-soft);
  font-size: 18px;
  line-height: 1;
}
.search-clear[hidden] { display: none; }

.chip-row { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }

.chip {
  font-size: 13px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1.5px solid rgba(244, 240, 230, 0.45);
  color: var(--chalk-dim);
}
.chip.active {
  background: var(--cone);
  border-color: var(--cone);
  color: #fff;
}

.find-result-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--chalk-dim);
  margin-bottom: 8px;
}

/* ---------- empty states ---------- */

.empty {
  text-align: center;
  padding: 34px 18px 30px;
}
.empty .lane-line {
  height: 2px;
  margin: 0 auto 16px;
  width: 150px;
  background: repeating-linear-gradient(
    90deg,
    var(--turf-line) 0 14px,
    transparent 14px 24px
  );
}
.empty p {
  font-size: 14px;
  color: var(--chalk-dim);
  max-width: 260px;
  margin: 0 auto;
}
.empty .btn-mini { margin-top: 14px; border-color: var(--chalk); color: var(--chalk); }

.empty.on-chalk .lane-line {
  background: repeating-linear-gradient(
    90deg,
    #d8d2c2 0 14px,
    transparent 14px 24px
  );
}
.empty.on-chalk p { color: var(--char-soft); }
.empty.on-chalk .btn-mini { border-color: var(--char); color: var(--char); }

/* ---------- about note (Find tab) ---------- */

.about-note {
  margin-top: 26px;
  border-top: 1px dashed var(--turf-line);
  padding-top: 14px;
  font-size: 12.5px;
  color: var(--chalk-dim);
  line-height: 1.55;
}

/* ---------- bottom tab bar ---------- */

#tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  background: var(--turf-deep);
  border-top: 2px solid rgba(244, 240, 230, 0.14);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 0 4px;
  color: var(--chalk-dim);
}
.tab .cone {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transition: transform 140ms ease, filter 140ms ease;
}
.tab span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tab.active {
  color: var(--cone);
}
.tab.active .cone {
  transform: translateY(-4px);
  filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.35));
}
.tab.tab-new.active .cone { filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.35)); }

/* ---------- toast ---------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 14px);
  transform: translate(-50%, 12px);
  z-index: 30;
  background: var(--char);
  color: var(--chalk);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  max-width: 86vw;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
