:root {
  color-scheme: light;
  --ink-950: #0b1525;
  --ink-900: #132139;
  --ink-800: #243651;
  --ink-700: #3e506b;
  --ink-600: #5d6d84;
  --ink-500: #78869a;
  --line: #dce3ea;
  --line-strong: #c9d3df;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --surface-warm: #fbfaf7;
  --teal-800: #075e58;
  --teal-700: #08756d;
  --teal-600: #0a8d82;
  --teal-100: #d9f3ef;
  --teal-50: #edfaf8;
  --amber-700: #94520a;
  --amber-100: #ffedc7;
  --red-700: #a22b36;
  --red-100: #ffe1e4;
  --blue-700: #285aa8;
  --blue-100: #e1edff;
  --shadow-sm: 0 1px 2px rgba(11, 21, 37, 0.07), 0 6px 22px rgba(11, 21, 37, 0.05);
  --shadow-lg: 0 24px 70px rgba(11, 21, 37, 0.17);
  --radius-sm: 9px;
  --radius-md: 15px;
  --radius-lg: 24px;
  --content: 1180px;
  --focus: 0 0 0 3px rgba(10, 141, 130, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink-900);
  background: var(--surface-warm);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

button,
select,
input[type="file"] {
  cursor: pointer;
}

a {
  color: var(--teal-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--teal-800);
}

:focus-visible {
  outline: 2px solid var(--teal-600);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 9px 14px;
  color: var(--surface);
  background: var(--ink-950);
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.section-shell {
  width: min(calc(100% - 40px), var(--content));
  margin-inline: auto;
}

.eyebrow,
.step-label {
  margin: 0 0 8px;
  color: var(--teal-700);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.3;
  text-transform: uppercase;
}

.public-header,
.admin-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(calc(100% - 40px), var(--content));
  min-height: 82px;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-950);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink-950);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--ink-950);
  border-radius: 12px;
  place-items: center;
  font-size: 1.08rem;
  font-weight: 800;
  box-shadow: 0 5px 18px rgba(11, 21, 37, 0.2);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.25;
}

.brand strong {
  font-size: 0.98rem;
}

.brand small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.header-nav a {
  color: var(--ink-700);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.header-nav .admin-link {
  padding: 8px 14px;
  color: var(--ink-900);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(400px, 0.75fr);
  gap: clamp(48px, 8vw, 110px);
  align-items: center;
  min-height: 690px;
  padding-block: 70px 92px;
}

.upload-page::before {
  position: absolute;
  z-index: -1;
  top: -220px;
  right: -180px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(10, 141, 130, 0.13), rgba(10, 141, 130, 0) 68%);
  content: "";
  pointer-events: none;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(2.65rem, 5.4vw, 4.65rem);
  font-weight: 840;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.hero h1 span {
  display: block;
  color: var(--teal-700);
}

.hero-lead {
  max-width: 650px;
  margin: 27px 0 0;
  color: var(--ink-600);
  font-size: clamp(1.03rem, 1.7vw, 1.17rem);
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 31px 0 0;
  padding: 0;
  color: var(--ink-700);
  list-style: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.trust-list span {
  display: inline-grid;
  width: 21px;
  height: 21px;
  margin-right: 6px;
  color: var(--teal-800);
  background: var(--teal-100);
  border-radius: 50%;
  place-items: center;
  font-size: 0.72rem;
}

.upload-card {
  padding: clamp(25px, 4vw, 38px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(201, 211, 223, 0.82);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.card-heading,
.modal-heading,
.panel-heading,
.dashboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.card-heading {
  margin-bottom: 27px;
}

.card-heading h2,
.process-section h2,
.requirements-section h2,
.faq-section h2,
.panel-heading h2,
.modal-heading h2 {
  margin: 0;
  color: var(--ink-950);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.secure-chip {
  flex: none;
  padding: 5px 9px;
  color: var(--teal-800);
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.field-group + .field-group,
.field-group + .upload-progress,
.upload-progress + .button-full {
  margin-top: 23px;
}

label,
.field-label {
  display: block;
  color: var(--ink-800);
  font-size: 0.9rem;
  font-weight: 750;
}

label > span {
  color: var(--ink-500);
  font-size: 0.76rem;
  font-weight: 500;
}

.field-hint {
  margin: 5px 0 10px;
  color: var(--ink-500);
  font-size: 0.78rem;
  line-height: 1.5;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal-600);
  box-shadow: var(--focus);
}

.secret-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: 41px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-primary {
  color: #fff;
  background: var(--teal-700);
  border-color: var(--teal-700);
  box-shadow: 0 6px 16px rgba(8, 117, 109, 0.2);
}

.button-primary:hover:not(:disabled) {
  color: #fff;
  background: var(--teal-800);
  border-color: var(--teal-800);
}

.button-secondary {
  color: var(--ink-900);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-quiet {
  color: var(--ink-700);
  background: var(--surface-soft);
  border-color: var(--line);
}

.button-danger {
  color: #fff;
  background: var(--red-700);
  border-color: var(--red-700);
}

.button-full {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
}

.secret-toggle {
  min-width: 63px;
}

.drop-zone {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 22px;
  text-align: center;
  background: var(--surface-soft);
  border: 1px dashed #a9b7c7;
  border-radius: var(--radius-md);
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  background: var(--teal-50);
  border-color: var(--teal-600);
  box-shadow: var(--focus);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.drop-zone strong {
  margin-top: 10px;
  color: var(--ink-800);
  font-size: 0.93rem;
}

.drop-zone > span:last-of-type {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 0.75rem;
  font-weight: 500;
}

.drop-icon {
  display: grid;
  width: 53px;
  height: 42px;
  color: var(--teal-800);
  background: var(--teal-100);
  border-radius: 9px;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.selected-file {
  margin: 9px 0 0;
  color: var(--ink-600);
  font-size: 0.77rem;
  overflow-wrap: anywhere;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--ink-600);
  font-size: 0.77rem;
  font-weight: 700;
}

progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  appearance: none;
  background: var(--line);
  border: 0;
  border-radius: 999px;
}

progress::-webkit-progress-bar {
  background: var(--line);
}

progress::-webkit-progress-value {
  background: var(--teal-600);
  border-radius: 999px;
}

progress::-moz-progress-bar {
  background: var(--teal-600);
  border-radius: 999px;
}

.form-status,
.dashboard-status {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--teal-800);
  font-size: 0.8rem;
  text-align: center;
}

.form-error {
  margin: 12px 0 0;
  padding: 9px 11px;
  color: var(--red-700);
  background: #fff5f6;
  border: 1px solid var(--red-100);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.45;
}

.upload-receipt {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 15px;
  margin-top: 25px;
  padding: 18px;
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: var(--radius-md);
}

.success-mark {
  display: grid;
  width: 36px;
  height: 36px;
  color: #fff;
  background: var(--teal-700);
  border-radius: 50%;
  place-items: center;
  font-weight: 900;
}

.upload-receipt h3,
.upload-receipt p {
  margin: 0;
}

.upload-receipt h3 {
  font-size: 1rem;
}

.upload-receipt p {
  margin-top: 3px;
  color: var(--ink-600);
  font-size: 0.78rem;
}

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

.receipt-grid div {
  min-width: 0;
}

.receipt-grid dt,
.stats-detail dt {
  color: var(--ink-500);
  font-size: 0.68rem;
}

.receipt-grid dd,
.stats-detail dd {
  margin: 1px 0 0;
  color: var(--ink-800);
  font-size: 0.78rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.process-section {
  padding-block: 95px;
  background: var(--ink-950);
}

.process-section .eyebrow {
  color: #79d6ce;
}

.process-section h2 {
  color: #fff;
  font-size: clamp(2rem, 3.4vw, 3rem);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 45px 0 0;
  padding: 0;
  list-style: none;
}

.process-grid li {
  min-height: 230px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.process-number {
  color: #79d6ce;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.process-grid h3 {
  margin: 52px 0 9px;
  color: #fff;
  font-size: 1.12rem;
}

.process-grid p {
  margin: 0;
  color: #aebbc9;
  font-size: 0.88rem;
}

.requirements-section {
  display: grid;
  grid-template-columns: 0.65fr 1fr;
  gap: clamp(45px, 8vw, 95px);
  padding-block: 110px;
}

.requirements-copy h2,
.faq-section h2 {
  font-size: clamp(2rem, 3.5vw, 3.1rem);
}

.requirements-copy > p:last-child {
  color: var(--ink-600);
}

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

.requirement-card {
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.requirement-card h3 {
  margin: 0;
  font-size: 1rem;
}

.requirement-card h3 span {
  margin-right: 5px;
}

.requirement-card.allowed h3 {
  color: var(--teal-800);
}

.requirement-card.denied h3 {
  color: var(--red-700);
}

.requirement-card ul {
  margin: 18px 0 0;
  padding-left: 19px;
  color: var(--ink-600);
  font-size: 0.84rem;
}

.requirement-card li + li {
  margin-top: 8px;
}

.faq-section {
  padding-block: 40px 110px;
}

.faq-list {
  max-width: 880px;
  margin-top: 35px;
  border-top: 1px solid var(--line-strong);
}

.faq-list details {
  border-bottom: 1px solid var(--line-strong);
}

.faq-list summary {
  padding: 20px 4px;
  color: var(--ink-800);
  cursor: pointer;
  font-weight: 750;
}

.faq-list p {
  max-width: 730px;
  margin: -4px 4px 22px;
  color: var(--ink-600);
}

.public-footer {
  padding-block: 38px;
  color: #aebbc9;
  background: var(--ink-950);
}

.footer-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.footer-inner p {
  margin: 0;
  font-size: 0.8rem;
}

.footer-inner strong {
  color: #fff;
  font-size: 0.92rem;
}

/* Admin */
.admin-page {
  min-height: 100vh;
  background: var(--surface-soft);
}

.admin-header {
  width: 100%;
  min-height: 72px;
  padding-inline: clamp(20px, 4vw, 58px);
  background: var(--ink-950);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-admin,
.brand-admin:hover {
  color: #fff;
}

.brand-admin .brand-mark {
  color: var(--ink-950);
  background: #fff;
  box-shadow: none;
}

.brand-admin small {
  color: #93a2b5;
}

.admin-session {
  display: flex;
  align-items: center;
  gap: 14px;
}

.session-indicator {
  color: #bdc8d5;
  font-size: 0.77rem;
  font-weight: 700;
}

.session-indicator span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  background: #67d3a4;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(103, 211, 164, 0.12);
}

.admin-header .button-quiet {
  color: #dce4ec;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.13);
}

.admin-main {
  width: min(calc(100% - 40px), 1320px);
  margin-inline: auto;
  padding-block: 50px 85px;
}

.auth-panel {
  display: grid;
  grid-template-columns: 1fr minmax(340px, 0.7fr);
  gap: clamp(45px, 9vw, 130px);
  align-items: center;
  max-width: 980px;
  min-height: calc(100vh - 210px);
  margin-inline: auto;
}

.auth-copy h1,
.dashboard-heading h1 {
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.auth-copy > p:last-child,
.dashboard-heading > div > p:last-child {
  max-width: 610px;
  color: var(--ink-600);
}

.auth-form {
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.auth-form .button-full {
  margin-top: 17px;
}

.dashboard-heading {
  align-items: flex-end;
}

.heading-actions {
  display: flex;
  gap: 9px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-top: 36px;
}

.summary-grid article {
  display: grid;
  min-height: 142px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.summary-grid span,
.summary-grid small {
  color: var(--ink-500);
  font-size: 0.73rem;
  font-weight: 700;
}

.summary-grid strong {
  align-self: end;
  color: var(--ink-950);
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.sites-panel {
  margin-top: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.panel-heading {
  align-items: flex-end;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  font-size: 1.15rem;
}

.panel-heading p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 0.76rem;
}

.filters {
  display: flex;
  gap: 9px;
}

.filters label {
  font-size: 0.68rem;
}

.filters select,
.filters input {
  min-width: 160px;
  min-height: 38px;
  margin-top: 3px;
  padding-block: 7px;
  font-size: 0.78rem;
}

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

.sites-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.sites-table th,
.sites-table td {
  padding: 15px 18px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.sites-table th {
  color: var(--ink-500);
  background: #fafbfd;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.sites-table tbody tr:hover {
  background: #fcfdfd;
}

.site-title {
  display: block;
  max-width: 300px;
  color: var(--ink-900);
  font-size: 0.85rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.site-slug {
  display: block;
  margin-top: 2px;
  color: var(--ink-500);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.69rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.revision-meta {
  display: block;
  margin-top: 6px;
  color: var(--ink-500);
  font-size: 0.65rem;
  line-height: 1.35;
  white-space: nowrap;
}

.status-awaiting_upload {
  color: var(--blue-700);
  background: var(--blue-100);
}

.status-pending_review {
  color: var(--amber-700);
  background: var(--amber-100);
}

.status-published {
  color: var(--teal-800);
  background: var(--teal-100);
}

.status-suspended,
.status-rejected,
.status-expired {
  color: var(--red-700);
  background: var(--red-100);
}

.status-unpublished {
  color: var(--ink-700);
  background: #e8edf2;
}

.date-cell,
.view-cell {
  color: var(--ink-600);
  white-space: nowrap;
}

.actions-cell {
  min-width: 260px;
}

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

.row-actions .button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 0.69rem;
}

.public-site-link {
  color: var(--teal-700);
  font-weight: 800;
}

.empty-state {
  padding: 55px 20px;
  color: var(--ink-600);
  text-align: center;
}

.empty-state strong {
  color: var(--ink-800);
}

.empty-state p {
  margin: 4px 0 0;
  font-size: 0.8rem;
}

.empty-state.compact {
  padding: 28px 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 13px 18px;
}

.pagination span {
  color: var(--ink-600);
  font-size: 0.74rem;
}

.dashboard-status {
  text-align: left;
}

/* Dialogs */
.modal {
  width: min(calc(100% - 32px), 590px);
  max-height: min(88vh, 900px);
  padding: 0;
  overflow: auto;
  background: transparent;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-wide {
  width: min(calc(100% - 32px), 880px);
}

.modal::backdrop {
  background: rgba(5, 13, 24, 0.65);
  backdrop-filter: blur(3px);
}

.modal-card {
  margin: 0;
  background: var(--surface);
}

.modal-heading {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-heading h2 {
  font-size: 1.3rem;
}

.modal-body {
  padding: 23px 24px;
}

.modal-body > p:first-child {
  margin-top: 0;
  color: var(--ink-600);
  font-size: 0.84rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 24px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

.icon-button {
  display: grid;
  width: 35px;
  height: 35px;
  padding: 0;
  color: var(--ink-500);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  place-items: center;
  font-size: 1.2rem;
  line-height: 1;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-stack input,
.form-stack textarea {
  margin-top: 5px;
}

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

.token-output-label {
  margin: 18px 0 6px;
}

.token-output {
  min-height: 84px;
  color: var(--ink-950);
  background: var(--surface-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.success-text {
  color: var(--teal-700);
}

.danger-text {
  color: var(--red-700);
}

.code-preview {
  max-height: 55vh;
  margin: 14px 0 0;
  padding: 18px;
  overflow: auto;
  color: #dbe7ef;
  background: var(--ink-950);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.stats-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.stats-detail div {
  min-width: 0;
  padding: 15px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
}

.stats-detail dd {
  margin-top: 5px;
  font-size: 1rem;
}

.inline-create {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.inline-create input {
  margin-top: 5px;
}

.qr-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.qr-item {
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 18px;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.qr-image-box {
  display: grid;
  width: 126px;
  height: 126px;
  padding: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  place-items: center;
}

.qr-image-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-image-placeholder {
  color: var(--ink-500);
  font-size: 0.7rem;
  text-align: center;
}

.qr-item h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 0.96rem;
}

.qr-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 18px;
  margin: 10px 0;
  color: var(--ink-600);
  font-size: 0.74rem;
}

.qr-url {
  display: block;
  max-width: 100%;
  margin-bottom: 10px;
  overflow: hidden;
  color: var(--teal-700);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.qr-actions .button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 0.69rem;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-block: 70px;
  }

  .hero-copy {
    max-width: 780px;
  }

  .upload-card {
    max-width: 660px;
  }

  .requirements-section {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    max-width: 680px;
    gap: 25px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .section-shell,
  .public-header,
  .admin-main {
    width: min(calc(100% - 28px), var(--content));
  }

  .public-header {
    min-height: 72px;
  }

  .header-nav a:not(.admin-link) {
    display: none;
  }

  .hero {
    gap: 38px;
    padding-block: 48px 62px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.35rem);
  }

  .trust-list {
    display: grid;
  }

  .process-section,
  .requirements-section {
    padding-block: 70px;
  }

  .process-grid,
  .requirements-grid {
    grid-template-columns: 1fr;
  }

  .process-grid li {
    min-height: 190px;
  }

  .process-grid h3 {
    margin-top: 34px;
  }

  .footer-inner,
  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-header {
    padding-inline: 14px;
  }

  .admin-session .session-indicator {
    display: none;
  }

  .admin-header .button {
    max-width: 150px;
  }

  .heading-actions,
  .heading-actions .button {
    width: 100%;
  }

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

  .summary-grid article {
    min-height: 120px;
    padding: 16px;
  }

  .filters {
    width: 100%;
    flex-direction: column;
  }

  .filters label,
  .filters select,
  .filters input {
    width: 100%;
  }

  .sites-table thead {
    display: none;
  }

  .sites-table,
  .sites-table tbody,
  .sites-table tr,
  .sites-table td {
    display: block;
    width: 100%;
  }

  .sites-table tr {
    padding: 15px;
    border-bottom: 1px solid var(--line);
  }

  .sites-table td {
    padding: 5px 0;
    border: 0;
  }

  .sites-table td::before {
    display: inline-block;
    min-width: 70px;
    margin-right: 8px;
    color: var(--ink-500);
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 800;
  }

  .sites-table td:first-child::before,
  .sites-table td:last-child::before {
    display: none;
  }

  .actions-cell {
    min-width: 0;
    margin-top: 8px;
  }

  .two-columns,
  .stats-detail {
    grid-template-columns: 1fr;
  }

  .qr-item {
    grid-template-columns: 1fr;
  }

  .qr-image-box {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 480px) {
  .brand small {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .upload-card,
  .auth-form {
    padding: 21px;
    border-radius: var(--radius-md);
  }

  .receipt-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid article {
    min-height: 105px;
  }

  .secret-input-row,
  .inline-create {
    grid-template-columns: 1fr;
  }

  .secret-toggle {
    width: 100%;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Upload workspace refresh */
.upload-page {
  position: relative;
  overflow-x: hidden;
  background: #f5f7f8;
}

.upload-page::before {
  top: -330px;
  right: -130px;
  width: 700px;
  height: 700px;
  opacity: 0.8;
}

.upload-page .public-header {
  min-height: 76px;
  border-bottom: 1px solid rgba(201, 211, 223, 0.65);
}

.upload-intro {
  padding-block: clamp(50px, 7vw, 78px) 42px;
}

.intro-copy {
  max-width: 980px;
}

.intro-copy h1 {
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(2.35rem, 5vw, 3.9rem);
  font-weight: 840;
  letter-spacing: -0.052em;
  line-height: 1.08;
}

.intro-copy > p:last-child {
  max-width: 750px;
  margin: 22px 0 0;
  color: var(--ink-600);
  font-size: clamp(0.98rem, 1.6vw, 1.1rem);
}

.benefit-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 850px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.benefit-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 11px;
  padding: 15px 17px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(201, 211, 223, 0.78);
  border-radius: 13px;
}

.benefit-list li > span {
  grid-row: 1 / span 2;
  color: var(--teal-700);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.7;
}

.benefit-list strong,
.benefit-list small {
  display: block;
  line-height: 1.35;
}

.benefit-list strong {
  color: var(--ink-800);
  font-size: 0.86rem;
}

.benefit-list small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 0.72rem;
}

.upload-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.42fr);
  gap: 26px;
  align-items: start;
  padding-bottom: clamp(75px, 9vw, 110px);
}

.upload-page .upload-panel {
  max-width: none;
  padding: clamp(26px, 4vw, 38px);
  border-radius: 21px;
  box-shadow: 0 18px 55px rgba(11, 21, 37, 0.11);
}

.upload-heading {
  margin-bottom: 31px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.upload-heading h2,
.guide-card h2,
.revision-card h2 {
  margin: 0;
  color: var(--ink-950);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.upload-heading h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
}

.heading-note {
  margin: 8px 0 0;
  color: var(--ink-500);
  font-size: 0.82rem;
}

.upload-page .secure-chip {
  margin-top: 2px;
  padding: 6px 10px;
  white-space: nowrap;
}

.numbered-field {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.upload-page .field-group + .field-group {
  margin-top: 27px;
}

.field-number {
  display: grid;
  width: 30px;
  height: 30px;
  margin-top: -3px;
  color: var(--teal-800);
  background: var(--teal-100);
  border-radius: 9px;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 900;
}

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

.upload-page label,
.upload-page .field-label {
  font-size: 0.92rem;
}

.upload-page .field-hint {
  margin: 5px 0 11px;
  font-size: 0.78rem;
}

.upload-page input {
  min-height: 47px;
}

.compact-drop-zone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 15px;
  min-height: 112px;
  padding: 18px;
  text-align: left;
}

.compact-drop-zone .drop-icon {
  width: 54px;
  height: 46px;
}

.compact-drop-zone .drop-copy {
  min-width: 0;
}

.compact-drop-zone .drop-copy strong,
.compact-drop-zone .drop-copy span {
  display: block;
}

.compact-drop-zone .drop-copy strong {
  margin: 0;
  color: var(--ink-800);
  font-size: 0.9rem;
}

.compact-drop-zone .drop-copy span {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 0.74rem;
  font-weight: 500;
}

.choose-file {
  padding: 8px 11px;
  color: var(--teal-800) !important;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 0.73rem !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

.compact-drop-zone.has-file {
  background: var(--teal-50);
  border-color: var(--teal-600);
}

.upload-page .selected-file {
  min-height: 21px;
  margin: 8px 0 0;
  padding-left: 2px;
}

.upload-page .selected-file.is-selected {
  color: var(--teal-800);
  font-weight: 750;
}

.revision-inline-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin: 25px 0 0 45px;
  padding: 12px 14px;
  color: var(--ink-700);
  background: #f4f8fc;
  border: 1px solid #dce8f4;
  border-radius: 11px;
}

.revision-inline-note > span {
  display: grid;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  color: var(--blue-700);
  background: var(--blue-100);
  border-radius: 50%;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 0.78rem;
  font-weight: 800;
}

.revision-inline-note p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.55;
}

.upload-page .upload-progress {
  margin: 22px 0 0 45px;
}

.upload-page .button-full {
  min-height: 51px;
  margin-top: 23px;
  font-size: 0.9rem;
}

.upload-page .form-status:empty {
  min-height: 0;
  margin: 0;
}

.upload-page .form-error {
  margin-top: 11px;
}

.upload-page .upload-receipt {
  display: block;
  margin-top: 27px;
  padding: 21px;
  background: #f1faf8;
  border-color: #bfe7e1;
}

.receipt-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.receipt-heading .success-mark {
  flex: none;
}

.receipt-heading h3,
.receipt-heading p {
  margin: 0;
}

.receipt-heading h3 {
  color: var(--ink-900);
  font-size: 1rem;
}

.receipt-heading p {
  margin-top: 3px;
  color: var(--ink-600);
  font-size: 0.76rem;
}

.revision-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 17px;
}

.revision-result > div {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid #d7ebe8;
  border-radius: 10px;
}

.revision-result span,
.revision-result strong {
  display: block;
}

.revision-result span {
  color: var(--ink-500);
  font-size: 0.68rem;
}

.revision-result strong {
  margin-top: 2px;
  color: var(--ink-800);
  font-size: 0.86rem;
}

.revision-result b {
  color: var(--teal-700);
  font-size: 1.13rem;
}

.remaining-result.is-empty b {
  color: var(--amber-700);
}

.upload-page .receipt-grid {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #cfe6e2;
}

.upload-guide {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 17px;
}

.guide-card,
.revision-card {
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow-sm);
}

.guide-card h2,
.revision-card h2 {
  font-size: 1.18rem;
}

.guide-steps {
  display: grid;
  gap: 0;
  margin: 23px 0 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 29px 1fr;
  gap: 11px;
  min-height: 68px;
}

.guide-steps li:not(:last-child)::after {
  position: absolute;
  top: 29px;
  bottom: 0;
  left: 14px;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.guide-steps li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 29px;
  height: 29px;
  color: var(--teal-800);
  background: var(--teal-100);
  border-radius: 9px;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 900;
}

.guide-steps strong {
  display: block;
  color: var(--ink-800);
  font-size: 0.82rem;
  line-height: 1.4;
}

.guide-steps p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 0.72rem;
  line-height: 1.45;
}

.revision-card {
  color: #d6e0eb;
  background: var(--ink-950);
  border-color: var(--ink-950);
  box-shadow: 0 15px 36px rgba(11, 21, 37, 0.18);
}

.revision-card h2 {
  margin-top: 12px;
  color: #fff;
}

.policy-chip {
  display: inline-block;
  padding: 4px 8px;
  color: #9ee5de;
  background: rgba(121, 214, 206, 0.11);
  border: 1px solid rgba(121, 214, 206, 0.2);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 850;
}

.revision-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 20px;
}

.revision-track span {
  padding: 7px 3px;
  color: #b5c3d1;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  font-size: 0.59rem;
  font-weight: 750;
  text-align: center;
  white-space: nowrap;
}

.revision-track .is-initial {
  color: #a4eee7;
  background: rgba(121, 214, 206, 0.12);
  border-color: rgba(121, 214, 206, 0.22);
}

.revision-card > p:last-child {
  margin: 16px 0 0;
  color: #aebbc9;
  font-size: 0.72rem;
  line-height: 1.55;
}

.upload-requirements {
  padding-block: 86px;
  border-top: 1px solid var(--line);
}

.upload-requirements .requirements-copy h2,
.compact-faq h2 {
  font-size: clamp(1.85rem, 3vw, 2.65rem);
}

.compact-faq {
  padding-block: 20px 95px;
}

.compact-faq .faq-list {
  margin-top: 26px;
}

@media (max-width: 980px) {
  .upload-workspace {
    grid-template-columns: 1fr;
  }

  .upload-page .upload-panel {
    max-width: none;
  }

  .upload-guide {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-requirements {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .upload-intro {
    padding-block: 42px 32px;
  }

  .benefit-list {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 27px;
  }

  .benefit-list li {
    padding: 12px 14px;
  }

  .upload-workspace {
    gap: 17px;
    padding-bottom: 70px;
  }

  .upload-guide {
    grid-template-columns: 1fr;
  }

  .upload-requirements {
    padding-block: 70px;
  }
}

@media (max-width: 560px) {
  .upload-page .public-header {
    min-height: 68px;
  }

  .intro-copy h1 {
    font-size: clamp(2.1rem, 11vw, 3rem);
  }

  .upload-page .upload-panel {
    padding: 22px;
    border-radius: 16px;
  }

  .upload-heading {
    margin-bottom: 25px;
    padding-bottom: 20px;
  }

  .upload-heading .secure-chip {
    display: none;
  }

  .numbered-field {
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 9px;
  }

  .field-number {
    width: 27px;
    height: 27px;
  }

  .upload-page .secret-input-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .upload-page .secret-toggle {
    width: auto;
  }

  .compact-drop-zone {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    min-height: 104px;
    padding: 14px;
  }

  .compact-drop-zone .choose-file {
    display: none;
  }

  .revision-inline-note,
  .upload-page .upload-progress {
    margin-left: 36px;
  }

  .revision-result,
  .upload-page .receipt-grid,
  .upload-requirements .requirements-grid {
    grid-template-columns: 1fr;
  }

  .guide-card,
  .revision-card {
    padding: 22px;
  }

  .compact-faq {
    padding-bottom: 75px;
  }
}

@media (max-width: 380px) {
  .upload-page .section-shell,
  .upload-page .public-header {
    width: min(calc(100% - 20px), var(--content));
  }

  .upload-page .upload-panel {
    padding: 18px;
  }

  .numbered-field {
    grid-template-columns: 1fr;
  }

  .field-number {
    margin: 0 0 2px;
  }

  .revision-inline-note,
  .upload-page .upload-progress {
    margin-left: 0;
  }
}

/* Portfolio one-click publishing */
.admin-header-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.admin-product-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
}

.admin-product-nav a {
  padding: 6px 11px;
  color: #aebbc9;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.admin-product-nav a:hover {
  color: #fff;
}

.admin-product-nav a.is-active {
  color: var(--ink-950);
  background: #fff;
}

.portfolio-main {
  max-width: 1240px;
}

.portfolio-dashboard-heading {
  margin-bottom: 30px;
}

.portfolio-dashboard-heading h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.portfolio-dashboard-heading > div > p:last-child {
  max-width: 720px;
  margin: 13px 0 0;
  color: var(--ink-600);
}

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

.portfolio-summary article {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 21px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.portfolio-summary span {
  color: var(--ink-600);
  font-size: 0.78rem;
  font-weight: 750;
}

.portfolio-summary strong {
  color: var(--ink-950);
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.portfolio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(285px, 0.64fr);
  gap: 22px;
  align-items: start;
}

.portfolio-publish-card,
.portfolio-list-panel {
  padding: clamp(24px, 3.6vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.portfolio-panel-heading {
  margin-bottom: 27px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.portfolio-panel-heading h2,
.portfolio-help-card h2,
.portfolio-list-heading h2 {
  margin: 0;
  color: var(--ink-950);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.portfolio-panel-heading h2,
.portfolio-list-heading h2 {
  font-size: 1.4rem;
}

.portfolio-panel-heading > div > p:last-child,
.portfolio-list-heading p {
  margin: 6px 0 0;
  color: var(--ink-500);
  font-size: 0.78rem;
}

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

.portfolio-form-grid label {
  min-width: 0;
}

.portfolio-form-grid input {
  margin-top: 6px;
}

.portfolio-file-field,
.portfolio-source-field {
  margin-top: 24px;
}

.portfolio-source-field {
  min-width: 0;
  padding: 0;
  border: 0;
}

.portfolio-source-field > legend {
  padding: 0;
  color: var(--ink-800);
  font-size: 0.8rem;
  font-weight: 800;
}

.portfolio-source-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.portfolio-source-tabs label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.portfolio-source-tabs input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.portfolio-source-tabs label > span {
  display: block;
  min-height: 61px;
  padding: 11px 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.portfolio-source-tabs strong,
.portfolio-source-tabs small {
  display: block;
}

.portfolio-source-tabs strong {
  color: var(--ink-800);
  font-size: 0.8rem;
}

.portfolio-source-tabs small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 0.67rem;
  font-weight: 500;
}

.portfolio-source-tabs input:checked + span {
  background: var(--surface);
  border-color: var(--teal-100);
  box-shadow: var(--shadow-sm);
}

.portfolio-source-tabs input:checked + span strong {
  color: var(--teal-800);
}

.portfolio-source-tabs input:focus-visible + span {
  outline: 2px solid var(--teal-600);
  outline-offset: 2px;
}

.portfolio-source-tabs input:disabled + span {
  cursor: not-allowed;
  opacity: 0.62;
}

.portfolio-source-panel {
  margin-top: 14px;
}

.portfolio-source-panel[hidden],
.portfolio-bundle-summary[hidden],
.portfolio-upload-progress[hidden] {
  display: none;
}

.portfolio-drop-zone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 116px;
  align-items: center;
  padding: 18px;
  background: var(--surface-soft);
  border: 1px dashed #a9b7c7;
  border-radius: 13px;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.portfolio-drop-zone:hover,
.portfolio-drop-zone.is-dragging,
.portfolio-drop-zone.has-file {
  background: var(--teal-50);
  border-color: var(--teal-600);
  box-shadow: var(--focus);
}

.portfolio-drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.portfolio-file-icon {
  display: grid;
  width: 56px;
  height: 47px;
  color: var(--teal-800);
  background: var(--teal-100);
  border-radius: 10px;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.portfolio-folder-icon {
  color: var(--blue-700);
  background: var(--blue-100);
}

.portfolio-drop-copy {
  min-width: 0;
}

.portfolio-drop-copy strong,
.portfolio-drop-copy small {
  display: block;
}

.portfolio-drop-copy strong {
  color: var(--ink-800);
  font-size: 0.88rem;
}

.portfolio-drop-copy small {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 0.72rem;
  font-weight: 500;
}

.portfolio-file-field .selected-file,
.portfolio-source-field .selected-file {
  min-height: 21px;
}

.portfolio-file-field .selected-file.is-selected,
.portfolio-source-field .selected-file.is-selected {
  color: var(--teal-800);
  font-weight: 750;
}

.portfolio-bundle-summary {
  margin-top: 10px;
  padding: 14px 15px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.portfolio-bundle-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portfolio-bundle-heading > div > span,
.portfolio-bundle-heading > div > strong {
  display: block;
}

.portfolio-bundle-heading > div > span {
  color: var(--ink-500);
  font-size: 0.64rem;
  font-weight: 750;
}

.portfolio-bundle-heading > div > strong {
  margin-top: 2px;
  color: var(--ink-900);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.portfolio-index-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--red-700);
  background: #fff5f6;
  border: 1px solid var(--red-100);
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
}

.portfolio-index-badge[data-state="ready"] {
  color: var(--teal-800);
  background: var(--teal-50);
  border-color: var(--teal-100);
}

.portfolio-bundle-summary dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.portfolio-bundle-summary dl > div {
  min-width: 0;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.portfolio-bundle-summary dt {
  color: var(--ink-500);
  font-size: 0.62rem;
}

.portfolio-bundle-summary dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink-800);
  font-size: 0.72rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-upload-progress {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--blue-100);
  border: 1px solid #b9d2f4;
  border-radius: 10px;
}

.portfolio-upload-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--blue-700);
  font-size: 0.7rem;
  font-weight: 800;
}

.portfolio-upload-progress progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  accent-color: var(--blue-700);
  background: rgba(37, 99, 235, 0.12);
  border: 0;
  border-radius: 999px;
}

.portfolio-upload-progress progress::-webkit-progress-bar {
  background: rgba(37, 99, 235, 0.12);
}

.portfolio-upload-progress progress::-webkit-progress-value {
  background: var(--blue-700);
  border-radius: 999px;
}

.portfolio-upload-progress progress::-moz-progress-bar {
  background: var(--blue-700);
  border-radius: 999px;
}

.portfolio-upload-progress[data-state="error"] {
  background: #fff5f6;
  border-color: var(--red-100);
}

.portfolio-upload-progress[data-state="error"] > div {
  color: var(--red-700);
}

.publish-pipeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.publish-pipeline li {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  align-items: center;
  padding: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.publish-pipeline li > span {
  display: grid;
  width: 27px;
  height: 27px;
  grid-row: 1 / span 2;
  color: var(--ink-600);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 900;
}

.publish-pipeline strong,
.publish-pipeline small,
.publish-pipeline b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publish-pipeline strong {
  color: var(--ink-800);
  font-size: 0.73rem;
}

.publish-pipeline small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 0.61rem;
  font-weight: 500;
}

.publish-pipeline b {
  grid-column: 1 / -1;
  color: var(--ink-500);
  font-size: 0.61rem;
  font-weight: 800;
}

.publish-pipeline li[data-state="running"] {
  background: var(--blue-100);
  border-color: #b9d2f4;
}

.publish-pipeline li[data-state="running"] > span,
.publish-pipeline li[data-state="running"] b {
  color: var(--blue-700);
}

.publish-pipeline li[data-state="done"] {
  background: var(--teal-50);
  border-color: var(--teal-100);
}

.publish-pipeline li[data-state="done"] > span,
.publish-pipeline li[data-state="done"] b {
  color: var(--teal-800);
}

.publish-pipeline li[data-state="error"] {
  background: #fff5f6;
  border-color: var(--red-100);
}

.publish-pipeline li[data-state="error"] > span,
.publish-pipeline li[data-state="error"] b {
  color: var(--red-700);
}

.portfolio-publish-card .button-full {
  min-height: 50px;
}

.portfolio-publish-card .form-status:empty {
  min-height: 0;
  margin: 0;
}

.portfolio-success {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  margin-top: 22px;
  padding: 17px;
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: 12px;
}

.portfolio-success h3,
.portfolio-success p {
  margin: 0;
}

.portfolio-success h3 {
  color: var(--ink-900);
  font-size: 0.98rem;
}

.portfolio-success p {
  margin-top: 3px;
  color: var(--ink-600);
  font-size: 0.75rem;
}

.portfolio-success .button {
  min-height: 35px;
  margin-top: 11px;
  padding-block: 6px;
}

.portfolio-help-card {
  padding: 26px;
  color: #d6e0eb;
  background: var(--ink-950);
  border: 1px solid var(--ink-950);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(11, 21, 37, 0.2);
}

.portfolio-help-card .step-label {
  color: #79d6ce;
}

.portfolio-help-card h2 {
  color: #fff;
  font-size: 1.3rem;
}

.portfolio-help-card > ol {
  display: grid;
  gap: 20px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.portfolio-help-card li {
  display: grid;
  grid-template-columns: 29px 1fr;
  gap: 11px;
}

.portfolio-help-card li > span {
  display: grid;
  width: 29px;
  height: 29px;
  color: #9de8e1;
  background: rgba(121, 214, 206, 0.12);
  border: 1px solid rgba(121, 214, 206, 0.18);
  border-radius: 8px;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 900;
}

.portfolio-help-card li strong {
  display: block;
  color: #fff;
  font-size: 0.8rem;
}

.portfolio-help-card li p {
  margin: 4px 0 0;
  color: #aebbc9;
  font-size: 0.7rem;
  line-height: 1.5;
}

.portfolio-help-note {
  margin-top: 25px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
}

.portfolio-help-note strong {
  color: #fff;
  font-size: 0.74rem;
}

.portfolio-help-note p {
  margin: 4px 0 0;
  color: #aebbc9;
  font-size: 0.68rem;
  line-height: 1.5;
}

.portfolio-list-panel {
  margin-top: 23px;
}

.portfolio-list-heading {
  align-items: center;
  margin-bottom: 20px;
}

.portfolio-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.portfolio-table th {
  padding: 11px 12px;
  color: var(--ink-500);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  font-size: 0.69rem;
  font-weight: 850;
  text-align: left;
}

.portfolio-table th:first-child {
  width: 27%;
}

.portfolio-table th:nth-child(2) {
  width: 18%;
}

.portfolio-table th:nth-child(3) {
  width: 10%;
}

.portfolio-table th:nth-child(4) {
  width: 25%;
}

.portfolio-table th:last-child {
  width: 20%;
  text-align: right;
}

.portfolio-table td {
  padding: 14px 12px;
  color: var(--ink-700);
  border-bottom: 1px solid var(--line);
  font-size: 0.76rem;
  vertical-align: middle;
}

.portfolio-table td > strong,
.portfolio-table td > code {
  display: block;
}

.portfolio-table td > strong {
  color: var(--ink-900);
  font-size: 0.82rem;
}

.portfolio-table td > code {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-table td a {
  font-weight: 750;
}

.portfolio-unavailable {
  color: var(--ink-500);
}

.portfolio-actions-cell {
  text-align: right;
}

.portfolio-delete-button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.69rem;
}

.delete-warning {
  margin: 0;
  padding: 12px 14px;
  color: var(--red-700);
  background: #fff5f6;
  border: 1px solid var(--red-100);
  border-radius: 10px;
  font-size: 0.79rem;
}

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

.delete-target dt {
  color: var(--ink-500);
  font-size: 0.68rem;
}

.delete-target dd {
  margin: 2px 0 0;
  color: var(--ink-900);
  font-size: 0.82rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .portfolio-layout {
    grid-template-columns: 1fr;
  }

  .portfolio-help-card > ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portfolio-help-note {
    max-width: 620px;
  }
}

@media (max-width: 820px) {
  .admin-header {
    flex-wrap: wrap;
    padding-block: 11px;
  }

  .admin-header-tools {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .admin-product-nav a {
    padding-inline: 9px;
  }

  .portfolio-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .portfolio-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .portfolio-summary article {
    min-height: 68px;
    padding: 14px 17px;
  }

  .portfolio-summary strong {
    font-size: 1.5rem;
  }

  .portfolio-help-card > ol {
    grid-template-columns: 1fr;
  }

  .portfolio-table thead {
    display: none;
  }

  .portfolio-table,
  .portfolio-table tbody,
  .portfolio-table tr,
  .portfolio-table td {
    display: block;
    width: 100%;
  }

  .portfolio-table tr {
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }

  .portfolio-table td {
    display: grid;
    grid-template-columns: 88px 1fr;
    padding: 5px 0;
    border: 0;
    text-align: left;
  }

  .portfolio-table td::before {
    color: var(--ink-500);
    content: attr(data-label);
    font-size: 0.67rem;
    font-weight: 850;
  }

  .portfolio-table td > code {
    grid-column: 2;
  }

  .portfolio-actions-cell {
    margin-top: 6px;
  }

  .portfolio-actions-cell .button {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .admin-header-tools {
    flex-basis: 100%;
    justify-content: space-between;
  }

  .admin-product-nav {
    flex: 1;
  }

  .admin-product-nav a {
    flex: 1;
    text-align: center;
  }

  .admin-header-tools .admin-session .session-indicator {
    display: none;
  }

  .portfolio-dashboard-heading .button,
  .portfolio-list-heading .button {
    width: 100%;
  }

  .portfolio-publish-card,
  .portfolio-list-panel,
  .portfolio-help-card {
    padding: 21px;
    border-radius: 15px;
  }

  .portfolio-panel-heading .secure-chip {
    display: none;
  }

  .portfolio-source-tabs {
    grid-template-columns: 1fr;
  }

  .portfolio-source-tabs label > span {
    min-height: 0;
  }

  .portfolio-drop-zone {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 106px;
    padding: 14px;
  }

  .portfolio-drop-zone .choose-file {
    display: none;
  }

  .portfolio-bundle-heading {
    align-items: flex-start;
  }

  .portfolio-bundle-summary dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-bundle-summary dl > div:first-child {
    grid-column: 1 / -1;
  }

  .publish-pipeline {
    grid-template-columns: 1fr;
  }

  .publish-pipeline li {
    grid-template-columns: 27px minmax(0, 1fr) auto;
  }

  .publish-pipeline li > span {
    grid-row: auto;
  }

  .publish-pipeline b {
    grid-column: auto;
  }

  .delete-target {
    grid-template-columns: 1fr;
  }
}
