:root {
  color-scheme: light;
  --page-bg: #eceae5;
  --panel-bg: #ffffff;
  --poster-bg: #fffdf8;
  --ink: #10233d;
  --muted: #5b6778;
  --line: #d9dde1;
  --navy: #17395c;
  --navy-soft: #e8eef3;
  --accent: #7a1f16;
  --accent-soft: #f9e8e1;
  --gold: #806022;
  --gold-band: #f4cf63;
  --gold-soft: #f5ecd7;
  --success: #24684f;
  --danger: #a73729;
  --shadow: 0 18px 46px rgba(24, 38, 54, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page-bg);
  font-size: 15px;
  line-height: 1.55;
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

.app-header {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 20px 32px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.app-header h1,
.panel-heading h2,
.preview-intro h2 {
  margin: 0;
  letter-spacing: -0.025em;
}

.app-header h1 {
  margin-top: 2px;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.25;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.internal-badge {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid #c9b17d;
  border-radius: 999px;
  color: #70541e;
  background: var(--gold-soft);
  font-size: 12px;
  font-weight: 750;
}

.workspace {
  width: min(1560px, 100%);
  min-height: calc(100vh - 88px);
  margin: 0 auto;
  padding: 0 32px 28px;
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.settings-panel,
.preview-panel {
  border: 1px solid rgba(16, 35, 61, 0.09);
  border-radius: 20px;
  background: var(--panel-bg);
  box-shadow: 0 10px 32px rgba(24, 38, 54, 0.06);
}

.settings-panel {
  padding: 22px;
}

.panel-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid #e8e8e4;
}

.panel-heading h2,
.preview-intro h2 {
  margin-top: 3px;
  font-size: 19px;
}

.panel-heading > p:last-child,
.preview-intro > p,
.settings-action p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.setting-step {
  padding: 18px 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid #eeeeea;
}

.step-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--navy);
  background: var(--navy-soft);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.setting-content {
  min-width: 0;
}

.setting-content label {
  display: block;
  margin: 3px 0 8px;
  font-size: 13px;
  font-weight: 750;
}

select,
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cdd3d8;
  border-radius: 11px;
  outline: none;
  background: #ffffff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

select {
  padding: 0 38px 0 12px;
}

input {
  padding: 0 12px;
  font-variant-numeric: tabular-nums;
}

input[type="date"] {
  color: var(--navy);
  font-family: inherit;
}

input[aria-invalid="true"] {
  border-color: #d47364;
  background: #fffafa;
}

select:focus,
input:focus {
  border-color: #6584a0;
  box-shadow: 0 0 0 3px rgba(23, 57, 92, 0.1);
}

option:disabled {
  color: #8b9299;
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.input-with-unit > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.amount-field {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
}

.amount-field > span:first-child {
  color: var(--navy);
  font-size: 18px;
  font-weight: 750;
}

.finance-amount-fields {
  display: grid;
  gap: 9px;
}

.finance-tier-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.finance-tier-row > label {
  margin: 0;
  color: var(--navy);
  font-size: 12px;
}

.compact-amount-field input {
  min-height: 38px;
}

.finance-tier-error {
  grid-column: 2;
  min-height: 0;
  margin-top: 2px;
}

.finance-tier-error:empty {
  display: none;
}

.quick-options {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.quick-options button,
.return-button {
  min-height: 44px;
  border: 1px solid #d4d9dd;
  border-radius: 10px;
  color: var(--navy);
  background: #f7f8f8;
  font-size: 12px;
  font-weight: 700;
}

.quick-options button:hover,
.return-button:hover {
  border-color: #9eabb7;
  background: var(--navy-soft);
}

.field-help,
.field-error {
  margin: 7px 0 0;
  font-size: 11px;
}

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

.field-error {
  min-height: 1.55em;
  color: var(--danger);
  font-weight: 650;
}

.settings-action {
  padding-top: 18px;
}

.settings-action p {
  margin: 0 0 10px;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: var(--navy);
  font-weight: 750;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px rgba(23, 57, 92, 0.2);
}

.primary-button:hover:not(:disabled) {
  background: #0f2e4c;
}

.primary-button:disabled {
  color: #8d969f;
  background: #dfe3e5;
  box-shadow: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #17395c;
  outline-offset: 3px;
}

.preview-panel {
  min-width: 0;
  padding: 16px;
}

.preview-intro {
  min-height: 48px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.preview-intro > p {
  max-width: 320px;
  margin: 0 2px 2px 0;
  text-align: right;
}

.poster-stage {
  min-width: 0;
  padding: 8px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 14px;
  background: #e7e5df;
  scrollbar-color: #9ca7af #e7e5df;
}

.poster {
  width: min(100%, 1103px);
  min-width: 980px;
  aspect-ratio: 1103 / 755;
  flex: 0 0 auto;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #b9a05b;
  border-radius: 12px;
  background: var(--poster-bg);
  box-shadow: var(--shadow);
}

.poster[data-project="career"] {
  --course-column-width: 16%;
  --status-column-width: 12%;
}

.poster[data-project="guide"] {
  --course-column-width: 15%;
  --status-column-width: 13%;
}

.poster[data-project="finance"] {
  --course-column-width: 22%;
  --status-column-width: 6%;
}

.poster-header {
  padding: 11px 18px 9px;
  border-bottom: 1px solid #ad872e;
  background: var(--gold-band);
  text-align: center;
}

.poster-project {
  margin: 0;
  color: #5f4719;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.poster-header h2 {
  margin: 1px 0 3px;
  color: #152a43;
  font-size: clamp(23px, 2.1vw, 29px);
  line-height: 1.15;
  letter-spacing: 0.015em;
}

.poster-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  color: #634e21;
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.poster-summary {
  min-height: 48px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #b9c2cb;
  background: #f7f2e7;
}

.poster-summary > div {
  min-width: 0;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-right: 1px solid #d2d7dc;
  white-space: nowrap;
  overflow: hidden;
}

.poster-summary > div:last-child {
  border-right: 0;
}

.poster-summary span {
  color: var(--muted);
  font-size: 10px;
}

.poster-summary strong {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  transform-origin: right center;
  transform: scaleX(var(--price-scale, 1));
}

.poster-summary b {
  font-size: 18px;
}

.poster-summary .summary-remaining {
  background: var(--accent-soft);
}

.poster-summary .summary-remaining strong,
.poster-summary .summary-remaining b {
  color: #7a1f16;
}

.roster-table-wrap {
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
}

.roster-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
  color: #203247;
  font-size: 10.5px;
  line-height: 1.08;
}

.roster-table thead {
  color: #ffffff;
  background: var(--navy);
}

.roster-table th,
.roster-table td {
  padding: 1px 4px;
  border-right: 1px solid #cad0d5;
  border-bottom: 1px solid #d8dcdf;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-table th {
  height: 25px;
  border-color: #46617b;
  font-size: 10px;
  font-weight: 750;
}

.roster-table td {
  height: 15px;
  font-variant-numeric: tabular-nums;
}

.roster-table th:last-child,
.roster-table td:last-child {
  border-right: 0;
}

.roster-table tbody tr:nth-child(even) {
  background: #fff8e8;
}

.roster-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.roster-table td[data-field="number"] {
  color: #607080;
  font-weight: 700;
}

.roster-table td[data-field="name"],
.roster-table td[data-field="phone"],
.roster-table td[data-field="amount"],
.roster-table td[data-field="owner"],
.roster-table td[data-field="status"] {
  font-weight: 700;
}

.roster-table td[data-field="course"] {
  text-align: left;
  padding-left: 7px;
}

.roster-table tr[data-row-state="available"] {
  color: #7d2f20;
  background: #fff0e8;
}

.roster-table tr[data-row-state="available"] td {
  border-color: #e9b9a8;
}

.roster-table tr[data-row-state="available"] td[data-field="status"] {
  color: #a33e28;
  background: #f8ddd3;
  font-weight: 850;
}

.roster-table tr[data-row-state="incomplete"] {
  color: #68727b;
  background: #f0f2f3;
}

.roster-table tr[data-row-state="incomplete"] td[data-field="status"] {
  color: #5e4b21;
  background: #eee3c8;
  font-weight: 800;
}

.col-number {
  width: 4%;
}

.col-name {
  width: 8%;
}

.col-course {
  width: var(--course-column-width);
}

.col-phone {
  width: 11.5%;
}

.col-amount {
  width: 8%;
}

.col-date {
  width: 10%;
}

.col-payment-status {
  width: 7%;
}

.col-payment-method {
  width: 8.5%;
}

.col-owner {
  width: 7%;
}

.col-course-status {
  width: 8%;
}

.col-status {
  width: var(--status-column-width);
}

.return-button {
  min-width: 138px;
  padding: 0 16px;
}

body.is-screenshot-mode {
  overflow: auto;
  background: #dcd9d2;
}

body.is-screenshot-mode .app-header,
body.is-screenshot-mode .settings-panel,
body.is-screenshot-mode .preview-intro {
  display: none;
}

body.is-screenshot-mode .workspace {
  width: 100%;
  min-height: 100vh;
  padding: 16px;
  display: block;
}

body.is-screenshot-mode .preview-panel {
  min-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.is-screenshot-mode .poster-stage {
  min-height: calc(100vh - 32px);
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  overflow: auto;
  background: transparent;
}

body.is-screenshot-mode .poster {
  grid-column: 2;
  width: min(1103px, calc(100vw - 230px), calc((100vh - 32px) * 1.461));
}

body.is-screenshot-mode .return-button {
  grid-column: 3;
  align-self: start;
  justify-self: start;
  margin-top: 4px;
}

@media (max-width: 1180px) {
  .app-header {
    padding-inline: 20px;
  }

  .workspace {
    padding-inline: 20px;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  }

  body.is-screenshot-mode .poster-stage {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  body.is-screenshot-mode .poster,
  body.is-screenshot-mode .return-button {
    grid-column: auto;
  }

  body.is-screenshot-mode .return-button {
    position: sticky;
    left: 14px;
    margin: 0;
  }
}

@media (max-width: 780px) {
  .app-header {
    padding: 16px 14px 12px;
  }

  .workspace {
    padding: 0 12px 24px;
    display: block;
  }

  .settings-panel,
  .preview-panel {
    border-radius: 16px;
  }

  .settings-panel {
    padding: 18px;
  }

  .preview-panel {
    margin-top: 14px;
    padding: 10px;
  }

  .preview-intro {
    align-items: flex-start;
  }

  .preview-intro > p {
    display: none;
  }

  .poster-stage {
    padding: 6px;
  }

  body.is-screenshot-mode .workspace {
    padding: 8px;
  }

  body.is-screenshot-mode .preview-panel,
  body.is-screenshot-mode .poster-stage {
    min-height: calc(100vh - 16px);
  }
}

@media (max-width: 420px) {
  .app-header h1 {
    font-size: 21px;
  }

  .internal-badge {
    padding-inline: 9px;
  }

  .workspace {
    padding-inline: 6px;
  }

  .preview-panel {
    padding: 6px;
  }

  .poster-stage {
    border-radius: 10px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .app-header,
  .settings-panel,
  .preview-intro,
  .return-button {
    display: none !important;
  }

  .workspace,
  .preview-panel,
  .poster-stage {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    display: block;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .poster {
    width: 100%;
    min-width: 0;
    box-shadow: none;
  }
}
