/* Conewise — Cone-Lane Clipboard */

:root {
  --accent: #f06a2b;
  --primary: #2f6b4f;
  --secondary: #f4f0e6;
  --ink: #1f2a24;
  --ink-soft: #5c6b62;
  --card: #fffdf7;
  --line: #dcd6c4;
  --green: #2f6b4f;
  --orange: #f06a2b;
  --blue: #4a90c2;
  --yellow: #d9b23a;
  --radius: 14px;
  --side: 12px;
  --tap: 48px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--secondary);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100dvh; }

#app {
  max-width: 480px;
  margin: 0 auto;
  padding-top: var(--safe-t);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  min-height: 100dvh;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* ---------- lanyard header ---------- */
.lanyard {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0 var(--side);
  background: linear-gradient(var(--secondary) 70%, rgba(244, 240, 230, 0));
}

.lanyard-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--primary);
  color: var(--secondary);
  border-radius: 0 0 12px 12px;
  padding: calc(8px + var(--safe-t)) 14px 10px;
  box-shadow: 0 2px 0 rgba(31, 42, 36, 0.18);
}

.lanyard-id {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.app-name {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 16px;
  white-space: nowrap;
}

/* flat whistle mark */
.whistle-mark {
  position: relative;
  width: 20px;
  height: 16px;
  display: inline-block;
  flex: none;
}
.whistle-mouth {
  position: absolute;
  right: 0;
  top: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
}
.whistle-mouth::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 3px;
  width: 9px;
  height: 7px;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
}
.whistle-loop {
  position: absolute;
  left: -2px;
  top: 0;
  width: 7px;
  height: 7px;
  border: 2px solid var(--secondary);
  border-radius: 50%;
  opacity: 0.9;
}

.lanyard-counters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.counter {
  background: var(--accent);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.counter b {
  font-size: 13px;
  color: #fff8ec;
  margin-right: 2px;
}

/* ---------- panels ---------- */
.panel {
  padding: 14px var(--side) 8px;
}

.panel-title {
  font-size: 22px;
  font-weight: 800;
  margin: 2px 2px 12px;
  letter-spacing: 0.01em;
  color: var(--primary);
}

/* ---------- orange new strip ---------- */
.new-strip {
  display: block;
  width: 100%;
  min-height: var(--tap);
  border: none;
  background: var(--accent);
  color: #fff8ec;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  border-radius: 10px;
  margin: 0 0 16px;
  box-shadow: 0 3px 0 #c14e17;
}
.new-strip:active { transform: translateY(1px); box-shadow: 0 2px 0 #c14e17; }

/* ---------- cone-lane cards ---------- */
.cone-lane {
  list-style: none;
  margin: 0 0 8px;
  padding: 0 0 0 14px;
  position: relative;
}
.cone-lane::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--primary) 0 10px,
    transparent 10px 18px
  );
  opacity: 0.35;
}

.cone-lane-sub { margin-top: 4px; }

.drill-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(31, 42, 36, 0.08);
}

/* clipped pitch-card look: notch at top-right */
.drill-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: var(--secondary);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.drill-card .card-clip {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink-soft);
  border-radius: 50%;
  opacity: 0.5;
}

/* skill-color stripes */
.stripe-green  { border-left: 6px solid var(--green); }
.stripe-orange { border-left: 6px solid var(--orange); }
.stripe-blue   { border-left: 6px solid var(--blue); }
.stripe-yellow { border-left: 6px solid var(--yellow); }

.card-body {
  display: flex;
  gap: 10px;
  padding: 12px 14px 8px 12px;
}

.card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.card-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.card-skill {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 3px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* duration disc */
.dur-disc {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--secondary);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.stripe-orange .dur-disc { background: var(--orange); color: #fff8ec; }
.stripe-blue   .dur-disc { background: var(--blue); color: #fff; }
.stripe-yellow .dur-disc { background: var(--yellow); color: #3a2f10; }

.card-actions {
  display: flex;
  border-top: 1px solid var(--line);
}

.act {
  flex: 1;
  min-height: var(--tap);
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--primary);
}
.act-del { color: #b3401a; }
.act + .act { border-left: 1px solid var(--line); }
.act:active { background: rgba(47, 107, 79, 0.08); }

/* ---------- drills groups ---------- */
.skill-group { margin-bottom: 18px; }

.skill-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 4px 2px 8px;
}

.skill-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: none;
}
.skill-dot.stripe-green  { background: var(--green); border: none; }
.skill-dot.stripe-orange { background: var(--orange); border: none; }
.skill-dot.stripe-blue   { background: var(--blue); border: none; }
.skill-dot.stripe-yellow { background: var(--yellow); border: none; }

/* ---------- form ---------- */
.form-clipboard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: 0 1px 3px rgba(31, 42, 36, 0.08);
  border-top: 6px solid var(--accent);
}

label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin: 14px 0 6px;
  color: var(--primary);
}
label:first-child { margin-top: 0; }

.req { color: var(--accent); }
.opt { font-weight: 500; color: var(--ink-soft); font-size: 12px; }

input[type="text"],
input[type="number"],
input[type="search"],
textarea {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom-on-focus */
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}

textarea { resize: vertical; line-height: 1.4; }

input:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.field-error {
  margin: 6px 2px 0;
  font-size: 12px;
  font-weight: 600;
  color: #b3401a;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.btn-primary {
  min-height: var(--tap);
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: var(--secondary);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  box-shadow: 0 3px 0 #1f4c38;
}
.btn-primary:active { transform: translateY(1px); box-shadow: 0 2px 0 #1f4c38; }

.btn-secondary {
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 15px;
}

.btn-danger {
  min-height: var(--tap);
  border: 1px solid #d8a08c;
  border-radius: 10px;
  background: #fdf1ec;
  color: #b3401a;
  font-weight: 700;
  font-size: 15px;
}

/* ---------- find ---------- */
.search-wrap { margin-bottom: 10px; }

#findInput {
  border-radius: 999px;
  padding-left: 18px;
}

.find-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 2px 4px 10px;
}

/* ---------- empty states ---------- */
.empty {
  text-align: center;
  padding: 40px 16px 30px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty-title {
  font-weight: 800;
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--primary);
}

.empty-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 auto 18px;
  max-width: 260px;
  line-height: 1.5;
}

.empty-cta {
  min-height: var(--tap);
  padding: 0 22px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff8ec;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 3px 0 #c14e17;
}

/* ---------- bottom tab bar ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 var(--side) var(--safe-b);
  background: var(--primary);
  box-shadow: 0 -3px 8px rgba(31, 42, 36, 0.2);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tap);
  border: none;
  background: transparent;
  color: rgba(244, 240, 230, 0.65);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 10px;
  transition: color 0.12s ease, transform 0.12s ease;
}

.tab.active {
  color: #fff8ec;
  transform: translateY(-3px);
  text-shadow: 0 2px 3px rgba(31, 42, 36, 0.4);
}

/* flat whistle tab glyphs */
.tab-whistle {
  position: relative;
  width: 18px;
  height: 14px;
  display: inline-block;
}
.tab-whistle::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
}
.tab-whistle::after {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 8px;
  height: 6px;
  border-radius: 3px 0 0 3px;
  background: currentColor;
}

.tab.active .tab-whistle {
  filter: drop-shadow(0 3px 2px rgba(31, 42, 36, 0.45));
}
