:root {
  color-scheme: light;
  --bg: #f2f4f3;
  --panel: #ffffff;
  --panel-soft: #f7f8f6;
  --ink: #172126;
  --muted: #667277;
  --line: #d8ddda;
  --accent: #167d8d;
  --accent-strong: #105d68;
  --danger: #b3261e;
  --green: #2e7153;
  --yellow: #a05b12;
  --blue-soft: #e8f4f7;
  --green-soft: #e9f6ef;
  --yellow-soft: #fff5d6;
  --red-soft: #fdebea;
  --shadow: 0 24px 70px rgba(23, 33, 38, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", "Segoe UI", sans-serif;
}

/* Visual system: a restrained production desk with a continuous progress rail. */
.product-lockup {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.product-mark {
  display: grid;
  width: 32px;
  gap: 4px;
  padding-top: 5px;
}

.product-mark i {
  display: block;
  height: 4px;
  background: var(--ink);
}

.product-mark i:nth-child(2) {
  width: 72%;
  background: var(--accent);
}

.product-mark i:nth-child(3) {
  width: 42%;
  background: #b26a18;
}

.tab-group-label {
  align-self: center;
  color: var(--muted);
  font: 700 10px/1.2 "Avenir Next", "Hiragino Sans", sans-serif;
  text-transform: uppercase;
  white-space: nowrap;
}

.tab-group-label.client-label {
  color: #8a5012;
}

.tab-spacer {
  flex: 1 0 18px;
}

@media (max-width: 880px) {
  .tab-group-label,
  .tab-spacer {
    display: none;
  }
}

/* Final design pass */
body {
  background:
    linear-gradient(90deg, rgba(23, 33, 38, 0.025) 1px, transparent 1px) 0 0 / 80px 80px,
    var(--bg);
}

.app-header {
  min-height: 106px;
  padding-top: 20px;
  padding-bottom: 18px;
  border-bottom-color: #c9d0cc;
}

.eyebrow {
  margin-bottom: 5px;
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
}

h1 {
  font-family: "Avenir Next", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  font-weight: 700;
}

.storage-status {
  min-height: auto;
  margin-top: 7px;
  border-radius: 3px;
  padding: 3px 7px;
}

.app-tabs {
  top: 0;
  gap: 3px;
  padding-top: 8px;
  padding-bottom: 8px;
  background: rgba(242, 244, 243, 0.96);
}

.app-tabs::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0 68%, #b26a18 68% 100%);
  content: "";
}

.app-tab {
  min-height: 36px;
  border-color: transparent;
  border-radius: 4px;
  padding: 7px 12px;
  background: transparent;
  font-size: 13px;
}

.app-tab:hover {
  background: #e7ecea;
  color: var(--ink);
}

.app-tab.client-tab {
  border-color: transparent;
  background: #f4eadc;
  color: #7c4810;
}

.app-shell {
  max-width: 1680px;
  margin: 0 auto;
  padding-top: 24px;
}

.app-view {
  position: relative;
  min-height: calc(100vh - 205px);
  border: 0;
  border-radius: 0;
  padding: 24px;
  box-shadow: 0 1px 0 var(--line);
}

.app-view::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--accent);
  content: "";
}

#reviewView::before,
#requestFormView::before {
  background: #b26a18;
}

.view-heading {
  margin-bottom: 24px;
}

.section-note {
  max-width: 680px;
}

.primary-button,
.text-button,
.icon-button,
input,
select,
textarea {
  border-radius: 4px;
}

.primary-button {
  box-shadow: 0 2px 0 var(--accent-strong);
}

.primary-button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.summary-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.summary-card {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.summary-card:last-child {
  border-right: 0;
}

.summary-card strong {
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: 26px;
}

.panel,
.post-card,
.review-card,
.kanban-column,
.calendar-grid,
.table-wrap,
fieldset {
  border-radius: 4px;
}

.panel {
  border-top: 3px solid var(--ink);
  background: var(--panel);
}

.kanban-column {
  border-top: 3px solid var(--accent);
  background: var(--panel-soft);
}

.kanban-column-header {
  background: #edf1ef;
}

.post-card,
.review-card,
.mini-item {
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.post-card:hover,
.review-card:hover,
.mini-item:hover {
  border-color: #a9b8b4;
  box-shadow: 0 8px 24px rgba(23, 33, 38, 0.08);
  transform: translateY(-1px);
}

.badge,
.holiday-label,
.weekend-label {
  border-radius: 3px;
}

.calendar-day {
  min-height: 140px;
}

.post-table th {
  background: #edf1ef;
  color: #46545a;
  text-transform: none;
}

.post-table tbody tr:hover td {
  background: #f4f8f7;
}

.post-table tbody tr:hover .sticky-col {
  background: #f4f8f7;
}

.request-form {
  max-width: 760px;
}

.csv-import-panel {
  display: grid;
  max-width: 940px;
  grid-template-columns: minmax(180px, 0.7fr) minmax(460px, 1.3fr);
  gap: 20px;
  margin-bottom: 18px;
  border-top: 3px solid #b26a18;
  padding: 16px;
  background: #fcfaf7;
}

.csv-import-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
}

.csv-file-field input {
  padding: 7px;
  background: var(--panel);
}

.calendar-post.format-reel {
  border-left-color: #2376d2;
  background: #eaf3ff;
}

.calendar-post.format-feed {
  border-left-color: #2e7153;
  background: #edf7f1;
}

.calendar-post.format-story {
  border-left-color: #c14f72;
  background: #fff0f4;
}

.calendar-post.format-reel em {
  color: #155ca9;
}

.calendar-post.format-feed em {
  color: #225c43;
}

.calendar-post.format-story em {
  color: #9f3657;
}

.post-card.format-reel {
  border-left: 4px solid #2376d2;
  background: #eaf3ff;
}

.post-card.format-feed {
  border-left: 4px solid #2e7153;
  background: #edf7f1;
}

.post-card.format-story {
  border-left: 4px solid #c14f72;
  background: #fff0f4;
}

.calendar-post.is-unconfirmed {
  filter: brightness(0.84) saturate(0.62);
  opacity: 0.82;
}

.calendar-post.is-unconfirmed:hover,
.calendar-post.is-unconfirmed:focus-visible {
  filter: brightness(0.92) saturate(0.78);
  opacity: 1;
}

.request-form fieldset {
  border-top: 3px solid #b26a18;
  background: #fcfaf7;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(22, 125, 141, 0.25);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    min-height: 0;
  }

  .product-mark {
    width: 24px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .app-shell {
    padding: 14px 10px 28px;
  }

  .app-view {
    padding: 18px 14px;
  }

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

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

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

button {
  cursor: pointer;
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(18px, 4vw, 40px) 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

.storage-status {
  display: inline-flex;
  min-height: 24px;
  margin: 8px 0 0;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--blue-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.storage-status.done {
  background: var(--green-soft);
  color: var(--green);
}

.storage-status.waiting {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.storage-status.hold {
  background: var(--red-soft);
  color: var(--danger);
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.header-actions,
.app-tabs,
.view-heading,
.view-actions,
.month-control,
.dialog-header,
.dialog-actions,
.card-meta,
.card-actions,
.review-actions {
  display: flex;
  align-items: center;
}

.header-actions,
.view-actions,
.dialog-actions,
.card-actions,
.review-actions {
  gap: 8px;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-tabs {
  position: sticky;
  top: 0;
  z-index: 8;
  gap: 6px;
  padding: 10px clamp(18px, 4vw, 40px);
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 243, 238, 0.96);
  backdrop-filter: blur(10px);
}

.app-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 16px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.app-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.app-tab.client-tab {
  border-color: #9b5f00;
  background: #fff3d8;
  color: #6f4300;
}

.app-tab.client-tab.active {
  border-color: #9b5f00;
  background: #9b5f00;
  color: white;
}

.app-shell {
  padding: 18px clamp(18px, 4vw, 40px) 40px;
}

.app-view {
  display: none;
  min-height: calc(100vh - 170px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
}

.app-view.active {
  display: block;
}

.view-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.primary-button,
.text-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

.primary-button {
  min-height: 44px;
  border-color: var(--accent);
  padding: 0 16px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.primary-button.compact {
  min-height: 38px;
}

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

.text-button {
  min-height: 34px;
  padding: 6px 10px;
  color: var(--accent);
  font-weight: 800;
}

a.text-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.sheet-link {
  background: var(--blue-soft);
}

.text-button.danger,
.icon-button.danger {
  color: var(--danger);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--panel);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(23, 107, 135, 0.16);
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

label b {
  color: var(--danger);
  font-size: 11px;
}

.request-form,
.summary-strip,
.calendar-summary {
  display: grid;
}

.request-form {
  max-width: 820px;
  gap: 14px;
}

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

.calendar-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-card,
.panel,
.post-card,
.review-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.summary-card {
  min-height: 64px;
  padding: 10px;
}

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

.summary-card span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

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

.dashboard-grid.single-panel {
  grid-template-columns: 1fr;
}

.panel {
  min-height: 260px;
  padding: 14px;
}

.panel-heading {
  margin-bottom: 12px;
}

.item-list,
.review-grid {
  display: grid;
  gap: 10px;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.mini-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
  text-align: left;
}

.mini-item.needs-client-review {
  border-color: rgba(184, 68, 68, 0.46);
  border-left: 5px solid var(--danger);
  background: #fff5f3;
  box-shadow: inset 0 0 0 1px rgba(184, 68, 68, 0.08);
}

.mini-item.needs-client-review .muted {
  color: #9d3f35;
  font-weight: 800;
}

.mini-item strong,
.post-card strong {
  overflow-wrap: anywhere;
}

.card-meta {
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--blue-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.badge.done {
  background: var(--green-soft);
  color: var(--green);
}

.badge.waiting {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.badge.hold {
  background: var(--red-soft);
  color: var(--danger);
}

.kanban-board {
  display: grid;
  grid-auto-columns: minmax(260px, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.kanban-column {
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.select-all-control,
.archive-check {
  display: flex;
  align-items: center;
}

.archive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
  background: #f1f4f2;
}

.select-all-control,
.archive-check {
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.select-all-control input,
.archive-check input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.archive-check {
  justify-self: start;
}

.archive-selected-button {
  min-height: 30px;
  max-width: 145px;
  padding: 4px 7px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-selected-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#toggleArchiveButton.active {
  border-color: var(--accent);
  background: var(--blue-soft);
}

#toggleArchiveButton {
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
}

.archive-tray {
  margin-top: 18px;
  border-top: 3px solid var(--ink);
  padding: 16px;
  background: var(--panel-soft);
}

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

.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.archive-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.archive-item strong {
  overflow-wrap: anywhere;
}

.kanban-column-body {
  display: grid;
  gap: 8px;
  min-height: 160px;
  padding: 10px;
}

.post-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  cursor: grab;
}

.post-card:active {
  cursor: grabbing;
}

.post-card.dragging {
  opacity: 0.45;
}

.kanban-column {
  transition: border-color 150ms ease, background-color 150ms ease;
}

.kanban-column.drag-over {
  border-color: var(--accent);
  background: #eaf4f3;
  box-shadow: inset 0 0 0 2px rgba(22, 125, 141, 0.16);
}

.kanban-column.drag-over .kanban-column-body {
  min-height: 190px;
}

.post-card button {
  text-align: left;
}

.card-title {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.month-control {
  gap: 8px;
}

.month-control input {
  width: 155px;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.weekday-row span {
  padding: 8px 4px;
}

.calendar-grid {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-day {
  min-height: 148px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  background: var(--panel);
}

.calendar-day.weekend {
  background: #fbfaf7;
}

.calendar-day.holiday {
  background: #fff8f4;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.muted {
  background: #f1eee7;
  color: var(--muted);
}

.calendar-day.calendar-drag-over {
  outline: 3px solid rgba(22, 125, 141, 0.28);
  outline-offset: -3px;
  background: #eef8f7;
}

.calendar-day.calendar-drag-over .day-number {
  color: var(--accent-strong);
}

.day-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 22px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
}

.day-subline {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.holiday-label,
.weekend-label {
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.6;
  white-space: nowrap;
}

.holiday-label {
  background: #ffe7df;
  color: #9a3412;
}

.weekend-label {
  background: #eee9dd;
  color: var(--muted);
}

.shoot-day-label {
  border-radius: 3px;
  padding: 1px 6px;
  background: #f4eadc;
  color: #8a5012;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.6;
  white-space: nowrap;
}

.calendar-shoot {
  display: grid;
  gap: 3px;
  width: 100%;
  margin-bottom: 6px;
  border: 1px dashed #b26a18;
  border-left: 4px solid #b26a18;
  border-radius: 4px;
  padding: 6px;
  background: #fcf5ea;
  color: var(--ink);
  text-align: left;
}

.calendar-shoot strong {
  color: #8a5012;
  font-size: 11px;
}

.calendar-shoot span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.calendar-post {
  display: grid;
  gap: 3px;
  width: 100%;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 6px;
  background: var(--blue-soft);
  text-align: left;
}

.calendar-post[draggable="true"] {
  cursor: grab;
}

.calendar-post.dragging {
  cursor: grabbing;
  opacity: 0.58;
}

.calendar-post.done {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.calendar-post.waiting {
  border-left-color: var(--yellow);
  background: var(--yellow-soft);
}

.calendar-post.hold {
  border-left-color: var(--danger);
  background: var(--red-soft);
}

.calendar-post strong,
.calendar-post span,
.calendar-post em {
  overflow-wrap: anywhere;
}

.calendar-post strong {
  font-size: 12px;
}

.calendar-post span {
  color: var(--muted);
  font-size: 11px;
}

.calendar-post em {
  color: var(--accent-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.filters {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(220px, 1fr) repeat(3, minmax(130px, 180px));
  gap: 12px;
  margin-bottom: 14px;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 345px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.post-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.post-table th,
.post-table td {
  max-width: 280px;
  min-width: 132px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.post-table td:hover {
  white-space: normal;
  overflow-wrap: anywhere;
}

.post-table a {
  color: var(--accent);
  font-weight: 800;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 132px !important;
  background: var(--panel);
  box-shadow: 1px 0 0 var(--line);
}

.post-table th.sticky-col {
  z-index: 4;
  background: var(--panel-soft);
}

.action-cell {
  white-space: normal;
}

.action-cell .text-button {
  width: 100%;
  margin-bottom: 6px;
}

.empty-state-cell {
  height: 180px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle !important;
}

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

.review-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--panel);
}

.review-card h3 {
  overflow-wrap: anywhere;
}

.link-list {
  display: grid;
  gap: 6px;
}

.link-list a {
  color: var(--accent);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.request-memo {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

fieldset {
  display: grid;
  gap: 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
}

legend {
  padding: 0 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.field-help {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.drive-url-field {
  gap: 8px;
}

.drive-url-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.linked-story-fields {
  border-top: 3px solid #c14f72;
  background: #fff8fa;
}

.wide {
  grid-column: 1 / -1;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(31, 35, 40, 0.45);
}

.edit-dialog {
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}

.edit-form {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px;
}

.dialog-header {
  justify-content: space-between;
  gap: 16px;
}

.dialog-actions {
  position: sticky;
  bottom: -18px;
  justify-content: flex-end;
  margin: 4px -18px -18px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.client-dialog {
  width: min(760px, calc(100vw - 32px));
}

.client-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.client-review-body {
  display: grid;
  gap: 14px;
}

.client-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
}

.client-preview dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  margin: 0;
}

.client-preview dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.client-preview dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.complete-dialog {
  width: min(420px, calc(100vw - 32px));
}

.complete-content {
  display: grid;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.complete-content strong {
  font-size: 22px;
}

.complete-content p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .app-header,
  .view-heading,
  .dialog-header {
    align-items: stretch;
    display: grid;
  }

  .view-actions {
    align-items: stretch;
    display: grid;
  }

  .app-tab {
    min-width: 116px;
  }

  .field-grid,
  .filters,
  .summary-strip,
  .calendar-summary,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .month-control {
    justify-content: space-between;
  }

  .month-control input {
    width: 100%;
  }

  .calendar-grid,
  .weekday-row {
    min-width: 720px;
  }

  .calendar-view {
    overflow-x: auto;
  }

  .client-preview dl {
    grid-template-columns: 1fr;
  }
}

/* Keep the studio design pass last so component defaults cannot override it. */
body {
  background:
    linear-gradient(90deg, rgba(23, 33, 38, 0.025) 1px, transparent 1px) 0 0 / 80px 80px,
    var(--bg);
}

.app-header {
  min-height: 106px;
  padding-top: 20px;
  padding-bottom: 18px;
  border-bottom-color: #c9d0cc;
}

.eyebrow {
  margin-bottom: 5px;
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
}

h1 {
  font-family: "Avenir Next", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 28px;
  font-weight: 650;
}

h2 {
  font-size: 22px;
  font-weight: 700;
}

.storage-status {
  min-height: auto;
  margin-top: 7px;
  border-radius: 3px;
  padding: 3px 7px;
}

.app-tabs {
  gap: 3px;
  padding-top: 8px;
  padding-bottom: 8px;
  background: rgba(242, 244, 243, 0.96);
}

.app-tab {
  min-height: 36px;
  border-color: transparent;
  border-radius: 4px;
  padding: 7px 12px;
  background: transparent;
  font-size: 13px;
}

.app-tab:hover {
  background: #e7ecea;
  color: var(--ink);
}

.app-tab.client-tab {
  border-color: transparent;
  background: #f4eadc;
  color: #7c4810;
}

.app-shell {
  max-width: 1680px;
  margin: 0 auto;
  padding-top: 24px;
}

.app-view {
  position: relative;
  min-height: calc(100vh - 205px);
  border: 0;
  border-radius: 0;
  padding: 24px;
  box-shadow: 0 1px 0 var(--line);
}

.view-heading {
  margin-bottom: 24px;
}

.section-note {
  max-width: 680px;
}

.primary-button,
.text-button,
.icon-button,
input,
select,
textarea {
  border-radius: 4px;
}

.summary-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.summary-card {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.panel,
.post-card,
.review-card,
.kanban-column,
.calendar-grid,
.table-wrap,
fieldset {
  border-radius: 4px;
}

.panel {
  border-top: 3px solid var(--ink);
  background: var(--panel);
}

.kanban-column {
  border-top: 3px solid var(--accent);
  background: var(--panel-soft);
}

.kanban-column-header,
.post-table th {
  background: #edf1ef;
}

.badge,
.holiday-label,
.weekend-label {
  border-radius: 3px;
}

.request-form {
  max-width: 760px;
}

.request-form fieldset {
  border-top: 3px solid #b26a18;
  background: #fcfaf7;
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    min-height: 0;
  }

  .app-shell {
    padding: 14px 10px 28px;
  }

  .app-view {
    padding: 18px 14px;
  }

  .csv-import-panel,
  .csv-import-actions {
    grid-template-columns: 1fr;
  }
}

/* Compact CSV intake */
.primary-button.compact {
  white-space: nowrap;
}

.csv-import-panel {
  max-width: 940px;
  grid-template-columns: minmax(220px, 0.8fr) minmax(420px, 1.2fr);
  gap: 28px;
  padding: 18px 20px 20px;
}

.csv-import-actions {
  grid-template-columns: minmax(250px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.csv-file-field {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
}

.csv-field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.csv-file-picker {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
  background: var(--panel);
}

.csv-file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.csv-select-button {
  flex: 0 0 auto;
  margin: 0;
  background: var(--panel-soft);
  white-space: nowrap;
}

.csv-file-name {
  min-width: 0;
  padding: 0 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#importRequestCsvButton,
#downloadRequestCsvTemplateButton {
  min-height: 40px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .csv-import-panel,
  .csv-import-actions {
    grid-template-columns: 1fr;
  }

  .csv-import-panel {
    gap: 16px;
    padding: 16px;
  }

  .csv-file-field {
    grid-column: auto;
  }

  .csv-import-actions > button,
  .view-heading > .primary-button {
    width: 100%;
  }
}
