:root {
  --ink: #1f2733;
  --ink-soft: #4a5568;
  --line: #e2e8f0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

.service-page {
  min-height: 100vh;
  margin: 0;
  background: #f6f7f9;
  color: var(--ink, #1f2937);
  font-family: "Noto Sans", Arial, sans-serif;
}

.nav-mpa {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(6px);
}

.nav-mpa .inner {
  width: min(1060px, 100%);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  padding: .6rem 1rem;
}

.nav-mpa .brand-tag {
  color: #6b5a80;
  font-size: .9rem;
  font-weight: 800;
}

.nav-mpa .links a {
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-mpa .links a:hover {
  color: #6b5a80;
}

.service-page [hidden] {
  display: none !important;
}

.service-nav .brand-tag {
  text-decoration: none;
}

.service-nav .links,
.account-links {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.service-nav .links a {
  margin-left: 0;
}

.account-email {
  max-width: 260px;
  overflow: hidden;
  color: #596273;
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-command {
  border: 0;
  padding: .25rem 0;
  background: transparent;
  color: #596273;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-command:hover {
  color: #5f5073;
}

.service-main {
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.25rem 0 4.5rem;
}

.service-header,
.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.service-header > div:first-child,
.dashboard-header > div:first-child {
  max-width: 720px;
}

.service-kicker,
.step-label {
  display: block;
  color: #6b5a80;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: uppercase;
}

.service-header h1,
.dashboard-header h1 {
  margin: .34rem 0 .58rem;
  color: var(--ink, #1f2937);
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.16;
}

.service-header p,
.dashboard-header p {
  margin: 0;
  color: #596273;
  font-size: .96rem;
  line-height: 1.65;
}

.service-header .evaluation-policy-copy {
  margin-top: .8rem;
  border-left: 2px solid #9a86b3;
  padding-left: .8rem;
  color: #4f5969;
  font-size: .86rem;
  line-height: 1.6;
}

.service-status {
  min-width: 230px;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid #d5dce6;
  border-radius: 6px;
  padding: .65rem .8rem;
  background: #fff;
  color: #596273;
  font-size: .76rem;
  font-weight: 700;
}

.status-dot {
  width: .58rem;
  height: .58rem;
  flex: none;
  border-radius: 50%;
  background: #98a2b3;
}

.service-status.is-ready {
  border-color: #a7cdbf;
  background: #f3faf7;
  color: #17654e;
}

.service-status.is-ready .status-dot {
  background: #1f8a68;
}

.service-status.is-unavailable {
  border-color: #e2b4b0;
  background: #fff7f6;
  color: #9f2f27;
}

.service-status.is-unavailable .status-dot {
  background: #c94b42;
}

.quota-banner {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: .72rem;
  margin-bottom: 1rem;
  border: 1px solid #b8d8cc;
  border-radius: 7px;
  padding: .82rem 1rem;
  background: #f3faf7;
  color: #17654e;
}

.quota-banner.is-blocked {
  border-color: #e2cc9f;
  background: #fffaf0;
  color: #76531d;
}

.quota-banner > i {
  margin-top: .16rem;
}

.quota-banner strong,
.quota-banner span {
  display: block;
}

.quota-banner strong {
  font-size: .82rem;
}

.quota-banner span {
  margin-top: .12rem;
  color: #596273;
  font-size: .74rem;
  line-height: 1.5;
}

.quota-banner.compact {
  margin-bottom: 1.5rem;
}

.access-code-row {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border-left: 3px solid #c69239;
  background: #fff9ed;
}

.access-code-row label {
  display: block;
  margin-bottom: .35rem;
  font-size: .78rem;
  font-weight: 800;
}

.access-code-row input {
  width: min(420px, 100%);
}

.submission-panel,
.jobs-section {
  overflow: hidden;
  border: 1px solid #d9e0e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(31, 39, 51, .04);
}

.panel-heading,
.section-heading {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e9ef;
  background: #fbfcfd;
}

.panel-heading h2,
.section-heading h2 {
  margin: .14rem 0 0;
  font-size: 1.18rem;
  font-weight: 800;
}

.requirements-badge,
.count-label {
  flex: none;
  border: 1px solid #ccd5e0;
  border-radius: 5px;
  padding: .25rem .5rem;
  background: #fff;
  color: #596273;
  font-size: .68rem;
  font-weight: 800;
}

.submission-panel form {
  padding: 1.25rem;
}

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

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

.form-field-wide {
  grid-column: 1 / -1;
}

.form-field label {
  display: block;
  margin-bottom: .38rem;
  color: #273142;
  font-size: .78rem;
  font-weight: 800;
}

.form-field label span {
  color: #7b8494;
  font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea,
.access-code-row input,
.publish-form input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: .67rem .72rem;
  background: #fff;
  color: #273142;
  font: inherit;
  font-size: .84rem;
  line-height: 1.4;
  box-shadow: none;
}

.form-field select {
  min-height: 43px;
}

.form-field textarea {
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.access-code-row input:focus,
.publish-form input:focus {
  border-color: #8b79a8;
  outline: 3px solid rgba(139, 121, 168, .15);
}

.form-field small {
  display: block;
  margin-top: .3rem;
  color: #667085;
  font-size: .7rem;
  line-height: 1.45;
}

.form-field code {
  color: #344054;
  font-size: .68rem;
}

.readonly-value {
  min-height: 43px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #d9e0e8;
  border-radius: 5px;
  padding: .67rem .72rem;
  background: #f7f8fa;
  color: #596273;
  font-size: .84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secret-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
}

.secret-input input {
  min-width: 0;
  border-radius: 5px 0 0 5px;
}

.secret-input button {
  border: 1px solid #cbd5e1;
  border-left: 0;
  border-radius: 0 5px 5px 0;
  background: #f8fafc;
  color: #667085;
  cursor: pointer;
}

.secret-input button:hover {
  background: #f0edf4;
  color: #665576;
}

.api-example {
  display: grid;
  grid-template-columns: minmax(220px, 31%) minmax(0, 1fr);
  gap: 1rem;
  margin: 1.35rem -1.25rem 0;
  padding: 1.15rem 1.25rem;
  border-top: 1px solid #e5e9ef;
  border-bottom: 1px solid #e5e9ef;
  background: #f8fafc;
}

.api-example h3 {
  margin: 0 0 .35rem;
  font-size: .88rem;
  font-weight: 800;
}

.api-example p {
  margin: 0;
  color: #596273;
  font-size: .75rem;
  line-height: 1.55;
}

.api-example pre {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  border: 1px solid #d7dee8;
  border-radius: 5px;
  padding: .85rem;
  background: #252a33;
  color: #edf1f7;
  font-size: .68rem;
  line-height: 1.55;
  white-space: pre;
}

.api-example code {
  color: inherit;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.submission-consent {
  display: grid;
  grid-template-columns: 1.05rem minmax(0, 1fr);
  align-items: start;
  gap: .55rem;
  margin: 1rem 0;
  color: #596273;
  font-size: .74rem;
  line-height: 1.5;
}

.submission-consent input {
  margin-top: .18rem;
}

.submit-command,
.primary-command,
.secondary-command,
.icon-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .48rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.submit-command,
.primary-command {
  min-height: 42px;
  padding: .62rem 1rem;
  background: #88759f;
  color: #fff;
}

.submit-command:hover,
.primary-command:hover {
  background: #78658f;
  color: #fff;
}

.submit-command:disabled,
.primary-command:disabled,
.primary-command.is-disabled {
  background: #b8b4be;
  color: #f6f5f7;
  cursor: not-allowed;
  pointer-events: none;
}

.secondary-command {
  min-height: 34px;
  padding: .43rem .7rem;
  border-color: #cfd7e2;
  background: #fff;
  color: #4d5767;
}

.secondary-command:hover {
  border-color: #a99ab9;
  background: #faf9fb;
  color: #5d4f70;
}

.secondary-command:disabled {
  opacity: .55;
  cursor: wait;
}

.icon-command {
  width: 34px;
  height: 34px;
  border-color: #cfd7e2;
  background: #fff;
  color: #596273;
}

.form-error {
  margin: .9rem 0;
  border: 1px solid #e5b7b2;
  border-radius: 5px;
  padding: .7rem .8rem;
  background: #fff7f6;
  color: #9f2f27;
  font-size: .76rem;
  line-height: 1.5;
}

.form-error.is-success {
  border-color: #a7cdbf;
  background: #f3faf7;
  color: #17654e;
}

.job-status-panel {
  margin-top: 1rem;
  border: 1px solid #cfd8e4;
  border-radius: 8px;
  padding: 1.2rem;
  background: #fff;
}

.job-status-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.job-status-heading h2 {
  margin: .14rem 0 0;
  font-size: 1.14rem;
}

.job-status-pill,
.table-status {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: .22rem .5rem;
  font-size: .67rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status-queued {
  background: #f1f3f6;
  color: #596273;
}

.status-running {
  background: #edf3fb;
  color: #315f96;
}

.status-succeeded {
  background: #eaf7f2;
  color: #17654e;
}

.status-failed {
  background: #fff0ef;
  color: #9f2f27;
}

.job-status-panel dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem 1.2rem;
  margin: 1rem 0;
}

.job-status-panel dl div {
  min-width: 0;
}

.job-status-panel dt {
  color: #7b8494;
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.job-status-panel dd {
  margin: .18rem 0 0;
  overflow-wrap: anywhere;
  font-size: .8rem;
}

.job-status-panel > p {
  color: #596273;
  font-size: .78rem;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.auth-main {
  width: min(430px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4.5rem 0;
}

.auth-panel {
  border: 1px solid #d9e0e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(31, 39, 51, .07);
}

.auth-heading {
  padding: 1.35rem 1.4rem 1.1rem;
  border-bottom: 1px solid #e5e9ef;
}

.auth-heading h1 {
  margin: .3rem 0 .4rem;
  font-size: 1.65rem;
  font-weight: 800;
}

.auth-heading p {
  margin: 0;
  color: #596273;
  font-size: .79rem;
  line-height: 1.55;
}

.auth-panel form {
  display: grid;
  gap: 1rem;
  padding: 1.3rem 1.4rem;
}

.auth-submit {
  width: 100%;
}

.auth-switch {
  margin: 0;
  border-top: 1px solid #e5e9ef;
  padding: .9rem 1.4rem;
  color: #596273;
  font-size: .76rem;
  text-align: center;
}

.auth-switch a,
.result-link {
  color: #665576;
  font-weight: 800;
  text-decoration: none;
}

.dashboard-main {
  width: min(1220px, calc(100% - 2rem));
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .75rem;
}

.jobs-table th {
  padding: .72rem .8rem;
  border-bottom: 1px solid #dfe5ec;
  background: #f7f8fa;
  color: #596273;
  font-size: .66rem;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.jobs-table td {
  min-width: 105px;
  padding: .82rem;
  border-bottom: 1px solid #e8ecf1;
  color: #475162;
  vertical-align: top;
}

.jobs-table tr:last-child td {
  border-bottom: 0;
}

.jobs-table td:first-child {
  min-width: 190px;
}

.jobs-table td strong,
.jobs-table td small,
.jobs-table td code,
.jobs-table td span {
  display: block;
}

.jobs-table td strong {
  color: #273142;
  font-size: .78rem;
}

.jobs-table td small {
  margin-top: .16rem;
  color: #667085;
}

.jobs-table td code {
  width: fit-content;
  margin-top: .3rem;
  color: #697386;
  font-size: .65rem;
}

.jobs-table .table-status {
  width: fit-content;
}

.result-link {
  display: inline-flex !important;
  align-items: center;
  gap: .3rem;
  white-space: nowrap;
}

.result-pending {
  color: #7b8494;
  font-size: .7rem;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: .4rem;
  padding: 3rem 1rem;
  color: #7b8494;
  text-align: center;
}

.empty-state i {
  font-size: 1.5rem;
}

.empty-state strong {
  color: #475162;
}

.empty-state span {
  font-size: .76rem;
}

.admin-table th:last-child,
.admin-table td:last-child {
  min-width: 285px;
}

.publish-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: .42rem;
}

.publish-form .result-link,
.publish-form input[name="note"] {
  grid-column: 1 / -1;
}

.publish-form input {
  min-width: 0;
  padding: .42rem .5rem;
  font-size: .69rem;
}

.publish-form input[type="file"] {
  max-width: 175px;
}

@media (max-width: 800px) {
  .service-main {
    padding-top: 2.2rem;
  }

  .service-header,
  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .service-header h1,
  .dashboard-header h1 {
    font-size: 1.85rem;
  }

  .service-status {
    width: 100%;
  }

  .form-grid,
  .api-example {
    grid-template-columns: 1fr;
  }

  .form-field-wide {
    grid-column: auto;
  }

  .job-status-panel dl {
    grid-template-columns: 1fr;
  }

  .account-email {
    display: none;
  }
}

@media (max-width: 560px) {
  .service-nav .links {
    gap: .55rem;
  }

  .service-nav .links a {
    font-size: .7rem;
  }

  .nav-command {
    font-size: .7rem;
  }

  .service-main {
    width: min(100% - 1rem, 1040px);
  }

  .panel-heading,
  .section-heading,
  .submission-panel form {
    padding-right: .9rem;
    padding-left: .9rem;
  }

  .api-example {
    margin-right: -.9rem;
    margin-left: -.9rem;
    padding-right: .9rem;
    padding-left: .9rem;
  }

  .requirements-badge {
    display: none;
  }
}

.submission-guidance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1.35rem;
  border-top: 1px solid #dfe4ea;
  border-bottom: 1px solid #dfe4ea;
  padding: 1rem 0;
}

.submission-guidance > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr);
  align-items: start;
  gap: .55rem;
}

.submission-guidance i {
  margin-top: .14rem;
  color: #77658c;
  font-size: .84rem;
  text-align: center;
}

.submission-guidance span {
  color: #667085;
  font-size: .72rem;
  line-height: 1.5;
}

.submission-guidance strong {
  display: block;
  margin-bottom: .12rem;
  color: #303949;
  font-size: .76rem;
}

@media (max-width: 800px) {
  .submission-guidance {
    grid-template-columns: 1fr;
  }
}
