/* App additions, built only from the design-system tokens (design-system.css). */
[hidden] { display: none !important; }
body { font-family: 'Inter', var(--font-family-base); background: var(--color-canvas-bg); margin: 0; }
.app-container { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; flex-shrink: 0; display: flex;
  flex-direction: column; justify-content: space-between; }
.sidebar-brand { display: flex; align-items: center; gap: 8px; color: white; font-weight: 700; margin-bottom: 16px; }
.brand-mark { font-size: 18px; }
.sidebar-footer { font-size: var(--font-size-xs); }
.nav-item { text-decoration: none; display: flex; align-items: center; gap: 8px; }
.main-canvas { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top-toolbar { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-title { font-size: var(--font-size-xl); font-weight: 600; color: var(--color-text-main); margin: 0; }
.content-body { display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--color-text-muted); font-size: var(--font-size-sm); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 8px; }
.row.between { justify-content: space-between; }
.panel { background: var(--color-surface-white); border: 1px solid var(--color-border-card-neutral);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 16px 20px; }
.panel.mint { background: var(--color-surface-card-mint); border-color: var(--color-border-card-mint); }
.input { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px;
  border: 1px solid var(--color-border-input); border-radius: var(--radius-md); background: white; }
textarea.input { resize: vertical; overflow: hidden; line-height: 1.45; }
table.map td:first-child { width: 1%; }
.pill { display: inline-block; padding: 2px 10px; border-radius: var(--radius-full);
  font-size: var(--font-size-xs); font-weight: 600; border: 1px solid; white-space: nowrap; }
.pill-green { background: var(--color-status-published-bg); color: var(--color-status-published-text);
  border-color: var(--color-status-published-border); }
.pill-amber { background: var(--color-status-review-bg); color: var(--color-status-review-text);
  border-color: var(--color-status-review-border); }
.pill-grey { background: var(--color-status-draft-bg); color: var(--color-status-draft-text);
  border-color: var(--color-status-draft-border); }
.pill-blue { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary-light); }
.pill-red { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }
.cite { font-size: var(--font-size-sm); color: var(--color-text-body);
  border-left: 3px solid var(--color-border-divider); padding-left: 8px; margin-top: 4px; }
.answer-text { white-space: pre-wrap; color: var(--color-text-body); font-size: var(--font-size-base); }
.chip { cursor: pointer; padding: 4px 12px; border-radius: var(--radius-full);
  border: 1px solid var(--color-border-input); font-size: var(--font-size-sm); background: white; font: inherit; }
.chip.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.btn-outline-neutral, .btn-outline-primary, .btn-primary-action { cursor: pointer; font: inherit; }
button:disabled { opacity: .5; cursor: default; }
.btn-link { background: none; border: none; color: var(--color-primary); cursor: pointer; font: inherit;
  font-size: var(--font-size-sm); padding: 2px 4px; }
#fill-body { display: flex; flex-direction: column; gap: 16px; }
.drop { display: block; border: 2px dashed var(--color-border-input); border-radius: var(--radius-lg); padding: 32px;
  text-align: center; background: white; cursor: pointer; }
.drop.over { border-color: var(--color-primary); background: var(--color-primary-light); }
.progress { height: 6px; background: var(--color-border-divider); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--color-primary); transition: width .3s; }
.item { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 20px; }
.item h3 { margin: 0 0 6px; font-size: var(--font-size-base); font-weight: 600; color: var(--color-text-main); }
table.map { width: 100%; border-collapse: collapse; background: white; }
table.map th, table.map td { padding: 8px 12px; border-bottom: 1px solid var(--color-border-divider);
  vertical-align: top; text-align: left; font-size: var(--font-size-sm); }
table.map td.q { width: 60%; }
#toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.toast { background: var(--color-text-main); color: white; padding: 10px 14px; border-radius: var(--radius-md);
  max-width: 420px; font-size: var(--font-size-sm); box-shadow: var(--shadow-card); }
.toast.error { background: #991B1B; }
@media (max-width: 800px) {
  .app-container { flex-direction: column; }
  .sidebar { position: static; height: auto; width: auto; }
  .item { grid-template-columns: 1fr; }
}
