/* Shared interactive components: buttons, cards, tabs, modals */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--touch-min);
  padding: 12px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--on-surface, var(--text));
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--ease), border-color var(--ease), opacity var(--ease), color var(--ease);
}
.btn:hover { background: var(--surface-low, var(--bg-subtle)); text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  background: var(--primary-container, var(--accent));
  border-color: var(--primary-container, var(--accent));
  filter: none;
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  color: var(--on-surface, var(--text));
  background: var(--surface-low, var(--bg-subtle));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
}

.modal-backdrop,
.propose-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(26, 29, 36, 0.45);
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  overflow: auto;
}
.modal-backdrop.is-open,
.propose-backdrop.is-open { display: flex; }

.modal,
.propose-modal {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.theme-toggle:hover {
  background: var(--surface-low, var(--bg-subtle));
  color: var(--text);
}

.toast {
  position: fixed;
  z-index: 50;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--on-surface, var(--text));
  color: var(--surface);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  max-width: min(420px, calc(100vw - 32px));
}
.toast.is-on { opacity: 1; }
.toast.is-error { background: var(--danger); }
