/* Existing design tokens/layout remain intentionally simple. */

:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17202a;
  background: #f5f7fa;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
}

.app-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.app-header,
.section-heading,
.action-row,
.topic-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-header {
  align-items: flex-start;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #667085;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.subtitle {
  margin-bottom: 0;
  color: #667085;
}

.progress-panel,
.parser-panel {
  padding: 24px;
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 14px;
}

.progress-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #667085;
}

.task-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e7eaee;
  border-radius: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.status-badge--success {
  color: #146c43;
  background: #e9f7ef;
}

.status-badge--warning {
  color: #8a5a00;
  background: #fff4d6;
}

.status-panel {
  padding: 12px 14px;
  margin-top: 16px;
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  color: #475467;
  background: #f8fafc;
}

.status-panel--success {
  color: #146c43;
  background: #e9f7ef;
  border-color: #b7e1c8;
}

.status-panel--warning {
  color: #8a5a00;
  background: #fff4d6;
  border-color: #f0d99a;
}

.form-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  font-size: 0.85rem;
  font-weight: 700;
}

select,
textarea,
input[type="text"],
input[type="search"] {
  width: 100%;
  border: 1px solid #cfd5dc;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}

button,
.file-button {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #cfd5dc;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #17202a;
  background: #fff;
}

textarea {
  resize: vertical;
}

.primary-button {
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: #17202a;
}

.secondary-button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button:hover,
.file-button:hover {
  filter: brightness(0.96);
}

button:focus-visible,
.file-button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #7db4ff;
  outline-offset: 2px;
}

.onedrive-settings {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.onedrive-settings .action-row {
  flex-wrap: wrap;
}

.randomizer__toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: #475467;
  font-size: 0.9rem;
}

.randomizer__toggle input {
  width: 18px;
  height: 18px;
}

.activity-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.activity-entry {
  padding: 14px 16px;
  border: 1px solid #e7eaee;
  border-radius: 10px;
  background: #fbfcfe;
}

.activity-entry__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-entry p {
  margin: 8px 0 0;
  color: #475467;
  overflow-wrap: anywhere;
}

.activity-entry time {
  display: block;
  margin-top: 8px;
  color: #667085;
  font-size: 0.78rem;
}

.file-button {
  margin: 0;
}

.action-row {
  justify-content: flex-start;
  margin-top: 16px;
}

.results-stack {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.topic-grid {
  display: grid;
  gap: 12px;
}

.topic-card {
  padding: 16px;
  border: 1px solid #dfe3e8;
  border-radius: 12px;
  background: #fff;
}

.topic-card__header {
  margin-bottom: 14px;
}

.topic-card__number {
  font-size: 0.75rem;
  font-weight: 700;
  color: #667085;
}

.topic-fields {
  display: grid;
  gap: 10px;
  margin: 0;
}

.topic-fields div {
  display: grid;
  gap: 2px;
}

.topic-fields dt {
  font-size: 0.72rem;
  font-weight: 700;
  color: #667085;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topic-fields dd {
  margin: 0;
}

.parser-errors {
  padding: 16px;
  border: 1px solid #f0d99a;
  border-radius: 12px;
  background: #fffaf0;
}

.parser-errors ul {
  margin: 0;
  padding-left: 20px;
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: minmax(220px, 300px) 1fr;
  }

  .field--full {
    grid-column: 1 / -1;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 20px, 1100px);
    padding-top: 20px;
  }

  .app-header,
  .section-heading,
  .task-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .onedrive-settings .action-row > * {
    width: 100%;
  }

  .progress-panel,
  .parser-panel {
    padding: 18px;
  }
}

.topic-detection {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 1rem;
}

.topic-detection--success {
  background: #ecfdf3;
  border-color: #b7e4c7;
}

.topic-detection--warning {
  background: #fff8e6;
  border-color: #f2d28b;
}

.panel {
  padding: 24px;
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 14px;
}

.form-group {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
}

.topic-save-button {
  margin-top: 16px;
}

.saved-topics {
  display: grid;
  gap: 16px;
}

.topic-card--saved {
  min-width: 0;
}

.phase-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #667085;
}

.topic-copy-button { margin-top: 16px; }

.topic-conflict {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-md);
  background: var(--color-warning-soft);
}

.topic-conflict__header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.topic-conflict__existing-id {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.topic-conflict__title {
  margin: 12px 0 0;
  font-weight: 700;
}

.topic-conflict__existing {
  margin-top: 12px;
}

.topic-conflict__details {
  margin-top: 12px;
}

.topic-conflict__details h4 {
  margin: 0 0 4px;
  font-size: 0.85rem;
}

.topic-conflict__details p,
.topic-conflict__details ul {
  margin: 0;
}

.topic-conflict__guidance {
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.topic-conflict__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.randomizer__description {
  margin-bottom: 16px;
  color: #667085;
}

.randomizer__result {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #dfe3e8;
  border-radius: 12px;
  background: #f8fafc;
}

.randomizer__result--success {
  border-color: #b7e1c8;
  background: #f7fcf9;
}

.randomizer__result--warning {
  border-color: #f0d99a;
  background: #fffaf0;
}

.randomizer__selected-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #172520;
  background: #f4f7f4;
  line-height: 1.55;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(203, 235, 217, 0.23), transparent 42rem),
    #f4f7f4;
}

.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: 1680px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 18px 20px;
  color: #eff8f1;
  background: linear-gradient(165deg, #18362b 0%, #10251e 100%);
  box-shadow: 14px 0 40px rgba(18, 44, 33, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 34px;
  color: #f5fff7;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(184, 239, 202, 0.28);
  border-radius: 14px;
  color: #c5f2d1;
  background: linear-gradient(145deg, #2c6249, #214a38);
  font-size: 1.35rem;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand strong {
  font-size: 1.02rem;
  letter-spacing: 0.15em;
}

.brand small {
  margin-top: 4px;
  color: #9bb6a5;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.sidebar-label {
  padding: 0 12px 10px;
  color: #7e9b89;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #bdcfc3;
  background: transparent;
  font-size: 0.91rem;
  font-weight: 650;
  text-align: left;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  border-color: rgba(186, 237, 201, 0.14);
  color: #f3fff5;
  background: linear-gradient(90deg, rgba(109, 176, 132, 0.24), rgba(89, 148, 111, 0.12));
  box-shadow: inset 3px 0 #9fe0b1;
}

.nav-icon {
  display: grid;
  width: 24px;
  place-items: center;
  color: #9acaaa;
  font-size: 1.18rem;
}

.nav-count {
  min-width: 25px;
  padding: 2px 7px;
  margin-left: auto;
  border-radius: 999px;
  color: #bce5c6;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  text-align: center;
}

.sidebar-spacer { flex: 1; }

.sidebar-storage {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 10px;
  border: 1px solid rgba(208, 237, 215, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.storage-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #edc779;
  box-shadow: 0 0 0 4px rgba(237, 199, 121, 0.12);
}

.sidebar-storage strong,
.sidebar-storage small { display: block; }
.sidebar-storage strong { color: #edf7ef; font-size: 0.75rem; }
.sidebar-storage small { margin-top: 2px; color: #8ea999; font-size: 0.68rem; }

.sidebar-storage .icon-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  margin-left: auto;
  border: 0;
  color: #a3bcab;
  background: transparent;
}

.workspace {
  min-width: 0;
  padding: 0 clamp(22px, 4.6vw, 68px) 56px;
}

.topbar {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #e6ece7;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #94a19a;
  font-size: 0.77rem;
}

.breadcrumb strong { color: #34453c; font-weight: 700; }
.topbar-actions, .parser-actions { display: flex; align-items: center; gap: 12px; }

.topbar-connect {
  min-height: 36px;
  padding: 6px 12px;
  border-color: #dce7de;
  color: #3e5949;
  background: #fff;
  font-size: 0.77rem;
}

.persistence-banner {
  margin: 16px 0 0;
  padding: 9px 13px;
  border-radius: 11px;
  font-size: 0.81rem;
}

.page-view {
  padding-top: 36px;
  animation: view-enter 220ms ease-out;
}

.page-view[hidden] { display: none !important; }

@keyframes view-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin: 4px 0 28px;
}

.page-heading h1 {
  margin: 4px 0 8px;
  color: #18352a;
  font-size: clamp(2rem, 3.2vw, 2.72rem);
  font-weight: 730;
  letter-spacing: -0.045em;
}

.page-heading .app-subtitle { margin: 0; color: #798980; font-size: 0.95rem; }
.eyebrow { color: #7c9384; font-size: 0.66rem; letter-spacing: 0.13em; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  position: relative;
  min-height: 145px;
  padding: 20px 21px;
  overflow: hidden;
  border: 1px solid #e5ece6;
  border-radius: 17px;
  background: linear-gradient(145deg, #fff 25%, #f8fbf8);
  box-shadow: 0 7px 24px rgba(29, 59, 41, 0.035);
}

.metric-card--mint { background: linear-gradient(145deg, #fff 18%, #f0f8f1); }
.metric-card--amber { background: linear-gradient(145deg, #fff 18%, #fcf7eb); }
.metric-card--blue { background: linear-gradient(145deg, #fff 18%, #eef5f8); }
.metric-label { display: block; color: #7e8e83; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.105em; }

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: #1d3c2d;
  font-size: 2.15rem;
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 1;
}

.metric-card small { display: block; margin-top: 8px; color: #87948a; font-size: 0.73rem; }
.metric-icon { position: absolute; top: 19px; right: 19px; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: #547b61; background: rgba(173, 218, 184, 0.24); font-size: 1.1rem; }
.metric-card--amber .metric-icon { color: #9b7832; background: #fbf0d4; }
.metric-card--blue .metric-icon { color: #507d92; background: #dfedf2; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.95fr);
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-side { display: grid; gap: 16px; }
.panel, .parser-panel { padding: 23px; border-color: #e5ece6; border-radius: 17px; box-shadow: 0 7px 24px rgba(29, 59, 41, 0.035); }
.panel h2, .panel h3 { color: #203b2d; }
.panel .section-heading { margin-bottom: 15px; }
.storage-panel .subtitle { color: #78877d; font-size: 0.82rem; }
.storage-panel .storage-meta { margin: 10px 0 0; color: #74877a; font-size: 0.72rem; font-weight: 650; }
.storage-panel .onedrive-settings { margin-top: 20px; }
.storage-panel .action-row { flex-wrap: wrap; gap: 8px; }
.storage-panel .action-row button { min-height: 37px; padding: 7px 11px; font-size: 0.75rem; }
.storage-panel .action-row .primary-button { color: #fff; }
.storage-panel #onedrive-message[data-state="conflict"] { color: #805716; }
.storage-panel #onedrive-message[data-state="error"] { color: #8c4d43; }
.persistence-banner--working { color: #3c5b46; background: #eff7f0; border-color: #d7e9db; }
.persistence-banner--working::before,
#onedrive-message[aria-busy="true"]::before {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.55em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.08em;
  animation: atlas-spin 750ms linear infinite;
}
@keyframes atlas-spin { to { transform: rotate(360deg); } }
.storage-panel .status-badge { white-space: nowrap; }
.storage-panel .action-row button { transition: transform 140ms ease, box-shadow 140ms ease; }
.storage-panel .action-row button:hover { transform: translateY(-1px); }
.field span, .form-group label { color: #53665a; font-size: 0.77rem; font-weight: 700; }
.field input, .form-group textarea, .topic-search input, .activity-search input { border-color: #dfe8e0; border-radius: 11px; color: #20392c; background: #fbfdfb; }

.primary-button {
  min-height: 43px;
  padding: 10px 16px;
  border: 1px solid #1c4b34;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #245c3e, #19462f);
  box-shadow: 0 5px 13px rgba(27, 80, 50, 0.14);
  font-size: 0.83rem;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.primary-button:hover { transform: translateY(-1px); box-shadow: 0 8px 17px rgba(27, 80, 50, 0.18); filter: brightness(1.05); }
.secondary-button { border-color: #dce6dd; border-radius: 10px; color: #3c5b46; background: #fff; font-size: 0.79rem; }

.quick-tip {
  padding: 19px 20px;
  border: 1px solid #dcebe0;
  border-radius: 16px;
  background: linear-gradient(145deg, #edf7ef, #f6faf5);
}

.quick-tip > span { color: #477356; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.11em; }
.quick-tip p { margin: 10px 0; color: #486052; font-size: 0.81rem; line-height: 1.65; }
.quick-tip button { min-height: 30px; padding: 4px 0; border: 0; color: #28613e; background: transparent; font-size: 0.76rem; }
.activity-search { width: min(260px, 45%); }
.activity-search input { min-height: 37px; padding: 8px 11px; font-size: 0.76rem; }
.activity-entry { border-color: #e6ece6; border-radius: 12px; background: #fbfdfb; }
.activity-entry__heading strong { color: #294533; font-size: 0.8rem; }
.activity-entry p { font-size: 0.77rem; }
.activity-entry time { font-size: 0.7rem; }
.format-chip { padding: 6px 10px; border: 1px solid #dfece1; border-radius: 999px; color: #54745d; background: #f2f8f2; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.08em; }
.parser-panel { max-width: 1040px; }
.parser-panel .form-group { margin-top: 20px; }
.parser-panel textarea { min-height: 270px; line-height: 1.65; }
.parser-panel .topic-detection { border-radius: 11px; }
.parser-actions { justify-content: space-between; flex-wrap: wrap; margin-top: 14px; }
.keyboard-hint { color: #829087; font-size: 0.72rem; }
#script-source-topic { margin-top: 18px; }

.topic-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  margin: 10px 0 20px;
  padding: 0 12px;
  border: 1px solid #dfe8e0;
  border-radius: 11px;
  color: #71847a;
  background: #fbfdfb;
}

.topic-search input { min-height: 42px; padding: 8px 0; border: 0; outline: 0; background: transparent; box-shadow: none; }
.topic-bank-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: -8px 0 20px; }
.topic-bank-filters label { display: grid; gap: 5px; color: #71847a; font-size: 0.68rem; font-weight: 750; }
.topic-bank-filters select { min-width: 150px; min-height: 38px; padding: 7px 30px 7px 10px; border: 1px solid #dfe8e0; border-radius: 10px; color: #304539; background: #fbfdfb; }
.topic-card--skeleton { min-height: 210px; border-color: transparent; background: linear-gradient(100deg, #f3f7f3 30%, #e9f0ea 45%, #f3f7f3 60%); background-size: 220% 100%; animation: topic-skeleton 1.3s ease-in-out infinite; }
@keyframes topic-skeleton { to { background-position-x: -220%; } }
.topic-card, .topic-conflict { border-color: #e3ebe4; border-radius: 14px; box-shadow: 0 4px 14px rgba(27, 53, 37, 0.03); }
.topic-fields dt { color: #819085; font-size: 0.65rem; }
.topic-fields dd { color: #304539; font-size: 0.86rem; line-height: 1.55; overflow-wrap: anywhere; }
.topic-card__number { color: #587562; font-size: 0.72rem; }
.topic-card__flag-fallback { display: inline-grid; width: 28px; height: 20px; place-items: center; border: 1px solid #d8e2dc; border-radius: 5px; background: #f4f8f5; font-size: 0.8rem; }
.topic-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.topic-card__actions button { min-height: 36px; padding: 7px 11px; font-size: 0.74rem; }
.phase-label { color: #668170; font-size: 0.69rem; font-weight: 800; }
.randomizer { padding: 0; border: 0; background: transparent; }
.randomizer__description { color: #7a8a7f; font-size: 0.77rem; }
.randomizer__result { margin-top: 14px; padding: 12px; border: 1px solid #e4ece5; border-radius: 12px; background: #fbfdfb; }
.randomizer__result .topic-fields { margin-top: 11px; }

.match-panel { margin-top: 20px; padding: 19px; border: 1px solid #e2ebe3; border-radius: 15px; background: #fbfdfb; }
.match-panel__heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.match-panel__heading h3 { margin-bottom: 0; }
.match-panel > p { margin: 10px 0 14px; color: #728077; font-size: 0.81rem; }
.match-candidates { display: grid; gap: 8px; }
.match-candidate { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-color: #e1e9e2; border-radius: 12px; text-align: left; }
.match-candidate:hover { border-color: #9fcaab; background: #f3faf4; }
.match-rank { display: grid; flex: 0 0 27px; height: 27px; place-items: center; border-radius: 9px; color: #4d7559; background: #e7f2e9; font-size: 0.75rem; font-weight: 800; }
.match-candidate__copy { display: grid; flex: 1; gap: 2px; }
.match-candidate__copy strong { color: #2b4434; font-size: 0.81rem; }
.match-candidate__copy small { color: #7f8c82; font-size: 0.69rem; }
.match-score { color: #557660; font-size: 0.78rem; font-weight: 800; }
.match-confirmed { display: flex; align-items: center; gap: 12px; }
.match-check { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 50%; color: #27643b; background: #e5f4e8; font-weight: 900; }
.match-confirmed strong { color: #28523a; font-size: 0.83rem; }
.match-confirmed p { margin: 3px 0 0; color: #728077; font-size: 0.76rem; }
.topic-conflict__actions { margin-top: 14px; }
.topic-conflict__details { border-radius: 10px; background: #fffaf0; }
.status-badge--success { color: #28613e; background: #e9f5eb; }
.status-badge--warning { color: #8c6925; background: #fbf2dc; }
.status-panel { line-height: 1.55; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #83c89a; outline-offset: 3px; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell { display: flex; flex-direction: column; }
  .sidebar { position: sticky; z-index: 20; top: 0; height: auto; padding: 10px 14px 11px; box-shadow: 0 7px 22px rgba(18, 44, 33, 0.15); }
  .brand { padding: 0 3px 10px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .brand strong { font-size: 0.86rem; }
  .brand small { font-size: 0.56rem; }
  .sidebar-label, .sidebar-spacer, .sidebar-storage { display: none; }
  .sidebar-nav { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .nav-item { justify-content: center; gap: 6px; min-height: 39px; padding: 6px; border-radius: 10px; font-size: 0.72rem; }
  .nav-icon { width: auto; font-size: 0.95rem; }
  .nav-count { min-width: 19px; padding: 1px 5px; font-size: 0.62rem; }
  .workspace { padding: 0 15px 34px; }
  .topbar { min-height: 54px; }
  .breadcrumb { font-size: 0.68rem; }
  .topbar-connect { min-height: 32px; padding: 5px 8px; font-size: 0.67rem; }
  .topbar-actions .status-badge { min-height: 25px; padding: 3px 7px; font-size: 0.58rem; }
  .page-view { padding-top: 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 2rem; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 125px; padding: 15px; border-radius: 14px; }
  .metric-card strong { font-size: 1.8rem; }
  .metric-icon { top: 13px; right: 13px; width: 29px; height: 29px; }
  .panel, .parser-panel { padding: 17px; border-radius: 15px; }
  .panel .section-heading { align-items: flex-start; flex-direction: row; }
  .storage-panel .action-row > * { flex: 1 1 auto; width: auto; }
  .parser-panel textarea { min-height: 220px; }
  .parser-actions { align-items: flex-start; flex-direction: column; }
  .keyboard-hint { line-height: 1.4; }
  .activity-search { width: 46%; }
  .activity-entry__heading { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}


/* =========================================================
   ATLAS MINUTE — Reference dashboard layout
   Global sidebar + reference-matched dashboard geometry.
   ========================================================= */

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: calc(100% - 44px);
  max-width: none;
  min-height: 100vh;
  margin: 0 22px;
  padding: 0;
  gap: 0;
}

/* ---------- Global sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 34px 18px 24px;
  color: #30443a;
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid #e5ebe7;
  border-radius: 0 0 20px 20px;
  box-shadow: 10px 0 35px rgba(26, 61, 43, 0.035);
  backdrop-filter: blur(18px);
}

.brand {
  padding: 0 8px 38px;
  color: #1d3028;
}

.brand-mark {
  width: 49px;
  height: 49px;
  border: 0;
  border-radius: 15px;
  color: #eaf8ee;
  background: linear-gradient(145deg, #2e7653, #174f36);
  box-shadow: 0 8px 18px rgba(30, 99, 67, 0.12);
}

.brand strong {
  color: #183128;
  font-size: 1rem;
  letter-spacing: 0.15em;
}

.brand small {
  color: #77867d;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}

.sidebar-label {
  padding: 0 12px 10px;
  color: #849087;
}

.sidebar-nav {
  gap: 6px;
}

.nav-item {
  min-height: 49px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #718078;
  background: transparent;
}

.nav-item:hover {
  color: #244638;
  background: #f3f8f4;
}

.nav-item.is-active {
  border-color: rgba(111, 194, 140, 0.18);
  color: #183f2d;
  background: linear-gradient(
    90deg,
    rgba(93, 178, 122, 0.16),
    rgba(93, 178, 122, 0.07)
  );
  box-shadow: inset 3px 0 #54c47c;
}

.nav-icon {
  color: #76a587;
}

.nav-count {
  color: #4d8060;
  background: #e9f5ec;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-storage {
  padding: 13px 10px;
  border: 1px solid #e5ece7;
  border-radius: 14px;
  background: #fbfdfb;
  box-shadow: 0 7px 20px rgba(29, 65, 45, 0.035);
}

.sidebar-storage strong {
  color: #294337;
}

.sidebar-storage small {
  color: #829087;
}

.sidebar-storage .icon-button {
  color: #789084;
}

/* ---------- Workspace ---------- */

.workspace {
  min-width: 0;
  padding: 0 34px 42px 58px;
}

.topbar {
  min-height: 76px;
  border-bottom: 1px solid #e5ebe7;
}

.breadcrumb {
  color: #9aa59f;
}

.breadcrumb strong {
  color: #31443b;
}

.topbar-actions {
  gap: 12px;
}

.topbar-connect {
  border-color: #dce7de;
  color: #40594a;
  background: #fff;
}

.persistence-banner {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 11px;
}

/* ---------- Dashboard heading ---------- */

#dashboard-view {
  padding-top: 28px;
}

#dashboard-view .page-heading {
  margin: 0 0 25px;
  align-items: flex-end;
}

#dashboard-view .page-heading h1 {
  margin: 4px 0 8px;
  color: #102c20;
  font-size: clamp(2.2rem, 3.1vw, 2.8rem);
  letter-spacing: -0.055em;
}

#dashboard-view .app-subtitle {
  color: #78877e;
}

/* ---------- Metric cards ---------- */

#dashboard-view .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 19px;
}

#dashboard-view .metric-card {
  min-height: 130px;
  padding: 19px 21px;
  border: 1px solid #e3ebe5;
  border-radius: 17px;
  box-shadow: 0 7px 24px rgba(29, 59, 41, 0.035);
}

#dashboard-view .metric-card strong {
  margin-top: 9px;
  font-size: 2.05rem;
}

#dashboard-view .metric-icon {
  top: 19px;
  right: 19px;
}

/* ---------- Main dashboard row ---------- */

#dashboard-view .dashboard-grid {
  grid-template-columns: minmax(0, 1.58fr) minmax(330px, 0.82fr);
  align-items: stretch;
  gap: 17px;
  margin-bottom: 18px;
}

#dashboard-view .dashboard-grid > * {
  min-height: 265px;
}

#dashboard-view .storage-panel,
#dashboard-view .dashboard-side {
  min-height: 265px;
}

#dashboard-view .dashboard-side {
  display: grid;
  grid-template-rows: 1fr;
  gap: 0;
}

/* The reference dashboard keeps Activity directly below
   the Storage + Randomizer row. */
#dashboard-view .quick-tip {
  display: none;
}

#dashboard-view .panel {
  border: 1px solid #e3ebe5;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 7px 24px rgba(29, 59, 41, 0.035);
}

#dashboard-view .storage-panel {
  padding: 23px;
}

#dashboard-view .storage-panel .section-heading {
  margin-bottom: 15px;
}

#dashboard-view .storage-panel .subtitle {
  color: #78877e;
}

/* ---------- Randomizer ---------- */

#dashboard-view .randomizer {
  min-height: 265px;
}

#dashboard-view .randomizer__description {
  color: #7a8a80;
}

#dashboard-view .randomizer__result {
  margin-top: 13px;
}

/* ---------- Activity ---------- */

#dashboard-view .activity-panel {
  width: 100%;
  margin-top: 0;
  border: 1px solid #e3ebe5;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 7px 24px rgba(29, 59, 41, 0.035);
}

#dashboard-view .activity-search {
  width: min(260px, 45%);
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .workspace {
    padding-left: 40px;
    padding-right: 28px;
  }

  #dashboard-view .dashboard-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.9fr);
  }
}

@media (max-width: 980px) {
  .app-shell {
    width: 100%;
    margin: 0;
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .workspace {
    padding-left: 28px;
    padding-right: 22px;
  }

  #dashboard-view .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dashboard-view .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    z-index: 20;
    top: 0;
    height: auto;
    min-height: 0;
    padding: 10px 14px 11px;
    border-radius: 0;
  }

  .sidebar-label,
  .sidebar-spacer,
  .sidebar-storage {
    display: none;
  }

  .brand {
    padding-bottom: 10px;
  }

  .sidebar-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .workspace {
    padding: 0 15px 34px;
  }

  #dashboard-view .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  #dashboard-view .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .metric-card { min-height: 122px; padding: 15px; }
  .metric-card strong { font-size: 1.8rem; }
  .metric-icon { top: 13px; right: 13px; width: 29px; height: 29px; }
  .topbar { align-items: flex-start; flex-direction: column; justify-content: center; padding: 12px 0; }
  .topbar-actions { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  #onedrive-message[aria-busy="true"]::before,
  .persistence-banner--working::before { animation: none; }
}
/* ============================================================
   ATLAS MINUTE — PARSER REFERENCE UI
   ============================================================ */

#parser-view {
  width: 100%;
}

#parser-view .page-heading {
  margin-bottom: 18px;
}

#parser-view .page-heading .eyebrow {
  margin-bottom: 5px;
}

#parser-view .page-heading h1 {
  margin: 0;
  font-size: clamp(2.15rem, 3.2vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: #071c16;
}

#parser-view .page-heading .app-subtitle {
  margin-top: 9px;
  color: #718078;
  font-size: 0.98rem;
}

/* ---------- main input card ---------- */

#parser-view .parser-panel {
  width: 100%;
  max-width: none;
  padding: 27px 29px 24px;
  border: 1px solid #e3ebe5;
  border-radius: 17px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 8px 25px rgba(26, 57, 40, 0.045);
}

#parser-view .parser-panel > .section-heading {
  margin-bottom: 20px;
  align-items: center;
}

#parser-view .parser-panel > .section-heading h2 {
  margin-top: 5px;
  color: #0a2b1f;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

#parser-view .format-chip {
  padding: 7px 13px;
  border: 1px solid #d9ebe0;
  border-radius: 999px;
  color: #216049;
  background: #f2f8f4;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

#parser-view .parser-panel .form-group {
  margin-top: 0;
}

#parser-view .parser-panel .form-group label {
  display: block;
  margin-bottom: 8px;
  color: #45665a;
  font-size: 0.74rem;
  font-weight: 750;
}

#parser-view #unified-input {
  width: 100%;
  min-height: 190px;
  padding: 16px 17px;
  border: 2px solid #93d5b4;
  border-radius: 12px;
  outline: none;
  color: #263d34;
  background: #fff;
  font-size: 0.86rem;
  line-height: 1.6;
  resize: vertical;
  box-shadow:
    0 0 0 3px rgba(99, 190, 142, 0.08),
    inset 0 1px 2px rgba(21, 50, 35, 0.025);
}

#parser-view #unified-input::placeholder {
  color: #98a2ac;
}

#parser-view #unified-input:focus {
  border-color: #55bb8a;
  box-shadow:
    0 0 0 4px rgba(77, 186, 133, 0.13),
    inset 0 1px 2px rgba(21, 50, 35, 0.025);
}

/* ---------- detection strip ---------- */

#parser-view .topic-detection {
  min-height: 41px;
  margin-top: 9px;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  color: #8a5a0a;
  background: #fff8e7;
  font-size: 0.74rem;
}

#parser-view .parser-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

#parser-view .parser-actions .primary-button {
  min-height: 45px;
  padding: 10px 18px;
  border-radius: 11px;
  font-size: 0.78rem;
  font-weight: 800;
}

#parser-view .keyboard-hint {
  color: #8b9690;
  font-size: 0.72rem;
}

/* ---------- preview area ---------- */

#parser-view #topic-results {
  width: 100%;
  margin-top: 17px;
}

#parser-view #topic-results > section {
  padding: 20px 13px 13px;
  border: 1px solid #e4ebe6;
  border-radius: 17px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 8px 25px rgba(26, 57, 40, 0.035);
}

#parser-view #topic-results > section > h3 {
  margin: 0 0 15px;
  padding: 0 1px;
  color: #12271e;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

#parser-view .topic-preview-success {
  float: right;
  margin-top: -31px;
  margin-right: 1px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #277247;
  background: #eaf7ed;
  font-size: 0.67rem;
  font-weight: 700;
}

/* ---------- 2-column topic grid ---------- */

#parser-view .topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ---------- topic card ---------- */

#parser-view .topic-card {
  position: relative;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 13px;
  min-width: 0;
  min-height: 108px;
  padding: 9px;
  overflow: hidden;
  border: 1px solid #e2e9e4;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 3px 11px rgba(24, 53, 37, 0.025);
}

#parser-view .topic-card__media {
  position: relative;
  min-height: 90px;
  overflow: hidden;
  border-radius: 10px;
  background:
    linear-gradient(135deg, #c9dfd2, #e8eee9);
}

#parser-view .topic-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 90px;
  object-fit: cover;
}

#parser-view .topic-card__number {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #25352d;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 2px 7px rgba(0,0,0,0.08);
  font-size: 0.7rem;
  font-weight: 800;
}

#parser-view .topic-card__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 2px 2px 1px 0;
}

#parser-view .topic-card__topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

#parser-view .topic-card__title {
  margin: 0;
  color: #13271f;
  font-size: 0.87rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.015em;
}

#parser-view .topic-card__valid {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #27734d;
  background: #e9f6ee;
  font-size: 0.59rem;
  font-weight: 800;
}

#parser-view .topic-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

#parser-view .topic-card__country {
  color: #43564c;
  font-size: 0.69rem;
}

#parser-view .topic-card__flag {
  margin-right: 4px;
}

#parser-view .topic-card__category {
  padding: 4px 8px;
  border-radius: 999px;
  color: #32719a;
  background: #e9f5fb;
  font-size: 0.59rem;
  font-weight: 700;
}

#parser-view .topic-card__hook {
  margin: 8px 0 0;
  color: #65746c;
  font-size: 0.67rem;
  line-height: 1.45;
}

#parser-view .topic-card__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 7px;
}

#parser-view .topic-save-button {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 0.64rem;
  font-weight: 800;
}

#parser-view .topic-save-button.is-saved {
  pointer-events: none;
}

/* Hide old field-list presentation inside parser cards */
#parser-view .topic-card .topic-fields {
  display: none;
}

/* ---------- parser status ---------- */

#parser-view #parser-status {
  margin-top: 10px;
}

#parser-view #parser-status.status-panel--warning {
  color: #8a5a0a;
  background: #fff8e7;
}

#parser-view #parser-status.status-panel--success {
  color: #277247;
  background: #eaf7ed;
}

/* ---------- responsive ---------- */

@media (max-width: 1050px) {
  #parser-view .topic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #parser-view .parser-panel {
    padding: 20px 16px;
  }

  #parser-view .parser-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  #parser-view .keyboard-hint {
    align-self: flex-end;
  }

  #parser-view .topic-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  #parser-view .topic-card__media,
  #parser-view .topic-card__media img {
    min-height: 82px;
  }

  #parser-view .topic-card__valid {
    display: none;
  }
}

/* ============================================================
   TOPIC PREVIEW — reference-style card polish
   ============================================================ */

#topic-results {
  width: 100%;
  margin-top: 16px;
}

#topic-results > section {
  width: 100%;
}

#topic-results > section > h3 {
  margin: 0 0 12px;
  color: #20352a;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

#topic-results .topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
}

#topic-results .topic-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  min-width: 0;
  min-height: 150px;
  overflow: hidden;
  border: 1px solid #e0e8e2;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(27, 53, 37, 0.035);
}

#topic-results .topic-card__media {
  position: relative;
  min-width: 0;
  min-height: 150px;
  margin: 9px 0 9px 9px;
  overflow: hidden;
  border-radius: 10px;
  background: #e8eee9;
}

#topic-results .topic-card__media:has(.topic-card__image--loading)::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-right-color: transparent;
  border-radius: 50%;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
  animation: atlas-spin 750ms linear infinite;
}

#topic-results .topic-card__image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
}

#topic-results .topic-card__number {
  position: absolute;
  top: 7px;
  left: 7px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #294336;
  font-size: 0.68rem;
  font-weight: 900;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.08);
}

#topic-results .topic-card__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 13px 12px 10px;
}

#topic-results .topic-card__topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

#topic-results .topic-card__topline h3 {
  min-width: 0;
  margin: 1px 0 0;
  color: #1d3126;
  font-size: 0.84rem;
  line-height: 1.25;
  font-weight: 850;
  letter-spacing: -0.01em;
}

#topic-results .topic-card .status-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.58rem;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0.04em;
}

#topic-results .topic-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

#topic-results .country-badge {
  display: inline-grid;
  min-width: 24px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border: 1px solid #d8e4dc;
  border-radius: 5px;
  background: #f4f8f5;
  color: #587062;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

#topic-results .topic-card__country {
  color: #6b7a71;
  font-size: 0.64rem;
  font-weight: 600;
}

#topic-results .category-badge {
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf6fb;
  color: #34739b;
  font-size: 0.56rem;
  font-weight: 800;
}

#topic-results .topic-card__hook {
  margin: 9px 0 0;
  color: #65736b;
  font-size: 0.64rem;
  line-height: 1.48;
}

#topic-results .topic-card__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 8px;
}

#topic-results .topic-save-button {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(28, 79, 51, 0.13);
}

@media (max-width: 900px) {
  #topic-results .topic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  #topic-results .topic-card {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  #topic-results .topic-card__media {
    min-height: 138px;
  }

  #topic-results .topic-card__image {
    min-height: 138px;
  }
}

/* AI topic image states */
#topic-results .topic-card__image {
  transition: opacity 180ms ease, transform 220ms ease;
}

#topic-results .topic-card__image--loading {
  opacity: 0.72;
}

#topic-results .topic-card__image--ai {
  opacity: 1;
}

#topic-results .topic-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}


#topic-results .topic-card__flag {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  width:28px;
  height:20px;
  overflow:hidden;
  border:1px solid #d8e2dc;
  border-radius:3px;
  background:#f4f7f5;
}

#topic-results .topic-card__flag-image {
  display:block;
  width:28px;
  height:20px;
  object-fit:cover;
  object-position:center;
  border-radius:2px;
}
