:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --panel: #fffdf8;
  --ink: #221f1a;
  --muted: #7a756c;
  --line: #e2ddd3;
  --ready: #0f766e;
  --draft: #b45309;
  --sent: #57534e;
  --accent: #1f6f78;
  --accent-strong: #174f56;
  --danger: #b42318;
  --shadow: 0 14px 40px rgba(42, 35, 25, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 18px 14px 96px;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.08;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
}

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

.summary-card {
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.summary-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.ops-strip {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.ops-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.ops-card span,
.ops-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.ops-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.25;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 0 12px;
  background: rgba(245, 243, 238, 0.94);
  backdrop-filter: blur(10px);
}

.tab {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.15;
}

.tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.month-grid {
  display: grid;
  gap: 16px;
}

.status-section {
  display: grid;
  gap: 9px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 0;
}

.section-title strong {
  font-size: 15px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.section-grid {
  display: grid;
  gap: 12px;
}

.section-empty {
  padding: 18px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 253, 248, 0.65);
}

.content-card {
  display: grid;
  grid-template-columns: minmax(96px, 112px) minmax(0, 1fr);
  gap: 12px;
  min-height: 150px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02);
}

.cover {
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  background: #e7e1d5;
  aspect-ratio: 3 / 4;
}

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

.date-pill {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.88);
  font-size: 11px;
  font-weight: 700;
}

.card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.card-body h3 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.22;
}

.shop-name {
  color: var(--muted);
  font-size: 13px;
}

.summary {
  display: -webkit-box;
  overflow: hidden;
  color: #4f4a42;
  font-size: 13px;
  line-height: 1.42;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eee9de;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.meta-row .badge {
  max-width: 100%;
}

.meta-row .badge:last-child {
  align-items: flex-start;
  line-height: 1.25;
  white-space: normal;
}

.badge.ready {
  background: #dcf5ef;
  color: var(--ready);
}

.badge.cover_ready {
  background: #e8f0f2;
  color: var(--accent-strong);
}

.badge.cover_only {
  background: #fff1d6;
  color: var(--draft);
}

.badge.published {
  background: #e7e5e4;
  color: var(--sent);
}

.badge.style {
  background: #e8f0f2;
  color: var(--accent-strong);
}

.card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(58px, auto);
  gap: 8px;
  margin-top: 4px;
}

.secondary-button,
.primary-button {
  min-width: 0;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 13px;
}

.secondary-button {
  background: #fff;
  color: var(--ink);
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary-button:disabled {
  border-color: #c9c2b8;
  background: #d7d2c9;
  color: #817a70;
}

.detail-sheet {
  width: min(94vw, 560px);
  max-height: 88vh;
  padding: 0;
  overflow-y: auto;
  border: 0;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detail-sheet::backdrop {
  background: rgba(24, 20, 16, 0.38);
}

.sheet-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.sheet-header h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.16;
}

.detail-summary {
  padding: 14px 16px 0;
  color: #4f4a42;
  line-height: 1.5;
}

.quality-panel {
  display: grid;
  gap: 10px;
  margin: 0 16px 14px;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.quality-grid div {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quality-grid strong,
.quality-grid span {
  display: block;
}

.quality-grid strong {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.1;
}

.quality-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.reason-list,
.warning-list,
.ready-note {
  display: grid;
  gap: 6px;
  margin: 0;
}

.reason-list p,
.warning-list p,
.ready-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.reason-list p {
  background: #fff1d6;
  color: var(--draft);
}

.warning-list p {
  background: #e8f0f2;
  color: var(--accent-strong);
}

.ready-note {
  background: #dcf5ef;
  color: var(--ready);
}

.detail-images {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  padding: 12px 16px;
}

.detail-images img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: #e7e1d5;
}

.copy-preview {
  max-height: 220px;
  margin: 0 16px 12px;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f5ee;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.5;
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}

.action-note {
  min-height: 22px;
  margin: -6px 16px 16px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 24px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 253, 248, 0.7);
}

@media (min-width: 680px) {
  .section-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
