:root {
  --ink: #18202b;
  --muted: #667085;
  --quiet: #8a94a3;
  --line: #dce2e9;
  --line-soft: #edf0f4;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --page: #f3f5f7;
  --red: #d62f4b;
  --red-dark: #a91f38;
  --red-soft: #fff0f3;
  --teal: #177567;
  --teal-soft: #eaf7f4;
  --blue: #3567a8;
  --blue-soft: #edf4fc;
  --amber: #9b6200;
  --amber-soft: #fff6e6;
  --shadow: 0 10px 28px rgba(24, 32, 43, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

.login-body {
  min-height: 100vh;
  background: #f3f5f7;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.login-panel {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(24, 32, 43, 0.1);
}

.login-brand,
.login-security {
  display: flex;
  align-items: center;
}

.login-brand {
  gap: 10px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line-soft);
}

.login-brand > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand strong {
  font-size: 15px;
}

.login-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.login-security {
  gap: 14px;
  margin-top: 28px;
}

.login-shield {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 22px;
  font-weight: 800;
}

.login-security h1 {
  font-size: 22px;
  line-height: 1.25;
}

.login-security p,
.login-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-security p {
  margin-top: 5px;
}

.feishu-login-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  border-radius: 6px;
  background: #3370ff;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.feishu-login-options {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.feishu-login-button.employee {
  background: #3370ff;
}

.feishu-login-button.core {
  border: 1px solid #aab7c8;
  background: #fff;
  color: #344054;
}

.feishu-login-button.core:hover,
.feishu-login-button.core:focus-visible {
  border-color: #7f8fa4;
  background: #f5f7fa;
}

.feishu-login-button:hover,
.feishu-login-button:focus-visible {
  background: #285ed8;
  outline: none;
}

.login-error {
  margin-top: 18px;
  border: 1px solid #f1c2ca;
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--red-soft);
  color: var(--red-dark);
  font-size: 13px;
  line-height: 1.5;
}

.login-note {
  margin-top: 14px;
  text-align: center;
}

a,
button,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

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

.note-input-grid label {
  min-width: 0;
  margin-bottom: 8px;
}

.note-input-grid textarea {
  min-height: 190px;
}

.note-input-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.note-input-title small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

a {
  color: inherit;
}

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

h1,
h2,
p {
  margin: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.header-inner {
  width: min(1320px, calc(100vw - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-actions,
.account-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-menu {
  min-height: 32px;
  border-left: 1px solid var(--line);
  padding-left: 10px;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.account-menu form {
  margin: 0;
}

.account-menu button {
  min-width: 48px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #475467;
  cursor: pointer;
}

.account-menu button:hover,
.account-menu button:focus-visible {
  border-color: #b7c0cc;
  color: var(--ink);
  outline: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-logo {
  width: 72px;
  height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.runtime-status {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 11px;
  background: #fff;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #98a2b3;
  box-shadow: 0 0 0 3px #edf0f3;
}

.runtime-status.is-online .status-dot {
  background: #1e8b69;
  box-shadow: 0 0 0 3px #e2f4ed;
}

.runtime-status.is-offline .status-dot {
  background: #cf3f52;
  box-shadow: 0 0 0 3px #fbe8eb;
}

.runtime-status.is-offline {
  color: var(--red-dark);
}

.runtime-status.is-warning .status-dot {
  background: #d89818;
  box-shadow: 0 0 0 3px #fff2d6;
}

.runtime-status.is-warning {
  color: var(--amber);
}

.app-shell {
  width: min(1320px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 42px 0 54px;
}

.page[hidden] {
  display: none;
}

.home-page {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding-top: 34px;
}

.home-intro {
  max-width: 680px;
  margin-bottom: 32px;
}

.eyebrow {
  color: var(--red-dark);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
}

.home-intro h1,
.page-heading h1 {
  margin-top: 9px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 790;
}

.home-intro > p:last-child,
.page-heading > div > p:last-child {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

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

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

.module-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.module-card:hover,
.module-card:focus-visible {
  transform: translateY(-2px);
  border-color: #c8d0da;
  box-shadow: 0 16px 36px rgba(24, 32, 43, 0.1);
  outline: none;
}

.module-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.module-number {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
}

.module-arrow {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-size: 19px;
  font-weight: 600;
}

.submit-card .module-arrow {
  background: var(--red);
}

.dashboard-card .module-arrow {
  background: var(--teal);
}

.optimizer-card .module-arrow {
  background: var(--blue);
}

.creator-card .module-arrow {
  background: var(--teal);
}

.creator-card .module-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.module-card.is-disabled {
  box-shadow: none;
  cursor: default;
}

.module-card.is-disabled:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.module-copy {
  margin: auto 0;
}

.module-copy h2 {
  font-size: 25px;
  line-height: 1.2;
}

.module-copy p {
  max-width: 340px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.module-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line-soft);
  padding-top: 17px;
}

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

.module-meta strong {
  font-size: 14px;
}

.home-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.home-summary > div {
  padding: 18px 20px;
}

.home-summary > div + div {
  border-left: 1px solid var(--line);
}

.home-summary span,
.home-summary strong {
  display: block;
}

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

.home-summary strong {
  margin-top: 8px;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

#homeDate {
  font-size: 18px;
}

.page-heading {
  position: relative;
  min-height: 122px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  padding-top: 34px;
}

.page-heading h1 {
  font-size: 29px;
}

.back-link {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.media-summary article {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.media-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.media-summary strong {
  color: var(--ink);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.media-summary .media-update-time {
  font-size: 21px;
}

.media-id-search-panel {
  display: grid;
  grid-template-columns: minmax(160px, 0.55fr) minmax(320px, 1.45fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
}

.media-id-search-panel h2 {
  margin: 0;
  font-size: 16px;
}

.media-id-search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.media-id-search-controls input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 11px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.media-id-search-controls input:focus {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 18%, transparent);
  outline-offset: 1px;
}

.media-id-search-controls .primary-button {
  min-width: 112px;
}

.media-filter-panel {
  padding: 18px;
}

.media-filter-heading {
  margin-bottom: 14px;
}

.media-filter-heading h2 {
  margin: 0;
  font-size: 16px;
}

.media-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 14px;
  align-items: start;
}

.media-filter-grid > label,
.media-filter-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.media-filter-grid > label > span,
.media-filter-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.media-filter-grid input,
.media-filter-grid select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 11px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.media-filter-grid select {
  appearance: none;
  padding-right: 38px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 6 3.5 3.5L11.5 6' fill='none' stroke='%23667085' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 16px 16px;
}

.media-filter-grid input[type="number"]::-webkit-inner-spin-button,
.media-filter-grid input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.media-price-field {
  grid-column: span 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 7px;
}

.media-price-field > span {
  grid-column: 1 / -1;
}

.media-price-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
}

.media-price-field:has(.media-custom-range:not([hidden])) .media-price-controls {
  grid-column: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-price-field > .media-custom-range {
  grid-column: 2;
}

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

.media-custom-range[hidden] {
  display: none;
}

.media-custom-range > span {
  color: var(--quiet);
  font-size: 12px;
}

.media-region-picker {
  position: relative;
}

.media-region-picker summary {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 11px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  list-style: none;
}

.media-region-picker summary::-webkit-details-marker {
  display: none;
}

.media-region-picker summary::after {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 6 3.5 3.5L11.5 6' fill='none' stroke='%23667085' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  transition: transform 120ms ease;
}

.media-region-picker[open] summary::after {
  transform: rotate(180deg);
}

.media-region-picker[open] summary {
  border-color: #aeb9c8;
  box-shadow: 0 0 0 3px rgba(53, 103, 168, 0.1);
}

.media-region-cascade {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: min(680px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(24, 32, 43, 0.14);
}

.media-region-columns {
  height: 300px;
  display: grid;
  grid-template-columns: 112px 188px minmax(220px, 1fr);
}

.media-region-column {
  min-width: 0;
  overflow-y: auto;
  padding: 6px;
}

.media-region-column + .media-region-column {
  border-left: 1px solid var(--line-soft);
}

.media-region-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-radius: 5px;
  padding: 0 7px;
  color: var(--ink);
  font-size: 12px;
}

#mediaContentTypeOptions .media-region-row,
#mediaCityOptions .media-region-row {
  min-height: 28px;
}

#mediaContentTypeOptions,
#mediaCityOptions {
  padding-top: 3px;
  padding-bottom: 3px;
}

.media-region-row.is-active {
  background: var(--surface-soft);
}

.media-region-row > label,
label.media-region-row {
  cursor: pointer;
}

.media-region-row > label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
}

label.media-region-row {
  justify-content: flex-start;
}

.media-region-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-region-row button {
  width: 24px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--quiet);
  cursor: pointer;
  font-size: 18px;
}

.media-region-row input {
  width: 15px;
  min-height: 15px;
  flex: 0 0 15px;
  margin: 0;
  accent-color: var(--red);
}

.media-country-column {
  background: #fafbfc;
}

.media-region-footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 8px 12px;
}

.media-region-footer button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.media-region-footer button:last-child {
  min-width: 76px;
  background: var(--red);
  color: #fff;
}

.media-filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.media-list-button {
  min-width: 136px;
  min-height: 38px;
  font-size: 13px;
}

.media-list-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.media-library-panel {
  min-height: 320px;
  overflow: visible;
}

#mediaListPage {
  width: calc(100vw - 24px);
  margin-left: calc(50% - 50vw + 12px);
}

.media-list-toolbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.media-list-toolbar > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.media-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.media-list-actions .primary-button,
.media-list-actions .secondary-button {
  min-height: 38px;
}

.media-export-dialog {
  width: min(560px, calc(100vw - 32px));
}

.media-export-policy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.media-export-policy > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.media-export-policy > div:last-child {
  border-right: 0;
}

.media-export-policy span {
  color: var(--muted);
  font-size: 11px;
}

.media-export-policy strong {
  color: var(--ink);
  font-size: 18px;
}

.media-export-notice {
  margin: 0;
  padding: 11px 12px;
  border-left: 3px solid #23875b;
  background: #eff8f3;
  color: #176440;
  font-size: 12px;
  line-height: 1.6;
}

.media-export-notice.is-approval {
  border-color: #c98500;
  background: #fff8e7;
  color: #7a5200;
}

.media-export-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.media-export-dialog-actions button {
  min-height: 38px;
}

.media-table-wrap {
  width: 100%;
  overflow: visible;
}

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

.media-table .media-col-name { width: 6.5%; }
.media-table .media-col-region { width: 5.5%; }
.media-table .media-col-tags { width: 7.5%; }
.media-table .media-col-home { width: 4%; }
.media-table .media-col-pgy { width: 5%; }
.media-table .media-col-fans { width: 4.5%; }
.media-table .media-col-price { width: 4.5%; }
.media-table .media-col-metric { width: 6.5%; }
.media-table .media-col-interaction { width: 6.5%; }
.media-table .media-col-percent { width: 5%; }
.media-table .media-col-posted { width: 6.5%; }
.media-table .media-col-projects { width: 11.5%; }
.media-table .media-col-owner { width: 5.5%; }

.media-table th,
.media-table td {
  min-width: 0;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  overflow: hidden;
}

.media-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 700;
}

.media-table th > span {
  display: block;
  margin-top: 2px;
  color: #8a94a5;
  font-size: 8px;
  font-weight: 600;
}

.media-sort-button {
  display: inline-flex;
  width: 16px;
  height: 18px;
  min-width: 16px;
  min-height: 18px;
  margin: -3px 0 -3px 3px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #a4adba;
  vertical-align: middle;
  cursor: pointer;
}

.media-sort-button > span {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.media-sort-button i {
  height: 6px;
  color: inherit;
  font-size: 6px;
  font-style: normal;
  line-height: 6px;
}

.media-sort-button:hover,
.media-sort-button:focus-visible {
  background: #e8ecf2;
  color: #58667a;
  outline: none;
}

.media-sort-button i.is-active {
  color: var(--red);
}

.media-sort-button.is-active {
  background: #f4e7e8;
}

.media-table td strong,
.media-table td span {
  display: block;
}

.media-table .media-name-cell {
  background: var(--surface);
}

.media-external-link {
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.media-external-link:hover {
  color: var(--red);
}

.media-chip-list {
  position: relative;
  display: block !important;
  width: 100%;
  max-width: 100%;
  margin-top: 0 !important;
  overflow: visible;
}

.media-chip-track {
  display: flex !important;
  width: 100%;
  gap: 3px;
  margin-top: 0 !important;
  overflow: hidden;
}

.media-tags-cell,
.media-projects-cell,
.media-owners-cell {
  position: relative;
  overflow: visible !important;
}

.media-table tr:hover {
  position: relative;
  z-index: 4;
}

.media-tags-cell .media-chip-list:hover::after,
.media-projects-cell .media-chip-list:hover::after,
.media-owners-cell .media-chip-list:hover::after {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: max-content;
  max-width: min(420px, 75vw);
  padding: 9px 11px;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 32, 51, 0.16);
  color: var(--ink);
  content: attr(data-full);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
  white-space: normal;
}

.media-projects-cell .media-chip-list:hover::after,
.media-owners-cell .media-chip-list:hover::after {
  right: 0;
  left: auto;
}

.media-chip {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  min-width: 0;
  min-height: 19px;
  margin-top: 0 !important;
  padding: 2px 5px;
  border: 1px solid #dfe4eb;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--ink) !important;
  font-size: 9px !important;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-empty-value {
  margin-top: 0 !important;
}

.media-posted-yes {
  color: #147d64 !important;
}

.media-posted-no {
  color: var(--muted) !important;
}

.media-table td strong,
.media-creator-name {
  color: var(--ink);
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
}

.media-creator-name:hover {
  color: var(--red);
}

.media-table td span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
}

.media-dual-metric {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  white-space: nowrap;
}

.media-dual-metric span {
  display: inline !important;
  margin-top: 0 !important;
  color: inherit !important;
  font-size: inherit !important;
}


.media-table td > strong,
.media-table td > a,
.media-table td > span:not(.media-chip-list) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  #mediaListPage {
    width: calc(100vw - 12px);
    margin-left: calc(50% - 50vw + 6px);
  }

  .media-table th,
  .media-table td {
    padding-right: 3px;
    padding-left: 3px;
  }

  .media-table th,
  .media-table td strong,
  .media-creator-name,
  .media-external-link {
    font-size: 9px;
  }
}

@media (max-width: 720px) {
  .media-list-actions {
    width: 100%;
  }

  .media-list-actions > * {
    flex: 1 1 0;
    justify-content: center;
  }

  .media-export-policy {
    grid-template-columns: 1fr;
  }

  .media-export-policy > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .media-export-policy > div:last-child {
    border-bottom: 0;
  }

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

  .media-id-search-panel,
  .media-id-search-controls {
    grid-template-columns: 1fr;
  }

  .media-id-search-controls .primary-button {
    width: 100%;
  }

  .media-filter-grid {
    grid-template-columns: 1fr;
  }

  .media-price-field {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .media-price-controls {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .media-price-field:has(.media-custom-range:not([hidden])) .media-price-controls,
  .media-price-field > .media-custom-range {
    grid-column: 1;
  }

  .media-region-cascade {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    left: -22px;
  }

  .media-region-columns {
    height: 330px;
    grid-template-columns: 24% 34% 42%;
  }

  .media-region-column {
    padding: 6px;
  }

  .media-region-row {
    min-height: 38px;
    padding: 0 6px;
  }

  .media-region-footer {
    display: flex;
  }

  .media-region-footer button {
    width: auto;
    min-width: 0;
  }

  .media-region-footer button:first-child {
    width: 72px;
    min-width: 72px;
    flex: 0 0 72px;
    text-align: center;
  }

  .media-region-footer button:last-child {
    width: 82px;
    min-width: 82px;
    flex: 0 0 82px;
  }

  .media-list-button {
    width: 100%;
  }

  .media-filter-actions {
    margin-top: 12px;
  }

  .media-list-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

.submit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.request-panel {
  padding: 24px;
}

.submit-side {
  display: grid;
  gap: 18px;
}

.preview-panel,
.recent-panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-title h2 {
  font-size: 16px;
  line-height: 1.25;
  font-weight: 780;
}

.panel-title p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.panel-title > span {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  border-radius: 6px;
  padding: 0 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.panel-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.text-button {
  border: 0;
  padding: 3px 0;
  color: var(--red-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.text-button:hover {
  color: var(--red);
}

.secondary-button.reuse-project-trigger {
  min-height: 36px;
  border-color: var(--red-dark);
  padding: 0 13px;
  background: var(--red-dark);
  color: #fff;
  box-shadow: 0 5px 12px rgba(190, 36, 61, 0.18);
}

.secondary-button.reuse-project-trigger:hover {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  box-shadow: 0 7px 16px rgba(190, 36, 61, 0.24);
}

.secondary-button.reuse-project-trigger:active {
  transform: translateY(0);
  border-color: #9f1f35;
  background: #9f1f35;
}

.resubmit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -4px 0 18px;
  border-left: 3px solid var(--amber);
  padding: 11px 13px;
  background: #fff9ec;
}

.resubmit-banner[hidden] {
  display: none;
}

.resubmit-banner div {
  display: grid;
  gap: 3px;
}

.resubmit-banner strong {
  color: #694800;
  font-size: 13px;
}

.resubmit-banner span {
  color: #846615;
  font-size: 11px;
  line-height: 1.45;
}

.panel-title > a {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 17px;
  color: #344054;
  font-size: 13px;
  font-weight: 720;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

input:focus,
textarea:focus {
  border-color: #e17a8b;
  box-shadow: 0 0 0 3px rgba(214, 47, 75, 0.1);
}

textarea {
  min-height: 226px;
  resize: vertical;
  background: #fbfcfd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
}

.project-memory-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 520;
  line-height: 1.5;
}

.project-memory-status.is-linked {
  color: var(--teal);
  font-weight: 700;
}

.project-memory-status.is-warning {
  color: var(--amber);
  font-weight: 700;
}

.report-field {
  margin-bottom: 19px;
}

.field-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 720;
}

.field-heading small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.report-upload {
  min-height: 76px;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 12px;
  margin: 0;
  border: 1px dashed #c7d0da;
  border-radius: 7px;
  padding: 13px 14px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.report-upload:hover {
  border-color: #df8292;
  background: var(--red-soft);
}

.report-upload input {
  display: none;
}

.upload-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--red-dark);
  font-size: 18px;
  font-weight: 800;
}

.upload-copy {
  min-width: 0;
}

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

.upload-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.queue-rule {
  margin-bottom: 18px;
  border-left: 3px solid var(--amber);
  padding: 9px 0 9px 12px;
}

.queue-rule > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.queue-rule strong {
  color: #344054;
  font-size: 12px;
}

.queue-rule span {
  color: var(--amber);
  font-size: 11px;
  font-weight: 720;
  text-align: right;
}

.queue-rule p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 3px;
}

.form-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

button,
.primary-button,
.secondary-button,
.upload-button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 16px;
  border: 1px solid transparent;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

button:hover,
.primary-button:hover,
.secondary-button:hover,
.upload-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

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

.secondary-button:hover,
.upload-button:hover {
  border-color: #c7d0da;
  background: var(--surface-soft);
}

.upload-button {
  display: inline-flex;
}

.upload-button input {
  display: none;
}

.icon-command {
  width: 38px;
  min-width: 38px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 20px;
}

.preview-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--line-soft);
}

.preview-count strong {
  color: var(--red-dark);
  font-size: 38px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.preview-count span {
  color: var(--muted);
  font-size: 13px;
}

.id-preview {
  max-height: 174px;
  overflow: auto;
  padding-top: 13px;
}

.id-preview span {
  display: block;
  overflow: hidden;
  padding: 7px 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.id-preview span + span {
  border-top: 1px solid var(--line-soft);
}

.check-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
}

.check-row + .check-row {
  border-top: 1px solid var(--line-soft);
}

.check-row.error {
  margin: 0 -8px;
  padding-right: 8px;
  padding-left: 8px;
  background: #fff5f6;
}

.check-copy {
  min-width: 0;
}

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

.check-copy strong {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-copy small {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.check-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.check-state.error {
  color: var(--red-dark);
}

.check-state.waiting {
  color: var(--amber);
}

#previewState.error-state {
  background: var(--red-soft);
  color: var(--red-dark);
}

#previewState.success-state {
  background: var(--teal-soft);
  color: var(--teal);
}

#previewState.warning-state {
  background: var(--amber-soft);
  color: var(--amber);
}

.recent-list {
  display: grid;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  text-decoration: none;
}

.recent-item + .recent-item {
  border-top: 1px solid var(--line-soft);
}

.recent-item strong,
.recent-item span {
  display: block;
}

.recent-item strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.progress-indicator {
  min-width: 76px;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.traffic-lights {
  display: flex;
  gap: 5px;
  margin: 0;
}

.traffic-light {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0.18;
}

.traffic-light.red {
  background: #d13a4f;
}

.traffic-light.yellow {
  background: #d89818;
}

.traffic-light.green {
  background: #238467;
}

.traffic-light.active {
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(24, 32, 43, 0.06);
}

.progress-indicator > span {
  margin: 0;
  color: #475467;
  font-size: 11px;
  font-weight: 720;
}

.recent-empty {
  padding: 18px 0;
  color: var(--muted);
  font-size: 12px;
}

.row-status,
.job-status {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  border: 1px solid #f0bcc5;
  border-radius: 6px;
  padding: 0 9px;
  background: var(--red-soft);
  color: var(--red-dark);
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.status-success {
  border-color: #b9e1d5;
  background: var(--teal-soft);
  color: var(--teal);
}

.status-warning {
  border-color: #efd59f;
  background: var(--amber-soft);
  color: var(--amber);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.overview-item {
  min-width: 0;
  padding: 18px 20px;
}

.overview-item + .overview-item {
  border-left: 1px solid var(--line);
}

.overview-item span,
.overview-item strong {
  display: block;
}

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

.overview-item strong {
  overflow: hidden;
  margin-top: 9px;
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-panel {
  margin-bottom: 18px;
  overflow: hidden;
}

.records-panel > .panel-title,
.detail-panel > .panel-title {
  margin: 0;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fb;
  color: #475467;
  text-align: left;
  font-size: 11px;
  font-weight: 780;
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

tbody tr:hover {
  background: #fbfcfd;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-subtext {
  max-width: 260px;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.table-action {
  min-height: 30px;
  padding: 0 11px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 11px;
}

.empty-row {
  height: 90px;
  color: var(--muted);
  text-align: center;
}

.detail-panel {
  overflow: hidden;
}

.empty-state {
  min-height: 250px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  padding: 30px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.empty-state span {
  font-size: 12px;
}

.text-link {
  margin-top: 6px;
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.hidden {
  display: none;
}

.job-view {
  padding: 20px;
}

.job-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.job-name {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 790;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.metric {
  min-width: 0;
  padding: 15px;
  background: #fff;
}

.metric + .metric {
  border-left: 1px solid var(--line);
}

.metric:first-child {
  background: var(--red-soft);
}

.metric span,
.flow-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
}

.metric strong,
.flow-grid strong {
  display: block;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.flow-grid > div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 13px;
}

.flow-grid > div:first-child {
  background: var(--teal-soft);
}

.flow-grid > div:nth-child(2),
.flow-grid > div:nth-child(3) {
  background: var(--blue-soft);
}

.flow-grid > div:first-child strong {
  color: var(--teal);
}

.flow-grid > div:nth-child(2) strong,
.flow-grid > div:nth-child(3) strong {
  color: var(--blue);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 17px;
}

.actions + .form-note {
  margin-top: 10px;
}

.table-wrap.compact {
  max-height: 380px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap.compact table {
  min-width: 980px;
}

.dashboard-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.date-selector {
  min-width: 210px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 0;
}

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

.date-selector input {
  min-width: 142px;
  padding: 9px 10px;
  background: #fff;
}

.daily-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
}

.daily-summary > div {
  min-width: 120px;
  padding: 15px 22px;
  border-left: 1px solid var(--line);
}

.daily-summary span,
.daily-summary strong {
  display: block;
}

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

.daily-summary strong {
  margin-top: 7px;
  font-size: 21px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.projects-section > .panel-title {
  margin-bottom: 14px;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.project-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 7px 20px rgba(24, 32, 43, 0.045);
}

.project-card-header {
  min-height: 92px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 19px;
}

.project-heading {
  min-width: 0;
}

.project-heading > span {
  display: block;
  overflow: hidden;
  color: var(--red-dark);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-heading h3 {
  overflow: hidden;
  margin: 6px 0 0;
  font-size: 17px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.project-cost-note {
  display: block;
  margin-top: 6px;
  color: #9a6700;
  font-size: 13px;
  font-weight: 600;
}

.project-card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.project-detail-button {
  min-height: 34px;
  padding: 0 13px;
  box-shadow: 0 6px 14px rgba(214, 47, 75, 0.16);
}

.data-band {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: stretch;
  border-top: 1px solid var(--line-soft);
}

.band-title {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px;
  border-right: 1px solid var(--line-soft);
  background: var(--surface-soft);
  color: #475467;
  font-size: 11px;
  font-weight: 800;
}

.band-title::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
}

.data-band.natural .band-title {
  color: var(--teal);
}

.data-band.paid .band-title {
  color: var(--blue);
}

.band-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(74px, 1fr));
}

.band-metrics > div,
.flow-metrics > div {
  min-width: 0;
  padding: 13px 11px;
}

.band-metrics > div + div,
.flow-metrics > div + div {
  border-left: 1px solid var(--line-soft);
}

.band-metrics span,
.band-metrics strong,
.flow-metrics span,
.flow-metrics strong {
  display: block;
}

.band-metrics span,
.flow-metrics span {
  color: var(--muted);
  font-size: 10px;
}

.band-metrics strong,
.flow-metrics strong {
  overflow: hidden;
  margin-top: 7px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-empty {
  min-height: 260px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.project-empty[hidden] {
  display: none;
}

.project-empty strong {
  color: var(--ink);
  font-size: 16px;
}

.project-empty span,
.project-empty a {
  font-size: 12px;
}

.project-empty a {
  margin-top: 4px;
  color: var(--red-dark);
  font-weight: 760;
  text-decoration: none;
}

.project-download {
  min-height: 42px;
  padding: 0 19px;
  box-shadow: 0 7px 16px rgba(214, 47, 75, 0.18);
}

.project-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.project-page-actions > * {
  min-height: 42px;
  margin: 0;
  padding: 0 18px;
}

.project-paid-upload {
  position: relative;
  cursor: pointer;
}

.project-paid-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.project-paid-upload.is-loading {
  cursor: wait;
  opacity: 0.58;
  pointer-events: none;
}

.project-retry {
  border-color: #e3a008;
  color: #8a5b00;
}

.reuse-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0;
  background: #fff;
  box-shadow: 0 24px 64px rgba(18, 25, 38, 0.22);
}

.reuse-dialog::backdrop {
  background: rgba(21, 29, 42, 0.42);
}

.reuse-dialog-shell {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.reuse-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.reuse-dialog-header h2 {
  font-size: 18px;
}

.reuse-dialog-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.reuse-project-list {
  display: grid;
  max-height: 430px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.reuse-project-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 13px 2px;
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.reuse-project-item:hover {
  background: var(--surface-soft);
}

.reuse-project-item strong,
.reuse-project-item small {
  display: block;
}

.reuse-project-item strong {
  color: var(--ink);
  font-size: 13px;
}

.reuse-project-item small,
.reuse-project-item > span,
.reuse-dialog-status {
  color: var(--muted);
  font-size: 11px;
}

.reuse-project-item small {
  margin-top: 4px;
}

.reuse-dialog-status {
  margin: 0;
}

.project-retry:hover {
  border-color: #c98500;
  background: #fff8e7;
}

.project-upload-status {
  margin: -12px 0 22px;
  padding: 10px 12px;
  border-left: 3px solid #9aa3b1;
  background: #f5f7fa;
  color: var(--muted);
  font-size: 13px;
}

.project-upload-status.is-success {
  border-color: #23875b;
  background: #eff8f3;
  color: #176440;
}

.project-upload-status.is-error {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red-dark);
}

.project-download.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.project-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-detail-summary > div {
  min-width: 0;
  padding: 17px 20px;
}

.project-detail-summary > div + div {
  border-left: 1px solid var(--line);
}

.project-detail-summary span,
.project-detail-summary strong {
  display: block;
}

.project-detail-summary span {
  color: var(--muted);
  font-size: 11px;
}

.project-detail-summary strong {
  overflow: hidden;
  margin-top: 8px;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creators-section > .panel-title {
  margin-bottom: 14px;
}

.creator-list {
  min-width: 0;
}

.creator-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.creator-table {
  width: 100%;
  min-width: 2260px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
}

.creator-table th,
.creator-table td {
  height: 42px;
  padding: 9px 10px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  white-space: nowrap;
}

.creator-table th {
  position: static;
  background: #f7f9fb;
  color: #475467;
  text-align: right;
  font-size: 10px;
}

.creator-table th:first-child,
.creator-table th:nth-child(2),
.creator-table th:nth-child(3) {
  text-align: left;
}

.creator-table .creator-group-row th {
  height: 34px;
  border-bottom-color: var(--line);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.creator-table .group-total {
  color: #475467;
}

.creator-table .group-natural {
  background: var(--teal-soft);
  color: var(--teal);
}

.creator-table .group-paid {
  background: var(--blue-soft);
  color: var(--blue);
}

.creator-table tbody tr:hover td {
  background: #fbfcfd;
}

.creator-table td.creator-cell-name {
  min-width: 150px;
  font-weight: 760;
}

.creator-table td.creator-cell-id {
  min-width: 220px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.creator-table td.number {
  min-width: 78px;
}

.creator-table thead tr:nth-child(2) th:nth-child(1),
.creator-table tbody td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 150px;
}

.creator-table thead tr:nth-child(2) th:nth-child(2),
.creator-table tbody td:nth-child(2) {
  position: sticky;
  left: 150px;
  z-index: 2;
  min-width: 220px;
}

.creator-table thead tr:nth-child(2) th:nth-child(3),
.creator-table tbody td:nth-child(3) {
  position: sticky;
  left: 370px;
  z-index: 2;
  min-width: 70px;
  box-shadow: 5px 0 8px rgba(24, 32, 43, 0.04);
}

.creator-table thead tr:nth-child(2) th {
  z-index: 3;
}

.creator-table tfoot td {
  border-bottom: 0;
  background: #f2f4f7;
  color: var(--ink);
  font-weight: 800;
}

.creator-table tr > *:last-child {
  border-right: 0;
}

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

.optimizer-heading {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.optimizer-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.optimizer-summary-item {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.optimizer-summary-item span,
.optimizer-summary-item small {
  display: block;
  color: var(--muted);
}

.optimizer-summary-item span {
  font-weight: 760;
}

.optimizer-summary-item strong {
  display: block;
  margin: 12px 0 6px;
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.15;
}

.optimizer-summary-item small {
  font-size: 12px;
}

.optimizer-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(620px, 1.5fr);
  gap: 18px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.optimizer-form,
.optimizer-list-panel {
  min-width: 0;
  padding: 22px;
}

.optimizer-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.optimizer-form-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.optimizer-form-grid .span-2 {
  grid-column: span 2;
}

.optimizer-form-grid input,
.optimizer-form-grid select,
.optimizer-form-grid textarea,
.optimizer-filter select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.optimizer-form-grid input:focus,
.optimizer-form-grid select:focus,
.optimizer-form-grid textarea:focus,
.optimizer-filter select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.optimizer-form .form-note {
  margin: 16px 0 12px;
}

.optimizer-save {
  width: 100%;
  justify-content: center;
  border: 0;
}

.text-command {
  border: 0;
  padding: 4px;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
}

.optimizer-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.optimizer-filter select {
  width: 96px;
  padding: 8px 9px;
}

.optimizer-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.optimizer-table {
  min-width: 790px;
}

.optimizer-table th {
  background: var(--surface-soft);
}

.optimizer-table td > strong,
.optimizer-table td > small {
  display: block;
}

.optimizer-table td > small {
  margin-top: 4px;
  color: var(--quiet);
}

.optimizer-table td.number {
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  white-space: nowrap;
}

.optimizer-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.optimizer-status.is-active {
  color: var(--teal);
  background: var(--teal-soft);
}

.optimizer-status.is-pending {
  color: var(--amber);
  background: var(--amber-soft);
}

.optimizer-status.is-done {
  color: var(--muted);
  background: var(--line-soft);
}

.optimizer-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.optimizer-row-actions button {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 8px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
}

.optimizer-row-actions button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

@media (max-width: 980px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .optimizer-workspace {
    grid-template-columns: 1fr;
  }

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

  .submit-layout {
    grid-template-columns: 1fr;
  }

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

  .metric-grid {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }

  .metric:nth-child(4) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .metric:nth-child(5),
  .metric:nth-child(6) {
    border-top: 1px solid var(--line);
  }

  .dashboard-toolbar {
    display: grid;
    gap: 0;
  }

  .project-card-actions {
    display: grid;
    justify-items: end;
    gap: 9px;
  }

  .daily-summary {
    border-top: 1px solid var(--line);
  }

  .daily-summary > div:first-child {
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .header-inner,
  .app-shell {
    width: min(100vw - 24px, 680px);
  }

  .app-shell {
    padding-top: 26px;
  }

  .brand {
    gap: 7px;
  }

  .brand-logo {
    width: 54px;
    height: 32px;
  }

  .brand strong {
    font-size: 13px;
  }

  .brand small,
  #runtimeLabel,
  .account-menu > span {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .runtime-status {
    width: 32px;
    min-height: 30px;
    justify-content: center;
    padding: 0;
  }

  .account-menu {
    gap: 0;
    border-left: 0;
    padding-left: 0;
  }

  .home-page {
    padding-top: 14px;
  }

  .home-intro h1,
  .page-heading h1 {
    font-size: 26px;
  }

  .module-grid,
  .submit-side {
    grid-template-columns: 1fr;
  }

  .note-input-grid {
    grid-template-columns: 1fr;
  }

  .request-panel .panel-title {
    display: grid;
  }

  .request-panel .panel-title-actions {
    justify-content: flex-start;
  }

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

  .optimizer-form-grid .span-2 {
    grid-column: auto;
  }

  .module-card {
    min-height: 244px;
  }

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

  .home-summary > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .page-heading {
    min-height: 116px;
  }

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

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

  .project-detail-summary > div:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .project-detail-summary > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .date-selector {
    justify-content: space-between;
  }

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

  .daily-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 0;
  }

  .daily-summary > div + div {
    border-top: 1px solid var(--line);
  }

  .daily-summary strong {
    margin-top: 0;
  }

  .data-band {
    grid-template-columns: 1fr;
  }

  .band-title {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .band-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .band-metrics > div:nth-child(5) {
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .band-metrics > div:nth-child(6),
  .band-metrics > div:nth-child(7) {
    border-top: 1px solid var(--line-soft);
  }

  .overview-item:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .overview-item:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .metric-grid,
  .flow-grid {
    grid-template-columns: 1fr;
  }

  .metric + .metric,
  .metric:nth-child(4) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .form-footer {
    display: grid;
  }

  .form-footer button {
    width: 100%;
  }

  .job-header {
    display: grid;
  }

  .actions > * {
    flex: 1 1 100%;
  }

  .project-page-heading {
    display: grid;
    align-items: end;
  }

  .project-download {
    width: auto;
  }

  .project-page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .project-page-actions > * {
    min-width: 0;
    flex: 1 1 calc(50% - 5px);
    justify-content: center;
  }

}
