/* ── Atlassian-inspired design system ────────────────────────────────────── */

:root {
  --color-primary:      #0052CC;
  --color-primary-dark: #0747A6;
  --color-primary-light:#DEEBFF;
  --color-bg:           #F4F5F7;
  --color-surface:      #FFFFFF;
  --color-border:       #DFE1E6;
  --color-text:         #172B4D;
  --color-text-subtle:  #6B778C;
  --color-success:      #00875A;
  --color-success-bg:   #E3FCEF;
  --color-warning:      #FF8B00;
  --color-warning-bg:   #FFFAE6;
  --color-danger:       #DE350B;
  --color-danger-bg:    #FFEBE6;
  --color-caution:      #FFAB00;
  --color-caution-bg:   #FFF0B3;
  --color-caution:      #FFAB00;
  --color-caution-bg:   #FFF0B3;
  --color-info-bg:      #DEEBFF;
  --sidebar-width:      240px;
  --radius:             4px;
  --shadow:             0 1px 3px rgba(9,30,66,.12), 0 0 1px rgba(9,30,66,.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────────────────── */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  background: #0747A6;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 16px 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.3px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo .emoji { font-size: 20px; }

.sidebar-section {
  padding: 16px 0 4px;
}

.sidebar-section-label {
  padding: 0 16px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

.sidebar-nav { list-style: none; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: rgba(255,255,255,.85);
  font-size: 14px;
  transition: background .12s, color .12s;
  border-radius: 0;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
}

.sidebar-nav a.active {
  background: rgba(255,255,255,.2);
  font-weight: 600;
}

.sidebar-nav .nav-icon { width: 18px; text-align: center; opacity: .8; }

.sidebar-sub { list-style: none; }

.sidebar-sub a {
  display: block;
  padding: 6px 16px 6px 44px;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  transition: background .12s, color .12s;
}

.sidebar-sub a:hover,
.sidebar-sub a.active {
  color: #fff;
  background: rgba(255,255,255,.1);
  text-decoration: none;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.sidebar-footer a {
  color: rgba(255,255,255,.6);
  font-size: 12px;
}

.sidebar-footer a:hover { color: #fff; text-decoration: none; }

/* ── Main content ────────────────────────────────────────────────────────── */

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}

.topbar-subtitle {
  font-size: 13px;
  color: var(--color-text-subtle);
  margin-left: 12px;
}

.page-body {
  padding: 32px;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-text);
}

.card-subtitle {
  font-size: 13px;
  color: var(--color-text-subtle);
  margin-bottom: 16px;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Lozenges (status badges) ────────────────────────────────────────────── */

.lozenge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.lozenge-success  { background: var(--color-success-bg); color: var(--color-success); }
.lozenge-warning  { background: var(--color-warning-bg); color: var(--color-warning); }
.lozenge-danger   { background: var(--color-danger-bg);  color: var(--color-danger); }
.lozenge-info     { background: var(--color-info-bg);    color: var(--color-primary); }
.lozenge-neutral  { background: var(--color-border);     color: var(--color-text-subtle); }

/* ── Alerts / Banners ────────────────────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin-bottom: 16px;
  font-size: 13px;
}

.alert-warning { background: var(--color-warning-bg); border-color: var(--color-warning); }
.alert-success { background: var(--color-success-bg); border-color: var(--color-success); }
.alert-danger  { background: var(--color-danger-bg);  border-color: var(--color-danger); }
.alert-info    { background: var(--color-info-bg);    border-color: var(--color-primary); }

.alert strong { display: block; margin-bottom: 2px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .12s, box-shadow .12s;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary   { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; }

.btn-subtle    { background: var(--color-bg); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-subtle:hover { background: var(--color-border); }

.btn-danger    { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid #FFBDAD; }
.btn-danger:hover { background: #FFBDAD; }

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */

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

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-subtle);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

input[type="text"], input[type="password"], input[type="date"],
input[type="number"], input[type="url"], textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color .12s;
}

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

textarea { resize: vertical; min-height: 80px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #F8F9FA; }

/* ── Page tabs ───────────────────────────────────────────────────────────── */

.page-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 24px;
}

.page-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-subtle);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
  text-decoration: none;
}

.page-tab:hover { color: var(--color-text); text-decoration: none; }
.page-tab.active { color: var(--color-primary); border-color: var(--color-primary); font-weight: 600; }

/* ── Section header ──────────────────────────────────────────────────────── */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 700;
}

/* ── Diary entry flags ───────────────────────────────────────────────────── */

.flag-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  margin-top: 3px;
}

.tp-overview-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 600px) {
  .tp-overview-plan-grid { grid-template-columns: 1fr; }
}

.flag-positive { background: var(--color-success); }
.flag-caution  { background: var(--color-caution); }
.flag-warning  { background: var(--color-warning); }
.flag-critical { background: var(--color-danger); }
.flag-info     { background: var(--color-primary); }

/* ── Login page ──────────────────────────────────────────────────────────── */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
}

.login-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 48px;
  width: 360px;
  text-align: center;
}

.login-card .logo { font-size: 36px; margin-bottom: 8px; }
.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-card .tagline { font-size: 13px; color: var(--color-text-subtle); margin-bottom: 28px; }
.login-card .form-group { text-align: left; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

/* ── Flash messages ──────────────────────────────────────────────────────── */

.flash-list { list-style: none; margin-bottom: 16px; }
.flash-list li { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 8px; }
.flash-list .error   { background: var(--color-danger-bg); color: var(--color-danger); }
.flash-list .success { background: var(--color-success-bg); color: var(--color-success); }
.flash-list .warning { background: var(--color-warning-bg); color: var(--color-warning); }

/* ── Training phase cards ────────────────────────────────────────────────── */

.phase-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 10px;
}

.phase-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  flex-shrink: 0;
}

.phase-age {
  font-size: 11px;
  color: var(--color-text-subtle);
  margin-left: auto;
  white-space: nowrap;
  font-weight: 500;
}

.phase-intro {
  font-style: italic;
  font-size: 14px;
  color: var(--color-text-subtle);
  line-height: 1.65;
  border-left: 3px solid var(--color-border);
  padding-left: 14px;
  margin-bottom: 20px;
}

.gear-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.training-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.training-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
}

.card-label-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.card-label-tag.gold   { color: #9a7d3a; }
.card-label-tag.red    { color: #6d28d9; }
.card-label-tag.green  { color: #0e7490; }
.card-label-tag.blue   { color: var(--color-primary); }
.card-label-tag.dim    { color: var(--color-text-subtle); }

.training-card.color-gold  { background: #FFFBF0; }
.training-card.color-green { background: #F0F9FF; }
.training-card.color-red   { background: #F5F3FF; }
.training-card.color-blue  { background: #EEF2FF; }
.training-card.color-dim   { background: var(--color-surface); }

.training-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}

.training-card ul {
  list-style: none;
  padding: 0;
}

.training-card ul li {
  padding: 3px 0 3px 14px;
  position: relative;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text);
}

.training-card ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--color-text-subtle);
  font-weight: 700;
}

.phase-warn {
  background: var(--color-danger-bg);
  border: 1px solid #FFBDAD;
  border-left: 3px solid var(--color-danger);
  padding: 14px 18px;
  margin-top: 12px;
  border-radius: var(--radius);
}

.phase-warn-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-danger);
  margin-bottom: 8px;
}

.phase-good {
  background: var(--color-success-bg);
  border: 1px solid #ABF5D1;
  border-left: 3px solid var(--color-success);
  padding: 14px 18px;
  margin-top: 12px;
  border-radius: var(--radius);
}

.phase-good-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-success);
  margin-bottom: 8px;
}

.phase-warn ul, .phase-good ul {
  list-style: none;
  padding: 0;
}

.phase-warn ul li, .phase-good ul li {
  padding: 3px 0 3px 14px;
  position: relative;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text);
}

.phase-warn ul li::before  { content: '›'; position: absolute; left: 0; color: var(--color-danger);  font-weight: 700; }
.phase-good ul li::before  { content: '›'; position: absolute; left: 0; color: var(--color-success); font-weight: 700; }

/* ── Prose (markdown output) ─────────────────────────────────────────────── */

.prose { font-size: 14px; line-height: 1.65; color: var(--color-text); }
.prose p  { margin-bottom: 10px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 20px; margin-bottom: 10px; }
.prose li { margin-bottom: 4px; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose code { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 3px; padding: 1px 5px; font-size: 12px; }
.prose h1, .prose h2, .prose h3 { font-weight: 700; margin: 14px 0 6px; }
.prose h1 { font-size: 17px; }
.prose h2 { font-size: 15px; }
.prose h3 { font-size: 14px; }

/* ── Misc ────────────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-subtle);
}

.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

.text-subtle { color: var(--color-text-subtle); }
.text-sm     { font-size: 12px; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mb-16       { margin-bottom: 16px; }
.flex        { display: flex; }
.flex-gap    { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Lifestyle page ──────────────────────────────────────────────────────── */

.lifestyle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.lifestyle-category-block {
  display: flex;
  flex-direction: column;
}

.lifestyle-cat-photo {
  height: 200px;
  background-size: cover;
  background-position: center top;
  background-color: var(--color-primary-dark);
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 12px 16px;
  margin-bottom: 10px;
}

.lifestyle-cat-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to top, rgba(7,71,166,.65) 0%, transparent 60%);
}

.lifestyle-cat-label {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
}

.lifestyle-empty-cat {
  padding: 12px 16px;
  font-style: italic;
}

/* Ideal Dog category header (no photo) */
.lifestyle-cat-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  margin-bottom: 10px;
  background: var(--color-primary);
  border-radius: 6px;
}
.lifestyle-cat-header .lifestyle-cat-label {
  position: static;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
}

@media (max-width: 768px) {
  .lifestyle-grid { grid-template-columns: 1fr; }
  .lifestyle-cat-photo { height: 160px; }
}

/* ── Dizzy banner ────────────────────────────────────────────────────────── */

.dizzy-banner {
  width: 100%;
  height: 340px;
  background-size: cover;
  background-position: center top;
  background-color: var(--color-primary-dark);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
}

.dizzy-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(7,71,166,.6) 0%, rgba(7,71,166,.1) 50%, transparent 80%);
  display: flex;
  align-items: flex-end;
  padding: 24px 28px;
}

.dizzy-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dizzy-banner-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
}

.dizzy-banner-name {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -.5px;
}

.dizzy-banner-sub {
  font-size: 13px;
  color: rgba(255,255,255,.8);
  font-style: italic;
}

@media (max-width: 768px) {
  .dizzy-banner { height: 210px; }
  .dizzy-banner-name { font-size: 26px; }
}

/* ── Hamburger button ────────────────────────────────────────────────────── */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: background .12s;
}

.hamburger:hover span { background: var(--color-primary); }

/* ── Sidebar backdrop ────────────────────────────────────────────────────── */

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9,30,66,.4);
  z-index: 99;
}

.sidebar-backdrop.active { display: block; }

/* ── Mobile responsive ───────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 100;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .topbar { padding: 0 16px; }

  .page-body { padding: 16px; }

  .topbar-title { font-size: 17px; }
  .topbar-subtitle { display: none; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  .gear-item-grid { grid-template-columns: repeat(2, 1fr) !important; }

  .training-card-grid { grid-template-columns: 1fr; }

  .section-tile-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
}

/* ── Home / section selector ─────────────────────────────────────────────── */

.home-body {
  background-image: url('/static/img/home/main.jpg');
  background-size: cover;
  background-position: center bottom;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  padding-bottom: 32vh;
  position: relative;
}

/* Dark gradient overlay so content stays readable */
.home-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.42) 0%,
    rgba(0,0,0,.55) 100%
  );
  z-index: 0;
}

.home-wrap {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  position: relative;
  z-index: 1;
}

.home-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-logo-icon { font-size: 36px; }

.home-logo-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,.35);
}

.section-tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}

.section-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 8px;
  padding: 24px 22px;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  transition: box-shadow .15s, background .15s, transform .1s;
}

.section-tile:hover {
  background: rgba(255,255,255,.97);
  box-shadow: 0 8px 28px rgba(0,0,0,.32);
  text-decoration: none;
  transform: translateY(-2px);
}

.section-tile--soon {
  opacity: .55;
  cursor: default;
  pointer-events: none;
}

.section-tile-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.section-tile-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.section-tile-desc {
  font-size: 13px;
  color: var(--color-text-subtle);
  line-height: 1.45;
}

.home-footer-links {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: rgba(255,255,255,.7);
}

.home-footer-links a { color: rgba(255,255,255,.7); }
.home-footer-links a:hover { color: #fff; }

/* ── Settings standalone page ────────────────────────────────────────────── */

.settings-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding-bottom: 18vh;
}

.settings-back {
  font-size: 13px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  transition: color .12s;
  align-self: flex-start;
}
.settings-back:hover { color: #fff; text-decoration: none; }

.settings-card {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}

.settings-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 20px;
}

.settings-section { }
.settings-section + .settings-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.settings-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-subtle);
  margin-bottom: 6px;
}

.settings-hint {
  font-size: 13px;
  color: var(--color-text-subtle);
  margin: 0 0 14px;
}

.home-flash {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  min-width: 300px;
}

/* ── Sidebar home link ───────────────────────────────────────────────────── */

.sidebar-home-link {
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.sidebar-home-link a {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  padding: 6px 10px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.1);
  text-align: center;
  letter-spacing: .01em;
}

.sidebar-home-link a:hover {
  background: rgba(255,255,255,.2);
  color: #fff;
  text-decoration: none;
}

/* ── Coming soon page ────────────────────────────────────────────────────── */

.coming-soon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 12px;
  text-align: center;
}

.coming-soon-icon { font-size: 48px; }
.coming-soon-title { font-size: 22px; font-weight: 700; color: var(--color-text); }
.coming-soon-text { font-size: 14px; color: var(--color-text-subtle); }

/* ── Training Plans ──────────────────────────────────────────────────────── */

.tp-dog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
  gap: 24px;
}

.tp-dog-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow);
  transition: box-shadow .15s, border-color .15s, transform .1s;
}

.tp-dog-card:hover {
  box-shadow: 0 4px 12px rgba(9,30,66,.18);
  border-color: var(--color-primary);
  text-decoration: none;
  transform: translateY(-2px);
}

.tp-dog-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-bg);
}

.tp-dog-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.tp-dog-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--color-border);
}

.tp-dog-info {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tp-dog-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.tp-dog-breed {
  font-size: 13px;
  color: var(--color-text-subtle);
}

.tp-dog-count {
  font-size: 12px;
  color: var(--color-text-subtle);
  margin-top: 4px;
}

/* Dog detail page */

.tp-dog-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background: var(--color-bg);
  flex-shrink: 0;
  border: 2px solid var(--color-border);
}

.tp-dog-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.tp-dog-avatar-editable { cursor: pointer; }
.tp-dog-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0;
  transition: opacity .15s;
}
.tp-dog-avatar-editable:hover .tp-dog-avatar-overlay { opacity: 1; }

.tp-dog-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.tp-plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tp-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.tp-plan-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tp-plan-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.tp-plan-goal {
  font-size: 13px;
  color: var(--color-text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-plan-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* make plan rows clickable links */
a.tp-plan-row {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.tp-plan-row:hover {
  border-color: var(--color-primary);
  box-shadow: 0 3px 10px rgba(9,30,66,.15);
  text-decoration: none;
}

/* ── Plan board ──────────────────────────────────────────────────────────── */

.tp-empty-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.tp-board-actions {
  margin-bottom: 16px;
}

.tp-widget-board {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Widget card ─────────────────────────────────────────────────────────── */

.tp-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .15s;
}

.tp-widget.tp-dragging,
.tp-widget-group.tp-dragging,
.tp-section-block.tp-dragging,
.tp-check-row.tp-dragging,
.training-card.tp-dragging,
.card.tp-dragging {
  opacity: .35;
  box-shadow: none;
  pointer-events: none;
}

/* Drop-line indicator: a 3 px blue rule above or below the target */
.tp-widget.tp-drop-before,
.tp-widget-group.tp-drop-before,
.tp-section-block.tp-drop-before,
.tp-check-row.tp-drop-before,
.training-card.tp-drop-before,
.card.tp-drop-before {
  box-shadow: 0 -3px 0 0 var(--color-primary);
}
.tp-widget.tp-drop-after,
.tp-widget-group.tp-drop-after,
.tp-section-block.tp-drop-after,
.tp-check-row.tp-drop-after,
.training-card.tp-drop-after,
.card.tp-drop-after {
  box-shadow: 0 3px 0 0 var(--color-primary);
}

.tp-widget-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.tp-row-handle {
  font-size: 14px;
  color: var(--color-text-subtle);
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
  padding: 2px 3px;
  border-radius: 3px;
  transition: background .1s, color .1s;
}
.tp-row-handle:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.tp-row-handle:active { cursor: grabbing; }

.tp-drag-handle {
  font-size: 18px;
  color: var(--color-text-subtle);
  cursor: grab;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background .1s, color .1s;
}
.tp-drag-handle:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}
.tp-drag-handle:active { cursor: grabbing; }

.tp-widget-type-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  flex-shrink: 0;
}
.tp-badge-phase    { background: #E3F0FF; color: #0052CC; }
.tp-badge-steps    { background: #E3FCEF; color: #00875A; }
.tp-badge-goals    { background: #FFFAE6; color: #974F0C; }
.tp-badge-calendar { background: #F3F0FF; color: #5243AA; }

.tp-widget-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}

.tp-widget-header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.tp-widget-body {
  padding: 16px;
}

/* ── Phase internals ─────────────────────────────────────────────────────── */

.tp-target-goal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary-light);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--color-primary-dark);
  margin-bottom: 14px;
}
.tp-target-label {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tp-section-block {
  border-top: 1px solid var(--color-border);
  padding: 12px 16px;
}
.tp-section-block:first-child { border-top: none; }

.tp-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tp-section-drag-handle {
  font-size: 14px;
  color: var(--color-text-subtle);
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
  padding: 2px 3px;
  border-radius: 3px;
  transition: background .1s, color .1s;
}
.tp-section-drag-handle:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.tp-section-drag-handle:active { cursor: grabbing; }

/* ── Section add / remove buttons ────────────────────────────────────────── */

.tp-section-empty-add {
  padding: 4px 0 8px;
}

.tp-section-remove-btn {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-text-subtle);
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: color .12s, background .12s;
}
.tp-section-remove-btn:hover {
  color: #c0392b;
  background: #fdf2f2;
}

.tp-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--color-text-subtle);
  text-transform: none;
}

/* legacy — keep for any remaining uses */
.tp-phase-section { margin-bottom: 14px; }
.tp-phase-section:last-child { margin-bottom: 0; }

.tp-phase-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--color-text-subtle);
  margin-bottom: 8px;
}

/* Cards inside phase */
.tp-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.tp-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 12px 14px;
}

.tp-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tp-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

/* ── Checklist rows ──────────────────────────────────────────────────────── */

.tp-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.tp-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text);
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
}

.tp-check-label.tp-done span {
  text-decoration: line-through;
  color: var(--color-text-subtle);
}

.tp-checkbox {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.tp-delete-row-btn {
  background: none;
  border: none;
  color: var(--color-text-subtle);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.tp-delete-row-btn:hover { color: var(--color-danger); }

.tp-inline-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.tp-inline-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 13px;
  background: var(--color-surface);
}
.tp-inline-input:focus { outline: 2px solid var(--color-primary); border-color: transparent; }

/* ── Weekly calendar ─────────────────────────────────────────────────────── */

.tp-calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  padding: 14px 16px;
}

.tp-cal-day {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp-cal-day-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-subtle);
  text-align: center;
}

.tp-cal-textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 7px 8px;
  font-size: 12px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}
.tp-cal-textarea:focus { outline: 2px solid var(--color-primary); border-color: transparent; background: #fff; }
.tp-cal-textarea::placeholder { color: var(--color-border); }

/* ── Widget picker ───────────────────────────────────────────────────────── */

.tp-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tp-picker-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
  transition: border-color .12s, background .12s;
}
.tp-picker-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.tp-picker-icon { font-size: 22px; }
.tp-picker-name { font-size: 14px; font-weight: 600; color: var(--color-text); }
.tp-picker-desc { font-size: 12px; color: var(--color-text-subtle); }

/* ── Page breadcrumb / back link ─────────────────────────────────────────── */

.page-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--color-text-subtle);
  margin-bottom: 16px;
  transition: color .12s;
}
.page-back-link:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* ── Plan banner ─────────────────────────────────────────────────────────── */

.tp-plan-banner {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #0052CC;
}
.tp-banner-no-photo {
  background: linear-gradient(135deg, #0052CC 0%, #0747A6 100%);
}

.tp-plan-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Text overlay on no-photo banner */
.tp-banner-text-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  pointer-events: none;
}
.tp-banner-plan-name {
  font-size: 22px;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  letter-spacing: .01em;
}
.tp-banner-plan-goal {
  font-size: 13px;
  color: rgba(255,255,255,.65);
  margin-top: 5px;
}

/* Footer bar: status + actions */
.tp-banner-photo-controls {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.tp-banner-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(3px);
}

/* Status pill inside banner */
.tp-banner-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  letter-spacing: .04em;
  white-space: nowrap;
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
}
.tp-banner-status-active  { background: rgba(16,185,129,.3); border-color: rgba(16,185,129,.6); }
.tp-banner-status-paused  { background: rgba(245,158, 11,.3); border-color: rgba(245,158,11,.6); }
.tp-banner-status-finished{ background: rgba(34,197, 94,.3); border-color: rgba(34,197,94,.6); }

/* Buttons inside banner */
.tp-banner-btn {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.45);
  color: #fff;
  border-radius: 4px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
}
.tp-banner-btn:hover            { background: rgba(255,255,255,.28); }
.tp-banner-btn-primary          { background: rgba(16,185,129,.35); border-color: rgba(16,185,129,.7); }
.tp-banner-btn-primary:hover    { background: rgba(16,185,129,.55); }
.tp-banner-btn-danger           { background: rgba(220,38,38,.25);  border-color: rgba(220,38,38,.6); }
.tp-banner-btn-danger:hover     { background: rgba(220,38,38,.45); }

/* ── Phase complete ───────────────────────────────────────────────────────── */

.tp-widget-completed {
  opacity: 0.65;
  position: relative;
}

.tp-widget-completed::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  pointer-events: none;
  border: 2px solid var(--color-success);
}

.tp-widget-completed .phase-num {
  color: var(--color-success);
}

.tp-complete-badge {
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: .02em;
}

.tp-complete-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--color-text-subtle);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
  white-space: nowrap;
}
.tp-complete-btn:hover {
  border-color: var(--color-success);
  color: var(--color-success);
  background: var(--color-success-bg);
}
.tp-complete-btn-done {
  border-color: var(--color-success);
  color: var(--color-success);
  background: var(--color-success-bg);
}

/* ── Calendar (new) ──────────────────────────────────────────────────────── */

.tp-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.tp-cal-week-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-subtle);
}

.tp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 12px;
}

.tp-cal-col {
  display: flex;
  flex-direction: column;
  min-height: 130px;
}

.tp-cal-day-header {
  text-align: center;
  margin-bottom: 5px;
  padding: 4px 2px;
  border-radius: 4px;
}

.tp-cal-day-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-subtle);
}

.tp-cal-day-date {
  font-size: 12px;
  color: var(--color-text-subtle);
}

.tp-cal-today-header .tp-cal-day-name,
.tp-cal-today-header .tp-cal-day-date {
  color: var(--color-success);
  font-weight: 700;
}

.tp-cal-cell {
  flex: 1;
  background: var(--color-bg);
  border-radius: 4px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 2px solid transparent;
}

.tp-cal-cell-today {
  background: var(--color-success-bg);
  border-color: var(--color-success);
}

.tp-cal-entry {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  background: #fff;
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 11px;
  line-height: 1.4;
}

.tp-cal-entry-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}

.tp-cal-entry-win    .tp-cal-entry-dot { background: var(--color-success); }
.tp-cal-entry-watch_out .tp-cal-entry-dot { background: var(--color-warning); }

.tp-cal-entry-text {
  flex: 1;
  overflow: hidden;
  word-break: break-word;
}
@media (max-width: 600px) {
  .tp-cal-entry-text { display: none; }
}

.tp-cal-entry-del {
  background: none;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
  font-size: 13px;
  padding: 0 1px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .1s;
}
.tp-cal-entry:hover .tp-cal-entry-del { opacity: 1; }
.tp-cal-entry-del:hover { color: var(--color-danger); }

.tp-cal-add-btn {
  margin-top: auto;
  background: none;
  border: 1px dashed var(--color-border);
  border-radius: 3px;
  padding: 2px;
  font-size: 14px;
  color: var(--color-text-subtle);
  cursor: pointer;
  width: 100%;
  transition: background .12s, border-color .12s;
  line-height: 1.4;
}
.tp-cal-add-btn:hover {
  background: #fff;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ── Widget groups ───────────────────────────────────────────────────────── */

.tp-widget-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tp-group-drag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 4px;
  cursor: grab;
  color: var(--color-text-subtle);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  user-select: none;
}
.tp-group-drag-row:active { cursor: grabbing; }
.tp-group-drag-row .tp-drag-handle { font-size: 16px; }

.tp-group-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .06em;
}

/* ── Active plan badge ───────────────────────────────────────────────────── */

.tp-active-badge {
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: .02em;
}

/* ── Active toggle button on dog plan list ───────────────────────────────── */

.tp-plan-row-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
}
.tp-plan-row-wrap .tp-plan-row {
  flex: 1;
  border-bottom: none;
}
.tp-plan-row-wrap .tp-plan-row:hover { background: var(--color-primary-light); }

.tp-active-toggle {
  flex-shrink: 0;
  margin-right: 12px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--color-text-subtle);
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
}
.tp-active-toggle:hover {
  border-color: var(--color-success);
  color: var(--color-success);
}
.tp-active-toggle-on {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
  font-weight: 600;
}

/* ── Plan status bar (plan page) ─────────────────────────────────────────── */

.tp-plan-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 8px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.tp-status-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: .03em;
  white-space: nowrap;
}
.tp-status-pill-inactive {
  background: var(--color-bg);
  color: var(--color-text-subtle);
  border: 1px solid var(--color-border);
}
.tp-status-pill-active {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}
.tp-status-pill-paused {
  background: #fff8e1;
  color: #b45309;
  border: 1px solid #f59e0b;
}
.tp-status-pill-finished {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

/* ── Status badges (dog plan list) ──────────────────────────────────────── */

.tp-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.tp-status-badge-active {
  background: var(--color-success-bg);
  color: var(--color-success);
}
.tp-status-badge-paused {
  background: #fff8e1;
  color: #b45309;
}
.tp-status-badge-finished {
  background: #f0fdf4;
  color: #166534;
}

/* ── Plan group dividers / labels (dog page) ─────────────────────────────── */

/* ── Daily overview CTA strip ────────────────────────────────────────────── */

.tp-overview-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 20px;
  background: var(--color-primary);
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(0,82,204,.25);
}
.tp-overview-cta:hover {
  background: #0747A6;
  box-shadow: 0 4px 16px rgba(0,82,204,.35);
  text-decoration: none;
  color: #fff;
}
.tp-overview-cta-icon  { font-size: 24px; flex-shrink: 0; }
.tp-overview-cta-title { font-size: 15px; font-weight: 700; }
.tp-overview-cta-sub   { font-size: 12px; opacity: .8; margin-top: 1px; }
.tp-overview-cta-arrow {
  margin-left: auto;
  font-size: 20px;
  opacity: .7;
  transition: transform .15s, opacity .15s;
}
.tp-overview-cta:hover .tp-overview-cta-arrow {
  transform: translateX(4px);
  opacity: 1;
}

.tp-plan-group-divider {
  height: 1px;
  background: var(--color-border);
  margin: 20px 0 16px;
}
.tp-plan-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-subtle);
  margin-bottom: 8px;
}
.tp-plan-row-finished {
  opacity: .65;
}
.tp-plan-row-finished:hover {
  opacity: 1;
}

/* ── Dog overview page ───────────────────────────────────────────────────── */

.tp-overview-tile {
  display: flex;
  flex-direction: column;
}

.tp-overview-widget-block {
  background: var(--color-bg);
  border-radius: 4px;
  padding: 12px 14px;
  margin-top: 8px;
  flex: 1;
}

.tp-overview-widget-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-subtle);
  margin-bottom: 8px;
}

.tp-overview-choose {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--color-bg);
  border-radius: 4px;
}

.tp-overview-choice-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.tp-overview-choice-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
