/* Garage — shared components (ported from mockup/styles.css; later batches add the rest) */

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow), var(--inset);
  border-radius: var(--radius);
}

/* 48px tap targets (DESIGN.md 1.10): visual size stays, hit area grows. */
.hit, .icon-btn, .back, .btn-plus, .backup-btn, .ghost-btn, .cal-btn,
.filters button, .seg button, .suggest button, .dd-item, .nacts button, .toast-action {
  position: relative;
}
.hit::after, .icon-btn::after, .back::after, .btn-plus::after, .backup-btn::after,
.ghost-btn::after, .cal-btn::after, .filters button::after, .seg button::after,
.suggest button::after, .dd-item::after, .nacts button::after, .toast-action::after {
  content: "";
  position: absolute;
  inset: min(0px, calc((100% - 48px) / 2));
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.icon-btn svg { width: 18px; height: 18px; }

.badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--due);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

/* Buttons */
.btn-plus, .primary, .backup-btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(124,94,74,0.25);
}
.btn-plus {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
}
.btn-plus svg { width: 14px; height: 14px; }
.primary {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  font-size: 15px;
  margin-top: 8px;
}
.primary { display: flex; align-items: center; justify-content: center; gap: 8px; }
.primary svg, .backup-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.primary[disabled] { opacity: 0.5; cursor: default; }
.backup-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.backup-btn.soft {
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: none;
}
.ghost-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.danger-btn {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: 1px solid rgba(185,28,28,0.25);
  border-radius: 14px;
  background: #FEF2F2;
  color: var(--overdue);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.danger-btn[disabled] { opacity: 0.5; cursor: default; }
.ghost-wide {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}

/* Text helpers */
.group-lbl {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 8px 0 8px 4px;
}
.section-lbl {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 16px 0 8px;
}
.hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.hint.warn { color: var(--due-ink); font-weight: 650; }
.note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.note b { color: var(--text); }
.note .inline-ic { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; color: var(--text); }
.note ol { margin: 8px 0 0; padding-inline-start: 18px; }
.note li { margin-bottom: 4px; }

/* Settings rows */
.row-card { padding: 0; overflow: hidden; margin-bottom: 16px; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
  width: 100%;
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: default;
}
.row:last-child { border-bottom: 0; }
.row.clickable { cursor: pointer; min-height: 48px; }
.row .r-title { font-size: 15px; font-weight: 650; }
.row .r-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row .seg { min-width: 112px; flex-shrink: 0; }
.chev { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }

/* Sheets */
.backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.backdrop.is-open { opacity: 1; visibility: visible; transition: opacity 0.25s ease, visibility 0s; }
.sheet {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 60;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--stroke);
  border-bottom: 0;
  padding: 10px 16px calc(24px + var(--safe-bottom));
  transform: translateY(110%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 -16px 48px rgba(17,24,39,0.15);
  scrollbar-width: none;
}
.sheet::-webkit-scrollbar { display: none; }
.sheet.is-open { transform: none; }
.sheet:has(.dd.is-open) { overflow: hidden; min-height: min(90%, 440px); } /* room for the menu on short sheets */
.sheet:has(.dd.is-open) > .primary { display: none; }
.grab {
  width: 40px; height: 4px; border-radius: 4px;
  background: var(--beige);
  margin: 0 auto 14px;
}
.sheet h2 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  outline: none;
}

/* Form controls */
.field { margin-bottom: 10px; }
.field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 48px;
  font: inherit;
  font-size: 15px;
  outline: none;
  box-shadow: var(--shadow);
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg {
  display: flex;
  background: var(--bg-2);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
}
.seg button.is-on {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.seg button[disabled] { opacity: 0.5; cursor: default; }

.dd { position: relative; }
.dd.is-open { z-index: 8; }
.dd-btn {
  width: 100%;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 48px;
  font: inherit;
  font-size: 15px;
  font-weight: 550;
  text-align: start;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: var(--shadow);
}
.dd-btn .caret { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.dd-menu {
  display: none;
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 20;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  max-height: 260px;
  overflow-y: auto;
}
.dd.is-open .dd-menu { display: block; }
.dd.is-open .dd-btn { border-color: var(--accent); }
.dd-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  text-align: start;
  padding: 8px 10px;
  min-height: 48px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.dd-item small { color: var(--muted); font-size: 11px; font-weight: 450; }
.dd-item.is-on, .dd-item:hover { background: var(--accent-soft); }

/* Toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(110px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 550;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90%;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: var(--shadow-lg);
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.has-action.is-on { pointer-events: auto; }
.toast-text { overflow: hidden; text-overflow: ellipsis; }
.toast-action {
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  height: 20px;
}
