:root {
  --ink: #18211f;
  --muted: #687471;
  --line: #d9dfdc;
  --surface: #ffffff;
  --soft: #f7f1e9;
  --accent: #216e62;
  --accent-2: #c16b4b;
  --shadow: 0 18px 45px rgba(24, 33, 31, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, #f6f8f6 0%, #edf4f1 42%, #fbf2ea 100%);
  font-family: Arial, Helvetica, sans-serif;
}

.portal-shell {
  width: min(960px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 14px 18px;
  background: #17211f;
  color: #ffffff;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: #dbeaf0;
  letter-spacing: 3px;
  line-height: 1;
  white-space: nowrap;
}

.logo-word {
  font-size: 30px;
  font-weight: 700;
}

.logo-script {
  position: relative;
  top: -1px;
  margin: 0 -1px 0 1px;
  color: #4a91b3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 58px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.portal-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
}

.portal-user button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.portal-intro {
  margin: 30px 0 18px;
}

.eyebrow,
.tool-kicker {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-intro h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 56px);
  line-height: 1;
}

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

.portal-tools {
  display: grid;
  gap: 22px;
}

.tool-section {
  display: grid;
  gap: 10px;
}

.tool-section-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.compact-tool-grid {
  grid-template-columns: minmax(0, 1fr);
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(280px, 560px);
  gap: 10px;
  align-items: start;
  justify-content: end;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.portal-button {
  min-height: 44px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.portal-message {
  min-height: 18px;
  margin: -10px 0 0;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

.tool-card {
  display: grid;
  gap: 10px;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.tool-card strong {
  font-size: 26px;
  line-height: 1.05;
}

.tool-card span:last-child {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.primary-tool {
  border-color: rgba(33, 110, 98, 0.45);
  background: #eef7f3;
}

.tool-card[aria-disabled="true"] {
  color: #4d5a57;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .portal-shell {
    width: 100%;
    padding: 0 0 24px;
  }

  .portal-header {
    min-height: 64px;
    padding: 10px 12px;
  }

  .brand-logo {
    letter-spacing: 1px;
  }

  .logo-word {
    font-size: 19px;
  }

  .logo-script {
    font-size: 34px;
  }

  .portal-user {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .portal-intro {
    margin: 22px 14px 14px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .portal-tools {
    gap: 18px;
    margin: 0 14px;
  }

  .tool-section-header h2 {
    font-size: 20px;
  }

  .login-panel {
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 0 14px 14px;
    padding: 16px;
    border-radius: 8px;
  }

  .portal-message {
    grid-column: auto;
  }

  .tool-card {
    min-height: 150px;
    padding: 16px;
    border-radius: 8px;
  }
}
