:root {
  color-scheme: light;
  --bg: #d8eaf2;
  --surface: #f7fbfd;
  --surface-strong: #ffffff;
  --line: #bdd5e1;
  --ink: #0d2433;
  --muted: #516675;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --blue: #2563eb;
  --shadow: 0 14px 34px rgba(36, 74, 92, .13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Malgun Gothic", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 280px),
    var(--bg);
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, .2)),
    var(--bg);
}

.gate-card {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.gate-mark {
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
}

.gate-card h1 {
  margin: 0 0 26px;
  font-size: 1.45rem;
  line-height: 1.25;
}

.gate-card label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.gate-row {
  display: flex;
  gap: 8px;
}

.gate-row input {
  min-width: 0;
  flex: 1;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
}

.gate-row button {
  width: 88px;
  border: 0;
  border-radius: 7px;
  background: var(--brand);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.gate-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: #dc2626;
  font-weight: 700;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.portal-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

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

.brand-name {
  font-weight: 650;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
}

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

.work-card {
  min-height: 164px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(141, 168, 181, .65);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.work-card:hover,
.work-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--blue);
  box-shadow: 0 18px 38px rgba(36, 74, 92, .18);
  outline: none;
}

.work-card.primary {
  background: #f3fbf8;
  border-color: rgba(15, 118, 110, .35);
}

.card-code {
  width: 54px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e5eef3;
  color: #21465a;
  font-weight: 800;
  font-size: .82rem;
}

.primary .card-code {
  background: var(--brand);
  color: white;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 36px;
  border-radius: 7px;
  background: #ecf3f7;
  color: #1c4b63;
  font-weight: 700;
}

.primary .card-action {
  background: var(--brand);
  color: white;
}

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

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 24px;
  }

  .portal-header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .work-card {
    min-height: 168px;
  }

  .gate-row {
    flex-direction: column;
  }

  .gate-row button {
    width: 100%;
    height: 44px;
  }
}
