:root {
  color: #21352e;
  background: #f3f2ec;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --forest: #203c32;
  --ink: #21352e;
  --muted: #728078;
  --line: #dde2dc;
  --accent: #d8ef80;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f3f2ec;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 78% 8%, rgba(216, 239, 128, 0.2), transparent 24rem),
    linear-gradient(180deg, #f7f6f1 0%, #f1f0ea 100%);
  padding: 24px 16px;
}

a {
  color: inherit;
}

.page-shell {
  width: min(540px, 100%);
  margin: 0 auto;
}

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

.service-card {
  min-width: 0;
  min-height: 160px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 254, 251, 0.88);
  box-shadow: 0 10px 30px rgba(31, 52, 43, 0.045);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.service-card:hover {
  border-color: #aab7ad;
  box-shadow: 0 14px 36px rgba(31, 52, 43, 0.08);
  transform: translateY(-2px);
}

.service-card-primary {
  border-color: transparent;
  color: #f6f8f4;
  background:
    radial-gradient(circle at 88% 12%, rgba(216, 239, 128, 0.2), transparent 12rem),
    var(--forest);
  box-shadow: 0 12px 34px rgba(21, 48, 38, 0.14);
}

.service-card-primary:hover {
  border-color: transparent;
  box-shadow: 0 16px 42px rgba(21, 48, 38, 0.2);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.service-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #e0e5df;
  border-radius: 9px;
  background: #f7f8f4;
}

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

.service-card-primary .service-icon {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.card-label {
  color: #87938c;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.service-card-primary .card-label {
  color: rgba(255, 255, 255, 0.6);
}

.card-content {
  margin: 16px 0 14px;
}

.card-content h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card-content p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.service-card-primary .card-content p {
  color: rgba(255, 255, 255, 0.7);
}

.card-action {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #365548;
  font-size: 11px;
  font-weight: 650;
}

.service-card-primary .card-action {
  color: var(--accent);
}

.card-action span {
  font-size: 14px;
  font-weight: 400;
  transition: transform 180ms ease;
}

.service-card:hover .card-action span {
  transform: translateX(3px);
}

.service-card:focus-visible {
  outline: 2px solid #8cab67;
  outline-offset: 3px;
}

@media (max-width: 760px) {
  body {
    padding: 20px 14px;
    align-items: center;
  }

  .page-shell {
    width: min(340px, 100%);
  }

  .service-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .service-card {
    min-height: 140px;
    padding: 16px 18px;
    border-radius: 14px;
  }

  .card-content {
    margin: 12px 0 10px;
  }
}

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

.portal-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.portal-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.portal-kicker { margin: 0 0 6px; color: var(--muted); font-size: 10px; letter-spacing: .14em; }
.portal-header h1 { margin: 0; font-size: 24px; font-weight: 600; }
.portal-session { margin: 16px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-button, .logout-button { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--forest); font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.portal-assistant-link { border-color: var(--forest); background: var(--forest); color: var(--accent); font-weight: 600; white-space: nowrap; }
.login-button:focus-visible, .logout-button:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
[hidden] { display: none !important; }

.identity-panel { width: min(540px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; background: #fffefb; color: var(--ink); box-shadow: 0 24px 64px rgb(0 0 0 / 18%); }
.identity-panel::backdrop { background: rgb(20 36 28 / 38%); }
.identity-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.identity-panel h2 { margin: 0; font-size: 17px; }
.identity-panel form { display: grid; gap: 8px; }
.identity-panel input:not([type=checkbox]), .identity-panel select { width: 100%; min-width: 0; padding: 10px; border: 1px solid #bcc9bf; border-radius: 6px; font: inherit; }
.identity-panel button { padding: 10px 14px; border: 1px solid #203c32; border-radius: 6px; background: #203c32; color: white; cursor: pointer; }
.identity-panel button:disabled { opacity: .5; cursor: wait; }
.identity-panel .identity-dialog-close { padding: 4px 10px; background: transparent; color: var(--muted); border-color: var(--line); font-size: 22px; line-height: 1.2; }
.identity-panel label { font-size: 13px; }
.identity-search-row { display: flex; gap: 8px; }
.identity-search-row button { flex-shrink: 0; }
.identity-consent { display: flex; gap: 8px; align-items: start; margin-top: 8px; }
.identity-hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
#identity-feedback { font-size: 13px; overflow-wrap: anywhere; }
