/* Beyond Line Management Dashboard — Brand Tokens */
:root {
  /* Core colors */
  --ivory: #FAF8F5;
  --charcoal: #1D1F23;
  --signal-red: #D94B3D;
  
  /* Derivatives */
  --charcoal-light: #2D3136;
  --charcoal-muted: #5A5E64;
  --ivory-dark: #F0EDE8;
  --border: #E5E2DD;
  --success: #2E7D4A;
  --warning: #C78A2C;
  --error: var(--signal-red);
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', Consolas, Monaco, monospace;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Sizing */
  --sidebar-width: 240px;
  --header-height: 64px;
  --radius: 8px;
  --radius-sm: 4px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(29, 31, 35, 0.05);
  --shadow: 0 4px 12px rgba(29, 31, 35, 0.08);
  --shadow-lg: 0 8px 24px rgba(29, 31, 35, 0.12);
}

/* Editorial due-date calendar — scoped to the CMS workspace panel. */
.editorial-calendar-slot { margin-block: var(--space-md); }
.editorial-calendar {
  display: grid;
  gap: var(--space-md);
  min-width: 0;
  padding: var(--space-md);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.editorial-calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.editorial-calendar-controls h4 { flex: 1 1 9rem; text-align: center; }
.editorial-calendar-grid { width: 100%; table-layout: fixed; border-collapse: collapse; }
.editorial-calendar-grid caption { padding: var(--space-sm); color: var(--muted); text-align: left; }
.editorial-calendar-grid th { padding: var(--space-xs); color: var(--muted); font-size: .8rem; font-weight: 600; }
.editorial-calendar-grid td { height: 4.25rem; padding: 2px; border: 1px solid var(--line); vertical-align: top; }
.editorial-calendar-day-button {
  display: flex;
  width: 100%;
  min-height: 3.75rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2px;
  padding: var(--space-xs);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.editorial-calendar-day-button:hover,
.editorial-calendar-day-button[aria-pressed="true"] { border-color: var(--signal-red); background: var(--ground); }
.editorial-calendar-day-button:focus-visible { outline: 2px solid var(--signal-red); outline-offset: 1px; }
.editorial-calendar-day-button.is-outside { color: var(--muted); }
.editorial-calendar-day-button.is-today .editorial-calendar-number { font-weight: 700; text-decoration: underline; text-decoration-color: var(--signal-red); text-underline-offset: 3px; }
.editorial-calendar-day-button.has-tasks .editorial-calendar-count {
  min-width: 1.35rem;
  padding-inline: 3px;
  border-radius: 999px;
  background: var(--ground);
  color: var(--ink);
  font-size: .75rem;
  text-align: center;
}
.editorial-calendar-day h5,
.editorial-calendar-undated h4 { margin-bottom: var(--space-xs); }
.editorial-calendar-task-list { display: grid; gap: var(--space-xs); padding-left: 1.25rem; }
.editorial-calendar-task-list li { padding-left: 2px; }
.editorial-calendar-task-list li span { display: block; overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .editorial-calendar { padding: var(--space-sm); }
  .editorial-calendar-grid th { font-size: .68rem; }
  .editorial-calendar-grid td { height: 3.25rem; padding: 1px; }
  .editorial-calendar-day-button { min-height: 2.8rem; padding: 2px; font-size: .8rem; }
  .editorial-calendar-day-button.has-tasks .editorial-calendar-count { min-width: 1.1rem; font-size: .68rem; }
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--charcoal);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
}

/* Views */
.view {
  min-height: 100vh;
}

.view.hidden {
  display: none;
}

/* Login */
.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  background: linear-gradient(145deg, var(--ivory-dark) 0%, var(--ivory) 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: var(--space-2xl);
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-card .brand-mark {
  margin: 0 auto var(--space-lg);
}

.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--charcoal);
}

.login-card .subtitle {
  color: var(--charcoal-muted);
  margin-bottom: var(--space-xl);
}

/* Brand Mark */
.brand-mark {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal);
}

.brand-mark.small {
  width: 32px;
  height: 32px;
}

.brand-mark .logo {
  width: 100%;
  height: 100%;
}

/* Dashboard Layout */
.dashboard-view {
  display: flex;
}

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--charcoal);
  color: var(--ivory);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-lg);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .brand-mark {
  color: var(--ivory);
}

.brand-text {
  font-weight: 600;
  font-size: 15px;
}

.nav {
  flex: 1;
  padding: var(--space-md) 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--ivory);
  background: rgba(255,255,255,0.05);
}

.nav-link.active {
  color: var(--ivory);
  background: rgba(255,255,255,0.1);
  border-right: 3px solid var(--signal-red);
}

.nav-link .icon {
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: var(--space-xl);
  background: var(--ivory);
}

/* Panels */
.panel {
  display: none;
  max-width: 1400px;
}

.panel.panel-active {
  display: block;
}

.panel-header {
  margin-bottom: var(--space-xl);
}

.panel-header.sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ivory);
  padding: var(--space-md) 0;
  margin: calc(-1 * var(--space-xl)) calc(-1 * var(--space-xl)) var(--space-xl);
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

.panel-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.panel-desc {
  color: var(--charcoal-muted);
}

.panel-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.stat-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--charcoal-muted);
  margin-bottom: var(--space-sm);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--charcoal);
}

/* Forms */
form {
  text-align: left;
}

.field {
  margin-bottom: var(--space-md);
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--charcoal);
}

.field.checkbox label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.field.checkbox input {
  width: auto;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="email"],
select,
textarea,
.input,
.select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  background: white;
  color: var(--charcoal);
  transition: border-color 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--charcoal);
}

textarea {
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.form-stack {
  max-width: 600px;
}

.error {
  color: var(--error);
  font-size: 13px;
  margin-top: var(--space-xs);
  min-height: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  color: var(--charcoal);
}

.btn-primary {
  background: var(--charcoal);
  color: var(--ivory);
  border-color: var(--charcoal);
}

.btn-primary:hover {
  background: var(--charcoal-light);
}

.btn-secondary {
  background: white;
  color: var(--charcoal);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--ivory-dark);
}

.btn-ghost {
  color: var(--charcoal-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--charcoal);
  background: rgba(0,0,0,0.05);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Lists */
.list-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.list-container.compact {
  font-size: 13px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s ease;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:hover {
  background: var(--ivory);
}

.list-item-main {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-meta {
  font-size: 12px;
  color: var(--charcoal-muted);
}

.list-item-actions {
  display: flex;
  gap: var(--space-sm);
}

.list-item-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--ivory-dark);
  color: var(--charcoal-muted);
}

.list-item-badge.draft {
  background: #FFC107;
  color: #333;
}

.list-item-badge.published {
  background: var(--success);
  color: white;
}

.list-item-badge.error {
  background: var(--error);
  color: white;
}

.list-item-badge.pending {
  background: var(--warning);
  color: white;
}

/* Editor */
.editor-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-xl);
  margin-top: var(--space-lg);
}

.editor-container.hidden {
  display: none;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.editor-header h3,
.editor-header h4 {
  font-weight: 600;
}

.editor-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.status-badge {
  font-size: 12px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--ivory-dark);
  color: var(--charcoal-muted);
}

/* Quick Actions */
.quick-actions {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.quick-actions h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--charcoal-muted);
}

/* Linea Layout */
.linea-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

@media (max-width: 900px) {
  .linea-layout {
    grid-template-columns: 1fr;
  }
}

.linea-config,
.linea-chat {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.linea-config h3,
.linea-chat h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.chat-messages {
  min-height: 300px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--ivory);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.chat-message {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  max-width: 85%;
}

.chat-message.user {
  background: var(--charcoal);
  color: var(--ivory);
  margin-left: auto;
}

.chat-message.assistant {
  background: white;
  border: 1px solid var(--border);
}

.chat-message .role {
  font-size: 11px;
  opacity: 0.7;
  margin-bottom: 2px;
}

.chat-input-row {
  display: flex;
  gap: var(--space-sm);
}

.chat-input-row .input {
  flex: 1;
}

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--space-xl);
}

.settings-card {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.settings-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

/* Health */
.health-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.health-summary-item {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.health-summary-item .count {
  font-size: 24px;
  font-weight: 700;
}

.health-summary-item.ok {
  border-top: 3px solid var(--success);
}

.health-summary-item.error {
  border-top: 3px solid var(--error);
}

.health-summary-item.warning {
  border-top: 3px solid var(--warning);
}

/* Toast */
#toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  background: var(--charcoal);
  color: var(--ivory);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
  max-width: 400px;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--error);
}

.toast.warning {
  background: var(--warning);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Empty State */
.empty-state {
  padding: var(--space-2xl);
  text-align: center;
  color: var(--charcoal-muted);
}

/* Loading */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main {
    margin-left: 0;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .health-summary {
    grid-template-columns: 1fr;
  }
  
  .linea-layout {
    grid-template-columns: 1fr;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--ivory-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--charcoal-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--charcoal);
}

/* ---------- CMS-001 additions ---------- */

.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-mark.small .logo-img {
  width: 28px;
  height: 28px;
}

.form-note {
  font-size: 12px;
  color: var(--charcoal-muted);
  margin: var(--space-sm) 0 var(--space-md);
  line-height: 1.5;
}

.form-note code {
  background: var(--ivory-dark);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.notice-card {
  background: #FFF7EC;
  border: 1px solid #F0DDBC;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.notice-card h3 {
  font-size: 14px;
  margin-bottom: var(--space-xs);
}

.notice-card p {
  font-size: 13px;
  color: var(--charcoal-muted);
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

@media (max-width: 1000px) {
  .editor-grid { grid-template-columns: 1fr; }
}

.editor-col h4 {
  font-size: 13px;
  font-weight: 600;
  margin: var(--space-md) 0 var(--space-sm);
}

.editor-col textarea {
  width: 100%;
}

.muted { color: var(--charcoal-muted); font-weight: 400; }

.muted-box {
  background: var(--ivory-dark);
  color: var(--charcoal-muted);
}

.muted-line {
  font-size: 12px;
  color: var(--charcoal-muted);
  margin-bottom: var(--space-md);
}

.snippet {
  font-size: 12px;
  color: var(--charcoal-muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.search-row {
  margin-bottom: var(--space-md);
}

.raw-settings {
  font-size: 12px;
  max-height: 300px;
  overflow: auto;
  padding: var(--space-md);
  line-height: 1.8;
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
}

.budget-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}

.budget-row:last-child { border-bottom: none; }

/* API key controls need their own flow; the budget rows above stay compact. */
.apikey-card {
  display: grid;
  gap: var(--space-md);
  min-width: 0;
  padding: var(--space-md) 0;
  border-bottom: 1px dashed var(--border);
}
.apikey-card:last-child { border-bottom: none; }
.apikey-details { display: grid; gap: var(--space-xs); min-width: 0; }
.apikey-name { overflow-wrap: anywhere; }
.apikey-id,
.apikey-meta { min-width: 0; overflow-wrap: anywhere; }
.apikey-meta { color: var(--charcoal-muted); font-size: 13px; line-height: 1.5; }
.apikey-usage { margin: 0; }
.apikey-expiry-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  min-width: 0;
}
.apikey-expiry-controls .expiry-picker { display: flex; flex: 1 1 220px; gap: var(--space-xs); min-width: min(100%, 220px); }
.apikey-expiry-controls .expiry-picker .input { min-width: 0; }
.apikey-policy-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); min-width: 0; }
.apikey-policy-controls > .checkbox { grid-column: 1 / -1; }
.apikey-policy-controls .form-stack,
.apikey-policy-controls .field { min-width: 0; }
.apikey-policy-controls .form-stack { margin: 0; }
.apikey-policy-controls .form-stack > * { min-width: 0; }
.apikey-policy-controls .input { min-width: 0; }
.apikey-policy-controls .field label { display: block; }
.apikey-card > .btn { justify-self: start; }

@media (max-width: 640px) {
  .apikey-policy-controls { grid-template-columns: minmax(0, 1fr); }
  .apikey-policy-controls > .checkbox { grid-column: auto; }
  .apikey-expiry-controls .expiry-picker { flex-basis: 100%; }
}

.btn-danger {
  background: var(--signal-red);
  color: white;
  border-color: var(--signal-red);
}

.btn-danger:hover { filter: brightness(0.92); }

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.inline-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 13px;
  color: var(--charcoal-muted);
}

.stat-value.small {
  font-size: 16px;
  line-height: 1.4;
}

.chat-message.system {
  background: var(--ivory-dark);
  color: var(--charcoal-muted);
  border: 1px dashed var(--border);
  max-width: 100%;
}

.health-item .list-item-main {
  padding-right: var(--space-md);
}

/* Global show/hide utility (auth forms, panels, lists, editors) */
.hidden {
  display: none !important;
}
/* T-C content forms and advisory search guidance. */
#draft-fields { min-width: 0; }
#draft-fields input, #draft-fields textarea { width: 100%; box-sizing: border-box; }
#editor-form-toggle { margin-bottom: 18px; }
#editor-form-toggle input { width: auto; }
.seo-counter { display: block; font-size: 12px; margin-top: 6px; font-weight: 600; }
.seo-green { color: #24633b; }
.seo-amber { color: #875600; }
.seo-red { color: #a32720; }
.seo-score { font-weight: 700; border: 1px solid currentColor; padding: 8px 12px; border-radius: 6px; }
#seo-panel { background: var(--ivory-dark); border: 1px solid var(--border); border-radius: 8px; padding: 18px; margin-bottom: 24px; min-width: 0; }
.search-preview { background: white; border: 1px solid var(--border); padding: 14px; border-radius: 6px; overflow-wrap: anywhere; margin: 12px 0; }
.search-url { color: #39434c; font-size: 12px; }
.search-title { color: #234e93; font-size: 18px; margin: 5px 0; }
.search-description { color: #454a50; font-size: 13px; line-height: 1.55; }
.social-card-previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; margin: 14px 0; min-width: 0; }
#content-editor .social-card { min-width: 0; max-width: 420px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgb(29 31 35 / 8%); }
#content-editor .social-card h5 { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
#content-editor .social-card-figure { display: grid; place-items: center; width: 100%; aspect-ratio: 1.91 / 1; margin: 0; overflow: hidden; background: var(--ivory); }
#content-editor .social-card-image { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
#content-editor .social-card-placeholder { display: grid; place-items: center; width: 100%; height: 100%; padding: 16px; box-sizing: border-box; color: var(--muted); text-align: center; }
#content-editor .social-card-copy { padding: 11px 13px 13px; }
#content-editor .social-card-title { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
#content-editor .social-card-description { display: -webkit-box; overflow: hidden; margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
#content-editor .social-card > small { display: block; padding: 0 13px 12px; overflow-wrap: anywhere; }
#content-editor .social-card--x { border-radius: 14px; }
.social-preview { min-width: 0; }
.social-preview .form-note { margin-top: 8px; }
.social-card-warning { padding: 9px 11px; border-left: 3px solid var(--warning); background: var(--soft-amber); color: var(--ink); }
.seo-metrics { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; font-size: 13px; }
.seo-metrics dt, .seo-metrics dd { margin: 0; overflow-wrap: anywhere; }
.seo-metrics dd { font-weight: 600; }
.seo-guidance { padding-left: 20px; font-size: 13px; line-height: 1.7; }
.faq-editor { border: 1px solid var(--border); border-radius: 6px; padding: 16px; margin: 20px 0; min-width: 0; }
.faq-row { border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 16px; }
.seo-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.seo-table th, .seo-table td { border-bottom: 1px solid var(--border); padding: 12px 8px; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.seo-table th:first-child { width: 18%; }
.seo-table .search-preview { margin: 0; }
#content-editor:has(.seo-table) .editor-grid { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 700px) {
  .seo-table, .seo-table tbody, .seo-table tr, .seo-table th, .seo-table td { display: block; width: auto; }
  .seo-table thead { display: none; }
  .seo-table th:first-child { width: auto; background: var(--ivory-dark); }
  .seo-table td { border: 0; }
  .seo-table td .social-card-previews { grid-template-columns: minmax(0, 1fr); }
  #content-editor .social-card { max-width: none; }
  .seo-table tr { border-bottom: 1px solid var(--border); padding-bottom: 16px; }
  .faq-editor, #seo-panel { padding: 12px; }
  .editor-actions, .button-row { flex-wrap: wrap; }
}

/* Workspace shell adaptation using the approved ivory, charcoal and signal-red system. */
:root{--ivory:#faf8f5;--charcoal:#1d1f23;--signal-red:#d94b3d;--ground:#f7f7f8;--surface:#fff;--ink:#1d1f23;--muted:#646872;--line:#e6e7ea;--soft-red:#fcf0ed;--soft-green:#edf6ef;--soft-amber:#fcf5e8;--green:#28744c;--warning:#8b611b;--sidebar-width:246px}
body{margin:0;background:var(--ground);color:var(--ink);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:13px;line-height:1.55}
.dashboard-view{display:flex;min-height:100vh;background:var(--ground)}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-width);display:flex;flex-direction:column;background:var(--surface);border-right:1px solid var(--line);padding:28px 17px 16px;z-index:20;overflow:auto}
.sidebar-header{display:flex;align-items:center;gap:12px;padding:0 8px 26px;border-bottom:1px solid var(--line)}
.sidebar-header .brand-mark{width:36px;height:36px;margin:0;background:var(--charcoal);border-radius:6px;display:grid;place-items:center}
.sidebar-header .logo-img{width:25px;height:25px;filter:brightness(0) invert(1)}
.brand-text{font-size:13px;font-weight:650;letter-spacing:-.2px;color:var(--ink)}.brand-text small{display:block;color:var(--muted);font-size:10px;font-weight:400;letter-spacing:0}
.workspace-label{margin:22px 10px 9px;color:var(--muted);font-size:9px;font-weight:700;letter-spacing:1px}
.nav{display:flex;flex-direction:column;gap:3px}
.nav-link{display:flex;align-items:center;gap:11px;min-height:39px;padding:9px 11px;border-radius:5px;color:var(--muted);font-size:12px;text-decoration:none;transition:background .12s,color .12s}
.nav-link .icon{width:18px;text-align:center;font-size:15px}.nav-link:hover{background:var(--ground);color:var(--ink)}.nav-link.active{background:var(--soft-red);color:#ad3428;font-weight:600}
.sidebar-footer{margin-top:auto;padding:18px 4px 0;border-top:1px solid var(--line)}.sidebar-footer .btn{width:100%;justify-content:flex-start;color:var(--muted)}
.workspace-shell{width:calc(100% - var(--sidebar-width));margin-left:var(--sidebar-width);min-width:0;display:flex;flex-direction:column;min-height:100vh}
.workspace-topbar{height:72px;min-height:72px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 38px;background:var(--surface);border-bottom:1px solid var(--line)}
.topbar-context{display:flex;align-items:center;gap:12px}.topbar-context>div{display:flex;flex-direction:column}.topbar-kicker{font-size:9px;letter-spacing:.9px;color:var(--muted);font-weight:650}.topbar-context strong{font-size:16px;font-weight:600;letter-spacing:-.3px}
.topbar-tools{display:flex;align-items:center;gap:18px}.theme-picker{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:10px}.theme-picker select{border:1px solid var(--line);border-radius:5px;min-height:32px;padding:5px 9px;background:var(--surface);color:var(--ink);font:inherit}.workspace-badge{display:flex;align-items:center;gap:7px;padding:6px 9px;border:1px solid var(--line);border-radius:5px;color:var(--muted);font-size:10px;white-space:nowrap}.workspace-badge .status-dot{width:6px;height:6px;background:#819184}
.main{width:100%;max-width:1540px;margin:0 auto;padding:34px 38px 28px;flex:1;min-width:0}
.main>.panel{display:none;background:transparent;border:0;border-radius:0;box-shadow:none;padding:0;overflow:visible}.main>.panel.panel-active{display:block}
.panel-header{padding:0 0 21px;margin:0 0 22px;border-bottom:1px solid var(--line);background:transparent}.panel-header h2{font-size:24px;letter-spacing:-.7px;font-weight:600;color:var(--ink)}.panel-desc{font-size:12px;color:var(--muted);margin-top:5px}
.cards-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 22px}.stat-card{border:1px solid var(--line);border-radius:7px;background:var(--surface);padding:16px 18px;box-shadow:0 2px 8px #1d1f2308}.stat-title{font-size:10px;color:var(--muted)}.stat-value{font-size:25px;line-height:1.3;margin-top:8px;font-weight:600;letter-spacing:-.7px;color:var(--ink)}.stat-value.small{font-size:13px;letter-spacing:0}
.notice-card{padding:19px 21px;border:1px solid var(--line);border-radius:7px;background:var(--ivory)}.notice-card h3{font-size:14px;font-weight:600}.notice-card p{font-size:11px;margin-top:5px;max-width:780px;color:var(--muted)}
.panel-header.sticky{position:static}.panel-actions{gap:8px;align-items:center}.btn{border-radius:5px;font-size:11px;font-weight:550;min-height:35px;padding:8px 12px}.btn-primary{background:var(--signal-red);border-color:var(--signal-red);color:#fff}.btn-primary:hover{background:#b73d32;border-color:#b73d32}.btn-secondary{background:var(--surface);border-color:var(--line);color:var(--ink)}.btn-secondary:hover{background:var(--ground)}.btn-ghost{border-color:transparent;color:var(--muted)}
.owner-content-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:25px;align-items:start}.owner-menu{position:sticky;top:18px;background:var(--surface);border:1px solid var(--line);border-radius:7px;padding:13px;max-height:calc(100vh - 110px);overflow:auto}.owner-menu>summary{font-size:11px;font-weight:600;cursor:pointer;padding:3px 4px 10px}.owner-menu nav h4{margin:15px 0 5px;padding:0 6px;color:var(--muted);font-size:9px;font-weight:700;letter-spacing:.4px}.owner-menu nav button{display:block;width:100%;text-align:left;border:0;background:transparent;border-radius:4px;padding:8px 7px;color:var(--muted);font-size:10px}.owner-menu nav button:hover{background:var(--ground);color:var(--ink)}.owner-menu nav button.owner-menu-active{background:var(--soft-red);color:#ad3428;font-weight:600}.owner-menu>.inline-label{display:flex;margin:17px 5px 3px;font-size:10px}
.owner-content-work{min-width:0}.content-list-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:15px;margin:0 0 5px}.content-list-toolbar h3{font-size:15px;font-weight:600}.content-list-toolbar p{margin-top:4px;color:var(--muted);font-size:10px}.content-filters{display:flex;gap:8px;align-items:center}.content-filters input,.content-filters select{border:1px solid var(--line);border-radius:5px;background:var(--surface);color:var(--ink);min-height:34px;padding:7px 10px;font:inherit;font-size:10px}.content-filters input{width:min(250px,34vw)}.content-result-count{margin:6px 0 9px;color:var(--muted);font-size:9px}
.list-container{display:flex;flex-direction:column;gap:8px}.list-item{display:flex;align-items:center;gap:10px;padding:12px 14px;border:1px solid var(--line);border-radius:6px;background:var(--surface);min-width:0}.list-item-main{min-width:0;flex:1}.list-item-title{font-size:11px;font-weight:600;overflow-wrap:anywhere}.list-item-meta{color:var(--muted);font-size:9px;margin-top:3px}.list-item-badge{font-size:9px;padding:3px 7px;border:1px solid var(--line);border-radius:4px;color:var(--muted);white-space:nowrap}.list-item-badge.draft{border-color:transparent;background:var(--soft-amber);color:var(--warning)}.list-item-badge.published{border-color:transparent;background:var(--soft-green);color:var(--green)}.list-item-actions{display:flex;gap:5px}.empty-state{padding:25px 15px;text-align:center;border:1px dashed var(--line);border-radius:6px;background:var(--surface);color:var(--muted);font-size:11px}
.editor-container{margin-top:19px;padding:19px;border:1px solid var(--line);border-radius:7px;background:var(--surface)}.editor-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:14px;margin-bottom:16px;border-bottom:1px solid var(--line)}.editor-header h3{font-size:15px;font-weight:600}.editor-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(240px,.8fr);gap:18px}.editor-col{min-width:0;padding:15px;border:1px solid var(--line);border-radius:6px;background:color-mix(in srgb,var(--ground) 48%,var(--surface))}.editor-col h4{margin:0 0 11px;font-size:12px}.editor-col textarea,.editor-container textarea,.editor-container input,.editor-container select{border-radius:5px;border-color:var(--line);background:var(--surface);color:var(--ink);font:inherit}.editor-col textarea{width:100%;min-height:280px;padding:12px;font-family:Consolas,Monaco,monospace;font-size:11px;line-height:1.55}.field{margin:14px 0}.field label{font-size:10px;font-weight:600}.field input,.field textarea,.field select{padding:9px 10px;font-size:11px}.button-row{gap:7px;flex-wrap:wrap}.form-note{font-size:10px;line-height:1.65;color:var(--muted)}.error{color:#ad3428;font-size:10px;white-space:pre-wrap}.version-list,.list-container.compact{gap:5px}.workspace-footer{display:flex;justify-content:space-between;gap:10px;padding:15px 38px;border-top:1px solid var(--line);color:var(--muted);font-size:9px}.recovery-inbox{padding:14px 16px;margin:0 0 17px;border:1px solid #ead8c3;border-radius:6px;background:var(--ivory)}.recovery-inbox>strong{font-size:11px}.recovery-inbox>p{margin:3px 0 9px;font-size:10px;color:var(--muted)}.recovery-inbox-list{display:grid;gap:6px}.recovery-inbox-row{display:flex;align-items:center;gap:8px;padding-top:7px;border-top:1px solid #e9e2da}.recovery-inbox-row>span{flex:1;min-width:0;font-size:10px;overflow-wrap:anywhere}.recovery-notice,.conflict-notice{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:0 0 12px}.recovery-notice>span,.conflict-notice>span{flex:1;min-width:220px}.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}
body[data-theme=dark]{--ground:#191b1f;--surface:#23252a;--ivory:#292b2f;--ink:#f3f1ef;--muted:#afb3bd;--line:#393c44;--soft-red:#402a2a;--soft-green:#273b30;--soft-amber:#3c3428;--green:#8bc69c;--warning:#e4bd76;color-scheme:dark}body[data-theme=dark] .sidebar-header .logo-img{filter:brightness(0) invert(1)}body[data-theme=dark] .nav-link.active{color:#f28b7f}body[data-theme=dark] .owner-menu nav button.owner-menu-active{color:#f28b7f}body[data-theme=dark] .workspace-badge .status-dot{background:#8bc69c}
.dashboard-menu-toggle{display:none}
.mobile-shade{display:none}
@media(max-width:1100px){.main{padding:28px 24px}.workspace-topbar{padding:0 24px}.workspace-footer{padding-left:24px;padding-right:24px}.owner-content-layout{grid-template-columns:190px minmax(0,1fr);gap:16px}.editor-grid{grid-template-columns:minmax(0,1fr)}.cards-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.dashboard-view{display:block}.sidebar{width:246px;transform:translateX(-105%);transition:transform .2s;box-shadow:0 14px 40px #0002}.sidebar.open{transform:translateX(0)}.mobile-shade.open{display:block;position:fixed;inset:0;z-index:19;border:0;background:#1d1f2370}.workspace-shell{width:100%;margin:0}.workspace-topbar{height:60px;min-height:60px;padding:0 15px}.dashboard-menu-toggle{display:inline-flex;position:static;z-index:auto;width:34px;height:34px;min-width:34px;padding:0;align-items:center;justify-content:center}.topbar-context{gap:9px}.topbar-kicker{font-size:8px}.topbar-context strong{font-size:14px}.topbar-tools{gap:8px}.theme-picker>span,.workspace-badge{display:none}.main{padding:24px 15px}.panel-header h2{font-size:21px}.panel-actions{flex-wrap:wrap}.owner-content-layout{grid-template-columns:minmax(0,1fr)}.owner-menu{position:static;max-height:none}.owner-menu:not([open]){padding-bottom:11px}.content-list-toolbar{align-items:stretch;flex-direction:column}.content-filters{width:100%}.content-filters input{width:100%;min-width:0}.content-filters select{max-width:130px}.list-item{align-items:flex-start;flex-wrap:wrap}.list-item-main{flex-basis:100%}.list-item-actions{margin-left:auto}.editor-container{padding:12px}.editor-col{padding:11px}.cards-grid{gap:9px}.stat-card{padding:13px}.stat-value{font-size:21px}.workspace-footer{padding:13px 15px;font-size:8px}.recovery-inbox-row{flex-wrap:wrap}.recovery-inbox-row>span{flex-basis:100%}.recovery-inbox-row .btn{flex:1}}
@media(max-width:390px){.topbar-context strong{max-width:140px}.theme-picker select{max-width:75px}.cards-grid{grid-template-columns:1fr 1fr}.list-item-badge{font-size:8px}}
.recovery-inbox,.recovery-inbox-row{border-color:var(--line)}
#draft-fields input[type="date"] { padding: 10px 12px; border: 1px solid var(--border); border-radius: 4px; font: inherit; background: white; color: var(--charcoal); min-height: 42px; }
/* Owner editor — T-UX */
.owner-content-layout { display:grid;grid-template-columns:220px minmax(0,1fr);gap:24px;align-items:start; }
.owner-menu { position:sticky;top:110px;background:#FAF8F5;border:1px solid var(--border);padding:14px;border-radius:8px; }
.owner-menu summary { font-weight:700;cursor:pointer; }
.owner-menu h4 { margin:18px 0 6px;font-size:13px; }
.owner-menu button { display:block;width:100%;text-align:left;padding:10px;border:0;border-radius:4px;background:transparent;color:#1D1F23;cursor:pointer;font:inherit;font-size:13px; }
.owner-menu button.owner-menu-active { background:#1D1F23;color:white; }
.owner-content-work,.editor-col { min-width:0; }
.section-fields { border:1px solid var(--border);border-radius:6px;margin:12px 0;padding:14px; }
.section-fields summary { cursor:pointer;font-weight:600;margin-bottom:12px; }
.field-label { font-weight:600;display:block;margin-bottom:8px; }
.field-error { display:block;color:#a32720;font-size:13px;margin-top:5px; }
#draft-fields select,#draft-fields input[type=number] { width:100%;padding:10px;border:1px solid var(--border);border-radius:4px;background:white;font:inherit; }
#draft-fields input[type=checkbox] { width:22px;height:22px; }
.photo-field img { width:100%;max-width:280px;aspect-ratio:16/9;object-fit:cover;border-radius:6px; }
.photo-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;margin:16px 0; }
.photo-choice { border:1px solid var(--border);background:white;padding:8px;text-align:left;border-radius:6px;cursor:pointer; }
.photo-choice img { width:100%;aspect-ratio:16/9;object-fit:cover; }
.photo-choice strong,.photo-choice small { display:block;margin-top:8px;overflow-wrap:anywhere; }
.photo-choice[aria-pressed=true] { outline:3px solid #D94B3D; }
.photo-details dd { overflow-wrap:anywhere; }
dialog { border:1px solid var(--border);border-radius:8px;padding:24px;background:#FAF8F5;color:#1D1F23;width:min(900px,calc(100vw - 40px));max-height:85vh;overflow:auto; }
dialog::backdrop { background:rgba(29,31,35,.65); }
.preview-table { width:100%;table-layout:fixed;border-collapse:collapse; }
.preview-table th,.preview-table td { border:1px solid var(--border);padding:10px;overflow-wrap:anywhere;white-space:pre-wrap;text-align:left;vertical-align:top; }
.preview-changed { background:#fff0db; }
.owner-preview a { color:#234e93;text-decoration:underline; }
.markdown-toolbar { display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px; }
.keyword-chips { display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px; }
.keyword-chip { background:#eee9e3;border-radius:16px;padding:6px 10px;font-size:13px; }
.keyword-chip button { border:0;background:transparent;cursor:pointer;margin-left:8px; }
.waiting-row { display:flex;gap:16px;flex-wrap:wrap;padding:12px;border-bottom:1px solid var(--border); }
.live-fields { font-size:13px; }.live-fields dd { overflow-wrap:anywhere;white-space:pre-wrap;margin:4px 0 14px; }
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible { outline:3px solid #234e93;outline-offset:3px; }
@media(max-width:1100px){.owner-content-layout{grid-template-columns:180px minmax(0,1fr)}.editor-grid{grid-template-columns:1fr}}
@media(max-width:700px){.owner-content-layout{grid-template-columns:1fr}.owner-menu{position:static}.owner-menu nav{display:grid;grid-template-columns:1fr 1fr}.owner-menu h4{grid-column:1/-1}.photo-grid{grid-template-columns:1fr 1fr}.preview-table,.preview-table tr,.preview-table th,.preview-table td{display:block;width:auto}.preview-table tr{margin-bottom:12px}.preview-table td::before{font-weight:bold}dialog{padding:14px}.panel-header.sticky{position:static}}

#workspace-visibility,#workspace-tasks,#workspace-comments,#workspace-users,#workspace-operations{display:grid;gap:16px;margin-top:18px}
#editorial-panel>.notice-card{margin-top:18px}
#workspace-visibility .settings-card,#workspace-tasks,#workspace-comments,#workspace-users .settings-card,#workspace-operations .settings-card{min-width:0}
#workspace-visibility .field,#workspace-tasks .field,#workspace-comments .field,#workspace-users .field,#workspace-operations .field{display:flex;align-items:center;gap:9px}
#workspace-visibility .field input[type=checkbox],#workspace-users .field input[type=checkbox],#workspace-operations .field input[type=checkbox]{width:auto;min-height:auto}
#workspace-comments textarea{width:100%;padding:9px;border:1px solid var(--line);border-radius:5px;background:var(--surface);color:var(--ink);font:inherit}
#workspace-users .settings-card,#workspace-operations .settings-card{display:grid;gap:10px}

.dashboard-menu-toggle{display:none}@media(max-width:700px){.dashboard-menu-toggle{display:block;position:fixed;top:8px;right:8px;z-index:101}.sidebar:not(.open){visibility:hidden}.sidebar.open{visibility:visible}.main{padding-top:62px}}
@media(max-width:760px){.dashboard-menu-toggle{display:inline-flex;align-items:center;justify-content:center;position:static;top:auto;right:auto;z-index:auto}.main{padding-top:24px}}

.mcp-consent-dialog{max-width:min(640px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border:1px solid var(--border,#ddd);border-radius:16px;background:var(--surface,#fff);color:var(--text,#171717)}
.mcp-consent-dialog::backdrop{background:rgb(0 0 0 / 50%)}
