:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --page: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfd;
  --text: #111318;
  --muted: #6e7480;
  --quiet: #8a909a;
  --line: #d9dde5;
  --line-soft: #eceff4;
  --blue: #0071e3;
  --blue-strong: #0066cc;
  --blue-soft: #e8f2ff;
  --danger: #c74343;
  --success: #1f8f5f;
  --shadow-soft: 0 22px 60px rgba(20, 26, 38, 0.11);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100%;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0;
}

a { color: inherit; }

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2,
h3,
p { margin: 0; }

p { line-height: 1.5; }

button,
select,
input {
  min-height: 36px;
  border: 1px solid #b8c4d0;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  font: inherit;
}

button {
  cursor: pointer;
  font-weight: 700;
}

svg {
  display: block;
}

.muted {
  color: #74808c;
  font-size: 13px;
}

/* Public identity surface */
.identity-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 74% 20%, rgba(225, 231, 240, 0.78), rgba(225, 231, 240, 0) 28rem),
    linear-gradient(180deg, #fff 0%, var(--page) 62%, #fff 100%);
}

.identity-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(217, 221, 229, 0.78);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
}

.identity-brand,
.identity-nav,
.admin-link,
.primary-button,
.primary-link-button,
.result-link {
  display: inline-flex;
  align-items: center;
}

.identity-brand {
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 760;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(17, 19, 24, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #eef2f7);
  color: var(--blue);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 8px 18px rgba(17, 19, 24, .08);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.identity-nav {
  gap: 14px;
}

.language-switcher {
  min-height: 36px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(17, 19, 24, 0.08);
  border-radius: 8px;
  background: #eceff4;
}

.language-switcher button {
  min-width: 42px;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4f5662;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 760;
  line-height: 1;
}

.language-switcher button[aria-pressed="true"] {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 2px rgba(17, 19, 24, .12);
}

.language-switcher button:focus {
  outline: none;
}

.language-switcher button:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .18), 0 1px 2px rgba(17, 19, 24, .12);
}

.admin-link {
  min-height: 36px;
  gap: 8px;
  color: #3f4652;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.admin-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-link:hover,
.result-link:hover,
.secondary-link:hover {
  color: var(--blue-strong);
}

.identity-main {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 34px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
  gap: 72px;
  align-items: center;
}

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

.hero-copy h1 {
  font-size: 68px;
  line-height: .98;
  font-weight: 760;
  letter-spacing: 0;
}

.hero-subtitle {
  margin-top: 22px;
  color: #4f5662;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 520;
}

.hero-body {
  max-width: 620px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 17px;
}

.primary-button,
.primary-link-button {
  min-height: 54px;
  gap: 14px;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #0a84ff 0%, var(--blue) 100%);
  color: #fff;
  padding: 0 22px;
  font-size: 16px;
  font-weight: 760;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(0, 113, 227, .24);
}

.hero-copy .primary-button {
  width: min(360px, 100%);
  margin-top: 28px;
}

.primary-button svg,
.primary-link-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button:disabled {
  opacity: .62;
  cursor: wait;
  box-shadow: none;
}

.verification-stepper {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.verification-stepper li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--quiet);
  font-size: 14px;
  text-align: center;
}

.verification-stepper li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 17px;
  left: calc(50% + 24px);
  width: calc(100% - 34px);
  height: 1px;
  background: #c8ced8;
}

.verification-stepper span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #c8ced8;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: #596170;
  font-size: 14px;
  font-weight: 700;
}

.verification-stepper strong {
  font-size: 14px;
  font-weight: 560;
}

.verification-stepper .is-active {
  color: var(--blue);
}

.verification-stepper .is-active span {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .08);
}

.hero-visual {
  position: relative;
  min-height: 430px;
  display: grid;
  place-items: center;
  margin: 0;
}

.visual-disc {
  position: absolute;
  width: 318px;
  height: 318px;
  border: 1px solid rgba(198, 205, 216, .72);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(232, 236, 244, .72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 26px 72px rgba(45, 53, 68, .12);
}

.key-visual,
.key-visual-image {
  position: relative;
  width: 500px;
  max-width: 100%;
  height: auto;
}

.key-visual-image {
  border: 0;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 28px 42px rgba(90, 98, 112, .12));
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 68%, rgba(0, 0, 0, .8) 78%, transparent 93%);
  mask-image: radial-gradient(circle at 50% 50%, #000 68%, rgba(0, 0, 0, .8) 78%, transparent 93%);
}

.state-panel {
  width: min(860px, 100%);
  min-height: 106px;
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 30px;
  padding: 20px 24px;
  border: 1px solid rgba(197, 203, 214, .82);
  border-radius: 8px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 16px 42px rgba(20, 26, 38, .07);
}

.state-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
}

.state-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.state-panel strong {
  display: block;
  font-size: 17px;
  line-height: 1.3;
}

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

.state-panel.is-error .state-icon {
  background: #fff0f0;
  color: var(--danger);
}

.state-panel.is-success .state-icon {
  background: #e9f8f1;
  color: var(--success);
}

.result-content {
  min-width: 0;
  flex: 1;
}

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

.result-meta div {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}

.result-meta dt {
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.2;
}

.result-meta dd {
  margin: 4px 0 0;
  color: var(--text);
  font-weight: 760;
}

.result-link {
  min-height: 42px;
  margin-top: 16px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
}

.process-section {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 44px 0 76px;
  border-top: 1px solid rgba(217, 221, 229, 0.8);
}

.process-section h2 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 760;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.process-card {
  min-height: 198px;
  padding: 24px;
  border: 1px solid rgba(217, 221, 229, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.process-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #48515f;
}

.process-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.process-card h3 {
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.25;
}

.process-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

/* Admin sign-in */
.login-main .primary-link-button {
  width: min(360px, 100%);
  margin-top: 30px;
}

.login-stepper {
  grid-template-columns: repeat(3, 1fr);
}

.login-status {
  min-height: 24px;
  font-size: 14px;
}

/* Admin workspace */
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.sidebar {
  background: #17202a;
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar a {
  color: #d9e8ff;
  text-decoration: none;
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.queue {
  display: grid;
  gap: 12px;
}

.application-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #fff;
}

.card-header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 0;
}

.meta-grid div {
  padding: 8px;
  border: 1px solid #edf1f5;
  border-radius: 6px;
  background: #fafbfc;
}

dt {
  color: #74808c;
  font-size: 12px;
}

dd {
  margin: 3px 0 0;
  font-weight: 700;
}

.video-note {
  width: min(360px, 100%);
  border-radius: 8px;
  background: #111;
}

.decision-form textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: 1px solid #b8c4d0;
  border-radius: 6px;
  padding: 8px;
  font: inherit;
}

.actions,
.inline-form,
.location-form,
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.filter-bar {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #fff;
}

.secondary-link {
  color: #1769aa;
  font-weight: 700;
  text-decoration: none;
}

.detail-card {
  margin-bottom: 16px;
}

.audit-panel {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #fff;
}

.audit-panel h2 {
  margin-top: 0;
  font-size: 20px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid #edf1f5;
  vertical-align: top;
}

th {
  color: #5d6a76;
  font-size: 13px;
  background: #fafbfc;
}

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

.location-form {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-visual {
    min-height: 300px;
    order: -1;
  }

  .visual-disc {
    width: 272px;
    height: 272px;
  }

  .key-visual,
  .key-visual-image {
    width: 304px;
  }

  .state-panel {
    margin-top: 42px;
  }

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

@media (max-width: 760px) {
  .identity-header {
    position: static;
    min-height: 68px;
    padding: 14px 18px;
  }

  .identity-brand {
    font-size: 18px;
  }

  .identity-main {
    width: calc(100% - 32px);
    padding: 28px 0 34px;
  }

  .hero-grid {
    gap: 24px;
  }

  .hero-visual {
    min-height: 250px;
  }

  .visual-disc {
    width: 178px;
    height: 178px;
  }

  .key-visual,
  .key-visual-image {
    width: 270px;
  }

  .hero-copy h1 {
    font-size: 48px;
  }

  .hero-subtitle {
    margin-top: 18px;
    font-size: 21px;
  }

  .hero-body {
    margin-top: 14px;
    font-size: 16px;
  }

  .hero-copy .primary-button {
    width: 100%;
    margin-top: 24px;
  }

  .verification-stepper {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 12px;
    margin-top: 24px;
  }

  .verification-stepper li::after {
    display: none;
  }

  .state-panel {
    align-items: flex-start;
    padding: 20px;
    margin-top: 24px;
  }

  .result-meta {
    grid-template-columns: 1fr;
  }

  .process-section {
    width: calc(100% - 32px);
    padding-bottom: 52px;
  }

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

  .login-stage {
    width: calc(100% - 32px);
    padding: 42px 0;
  }

  .login-panel {
    padding: 30px 20px;
  }

  .login-panel h1 {
    font-size: 32px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .admin-main {
    padding: 16px;
  }

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

@media (max-width: 480px) {
  .identity-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
  }

  .identity-nav {
    width: 100%;
    justify-content: space-between;
  }

  .language-switcher {
    flex: 1;
  }

  .language-switcher button {
    flex: 1;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-subtitle {
    font-size: 19px;
  }

  .hero-visual {
    min-height: 218px;
  }

  .visual-disc {
    width: 128px;
    height: 128px;
  }

  .key-visual,
  .key-visual-image {
    width: 230px;
  }

  .verification-stepper {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
  }

  .verification-stepper li {
    gap: 8px;
  }

  .verification-stepper span {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .verification-stepper strong {
    font-size: 12px;
  }

  .state-panel {
    gap: 14px;
  }

  .state-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

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