:root {
  color-scheme: light;
  --ink: #000000;
  --muted: #5f5a55;
  --line: #d8d1c7;
  --paper: #ffffff;
  --page: #f2f1eb;
  --brand: #000000;
  --brand-strong: #2c2926;
  --cream: #f2f1eb;
  --taupe: #cbbfb1;
  --taupe-dark: #8c7d70;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Poppins, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-weight: 700;
}

h1 {
  margin-bottom: 0;
  font-size: 1.16rem;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.5vw, 2.2rem);
  line-height: 1.1;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  font-weight: 750;
}

.nav-item:hover,
.nav-item.active {
  background: var(--cream);
  color: var(--brand);
  border-color: var(--taupe);
}

.sidebar-panel,
.summary-card,
.preview-panel,
.settings-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar-panel {
  margin-top: auto;
  padding: 16px;
}

.panel-label,
.summary-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.week-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}

.week-stat strong {
  font-size: 2rem;
  color: var(--brand);
}

.status-stack {
  display: grid;
  gap: 8px;
}

.status-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar-actions,
.copy-actions,
.button-row,
.toolbar-row,
.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button,
.file-label,
.segment,
.icon-only {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 9px 13px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.primary-button {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.primary-button:hover {
  background: var(--brand-strong);
}

.secondary-button:hover,
.icon-button:hover,
.segment:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.ghost-button {
  background: transparent;
}

.danger-button {
  border-color: #f2b8ad;
  color: #a13d2c;
}

.icon-button,
.file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

input[type="file"] {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 18px;
}

.summary-card strong {
  display: block;
  font-size: 2.25rem;
  line-height: 1;
}

.summary-card.urgent {
  border-color: var(--taupe);
  background: #fbfaf7;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.86fr) minmax(360px, 1.14fr);
  gap: 18px;
  align-items: start;
}

#todayView .content-layout {
  grid-template-columns: minmax(0, 880px);
}

#todayView .preview-panel {
  display: none;
}

.task-column {
  min-width: 0;
}

.section-heading,
.preview-toolbar,
.dialog-heading,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.task-list,
.planner-list,
.library-grid {
  display: grid;
  gap: 12px;
}

.task-card,
.plan-row,
.library-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.06);
}

.task-card {
  display: grid;
  gap: 10px;
}

.task-card.selected {
  outline: 3px solid rgba(22, 108, 95, 0.18);
}

.task-card.expanded,
.library-card.expanded {
  border-left-color: var(--taupe-dark);
}

.library-card.expanded {
  grid-column: 1 / -1;
}

.card-topline,
.card-actions,
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-content {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding-top: 14px;
}

.inline-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.embedded-preview {
  width: 100%;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.type-badge,
.status-badge,
.date-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--cream);
  color: var(--brand-strong);
}

.type-gmb {
  background: #eee7df;
  color: #5c4f45;
}

.type-blogs {
  background: #f7f4ef;
  color: #5f5a55;
}

.type-emails {
  background: #eee7df;
  color: #473e38;
}

.type-group-posts {
  background: #e8dfd6;
  color: #4f463e;
}

.status-posted {
  background: #efe9e1;
  color: #4f463e;
}

.status-ready {
  background: #000000;
  color: #ffffff;
}

.status-waiting {
  background: #f2f1eb;
  color: #5f5a55;
}

.task-card h4,
.plan-row h4,
.library-card h4 {
  margin: 0;
  font-size: 1rem;
}

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

.preview-panel {
  min-height: 520px;
  padding: 18px;
  position: sticky;
  top: 24px;
}

.preview-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.content-preview {
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  min-height: 360px;
  overflow: auto;
}

.content-preview img {
  max-width: 100%;
  height: auto;
}

.empty-copy,
.empty-state {
  color: var(--muted);
  margin: 0;
}

.toolbar-row {
  justify-content: space-between;
  margin-bottom: 16px;
}

.segmented-control {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.segment {
  min-height: 34px;
  border: 0;
  background: transparent;
}

.segment.active {
  background: var(--brand);
  color: white;
}

.search-input,
label input,
label select,
label textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 12px;
}

.search-input {
  max-width: 360px;
}

.plan-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.22fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.library-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.library-card {
  display: grid;
  gap: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 1fr);
  gap: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.admin-manager {
  background: transparent;
}

.upload-dropzone {
  border: 1px dashed var(--taupe-dark);
  border-radius: 8px;
  background: #fbfaf7;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 144px;
  margin-top: 6px;
  text-align: center;
}

.upload-dropzone strong {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  color: var(--ink);
}

.upload-dropzone span {
  color: var(--muted);
  font-size: 0.92rem;
}

.settings-block {
  padding: 20px;
}

.settings-block label,
.editor-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  margin-bottom: 14px;
}

.editor-dialog {
  width: min(920px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.editor-dialog::backdrop {
  background: rgba(31, 41, 51, 0.42);
}

.editor-form {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.icon-only {
  width: 40px;
  padding: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--ink);
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    text-align: center;
  }

  .sidebar-panel {
    display: none;
  }

  .content-layout,
  .admin-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .workspace,
  .sidebar {
    padding: 18px 14px;
  }

  .topbar,
  .section-heading,
  .preview-toolbar,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .copy-actions,
  .button-row {
    width: 100%;
  }

  .topbar-actions > *,
  .copy-actions > *,
  .button-row > * {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  .summary-grid,
  .form-grid,
  .plan-row {
    grid-template-columns: 1fr;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
