:root {
  /* DataSeeds brand */
  --green: #27C18F;
  --blue: #4C89F1;
  --violet: #6F54DF;
  --brand-gradient: linear-gradient(135deg, #27C18F, #4C89F1, #6F54DF);

  /* App theme (light) */
  --bg: #F6F8FB;
  --card: #FFFFFF;
  --text: #1B2430;
  --muted: #5C6675;
  --border: #E3E7EE;
  --accent: #4C89F1;

  /* status */
  --status-review: #9AA4B2;
  --status-approved: #27C18F;
  --status-posted: #4C89F1;
  --status-skipped: #B9C0CB;

  --danger: #D9534F;
  --warn-bg: #FBF0DD;
  --warn-text: #8A5A12;
  --warn-border: #F0DAB2;

  /* spacing scale (4/8px) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;

  --radius: 6px;
  --radius-lg: 8px;
  --control-h: 32px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);

  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Montserrat, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3 { color: var(--text); margin: 0; font-weight: 700; }

a { color: var(--accent); }

button, select, input { font-family: inherit; }

.num, .tabular {
  font-variant-numeric: tabular-nums;
}

/* ---------- App shell ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  background: var(--brand-gradient);
  padding: var(--sp-5) var(--sp-4);
}

.sidebar-brand-name {
  color: #FFFFFF;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.sidebar-brand-sub {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--sp-3) 0;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border: none;
  background: transparent;
  border-left: 3px solid transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.nav-item:hover { background: #F6F8FB; }

.nav-item.active {
  background: #EAF1FE;
  border-left-color: var(--accent);
  color: var(--accent);
}

.nav-item .nav-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.nav-item.active .nav-count { color: var(--accent); }

.nav-item-muted {
  margin-top: auto;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  padding-top: var(--sp-4);
}

.nav-item-muted:hover { color: var(--text); }

.content {
  flex: 1;
  min-width: 0;
  padding: var(--sp-7) var(--sp-8);
}

.loading-state, .empty-state {
  color: var(--muted);
  padding: var(--sp-6) 0;
}

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .sidebar-brand {
    flex: 0 0 auto;
    padding: var(--sp-3) var(--sp-4);
  }
  .sidebar-brand-sub { display: none; }
  .sidebar-nav {
    flex-direction: row;
    padding: 0;
    overflow-x: auto;
  }
  .nav-item {
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    padding: var(--sp-3);
  }
  .nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
  .nav-item-muted {
    margin-top: 0;
    border-top: none;
    border-left: 1px solid var(--border);
    padding-top: var(--sp-3);
  }
  .content { padding: var(--sp-5); }
}

/* ---------- Buttons, chips, controls (shared radius + height) ---------- */

.btn {
  height: var(--control-h);
  padding: 0 var(--sp-3);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn:active { opacity: 0.8; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover { background: #3B78E0; color: #FFFFFF; }

.btn.copied {
  background: var(--green);
  border-color: var(--green);
  color: #FFFFFF;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-small {
  height: 26px;
  padding: 0 var(--sp-2);
  font-size: 12px;
}

.saved-flash {
  font-size: 12px;
  color: var(--green);
  opacity: 0;
  transition: opacity 0.2s ease;
  font-weight: 600;
}

.saved-flash.show { opacity: 1; }

.chip {
  height: var(--control-h);
  padding: 0 var(--sp-3);
  font-size: 12px;
  font-weight: 600;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.chip:hover { color: var(--text); border-color: var(--accent); }

.chip.active {
  background: #EAF1FE;
  color: var(--accent);
  border-color: var(--accent);
}

.chip .count { font-variant-numeric: tabular-nums; opacity: 0.8; }

select.control, .status-select {
  height: var(--control-h);
  padding: 0 var(--sp-2);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

input[type="number"], input[type="date"], input[type="text"] {
  height: var(--control-h);
  padding: 0 var(--sp-2);
  font-size: 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

/* ---------- Tab header ---------- */

.tab-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.tab-header h1 { font-size: 20px; }

.tab-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: var(--sp-1);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}

/* ---------- Overview: stat tiles ---------- */

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-7);
}

.stat-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}

.stat-tile-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-tile-value {
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  margin-top: var(--sp-1);
  font-variant-numeric: tabular-nums;
}

/* ---------- Calendar table ---------- */

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.calendar-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

.calendar-table tbody tr { cursor: pointer; }
.calendar-table tbody tr:hover { background: #F6F8FB; }
.calendar-table tbody tr:last-child td { border-bottom: none; }

.calendar-date {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calendar-date .weekday {
  color: var(--muted);
  margin-left: var(--sp-1);
}

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px var(--sp-2);
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.status-badge.status-review { background: #EEF0F4; color: var(--status-review); }
.status-badge.status-approved { background: #E3F8F0; color: var(--status-approved); }
.status-badge.status-posted { background: #EAF1FE; color: var(--status-posted); }
.status-badge.status-skipped { background: #F1F2F4; color: var(--status-skipped); }

.comment-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #EAF1FE;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Post row (mockup + tooling panel) ---------- */

.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.post-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--status-review);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: grid;
  grid-template-columns: 555px 1fr;
  gap: var(--sp-6);
  align-items: start;
  scroll-margin-top: var(--sp-6);
}

.post-row.status-review { border-left-color: var(--status-review); }
.post-row.status-approved { border-left-color: var(--status-approved); }
.post-row.status-posted { border-left-color: var(--status-posted); }
.post-row.status-skipped { border-left-color: var(--status-skipped); opacity: 0.6; }

.post-row.flash-highlight {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mockup-column {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0;
}

.version-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  font-size: 12px;
  font-weight: 600;
}

.version-banner .btn {
  background: #FFFFFF;
}

@media (max-width: 1100px) {
  .post-row {
    grid-template-columns: 1fr;
  }
  .li-mockup { max-width: 555px; }
}

/* ---------- LinkedIn mockup (authentic look, independent of app theme) ---------- */

.li-mockup {
  width: 100%;
  max-width: 555px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.li-header {
  display: flex;
  gap: 8px;
  padding: 12px 16px 8px;
}

.li-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #27C18F, #4C89F1, #6F54DF);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
}

/* LinkedIn shows company pages with a square (2px radius) mark, not round;
   applies to the photo and the initials fallback alike. */
.li-avatar.square { border-radius: 2px; }

.li-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.li-header-text { min-width: 0; }

.li-name {
  font-weight: 600;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.9);
  line-height: 1.35;
}

.li-headline {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.li-meta {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.35;
}

.li-meta svg { width: 12px; height: 12px; }

.li-body-wrap {
  padding: 0 16px 12px;
  position: relative;
}

.li-body {
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  color: rgba(0, 0, 0, 0.9);
}

.li-body.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.li-more {
  position: absolute;
  right: 16px;
  bottom: 0;
  background: #FFFFFF;
  padding-left: 4px;
  color: rgba(0, 0, 0, 0.6);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.li-less {
  margin-top: 4px;
  color: rgba(0, 0, 0, 0.6);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.li-hashtags {
  color: #0A66C2;
  font-weight: 600;
}

.li-image {
  width: 100%;
  display: block;
  border-radius: 0;
}

.li-footer {
  display: flex;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 4px 8px;
}

.li-footer-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  color: rgba(0, 0, 0, 0.6);
  font-size: 13px;
  font-weight: 600;
}

.li-footer-btn svg { width: 18px; height: 18px; }

/* ---------- Tooling panel ---------- */

.tooling-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-width: 0;
}

.tooling-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.post-number {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius);
  padding: 2px var(--sp-2);
  background: #EEF0F4;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.badge.score-high {
  background: #EAF1FE;
  color: var(--accent);
}

.version-indicator {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  background: #EEF0F4;
  border-radius: var(--radius);
  padding: 2px var(--sp-2);
}

.tooling-top .status-select { margin-left: auto; }

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  height: auto;
}

.link-btn:hover { text-decoration: underline; }

.edit-post-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: 100%;
}

.edit-post-textarea {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--card);
  resize: vertical;
}

.edit-post-actions {
  display: flex;
  gap: var(--sp-2);
}

.image-thumbs-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

.image-thumbs-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.image-thumb-btn {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--card);
  cursor: pointer;
  overflow: hidden;
}

.image-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-thumb-btn.selected { border-color: var(--accent); }

.image-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(27, 36, 48, 0.72);
  color: #FFFFFF;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}

.image-thumb-upload-btn {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.image-thumb-upload-btn:hover { border-color: var(--accent); color: var(--accent); }

.drop-zone {
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  display: block;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  color: var(--accent);
}

.drop-zone input { display: none; }

.source-line {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.source-line .article-title { color: var(--text); }

.source-line a { word-break: break-all; }

.tracking-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.tracking-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.tracking-field label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.tracking-field input[type="number"] { width: 84px; font-variant-numeric: tabular-nums; }

.date-field {
  position: relative;
}

.date-field input[type="date"] {
  padding-right: 26px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.date-field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
}

.date-field svg {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  width: 14px;
  height: 14px;
}

.date-display {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Disclosures: comments + history ---------- */

.disclosure {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3);
}

.disclosure-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: none;
  border: none;
  padding: 0;
  height: auto;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.disclosure-caret {
  color: var(--muted);
  font-size: 10px;
  width: 10px;
}

.disclosure-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.disclosure-count.accent { color: var(--accent); }

.disclosure-body {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.empty-inline {
  color: var(--muted);
  font-size: 12px;
}

.comment-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3);
}

.comment-item.resolved {
  opacity: 0.55;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12px;
  margin-bottom: var(--sp-1);
}

.comment-meta .muted { color: var(--muted); }

.resolved-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: var(--status-approved);
  background: #E3F8F0;
  border-radius: var(--radius);
  padding: 1px var(--sp-1);
}

.comment-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.comment-actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.comment-author-input {
  width: 100%;
}

.comment-text-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-2);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--card);
  resize: vertical;
}

.comment-form-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.version-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
  height: auto;
}

.version-item.current {
  border-color: var(--accent);
  background: #EAF1FE;
}

.version-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.version-date {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.version-note {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Onboarding tour ---------- */

.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 36, 48, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  z-index: 1000;
}

.tour-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-6);
}

.tour-skip {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  background: none;
  border: none;
  padding: 0;
  height: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tour-skip:hover { color: var(--text); }

.tour-title {
  font-size: 16px;
  padding-right: 48px;
  margin-bottom: var(--sp-3);
}

.tour-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin: 0 0 var(--sp-5);
}

.tour-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: var(--sp-5);
}

.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
}

.tour-dot.active {
  width: 16px;
  background: var(--accent);
}

.tour-actions {
  display: flex;
  gap: var(--sp-3);
}

.tour-actions .btn {
  flex: 1;
}

@media (max-width: 480px) {
  .tour-card { padding: var(--sp-5); }
}

/* ---------- Playbook ---------- */

.playbook-panel {
  max-width: 780px;
}

.playbook-actions {
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.playbook-view h3 {
  font-size: 15px;
  color: var(--text);
  margin: var(--sp-6) 0 var(--sp-2);
}

.playbook-view h4 {
  font-size: 13px;
  color: var(--accent);
  margin: var(--sp-5) 0 var(--sp-2);
}

.playbook-view h3:first-child { margin-top: 0; }

.playbook-view p {
  margin: var(--sp-2) 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.playbook-view ul, .playbook-view ol {
  margin: var(--sp-2) 0;
  padding-left: 20px;
  font-size: 13px;
}

.playbook-view li { margin: var(--sp-1) 0; }

.playbook-view strong { color: var(--text); }

.playbook-view table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--sp-3) 0 var(--sp-5);
  font-size: 12px;
  border: 1px solid var(--border);
}

.playbook-view th, .playbook-view td {
  border: 1px solid var(--border);
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
}

.playbook-view th {
  background: #F6F8FB;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.2px;
}

.playbook-edit {
  width: 100%;
  min-height: 420px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3);
  font-family: "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}

/* ---------- Footer ---------- */

.app-footer {
  color: var(--muted);
  font-size: 11px;
  margin-top: var(--sp-8);
}

/* ---------- Login page ---------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.login-brand {
  background: var(--brand-gradient);
  padding: var(--sp-6) var(--sp-5);
}

.login-brand-name {
  color: #FFFFFF;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.login-brand-sub {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  margin-top: 2px;
}

.login-form {
  padding: var(--sp-6) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.login-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.login-input {
  width: 100%;
  margin-bottom: var(--sp-3);
}

.login-submit {
  width: 100%;
}

.login-error {
  color: var(--danger);
  font-size: 12px;
  margin: var(--sp-3) 0 0;
}

.nav-item-quiet {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.nav-item-quiet:hover { color: var(--text); }

/* ---------- Overview: by-person table + calendar toggle ---------- */

.by-person-table td.num, .by-person-table th.num { text-align: right; }

.calendar-toggle {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.own-post-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px var(--sp-2);
  border-radius: var(--radius);
  background: #EEF0F4;
  color: var(--muted);
}

/* ---------- Actual posting calendar (month grid) ---------- */

.actual-empty-note {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: var(--sp-3);
}

.actual-calendar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}

.actual-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.actual-calendar-title {
  font-size: 15px;
  font-weight: 700;
}

.actual-calendar-nav {
  display: flex;
  gap: var(--sp-2);
}

.actual-calendar-nav-btn {
  width: var(--control-h);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.actual-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.actual-calendar-weekday {
  background: #F6F8FB;
  padding: var(--sp-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: var(--muted);
  text-align: center;
}

.actual-calendar-day {
  background: var(--card);
  min-height: 88px;
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.actual-calendar-day.empty { background: #FAFBFC; }

.actual-calendar-daynum {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.actual-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #EAF1FE;
  border: none;
  border-radius: var(--radius);
  padding: 2px 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  height: auto;
  width: 100%;
  text-align: left;
}

.actual-chip:hover { background: #DCE9FD; }

.actual-chip-avatar {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand-gradient);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 700;
}

.actual-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.actual-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

@media (max-width: 900px) {
  .actual-calendar-day { min-height: 64px; }
  .actual-chip-title { display: none; }
}

/* ---------- Team tab ---------- */

.team-add-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-7);
}

.team-add-panel h2 {
  font-size: 14px;
  margin-bottom: var(--sp-3);
}

.team-add-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.team-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.team-add-row .team-title-input { flex: 1 1 220px; }
.team-add-row .team-url-input { flex: 1 1 220px; }
.team-add-row select.team-person-select { flex: 0 0 160px; }
.team-add-row .team-person-new { flex: 0 0 160px; }
.team-add-row input[type="number"] { width: 100px; }

.team-groups {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.team-table-head {
  display: grid;
  grid-template-columns: 1fr 92px 130px 80px 70px 90px 56px;
  gap: var(--sp-2);
  padding: 0 var(--sp-3);
  margin-bottom: var(--sp-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
}

.team-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.team-group-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: #F6F8FB;
  border-bottom: 1px solid var(--border);
}

.team-group-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand-gradient);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.team-group-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.team-group-name {
  font-weight: 700;
  font-size: 13px;
}

.team-group-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.team-row {
  display: grid;
  grid-template-columns: 1fr 92px 130px 80px 70px 90px 56px;
  gap: var(--sp-2);
  align-items: center;
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.team-row:last-child { border-bottom: none; }

.team-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.team-row-title a { color: var(--text); text-decoration: none; }
.team-row-title a:hover { color: var(--accent); text-decoration: underline; }

.team-row-planned {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.team-row .date-field input[type="date"] { width: 100%; }

.team-row input[type="number"] { width: 100%; }

.team-row-flash {
  grid-column: 1 / -1;
  text-align: right;
}

.team-delete-btn {
  color: var(--muted);
  font-size: 12px;
}

.team-delete-btn:hover { color: var(--danger); }

@media (max-width: 900px) {
  .team-table-head { display: none; }
  .team-row {
    grid-template-columns: 1fr;
    gap: var(--sp-1);
    padding: var(--sp-3);
  }
}
