:root {
  --portal-ink: #17212b;
  --portal-muted: #647184;
  --portal-line: #d9e1e8;
  --portal-bg: #f4f7f9;
  --portal-teal: #087f75;
  --portal-blue: #2866b1;
  --portal-orange: #b85c1c;
  --portal-rose: #b33b62;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

body.portal-body {
  background: var(--portal-bg);
  color: var(--portal-ink);
  font-family: Inter, "Noto Sans JP", system-ui, -apple-system, sans-serif;
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.portal-auth {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.portal-auth-panel {
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  max-width: 460px;
  padding: 32px;
  width: 100%;
}

.portal-auth-brand,
.portal-brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.portal-logo {
  background: #fff;
  border-radius: 8px;
  display: block;
  flex: 0 0 auto;
  height: 42px;
  object-fit: contain;
  padding: 3px;
  width: 42px;
}

.portal-auth-brand > div,
.portal-brand > div {
  display: grid;
  gap: 2px;
}

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

.portal-auth-brand span {
  color: var(--portal-muted);
  font-size: 11px;
  font-weight: 700;
}

.portal-auth-panel h1 {
  font-size: 28px;
  margin: 8px 0 12px;
}

.portal-auth-panel p {
  color: var(--portal-muted);
  line-height: 1.7;
}

.portal-primary,
.portal-open-button {
  background: var(--portal-teal);
  border: 1px solid var(--portal-teal);
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-height: 44px;
  padding: 10px 18px;
}

.portal-secondary {
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 7px;
  color: var(--portal-ink);
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 8px 14px;
}

.portal-full {
  width: 100%;
}

.portal-header {
  align-items: center;
  background: #111a25;
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px max(24px, calc((100vw - 1180px) / 2));
}

.portal-brand {
  color: #fff;
}

.portal-brand strong {
  font-size: 18px;
}

.portal-brand div span {
  color: #a9b6c6;
  font-size: 11px;
  font-weight: 700;
}

.portal-account {
  align-items: center;
  display: flex;
  gap: 14px;
}

.portal-account > div {
  display: grid;
  gap: 2px;
  text-align: right;
}

.portal-account small {
  color: #a9b6c6;
}

.portal-main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 40px 24px 72px;
}

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

.portal-eyebrow {
  color: var(--portal-teal);
  font-size: 12px;
  font-weight: 900;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.portal-intro h1 {
  font-size: 34px;
  margin: 0 0 10px;
}

.portal-intro > div > p:last-child {
  color: var(--portal-muted);
  line-height: 1.7;
  margin: 0;
}

.portal-summary {
  display: flex;
  gap: 10px;
}

.portal-summary div {
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 7px;
  min-width: 108px;
  padding: 12px 14px;
}

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

.portal-summary strong {
  font-size: 22px;
}

.portal-summary span {
  color: var(--portal-muted);
  font-size: 11px;
  margin-top: 3px;
}

.portal-service-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.portal-service {
  background: #fff;
  border: 1px solid var(--portal-line);
  border-top: 4px solid var(--portal-teal);
  border-radius: 8px;
  display: grid;
  gap: 22px;
  min-height: 410px;
  padding: 22px;
}

.portal-service-lpo {
  border-top-color: var(--portal-blue);
}

.portal-service-push {
  border-top-color: var(--portal-orange);
}

.portal-service-threads_writer {
  border-top-color: var(--portal-rose);
}

.portal-service-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.portal-service-mark {
  color: var(--portal-teal);
  font-size: 12px;
  font-weight: 900;
}

.portal-service-lpo .portal-service-mark {
  color: var(--portal-blue);
}

.portal-service-push .portal-service-mark {
  color: var(--portal-orange);
}

.portal-service-threads_writer .portal-service-mark {
  color: var(--portal-rose);
}

.portal-count {
  background: #edf2f5;
  border-radius: 4px;
  color: var(--portal-muted);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 7px;
}

.portal-service h2 {
  font-size: 22px;
  margin: 0 0 8px;
}

.portal-service p {
  color: var(--portal-muted);
  line-height: 1.6;
  margin: 0;
}

.portal-site-preview {
  border-top: 1px solid var(--portal-line);
  list-style: none;
  margin: 0;
  padding: 10px 0 0;
}

.portal-site-preview li {
  border-bottom: 1px solid #edf1f4;
  display: grid;
  gap: 2px;
  padding: 9px 0;
}

.portal-site-preview span {
  font-size: 13px;
  font-weight: 700;
}

.portal-site-preview small,
.portal-more {
  color: var(--portal-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.portal-open-button {
  align-self: end;
  width: 100%;
}

.portal-service-lpo .portal-open-button {
  background: var(--portal-blue);
  border-color: var(--portal-blue);
}

.portal-service-push .portal-open-button {
  background: var(--portal-orange);
  border-color: var(--portal-orange);
}

.portal-service-threads_writer .portal-open-button {
  background: var(--portal-rose);
  border-color: var(--portal-rose);
}

.portal-status {
  color: var(--portal-muted);
  font-size: 12px;
  margin: 18px 0 0;
  min-height: 20px;
}

.portal-empty {
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: 32px;
}

.portal-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(14, 24, 36, 0.25);
  max-width: 560px;
  padding: 0;
  width: calc(100% - 32px);
}

.portal-dialog::backdrop {
  background: rgba(15, 25, 36, 0.58);
}

.portal-dialog form {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.portal-dialog h2 {
  font-size: 22px;
  margin: 0 0 6px;
}

.portal-dialog p {
  color: var(--portal-muted);
  line-height: 1.6;
  margin: 0;
}

.portal-site-picker {
  display: grid;
  gap: 8px;
}

.portal-site-option {
  align-items: center;
  border: 1px solid var(--portal-line);
  border-radius: 7px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr;
  padding: 13px 14px;
}

.portal-site-option:has(input:checked) {
  background: #eff8f6;
  border-color: var(--portal-teal);
}

.portal-site-option span {
  display: grid;
  gap: 3px;
}

.portal-site-option small {
  color: var(--portal-muted);
}

.portal-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .portal-header,
  .portal-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-header {
    gap: 12px;
  }

  .portal-account {
    justify-content: space-between;
  }

  .portal-account > div {
    text-align: left;
  }

  .portal-main {
    padding: 28px 18px 56px;
  }

  .portal-intro h1 {
    font-size: 28px;
  }

  .portal-summary {
    width: 100%;
  }

  .portal-summary div {
    flex: 1;
  }

  .portal-service-grid {
    grid-template-columns: 1fr;
  }

  .portal-service {
    min-height: 0;
  }
}
