/* Unseat — Unrolled Mat Ladder theme */

:root {
  --primary: #315c5b;
  --secondary: #f3e9dc;
  --accent: #d9825b;
  --pine: #315c5b;
  --clay: #d9825b;
  --oat: #cbb694;
  --sky: #8fb6b4;
  --floor: #efe6d8;
  --floor-deep: #e6d9c6;
  --ink: #2c3f3e;
  --ink-soft: #5f7371;
  --card: #faf4ea;
  --line: #dccdb6;
  --danger: #b04a32;
  --radius-mat: 22px;
  --radius-row: 16px;
  --tabbar-h: 66px;
  --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(--floor);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(14px + var(--safe-t)) 18px calc(var(--tabbar-h) + var(--safe-b) + 22px) 18px;
  min-height: 100vh;
}

.tab-panel[hidden] { display: none; }

/* ---------- page heads (varied per tab via order/spacing) ---------- */

.page-head { margin: 6px 0 4px; }
#panel-moves .page-head { margin: 10px 0 14px; }
#panel-find .page-head { margin: 4px 0 10px; }

.page-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary);
}
#panel-moves .page-title { font-size: 26px; }
#panel-find .page-title { font-size: 24px; }

.page-sub {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* ---------- Today: unrolled mat focus panel ---------- */

.mat-unrolled {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-mat);
  padding: 20px 16px 20px 22px;
  margin-top: 16px;
  box-shadow: 0 3px 0 rgba(49, 92, 91, 0.12);
  overflow: hidden;
}

.focus-stripe {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 10px;
}
.stripe-pine { background: var(--pine); }
.stripe-clay { background: var(--clay); }
.stripe-oat  { background: var(--oat); }
.stripe-sky  { background: var(--sky); }

.focus-body { flex: 1; min-width: 0; }

.focus-date {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.focus-name {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--primary);
  overflow-wrap: break-word;
}

.focus-tag {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* stitched ring counters */

.rings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.ring-block {
  position: relative;
  width: 66px;
  text-align: center;
}

.ring { width: 66px; height: 66px; display: block; transform: rotate(-90deg); }

.ring-track {
  fill: none;
  stroke: var(--floor-deep);
  stroke-width: 6;
  stroke-dasharray: 3 5; /* stitched dashes */
}

.ring-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dasharray 0.35s ease;
}
.ring-fill--snacks { stroke: var(--pine); }
.ring-fill--mins { stroke: var(--accent); }

.ring-num {
  position: absolute;
  top: 24px; left: 0; right: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

.ring-label {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

/* clay quick-action strip */

.clay-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 18px;
  padding: 17px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff7ee;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 3px 0 #b5673f;
  cursor: pointer;
}
.clay-strip:active { transform: translateY(2px); box-shadow: 0 1px 0 #b5673f; }
.strip-arrow { font-size: 20px; }

.today-note {
  margin: 14px 4px 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ---------- rolled-mat rows (Moves + Find) ---------- */

.ladder {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#panel-moves .ladder { margin-top: 2px; }
#panel-find .ladder { margin-top: 14px; gap: 10px; }

.mat-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 14px 14px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-row);
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(49, 92, 91, 0.10);
  overflow: hidden;
}
.mat-row:active { transform: translateY(1px); }

.row-stripe {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 8px;
}

.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.row-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-meta {
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* small circular duration dot with minutes inside */
.row-dot {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--secondary);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

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

.empty-state, .today-empty {
  text-align: center;
  padding: 34px 20px 10px;
}

.empty-line {
  margin: 12px 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}

.empty-sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.empty-roller {
  width: 64px; height: 26px;
  margin: 0 auto;
  border-radius: 13px;
  background: var(--primary);
  position: relative;
  opacity: 0.85;
}
.empty-roller span {
  position: absolute;
  right: 8px; top: 50%;
  width: 10px; height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  border: 2px solid var(--secondary);
}
.empty-roller--flat { background: var(--clay); }

/* ---------- Log: mat-label form panel ---------- */

.mat-label {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-mat);
  padding: 20px 18px 22px;
  box-shadow: 0 3px 0 rgba(49, 92, 91, 0.10);
}

.field { margin-bottom: 16px; }
.field:last-of-type { margin-bottom: 20px; }

.field label {
  display: block;
  margin: 0 0 6px 2px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.field input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px; /* 16px+ prevents iOS zoom */
  font-family: inherit;
  color: var(--ink);
  background: #fffdf8;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 130, 91, 0.22);
}

.field input::placeholder { color: #b3a68c; }

.form-msg {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7e0d6;
  border: 1px solid var(--danger);
  color: var(--danger);
  font-size: 13.5px;
  line-height: 1.45;
}

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

.btn {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: var(--secondary);
  box-shadow: 0 3px 0 #234443;
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #234443; }

.btn-danger {
  background: #fdf6ef;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}
.btn-danger:active { background: #f7e0d6; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}
.btn-ghost:active { color: var(--primary); }

/* ---------- Find: search ---------- */

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

#find-input {
  width: 100%;
  padding: 13px 44px 13px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
}
#find-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 130, 91, 0.22);
}
#find-input::placeholder { color: #b3a68c; }
#find-input::-webkit-search-cancel-button { display: none; }

.search-clear {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--floor-deep);
  color: var(--primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- About block ---------- */

.about-block {
  margin: 26px 0 6px;
  padding: 16px 16px 18px;
  background: var(--floor-deep);
  border-radius: var(--radius-mat);
}

.about-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary);
}

.about-block p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---------- bottom tab bar: foam-roller silhouettes ---------- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: 4px;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 10px calc(8px + var(--safe-b));
  background: var(--primary);
  border-top: 3px solid #234443;
}

.roller-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.roller-shape {
  width: 44px; height: 15px;
  border-radius: 8px;
  background: #3f6b6a;
  border: 1.5px solid #274b4a;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.roller-word {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #9db8b7;
}

.roller-tab.is-active .roller-shape {
  background: var(--secondary);
  border-color: var(--accent);
  transform: rotate(-6deg) translateY(-2px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.roller-tab.is-active .roller-word { color: var(--secondary); }
