/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--sans);
  pointer-events: auto;
  max-width: 420px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  line-height: 1.4;
  animation: toast-in 0.18s ease;
}
.toast.error { background: var(--bad); }
.toast.success { background: oklch(0.42 0.12 145); color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Inline two-step confirm */
.confirm-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--bad);
  font-family: var(--sans);
}

/* Home view styles */
.home {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 40px 80px;
}
.home .hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}
.home .hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.home .hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.home .hero .meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: right;
  line-height: 1.7;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.search {
  flex: 1;
  position: relative;
}
.search input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  font-size: 15px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.search input:focus {
  border-color: var(--accent);
  background: #fff;
}
.search .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 10px 0 14px;
}
.section-label h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.section-label .count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.subject-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px 20px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.subject-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--rule-2);
}
.subject-card .swatch {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--swatch);
}
.subject-card h3 {
  margin: 16px 0 4px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.subject-card .tagline {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 14px;
}
.subject-card .school-system-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2px 7px;
}
.subject-card .stats {
  display: flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.subject-card .stats strong { color: var(--ink); font-weight: 500; }

.add-card {
  background: transparent;
  border: 1.5px dashed var(--rule-2);
  border-radius: 10px;
  min-height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 20px;
}
.add-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(198,106,61,0.04);
}
.add-card .plus {
  font-size: 30px;
  font-family: var(--serif);
  line-height: 1;
}
.add-card .label {
  font-size: 13px;
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
}

/* archived section */
.archived-section {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--rule);
}

.archived-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.archived-toggle:hover { color: var(--accent); }
.archived-toggle-chevron {
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 2px;
}

.archived-grid { margin-top: 18px; }

.archived-card {
  opacity: 0.55;
  cursor: default;
  transition: opacity 0.15s ease;
}
.archived-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--rule);
  opacity: 0.75;
}

.archived-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
