:root {
  --bg: #f2efea;
  --panel: #fffdf9;
  --panel-strong: #ffffff;
  --ink: #171717;
  --muted: #756f67;
  --line: #e7e0d7;
  --brand: #d83128;
  --brand-soft: #fff1ee;
  --ok: #166534;
  --bad: #b91c1c;
  --shadow: 0 18px 40px rgba(33, 24, 18, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "SF Pro Display", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.workflow-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px 28px 64px;
}

h1,
h2,
h3,
p,
span,
strong {
  margin: 0;
}

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

.head-kicker {
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
}

.workflow-head h1 {
  font-size: 30px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.head-subtext,
.empty-text,
.mini-text,
.cover-upload-row p {
  color: var(--muted);
}

.head-subtext {
  margin-top: 10px;
  max-width: 720px;
  font-size: 14px;
  line-height: 1.7;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-link,
.month-switcher,
.step-next,
.action-button,
.ghost-mini,
.solid-mini,
.choice-button,
.remove-button {
  font: inherit;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.7);
}

.month-switcher {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #4d4a46;
  font-size: 15px;
  font-weight: 600;
}

.month-home-shell {
  max-width: 1320px;
}

.month-home-head {
  margin-bottom: 16px;
}

.month-create-box {
  min-width: 320px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.month-create-trigger {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 700;
  color: var(--brand);
}

.month-create-trigger::-webkit-details-marker {
  display: none;
}

.month-create-form {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.month-create-form label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.month-create-form input {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

.month-home-overview {
  margin-bottom: 18px;
}

.month-home-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.month-home-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.month-home-panel-head h2 {
  font-size: 22px;
  color: var(--brand);
}

.month-home-panel-head p {
  font-size: 13px;
  color: var(--muted);
}

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

.month-folder-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 148px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #fffefb 0%, #fff7f2 100%);
  text-decoration: none;
  color: var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.month-folder-card:hover {
  transform: translateY(-2px);
  border-color: #d7c1b4;
  box-shadow: 0 22px 40px rgba(33, 24, 18, 0.09);
}

.month-folder-main {
  display: grid;
  gap: 8px;
}

.month-folder-label {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff1ee;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.month-folder-main strong {
  font-size: 24px;
}

.month-folder-main p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.month-folder-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #1f1f1f;
  color: #fff;
  font-size: 12px;
}

.workflow-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.rail-step {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: #5c544d;
  cursor: pointer;
}

.rail-step.is-active {
  background: #1f1f1f;
  border-color: #1f1f1f;
  color: #fff;
}

.upload-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.add-account-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf8;
}

.add-account-form input,
.add-account-form select {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

.upload-guide-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf8;
}

.upload-guide-card strong {
  display: block;
  margin-bottom: 6px;
}

.upload-guide-card p {
  font-size: 12px;
  color: var(--muted);
}

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

  .overview-card,
  .step-card,
  .flash,
  .white-panel,
  .placeholder-panel,
  .overview-card {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .overview-card {
    padding: 18px 20px;
    border-radius: 20px;
  }

  .overview-card span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
  }

  .overview-card strong {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
  }

  .overview-card p {
    font-size: 13px;
    color: var(--muted);
  }

  .emphasis-card {
    background: linear-gradient(135deg, var(--brand-soft), #fffdf9 65%);
  }

  .flash-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
  }

  .flash {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .flash.success {
    border-color: #bbf7d0;
    color: var(--ok);
  }

  .flash.error {
    border-color: #fecaca;
    color: var(--bad);
  }

  .step-card {
    margin-top: 18px;
    padding: 24px 24px 26px;
    border-radius: 24px;
  }

  .step-card:not(.is-active) .step-body {
    display: none;
  }

  .step-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
  }

  .step-index {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 6px;
  }

  .step-header h2 {
    color: var(--brand);
    font-size: 22px;
    font-weight: 700;
  }

  .step-caption {
    margin-top: 8px;
    max-width: 760px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
  }

  .step-next {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 24px;
    cursor: pointer;
  }

  .step-body {
    margin-top: 18px;
  }

  .step-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fffaf8;
  }

  .simple-toolbar {
    justify-content: flex-start;
  }

  .toolbar-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .toolbar-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--line);
  }

  .success-badge {
    background: #eefbf1;
    color: #166534;
  }

  .warning-badge {
    background: #fff4eb;
    color: #9a3412;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .soft-table-wrap {
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
  }

  .upload-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  .upload-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #6f6f6f;
    font-size: 11px;
    font-weight: 600;
    padding: 14px 12px;
    background: #fbf7f4;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .upload-table td {
    padding: 14px 12px;
    border-top: 1px solid #f3ece6;
    vertical-align: top;
  }

  .upload-table input[type="text"],
  .notes-form textarea,
  .cover-upload-actions input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }

  .upload-table input[type="text"] {
    min-width: 120px;
  }

  .row-locked {
    background: #fffcfb;
  }

  .name-cell {
    min-width: 180px;
  }

  .name-cell strong {
    display: block;
  }

  .cell-meta {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
  }

  .upload-cell {
    display: grid;
    gap: 8px;
  }

.upload-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed #ddd0c2;
  border-radius: 12px;
  background: #fffdfa;
}

  .hidden-file {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .tiny-upload-button,
  .ghost-mini,
  .solid-mini,
  .choice-button,
  .remove-button,
  .action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .tiny-upload-button {
    width: 64px;
    height: 28px;
    border: 1px solid #b9d59b;
    border-radius: 999px;
    background: #ecf8de;
    font-size: 12px;
    color: #32501d;
  }

.prominent-upload {
  width: 94px;
  height: 32px;
  font-weight: 600;
}

  .tiny-upload-button.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .tiny-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #585858;
  }

  .upload-hint {
    font-size: 12px;
  }

.neutral-text {
  color: #8d7f74;
}

.uploaded-file-list {
  display: grid;
  gap: 4px;
}

.uploaded-file-list a {
  font-size: 12px;
  color: var(--brand);
  text-decoration: none;
}

  .ok-text {
    color: #84b965;
  }

  .warn-text {
    color: #df4a4a;
  }

  .ghost-mini,
  .solid-mini,
  .choice-button,
  .remove-button {
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: #555;
    text-decoration: none;
  }

  .solid-mini,
  .action-button,
  .choice-button.is-active {
    background: #1f1f1f;
    border-color: #1f1f1f;
    color: #fff;
  }

  .action-button {
    min-height: 42px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
  }

  .lock-action-cell {
    width: 96px;
  }

  .selection-subline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 12px;
  }

  .selection-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .selection-subline strong {
    color: var(--brand);
    font-size: 12px;
  }

  .step-grid {
    display: grid;
    gap: 14px;
  }

  .two-column-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }

  .placeholder-panel,
  .white-panel {
    border-radius: 18px;
    overflow: hidden;
  }

  .tint-panel {
    background: #fff8f7;
  }

  .placeholder-head {
    display: grid;
    padding: 14px 16px 12px;
    color: #6f6f6f;
    font-size: 11px;
    border-bottom: 1px solid var(--line);
  }

  .five-col-head {
    grid-template-columns: 1.8fr 1fr 0.7fr 1fr 1.2fr;
  }

  .two-col-head {
    grid-template-columns: 1fr 1fr;
  }

  .candidate-panel,
  .ranking-panel {
    min-height: 420px;
  }

  .candidate-table-wrap {
    max-height: 720px;
  }

  .candidate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }

  .candidate-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px 14px;
    text-align: left;
    font-size: 11px;
    color: #6f6f6f;
    background: #fbf7f4;
    border-bottom: 1px solid var(--line);
  }

  .candidate-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0e9e3;
    vertical-align: top;
  }

  .check-cell {
    width: 92px;
    text-align: center;
  }

  .selection-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .selection-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .selection-check span {
    width: 22px;
    height: 22px;
    border: 1px solid #d4c5b7;
    border-radius: 7px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .selection-check input:checked + span {
    background: #1f1f1f;
    border-color: #1f1f1f;
  }

  .selection-check input:checked + span::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: #fff;
  }

  .ranking-meta {
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--brand);
    font-weight: 700;
  }

  .candidate-table tbody tr:hover {
    background: #fffdf9;
  }

  .selection-select {
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font: inherit;
  }

  .candidate-list {
    display: grid;
    max-height: 370px;
    overflow: auto;
  }

  .candidate-row {
    display: grid;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0e9e3;
    font-size: 12px;
  }

  .interactive-row {
    grid-template-columns: 1.8fr 1fr 0.7fr 1fr 1.2fr;
  }

  .selection-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sync-panel {
    background: #fff;
  }

  .ranking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 370px;
  }

  .ranking-col {
    padding: 12px 14px;
    border-right: 1px solid var(--line);
  }

  .ranking-col:last-child {
    border-right: 0;
  }

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

  .ranking-item {
    padding: 10px 0;
    border-bottom: 1px solid #f2ebe5;
    font-size: 12px;
    line-height: 1.55;
  }

  .interactive-ranking-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .remove-button {
    min-width: 54px;
  }

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

  .compact-metrics {
    margin-bottom: 16px;
  }

  .cover-box,
  .white-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .cover-box strong {
    display: block;
    font-size: 32px;
    margin-bottom: 8px;
  }

  .ok-box {
    background: #f7fff2;
  }

  .warn-box {
    background: #fff5f5;
  }

  .cover-grid {
    align-items: start;
  }

  .panel-title {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
  }

  .cover-upload-list {
    display: grid;
    gap: 12px;
  }

  .cover-upload-row {
    display: grid;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #efe8e1;
  }

  .cover-upload-row strong {
    display: block;
    margin-bottom: 4px;
  }

  .cover-upload-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .cover-trigger {
    min-width: 88px;
  }

  .cover-status-text {
    font-size: 12px;
    color: var(--muted);
  }

  .cover-upload-actions a,
  .output-links a {
    color: var(--brand);
    text-decoration: none;
    font-size: 12px;
  }

  .notes-form {
    display: grid;
    gap: 12px;
  }

  .wide-form {
    max-width: 880px;
  }

  .notes-form label {
    display: grid;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
  }

  .notes-form textarea {
    resize: vertical;
    font: inherit;
    line-height: 1.7;
  }

  .output-panel {
    display: grid;
    gap: 12px;
  }

  .full-width-button {
    width: 100%;
  }

  .output-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .markdown-preview {
    display: grid;
    gap: 8px;
    max-height: 240px;
    overflow: auto;
    font-size: 12px;
    color: #555;
    padding-top: 6px;
  }

  @media (max-width: 1100px) {
    .two-column-grid,
    .overview-strip,
    .cover-metrics,
    .workflow-rail,
    .upload-guide-grid,
    .month-folder-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 900px) {
    .workflow-head,
    .step-header,
    .selection-subline,
    .selection-toolbar,
    .add-account-form,
    .cover-upload-actions,
    .month-home-panel-head {
      flex-direction: column;
      align-items: flex-start;
    }

    .workflow-shell {
      padding: 16px;
    }

    .head-actions,
    .toolbar-badges {
      flex-wrap: wrap;
    }

    .ranking-grid {
      grid-template-columns: 1fr;
    }

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

    .ranking-col:last-child {
      border-bottom: 0;
    }
  }
  .step-toolbar,
  .cover-metrics,
  .ranking-grid {
    grid-template-columns: 1fr;
  }

  .step-toolbar,
  .head-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .workflow-shell {
    width: 100%;
    padding: 16px;
  }
}