/* ─────────────────────────────────────────────────────────────────────────────
   Action Tether — App Stylesheet
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--at-font-sans);
  font-size: var(--at-text-base);
  font-weight: var(--at-weight-regular);
  line-height: var(--at-line-normal);
  color: var(--at-text-primary);
  background: var(--at-surface-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100%;
}

body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { color: var(--at-color-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
[x-cloak] { display: none !important; }

/* ── App container ───────────────────────────────────────────────────────── */
#app { height: 100%; display: flex; flex-direction: column; }

.at-app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Loading screen ──────────────────────────────────────────────────────── */
.at-loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--at-space-4);
  background: var(--at-surface-app);
  z-index: var(--at-z-toast);
}

.at-loading-logo {
  animation: at-pulse 1.8s ease-in-out infinite;
}

.at-loading-text {
  font-size: var(--at-text-sm);
  font-weight: var(--at-weight-medium);
  color: var(--at-text-muted);
  letter-spacing: 0.04em;
}

@keyframes at-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Screen header ───────────────────────────────────────────────────────── */
.at-header {
  flex-shrink: 0;
  height: var(--at-header-height);
  padding: 0 var(--at-space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--at-surface-card);
  border-bottom: 0.5px solid var(--at-border);
  padding-top: var(--at-safe-top);
}

.at-header-title {
  font-size: var(--at-text-md);
  font-weight: var(--at-weight-medium);
  color: var(--at-text-primary);
}

.at-header-sub {
  font-size: var(--at-text-xs);
  color: var(--at-text-muted);
  margin-top: 1px;
}

/* ── Main content area ───────────────────────────────────────────────────── */
.at-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--at-nav-height) + var(--at-safe-bottom) + var(--at-space-4));
}

/* ── Bottom navigation ───────────────────────────────────────────────────── */
.at-bottom-nav {
  flex-shrink: 0;
  height: calc(var(--at-nav-height) + var(--at-safe-bottom));
  padding-bottom: var(--at-safe-bottom);
  background: var(--at-surface-card);
  border-top: 0.5px solid var(--at-border);
  display: flex;
  align-items: center;
  z-index: var(--at-z-nav);
}

.at-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: var(--at-space-2) var(--at-space-1);
  color: var(--at-text-muted);
  border-radius: var(--at-radius-md);
  transition: color var(--at-transition-fast);
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.at-nav-item:active { opacity: 0.6; }
.at-nav-item.active { color: var(--at-color-brand); }

.at-nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.at-nav-label {
  font-size: 10px;
  font-weight: var(--at-weight-medium);
  letter-spacing: 0.02em;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.at-card {
  background: var(--at-surface-card);
  border-radius: var(--at-radius-lg);
  border: 0.5px solid var(--at-border);
  padding: var(--at-space-3) var(--at-space-4);
}

/* ── Task cards ──────────────────────────────────────────────────────────── */
.at-task-card {
  background: var(--at-surface-card);
  border-radius: var(--at-radius-lg);
  border: 0.5px solid var(--at-border);
  padding: var(--at-space-3) var(--at-space-3);
  margin: 0 var(--at-space-3) var(--at-space-2);
  cursor: pointer;
  transition: background var(--at-transition-fast);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  /* Touch swipe support — set via JS */
  touch-action: pan-y;
}

.at-task-card:active { background: var(--at-gray-100); }

/* Overdue indicator */
.at-task-card.is-overdue {
  border-left: 3px solid var(--at-color-danger);
  border-radius: 0 var(--at-radius-lg) var(--at-radius-lg) 0;
  padding-left: calc(var(--at-space-3) - 2px);
}

/* Stuck indicator */
.at-task-card.is-stuck {
  border-left: 3px solid var(--at-color-warning);
  border-radius: 0 var(--at-radius-lg) var(--at-radius-lg) 0;
  padding-left: calc(var(--at-space-3) - 2px);
}

.at-task-title {
  font-size: var(--at-text-sm);
  font-weight: var(--at-weight-medium);
  color: var(--at-text-primary);
  line-height: var(--at-line-tight);
  margin-bottom: var(--at-space-2);
}

.at-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--at-space-1);
  align-items: center;
}

/* ── Pills / badges ──────────────────────────────────────────────────────── */
.at-pill {
  display: inline-flex;
  align-items: center;
  border-radius: var(--at-radius-full);
  padding: 2px var(--at-space-2);
  font-size: var(--at-text-xs);
  font-weight: var(--at-weight-medium);
  white-space: nowrap;
  line-height: 1.4;
}

.at-pill-brand   { background: var(--at-brand-50);  color: var(--at-brand-800); }
.at-pill-success { background: var(--at-teal-50);   color: var(--at-teal-800); }
.at-pill-warning { background: var(--at-amber-50);  color: var(--at-amber-800); }
.at-pill-danger  { background: var(--at-coral-50);  color: var(--at-coral-800); }
.at-pill-info    { background: var(--at-blue-50);   color: var(--at-blue-800); }
.at-pill-neutral { background: var(--at-gray-100);  color: var(--at-gray-700); }

/* Energy dots */
.at-energy-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.at-energy-dot.high { background: var(--at-coral-600); }
.at-energy-dot.med  { background: var(--at-amber-400); }
.at-energy-dot.low  { background: var(--at-blue-600); }

/* Priority pips */
.at-priority-pip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.at-priority-pip span {
  width: 4px;
  height: 12px;
  border-radius: 2px;
  background: var(--at-gray-200);
}
.at-priority-pip[data-priority="1"] span:nth-child(1),
.at-priority-pip[data-priority="2"] span:nth-child(-n+2),
.at-priority-pip[data-priority="3"] span:nth-child(-n+3),
.at-priority-pip[data-priority="4"] span:nth-child(-n+4),
.at-priority-pip[data-priority="5"] span { background: var(--at-color-brand); }
.at-priority-pip[data-priority="5"] span { background: var(--at-color-danger); }

/* ── Section headings ────────────────────────────────────────────────────── */
.at-section-heading {
  font-size: var(--at-text-xs);
  font-weight: var(--at-weight-medium);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--at-text-muted);
  padding: var(--at-space-3) var(--at-space-4) var(--at-space-2);
}

/* ── Energy check-in strip ───────────────────────────────────────────────── */
.at-energy-strip {
  display: flex;
  gap: var(--at-space-2);
  padding: var(--at-space-3) var(--at-space-3) var(--at-space-2);
  flex-shrink: 0;
}

.at-energy-btn {
  flex: 1;
  border-radius: var(--at-radius-md);
  padding: var(--at-space-2) var(--at-space-1);
  font-size: var(--at-text-sm);
  font-weight: var(--at-weight-medium);
  text-align: center;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: var(--at-gray-100);
  color: var(--at-text-muted);
  transition: all var(--at-transition-fast);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--at-space-1);
  -webkit-tap-highlight-color: transparent;
}

.at-energy-btn.active-full  { background: var(--at-teal-50);  color: var(--at-teal-800);  border-color: var(--at-teal-600); }
.at-energy-btn.active-some  { background: var(--at-amber-50); color: var(--at-amber-800); border-color: var(--at-amber-400); }
.at-energy-btn.active-low   { background: var(--at-blue-50);  color: var(--at-blue-800);  border-color: var(--at-blue-600); }

/* ── Free block ──────────────────────────────────────────────────────────── */
.at-free-block {
  background: var(--at-teal-50);
  border-radius: var(--at-radius-md);
  margin: var(--at-space-1) var(--at-space-3);
  padding: var(--at-space-2) var(--at-space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0.5px solid var(--at-teal-100);
}

.at-free-block-label { font-size: var(--at-text-sm); font-weight: var(--at-weight-medium); color: var(--at-teal-800); }
.at-free-block-time  { font-size: var(--at-text-xs); color: var(--at-teal-600); margin-top: 2px; }

/* ── Calendar event row ──────────────────────────────────────────────────── */
.at-cal-row {
  display: flex;
  align-items: center;
  gap: var(--at-space-2);
  padding: var(--at-space-1) var(--at-space-4);
}

.at-cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.at-cal-text { font-size: var(--at-text-sm); color: var(--at-text-primary); flex: 1; }
.at-cal-dur  { font-size: var(--at-text-xs); color: var(--at-text-muted); }

/* ── Bottom sheet ────────────────────────────────────────────────────────── */
.at-sheet-overlay {
  position: fixed;
  inset: 0;
  background: var(--at-surface-overlay);
  z-index: var(--at-z-overlay);
}

.at-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--at-surface-card);
  border-radius: var(--at-sheet-radius) var(--at-sheet-radius) 0 0;
  z-index: var(--at-z-sheet);
  padding: var(--at-space-4) var(--at-space-4) calc(var(--at-space-4) + var(--at-safe-bottom));
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.at-sheet-drag-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--at-radius-full);
  background: var(--at-gray-200);
  margin: 0 auto var(--at-space-4);
}

/* Alpine transitions for sheet */
.at-fade-in  { animation: at-fade-in 180ms ease forwards; }
.at-fade-out { animation: at-fade-out 180ms ease forwards; }
.at-slide-up { animation: at-slide-up 240ms cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.at-slide-down { animation: at-slide-down 200ms cubic-bezier(0.4, 0, 0.2, 1) forwards; }

@keyframes at-fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes at-fade-out  { from { opacity: 1; } to { opacity: 0; } }
@keyframes at-slide-up   { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes at-slide-down { from { transform: translateY(0); }    to { transform: translateY(100%); } }

/* ── Stuck Mode sheet ────────────────────────────────────────────────────── */
.at-stuck-head {
  display: flex;
  align-items: center;
  gap: var(--at-space-3);
  margin-bottom: var(--at-space-2);
}

.at-stuck-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--at-amber-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.at-stuck-title { font-size: var(--at-text-md); font-weight: var(--at-weight-medium); }
.at-stuck-sub   { font-size: var(--at-text-sm); color: var(--at-text-secondary); line-height: var(--at-line-loose); margin-bottom: var(--at-space-4); }

.at-stuck-btn {
  display: flex;
  align-items: center;
  gap: var(--at-space-3);
  border-radius: var(--at-radius-lg);
  padding: var(--at-space-3) var(--at-space-3);
  margin-bottom: var(--at-space-2);
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  transition: opacity var(--at-transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.at-stuck-btn:active { opacity: 0.75; }

.at-stuck-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--at-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.at-stuck-btn-label { font-size: var(--at-text-sm); font-weight: var(--at-weight-medium); }
.at-stuck-btn-sub   { font-size: var(--at-text-xs); margin-top: 2px; opacity: 0.75; }

.at-stuck-divider {
  border: none;
  border-top: 0.5px solid var(--at-border);
  margin: var(--at-space-2) 0;
}

/* ── Form elements ───────────────────────────────────────────────────────── */
.at-input {
  width: 100%;
  background: var(--at-surface-input);
  border: 1.5px solid var(--at-border-medium);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-3) var(--at-space-3);
  font-size: var(--at-text-base);
  color: var(--at-text-primary);
  outline: none;
  transition: border-color var(--at-transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.at-input:focus {
  border-color: var(--at-color-brand);
  box-shadow: 0 0 0 3px rgba(107, 93, 211, 0.12);
}

.at-input::placeholder { color: var(--at-text-disabled); }

.at-label {
  display: block;
  font-size: var(--at-text-xs);
  font-weight: var(--at-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--at-text-muted);
  margin-bottom: var(--at-space-2);
}

.at-select {
  width: 100%;
  background: var(--at-surface-input);
  border: 1.5px solid var(--at-border-medium);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-3) var(--at-space-3);
  font-size: var(--at-text-base);
  color: var(--at-text-primary);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888780' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.at-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--at-space-2);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-2) var(--at-space-4);
  font-size: var(--at-text-sm);
  font-weight: var(--at-weight-medium);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--at-transition-fast);
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.at-btn:active { transform: scale(0.97); }
.at-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.at-btn-primary {
  background: var(--at-color-brand);
  color: var(--at-brand-50);
  border-color: var(--at-color-brand);
}
.at-btn-primary:hover { background: var(--at-brand-700); }

.at-btn-secondary {
  background: var(--at-gray-100);
  color: var(--at-text-primary);
  border-color: var(--at-border-medium);
}
.at-btn-secondary:hover { background: var(--at-gray-200); }

.at-btn-ghost {
  background: transparent;
  color: var(--at-color-brand);
  border-color: var(--at-color-brand);
}
.at-btn-ghost:hover { background: var(--at-brand-50); }

.at-btn-danger {
  background: var(--at-coral-50);
  color: var(--at-coral-800);
  border-color: var(--at-coral-600);
}

.at-btn-ai {
  background: var(--at-brand-50);
  color: var(--at-brand-800);
  border-color: var(--at-color-brand);
  font-size: var(--at-text-xs);
  min-height: 38px;
}

.at-btn-full { width: 100%; }

.at-btn-row {
  display: flex;
  gap: var(--at-space-2);
  margin-top: var(--at-space-3);
}

.at-btn-row .at-btn { flex: 1; }

/* ── Toggle switch ───────────────────────────────────────────────────────── */
.at-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.at-toggle input { opacity: 0; width: 0; height: 0; }

.at-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: var(--at-radius-full);
  background: var(--at-gray-200);
  cursor: pointer;
  transition: background var(--at-transition-fast);
}

.at-toggle input:checked + .at-toggle-track { background: var(--at-color-brand); }

.at-toggle-track::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: transform var(--at-transition-fast);
}

.at-toggle input:checked + .at-toggle-track::after { transform: translateX(20px); }

/* ── Settings row ────────────────────────────────────────────────────────── */
.at-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--at-space-3) var(--at-space-4);
  border-bottom: 0.5px solid var(--at-border);
}

.at-setting-row:last-child { border-bottom: none; }

.at-setting-label {
  font-size: var(--at-text-base);
  color: var(--at-text-primary);
  font-weight: var(--at-weight-medium);
}

.at-setting-sub {
  font-size: var(--at-text-xs);
  color: var(--at-text-muted);
  margin-top: 2px;
}

/* ── AI provider pills ───────────────────────────────────────────────────── */
.at-provider-pills {
  display: flex;
  gap: var(--at-space-2);
  flex-wrap: wrap;
  padding: 0 var(--at-space-4) var(--at-space-3);
}

.at-provider-pill {
  border-radius: var(--at-radius-full);
  padding: var(--at-space-2) var(--at-space-3);
  font-size: var(--at-text-sm);
  font-weight: var(--at-weight-medium);
  cursor: pointer;
  border: 1.5px solid var(--at-border-medium);
  background: var(--at-gray-100);
  color: var(--at-text-secondary);
  transition: all var(--at-transition-fast);
  min-height: 44px;
}

.at-provider-pill.active {
  background: var(--at-brand-50);
  color: var(--at-brand-800);
  border-color: var(--at-color-brand);
}

/* ── Usage bar ───────────────────────────────────────────────────────────── */
.at-usage-bar-wrap {
  background: var(--at-gray-100);
  border-radius: var(--at-radius-full);
  height: 6px;
  overflow: hidden;
  margin-bottom: var(--at-space-1);
}

.at-usage-bar {
  height: 100%;
  border-radius: var(--at-radius-full);
  background: var(--at-color-brand);
  transition: width var(--at-transition-slow);
}

.at-usage-bar.warning { background: var(--at-color-warning); }
.at-usage-bar.danger  { background: var(--at-color-danger); }

/* ── Kanban board ────────────────────────────────────────────────────────── */
.at-board-scroll {
  display: flex;
  gap: var(--at-space-3);
  padding: var(--at-space-3) var(--at-space-3) var(--at-space-4);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  height: 100%;
  align-items: flex-start;
  scroll-snap-type: x proximity;
}

.at-board-scroll::-webkit-scrollbar { display: none; }

.at-board-col {
  flex-shrink: 0;
  width: 260px;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

.at-board-col-header {
  border-radius: var(--at-radius-md);
  padding: var(--at-space-2) var(--at-space-3);
  margin-bottom: var(--at-space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.at-board-col-title { font-size: var(--at-text-sm); font-weight: var(--at-weight-medium); }

.at-board-col-count {
  border-radius: var(--at-radius-full);
  padding: 1px var(--at-space-2);
  font-size: var(--at-text-xs);
  font-weight: var(--at-weight-medium);
}

/* Column theme: Inbox */
.at-col-inbox .at-board-col-header { background: var(--at-gray-100); }
.at-col-inbox .at-board-col-title  { color: var(--at-gray-700); }
.at-col-inbox .at-board-col-count  { background: var(--at-gray-200); color: var(--at-gray-700); }

/* Column theme: Next */
.at-col-next .at-board-col-header { background: var(--at-brand-50); }
.at-col-next .at-board-col-title  { color: var(--at-brand-800); }
.at-col-next .at-board-col-count  { background: var(--at-brand-200); color: var(--at-brand-900); }

/* Column theme: Scheduled */
.at-col-scheduled .at-board-col-header { background: var(--at-teal-50); }
.at-col-scheduled .at-board-col-title  { color: var(--at-teal-800); }
.at-col-scheduled .at-board-col-count  { background: var(--at-teal-100); color: var(--at-teal-900); }

/* Column theme: Waiting */
.at-col-waiting .at-board-col-header { background: var(--at-amber-50); }
.at-col-waiting .at-board-col-title  { color: var(--at-amber-800); }
.at-col-waiting .at-board-col-count  { background: var(--at-amber-100); color: var(--at-amber-900); }

/* Column theme: Someday */
.at-col-someday .at-board-col-header { background: var(--at-gray-100); }
.at-col-someday .at-board-col-title  { color: var(--at-gray-600); }
.at-col-someday .at-board-col-count  { background: var(--at-gray-200); color: var(--at-gray-700); }

/* ── Capture / Brain Dump ────────────────────────────────────────────────── */
.at-capture-input-wrap {
  padding: var(--at-space-4) var(--at-space-3) var(--at-space-2);
  position: sticky;
  top: 0;
  background: var(--at-surface-app);
  z-index: var(--at-z-header);
  border-bottom: 0.5px solid var(--at-border);
}

.at-brain-dump-area {
  width: 100%;
  min-height: 200px;
  background: var(--at-surface-card);
  border: 1.5px solid var(--at-border-medium);
  border-radius: var(--at-radius-lg);
  padding: var(--at-space-4);
  font-size: var(--at-text-base);
  color: var(--at-text-primary);
  resize: none;
  outline: none;
  line-height: var(--at-line-loose);
}

.at-brain-dump-area:focus { border-color: var(--at-color-brand); }

/* ── Task steps / checklist ──────────────────────────────────────────────── */
.at-step {
  display: flex;
  align-items: center;
  gap: var(--at-space-3);
  padding: var(--at-space-2) 0;
  border-bottom: 0.5px solid var(--at-border);
}

.at-step:last-child { border-bottom: none; }

.at-step-check {
  width: 18px;
  height: 18px;
  border-radius: var(--at-radius-sm);
  border: 1.5px solid var(--at-gray-200);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--at-transition-fast);
}

.at-step-check.done {
  background: var(--at-color-success);
  border-color: var(--at-color-success);
}

.at-step-text { font-size: var(--at-text-sm); color: var(--at-text-primary); }
.at-step-text.done { color: var(--at-text-muted); text-decoration: line-through; }

/* ── Scary task indicator ────────────────────────────────────────────────── */
.at-scary-flag {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--at-color-danger);
  flex-shrink: 0;
}

/* ── Good Enough box ─────────────────────────────────────────────────────── */
.at-good-enough {
  background: var(--at-gray-50);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-3);
  margin-bottom: var(--at-space-3);
}

.at-good-enough-label {
  font-size: var(--at-text-xs);
  font-weight: var(--at-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--at-text-muted);
  margin-bottom: var(--at-space-1);
}

.at-good-enough-text {
  font-size: var(--at-text-sm);
  color: var(--at-text-primary);
  font-style: italic;
  line-height: var(--at-line-normal);
}

/* ── Scary toggle row ────────────────────────────────────────────────────── */
.at-scary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--at-coral-50);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-2) var(--at-space-3);
  margin-bottom: var(--at-space-2);
}

.at-scary-label {
  font-size: var(--at-text-sm);
  font-weight: var(--at-weight-medium);
  color: var(--at-coral-800);
}

/* ── Focus session (The Tether) ──────────────────────────────────────────── */
.at-tether-screen {
  position: fixed;
  inset: 0;
  background: var(--at-surface-app);
  z-index: calc(var(--at-z-sheet) + 10);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--at-space-8) var(--at-space-6);
  text-align: center;
  padding-top: var(--at-safe-top);
  padding-bottom: calc(var(--at-safe-bottom) + var(--at-space-8));
}

.at-tether-task {
  font-size: var(--at-text-xl);
  font-weight: var(--at-weight-medium);
  color: var(--at-text-primary);
  line-height: var(--at-line-tight);
  max-width: 320px;
  margin-bottom: var(--at-space-8);
}

.at-tether-timer {
  font-size: 56px;
  font-weight: var(--at-weight-medium);
  color: var(--at-color-brand);
  letter-spacing: -0.02em;
  margin-bottom: var(--at-space-8);
  font-variant-numeric: tabular-nums;
}

/* ── Toast notifications ─────────────────────────────────────────────────── */
.at-toast {
  position: fixed;
  bottom: calc(var(--at-nav-height) + var(--at-safe-bottom) + var(--at-space-3));
  left: var(--at-space-4);
  right: var(--at-space-4);
  background: var(--at-gray-800);
  color: #F0EEE8;
  border-radius: var(--at-radius-lg);
  padding: var(--at-space-3) var(--at-space-4);
  font-size: var(--at-text-sm);
  z-index: var(--at-z-toast);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: at-toast-in 200ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes at-toast-in {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Wins Log entry ──────────────────────────────────────────────────────── */
.at-win {
  display: flex;
  gap: var(--at-space-3);
  padding: var(--at-space-3) var(--at-space-4);
  border-bottom: 0.5px solid var(--at-border);
}

.at-win-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--at-teal-50);
  border: 1.5px solid var(--at-teal-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.at-win-title { font-size: var(--at-text-sm); font-weight: var(--at-weight-medium); color: var(--at-text-primary); }
.at-win-meta  { font-size: var(--at-text-xs); color: var(--at-text-muted); margin-top: 2px; }

/* ── Empty states ────────────────────────────────────────────────────────── */
.at-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--at-space-12) var(--at-space-6);
  text-align: center;
  gap: var(--at-space-3);
}

.at-empty-title { font-size: var(--at-text-md); font-weight: var(--at-weight-medium); color: var(--at-text-primary); }
.at-empty-sub   { font-size: var(--at-text-sm); color: var(--at-text-muted); line-height: var(--at-line-loose); max-width: 260px; }

/* ── Tether Partner nudge ────────────────────────────────────────────────── */
.at-tether-nudge {
  background: var(--at-brand-50);
  border: 1.5px solid var(--at-color-brand);
  border-radius: var(--at-radius-lg);
  padding: var(--at-space-3) var(--at-space-4);
  margin: var(--at-space-1) var(--at-space-3);
  font-size: var(--at-text-sm);
  color: var(--at-brand-800);
  font-weight: var(--at-weight-medium);
}

/* ── Onboarding prompt banner ────────────────────────────────────────────── */
.at-onboarding-prompt {
  background: var(--at-brand-50);
  border-bottom: 0.5px solid var(--at-brand-100);
  padding: var(--at-space-3) var(--at-space-4);
  display: flex;
  align-items: center;
  gap: var(--at-space-3);
}

.at-onboarding-text { flex: 1; font-size: var(--at-text-sm); color: var(--at-brand-800); line-height: var(--at-line-normal); }

.at-onboarding-cta {
  background: var(--at-color-brand);
  color: var(--at-brand-50);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-2) var(--at-space-3);
  font-size: var(--at-text-xs);
  font-weight: var(--at-weight-medium);
  white-space: nowrap;
  flex-shrink: 0;
}

.at-onboarding-dismiss {
  color: var(--at-text-muted);
  font-size: var(--at-text-xs);
  flex-shrink: 0;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.at-divider {
  border: none;
  border-top: 0.5px solid var(--at-border);
  margin: var(--at-space-2) 0;
}

.at-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.at-text-center { text-align: center; }
.at-mt-2 { margin-top: var(--at-space-2); }
.at-mt-3 { margin-top: var(--at-space-3); }
.at-mt-4 { margin-top: var(--at-space-4); }
.at-mb-2 { margin-bottom: var(--at-space-2); }
.at-mb-3 { margin-bottom: var(--at-space-3); }
.at-px-4 { padding-left: var(--at-space-4); padding-right: var(--at-space-4); }
