:root {
  color-scheme: light;
  --primary: #005bbf;
  --primary-hover: #1a73e8;
  --background: #f8f9fa;
  --card: #ffffff;
  --text: #191c1d;
  --secondary-text: #414754;
  --border: #e7e8e9;
  --sidebar: #031435;
  --sidebar-alt: #061625;
  --sidebar-muted: #8b9bb1;
  --sidebar-line: rgba(255, 255, 255, 0.12);
  --soft-blue: #eff6ff;
  --soft-blue-2: #f5f9ff;
  --shadow: 0 28px 80px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  text-rendering: geometricPrecision;
}

button,
a,
input,
select {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

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

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--background);
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  min-height: 720px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden auto;
  background: var(--sidebar);
  color: #ffffff;
  padding: 32px 20px 28px;
}

.sidebar-top,
.sidebar-bottom,
.sidebar-nav {
  display: grid;
}

.sidebar-top {
  gap: 34px;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.brand-copy strong {
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.brand-copy small {
  overflow: hidden;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-kicker {
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.sidebar-nav {
  gap: 6px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  padding: 0 10px;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.9);
}

.nav-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item:hover {
  border-color: var(--sidebar-line);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item.active {
  border-color: rgba(255, 255, 255, 0.42);
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.nav-item.active svg {
  color: var(--primary);
}

.nav-badge {
  display: inline-flex;
  min-width: 32px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 0 8px;
}

.sidebar-bottom {
  gap: 18px;
  margin-top: 28px;
}

.help-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--sidebar-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.help-card strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.help-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  line-height: 1.45;
}

.chat-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #0d3675;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 0 12px;
  transition: border-color 160ms ease, color 160ms ease;
}

.chat-button svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
}

.chat-button:hover {
  border-color: #c9d8ef;
  color: var(--primary-hover);
}

.logout-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 700;
}

.logout-link svg {
  width: 20px;
  height: 20px;
}

.logout-link:hover {
  color: #ffffff;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 0.86fr);
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #fbfcff 0%, #ffffff 64%, #f8f9fa 100%);
}

.institutional-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  overflow: hidden;
  background: #ffffff;
  padding: 72px clamp(52px, 7vw, 96px) 44px;
}

.institutional-copy {
  display: grid;
  gap: 26px;
  max-width: 600px;
}

.institutional-copy h1 {
  display: grid;
  gap: 5px;
  margin: 0;
  color: #071327;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.12;
}

.institutional-copy h1 span:last-child {
  color: var(--primary);
}

.institutional-copy p {
  max-width: 520px;
  margin: 0;
  color: #31415f;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.65;
}

.benefit-list {
  display: grid;
  gap: 24px;
  max-width: 560px;
}

.benefit-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.benefit-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 12px;
  background: var(--soft-blue);
  color: var(--primary);
}

.benefit-icon svg {
  width: 28px;
  height: 28px;
}

.benefit-item h2 {
  margin: 2px 0 6px;
  color: #101828;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.benefit-item p {
  margin: 0;
  color: #364764;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.connection-art {
  width: min(680px, 100%);
  margin-top: auto;
  color: var(--primary);
}

.connection-art svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.connection-art .line {
  fill: none;
  stroke: #a9caff;
  stroke-width: 1.2;
}

.connection-art .thin {
  stroke: #cfe0ff;
}

.connection-art .node {
  fill: #ffffff;
  stroke: #8db8ff;
  stroke-width: 1.4;
}

.connection-art .node.filled {
  fill: var(--primary);
  stroke: var(--primary);
}

.connection-art .mini-card {
  fill: #ffffff;
  filter: drop-shadow(0 12px 20px rgba(0, 91, 191, 0.14));
  stroke: #dbe9ff;
}

.connection-art .mini-shape {
  fill: none;
  stroke: #6fa2f7;
  stroke-width: 4;
  stroke-linecap: round;
}

.connection-art .logo-node {
  fill: var(--primary);
  filter: drop-shadow(0 16px 30px rgba(0, 91, 191, 0.28));
}

.connection-art g rect,
.connection-art g path {
  fill: none;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 11;
}

.login-panel {
  display: grid;
  min-width: 0;
  place-items: center;
  background: var(--background);
  padding: 72px clamp(36px, 6vw, 72px) 44px;
}

body[data-auth-mode="signup"] .login-panel {
  align-content: start;
  place-items: start center;
}

.login-card {
  display: grid;
  width: min(560px, 100%);
  min-height: 690px;
  align-content: center;
  justify-items: center;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 56px;
}

.login-card.is-signup {
  width: min(680px, 100%);
  min-height: 0;
  align-content: start;
  justify-items: stretch;
  padding: 42px;
}

.login-card.is-signup .login-brand {
  justify-self: center;
  margin-bottom: 24px;
}

.login-card.is-signup .login-heading {
  margin-bottom: 22px;
}

.login-brand {
  display: inline-grid;
  grid-template-columns: 56px auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.login-brand img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.login-brand strong {
  color: #071327;
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
}

.login-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 34px;
  text-align: center;
}

.login-heading h2 {
  margin: 0;
  color: #071327;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
}

.login-heading p {
  margin: 0;
  color: #354363;
  font-size: 16px;
  font-weight: 500;
}

.credential-form,
.signup-form {
  display: grid;
  width: 100%;
  gap: 14px;
}

.credential-form[hidden],
.signup-form[hidden] {
  display: none;
}

.credential-form label,
.signup-form label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.required-mark {
  color: #c2410c;
  font-size: 12px;
  font-weight: 900;
}

.signup-field-title {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.credential-form input,
.signup-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d5deea;
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  padding: 0 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-password-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.credential-form .login-password-shell input,
.signup-form .login-password-shell input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-password-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 91, 191, 0.12);
}

.login-password-shell button {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #526176;
  cursor: pointer;
}

.login-password-eye {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50% / 65%;
}

.login-password-eye::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.login-password-shell button.is-visible .login-password-eye { color: var(--primary); }

.credential-form input::placeholder,
.signup-form input::placeholder {
  color: #8b95a7;
}

.credential-form input:focus,
.signup-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 91, 191, 0.12);
}

.signup-section {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.signup-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.signup-section-title {
  color: #071327;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.signup-grid.three {
  grid-template-columns: 0.7fr 1fr 1fr;
}

.signup-service-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.signup-service-options label {
  min-height: 46px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid #d5deea;
  border-radius: 8px;
  background: #ffffff;
  padding: 0 12px;
}

.signup-service-options input {
  width: 16px;
  min-height: auto;
  height: 16px;
  padding: 0;
}

.credential-button {
  display: inline-flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  padding: 0 20px;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.credential-button:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  box-shadow: 0 12px 28px rgba(26, 115, 232, 0.14);
  transform: translateY(-1px);
}

.credential-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.login-option-divider {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: #8b95a7;
  font-size: 12px;
  font-weight: 700;
}

.login-option-divider span {
  height: 1px;
  background: var(--border);
}

.login-option-divider small {
  font: inherit;
}

.google-button {
  display: inline-flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 1px solid #d5deea;
  border-radius: 8px;
  background: #ffffff;
  color: #243b60;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  padding: 0 24px;
  transition: border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.google-button:hover {
  border-color: #bcd0ec;
  box-shadow: 0 12px 28px rgba(26, 115, 232, 0.08);
  color: #102a54;
  transform: translateY(-1px);
}

.google-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.google-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  stroke: none;
}

.login-feedback {
  min-height: 22px;
  margin: 16px 0 30px;
  color: var(--secondary-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.login-feedback[data-tone="error"] {
  color: #b42318;
}

.login-feedback[data-tone="success"] {
  color: #0969da;
}

.login-divider {
  width: 100%;
  height: 1px;
  margin-bottom: 46px;
  background: var(--border);
}

.signup-copy {
  margin: 0;
  color: #50607b;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}

.signup-copy a {
  color: var(--primary);
  font-weight: 700;
}

.signup-copy a:hover {
  color: var(--primary-hover);
}

.site-footer {
  display: flex;
  grid-column: 1 / -1;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 28px;
  border-top: 1px solid rgba(231, 232, 233, 0.8);
  background: rgba(255, 255, 255, 0.86);
  color: #74809a;
  font-size: 13px;
  font-weight: 500;
}

.site-footer a:hover {
  color: var(--primary);
}

.drawer-toggle,
.sidebar-backdrop {
  display: none;
}

@media (max-width: 1260px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .app-sidebar {
    min-height: 100vh;
    padding: 24px 12px;
  }

  .brand-lockup,
  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand-copy,
  .menu-kicker,
  .nav-item span,
  .help-card,
  .logout-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

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

  .sidebar-top {
    gap: 28px;
  }

  .nav-item {
    width: 48px;
    min-height: 48px;
    padding: 0;
  }

  .nav-badge {
    position: absolute;
    top: 2px;
    right: 1px;
    width: 9px;
    min-width: 9px;
    height: 9px;
    overflow: hidden;
    color: transparent;
    padding: 0;
  }

  .logout-link {
    width: 48px;
    min-height: 48px;
  }

  .workspace {
    grid-template-columns: minmax(380px, 1fr) minmax(360px, 0.9fr);
  }

  .institutional-panel {
    padding-inline: 44px;
  }

  .institutional-copy h1 {
    font-size: 38px;
  }

  .login-panel {
    padding-inline: 34px;
  }

  .login-card {
    min-height: 640px;
    padding: 44px;
  }
}

@media (max-width: 980px) {
  body.drawer-open {
    overflow: hidden;
  }

  .drawer-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 40;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--primary);
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.1);
  }

  body.drawer-open .drawer-toggle {
    left: min(276px, calc(100vw - 60px));
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(3, 20, 53, 0.92);
    color: #ffffff;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 28;
    display: block;
    background: rgba(3, 20, 53, 0.42);
    backdrop-filter: blur(3px);
  }

  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 32;
    width: 260px;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }

  body.drawer-open .app-sidebar {
    transform: translateX(0);
  }

  .brand-lockup {
    grid-template-columns: 40px minmax(0, 1fr);
    justify-items: start;
  }

  .brand-copy,
  .menu-kicker,
  .nav-item span,
  .help-card,
  .logout-link span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .nav-item {
    width: auto;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    justify-items: stretch;
    min-height: 42px;
    padding: 0 10px;
  }

  .nav-badge {
    position: static;
    width: auto;
    min-width: 32px;
    height: 22px;
    overflow: visible;
    color: #ffffff;
    padding: 0 8px;
  }

  .logout-link {
    width: auto;
  }

  .workspace {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .institutional-panel {
    min-height: auto;
    padding: 88px 24px 28px;
  }

  .institutional-copy,
  .benefit-list {
    max-width: none;
  }

  .login-panel {
    padding: 24px 24px 40px;
  }

  .login-card {
    width: 100%;
    min-height: auto;
    padding: 40px 28px;
  }

  .login-card.is-signup {
    padding: 34px 24px;
  }

  .login-heading {
    margin-bottom: 30px;
  }

  .site-footer {
    flex-wrap: wrap;
    gap: 12px 22px;
    padding: 18px 24px;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .institutional-panel {
    gap: 26px;
    padding-inline: 18px;
  }

  .institutional-copy h1 {
    font-size: 34px;
  }

  .institutional-copy p {
    font-size: 15px;
  }

  .benefit-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
  }

  .benefit-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }

  .connection-art {
    margin-top: 6px;
  }

  .login-panel {
    padding-inline: 18px;
  }

  .login-card {
    border-radius: 16px;
    padding: 34px 20px;
  }

  .login-card.is-signup {
    padding: 28px 18px;
  }

  .signup-grid,
  .signup-grid.three,
  .signup-service-options {
    grid-template-columns: 1fr;
  }

  .login-brand {
    grid-template-columns: 46px auto;
    gap: 12px;
    margin-bottom: 28px;
  }

  .login-brand img {
    width: 46px;
    height: 46px;
  }

  .login-brand strong {
    font-size: 32px;
  }

  .google-button {
    min-height: 56px;
    font-size: 15px;
  }

  .site-footer {
    font-size: 12px;
  }
}
