/* Intentide — Breath-Ring Focus Column theme */

:root {
  --linen: #f6f1e7;
  --linen-deep: #ece4d4;
  --euc-pale: #eaf1ea;
  --euc-mist: #dde9df;
  --primary: #5e8c7a;
  --primary-deep: #47705f;
  --accent: #e58f7a;
  --graphite: #6d6d68;
  --ink: #2f3a34;
  --ink-soft: #5d6a62;
  --shadow: 0 10px 24px rgba(94, 140, 122, 0.18);
  --tabbar-h: 72px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--euc-pale);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ---------- views ---------- */

#views {
  padding: 0 18px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px);
}

.view { display: none; }
.view.active { display: block; animation: rise 0.28s ease; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 22px 0 4px;
  letter-spacing: 0.01em;
}

.view-sub {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* ---------- Breathe header ---------- */

.arc-head {
  text-align: center;
  padding: 26px 0 6px;
}

.breath-arc {
  width: 190px;
  height: 56px;
  display: block;
  margin: 0 auto 6px;
}

.arc-head h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--primary-deep);
}

.arc-head .tag {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* counters */

.counter-row {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 16px 0 20px;
}

.counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.counter-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
}

.counter-ring--planned  { background: var(--primary);  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.35); }
.counter-ring--practice { background: var(--accent);   box-shadow: inset 0 0 0 3px rgba(255,255,255,0.35); }

.counter-label {
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

/* add strip */

.add-strip {
  width: 100%;
  border: none;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
  transition: transform 0.12s ease;
}

.add-strip:active { transform: scale(0.985); }

.strip-word {
  font-size: 1.02rem;
  font-weight: 600;
}

.strip-sub {
  font-size: 0.75rem;
  opacity: 0.85;
}

/* next-planned ring card */

.ring-card-zone { margin-top: 22px; }

.ring-card {
  background: var(--linen);
  border-radius: 34px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.ring-card::before {
  content: "";
  position: absolute;
  inset: -46px -30px auto -30px;
  height: 130px;
  border-radius: 50%;
  background: var(--euc-mist);
  opacity: 0.5;
}

.ring-card > * { position: relative; }

.ring-card .ring-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

.ring-svg {
  width: 168px;
  height: 168px;
  margin: 0 auto;
  display: block;
}

.ring-name {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 14px 0 4px;
  color: var(--primary-deep);
}

.ring-meta {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.ring-cue {
  margin: 0 0 18px;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink);
}

/* quick action button */

.btn-cycle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.btn-cycle:active { transform: scale(0.96); }

.btn-cycle .dot { background: #fff; }

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

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.dot-planned  { background: var(--primary); }
.dot-practice { background: var(--accent); }
.dot-closed   { background: transparent; box-shadow: inset 0 0 0 2px var(--graphite); }

.dot-hollow {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--stage, var(--primary));
}

/* ---------- Resets list ---------- */

.stage-group { margin: 0 0 18px; }

.stage-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 8px 4px;
}

.stage-head .count {
  background: var(--linen-deep);
  color: var(--ink-soft);
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 2px 8px;
}

.row {
  display: flex;
  align-items: stretch;
  background: var(--linen);
  border-radius: 14px;
  margin: 0 0 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(94, 140, 122, 0.08);
  transition: transform 0.12s ease;
}

.row:active { transform: scale(0.985); }

.row-edge {
  width: 6px;
  flex: 0 0 6px;
  background: var(--stage, var(--primary));
}

.row-notch {
  flex: 0 0 30px;
  display: grid;
  place-items: center;
}

.row-notch i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--euc-mist);
  box-shadow: inset 0 2px 3px rgba(47, 58, 52, 0.22);
}

.row-body {
  flex: 1;
  padding: 12px 4px 12px 0;
  min-width: 0;
}

.row-name {
  font-weight: 600;
  font-size: 0.98rem;
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px 10px 6px;
}

.btn-mini {
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.btn-mini--cycle {
  background: var(--linen-deep);
  color: var(--ink);
}

.btn-mini--delete {
  background: transparent;
  color: var(--accent);
  font-size: 1.05rem;
  padding: 3px 10px;
  align-self: center;
}

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

.empty {
  text-align: center;
  padding: 34px 20px;
  color: var(--ink-soft);
}

.empty svg {
  width: 96px;
  height: 96px;
  opacity: 0.4;
  display: block;
  margin: 0 auto 12px;
}

.empty p {
  margin: 0;
  font-size: 0.88rem;
}

/* ---------- New form ---------- */

.intention-card {
  background: var(--linen);
  border-radius: 26px;
  padding: 20px 18px;
  box-shadow: var(--shadow);
}

.field { margin: 0 0 16px; }

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 6px 2px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: inherit;
  font-size: 1rem; /* 16px+: no iOS focus zoom */
  color: var(--ink);
  background: #fff;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.field textarea { resize: vertical; min-height: 84px; }

.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--primary) 50%),
                    linear-gradient(135deg, var(--primary) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
}

.field input.invalid,
.field textarea.invalid {
  border-color: var(--accent);
}

.err {
  display: block;
  color: #c05f4c;
  font-size: 0.78rem;
  margin: 5px 0 0 2px;
}

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

.btn-primary {
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 15px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 12px;
  cursor: pointer;
}

.btn-danger {
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: #b95c49;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 11px 18px;
  cursor: pointer;
}

/* ---------- Find ---------- */

.search-wrap { margin: 0 0 14px; }

#search-input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 13px 16px;
  border: none;
  border-radius: 999px;
  background: var(--linen);
  box-shadow: inset 0 2px 5px rgba(94, 140, 122, 0.12);
  outline: none;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}

#search-input:focus { box-shadow: inset 0 2px 5px rgba(94,140,122,0.12), 0 0 0 2px var(--primary); }

.about-card {
  margin-top: 26px;
  background: var(--linen);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(94,140,122,0.1);
}

.about-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--primary-deep);
}

.about-card p {
  font-size: 0.84rem;
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.5;
}

.about-fine { font-size: 0.74rem; }

/* ---------- tab bar (river stones) ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: var(--linen);
  border-top: 1px solid rgba(94, 140, 122, 0.14);
  max-width: 480px;
  margin: 0 auto;
}

.tabbar::before { content: none; }

.stone {
  flex: 1;
  max-width: 92px;
  border: none;
  background: var(--linen-deep);
  color: var(--ink-soft);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px 7px;
  cursor: pointer;
  border-radius: 46% 54% 52% 48% / 62% 60% 40% 38%;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.stone svg { width: 22px; height: 22px; }

.stone span {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.stone.active {
  background: var(--primary);
  color: #fff;
  transform: translateY(-6px);
  box-shadow: 0 8px 16px rgba(94, 140, 122, 0.35);
}

.stone:not(.active):active { transform: translateY(-2px); }

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

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px);
  transform: translateX(-50%);
  background: var(--graphite);
  color: #fff;
  font-size: 0.82rem;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 40;
  max-width: 84%;
  text-align: center;
}

/* ---------- narrow phones ---------- */

@media (max-width: 340px) {
  .stone span { font-size: 0.58rem; }
  .counter-row { gap: 16px; }
}
