:root {
  --bg: #eef3ff;
  --bg-deep: #0f1f63;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --line: rgba(28, 58, 140, 0.12);
  --line-strong: rgba(28, 58, 140, 0.2);
  --ink: #13245e;
  --muted: #68779f;
  --primary: #3556ff;
  --primary-strong: #1730b8;
  --secondary: #00c7d8;
  --secondary-soft: #dffbff;
  --success: #16b57f;
  --warning: #ff8f42;
  --danger: #e54f68;
  --shadow: 0 20px 60px rgba(14, 28, 84, 0.12);
  --shadow-soft: 0 12px 36px rgba(14, 28, 84, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Verdana", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(53, 86, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(0, 199, 216, 0.2), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

button,
input,
textarea {
  font: inherit;
}

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

.icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.app-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.loading-card {
  width: min(420px, 100%);
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.loading-orbit {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 4px solid rgba(53, 86, 255, 0.14);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(320px, 0.85fr);
}

.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 48px 56px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.2), transparent 32%),
    radial-gradient(circle at 80% 24%, rgba(0, 199, 216, 0.3), transparent 28%),
    linear-gradient(135deg, #07134c 0%, #1730b8 52%, #2868ff 100%);
  color: #f8fbff;
}

.auth-hero::before,
.auth-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
}

.auth-hero::before {
  right: -100px;
  bottom: -80px;
  width: 320px;
  height: 320px;
  background: rgba(0, 199, 216, 0.22);
}

.auth-hero::after {
  left: -70px;
  top: 140px;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.08);
}

.brand-stack {
  position: relative;
  z-index: 1;
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: "Aptos Display", "Trebuchet MS", sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
}

.brand-mark span:last-child {
  color: #7cf0ff;
}

.brand-subtitle {
  margin: 8px 0 0;
  color: rgba(248, 251, 255, 0.8);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 580px;
  margin-top: 72px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(248, 251, 255, 0.88);
  font-size: 0.9rem;
}

.auth-copy h1 {
  margin: 18px 0 16px;
  font-family: "Aptos Display", "Trebuchet MS", sans-serif;
  font-size: clamp(2.2rem, 4vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.auth-copy p {
  margin: 0;
  max-width: 520px;
  color: rgba(248, 251, 255, 0.84);
  font-size: 1.05rem;
  line-height: 1.7;
}

.auth-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.auth-stat {
  position: relative;
  z-index: 1;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  background: rgba(8, 17, 64, 0.28);
  backdrop-filter: blur(20px);
}

.auth-stat strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.auth-stat span {
  color: rgba(248, 251, 255, 0.75);
  line-height: 1.5;
  font-size: 0.95rem;
}

.auth-card-wrap {
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-card {
  width: min(470px, 100%);
  padding: 34px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(19, 36, 94, 0.08);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 0;
  font-family: "Aptos Display", "Trebuchet MS", sans-serif;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.auth-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #31406f;
}

.field-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7faff;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.field-control:focus-within {
  border-color: rgba(53, 86, 255, 0.32);
  box-shadow: 0 0 0 4px rgba(53, 86, 255, 0.08);
  transform: translateY(-1px);
}

.field-control input {
  width: 100%;
  padding: 16px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.field-control .icon {
  color: var(--primary);
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
  padding: 15px 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary) 0%, #6474ff 100%);
  box-shadow: 0 14px 30px rgba(53, 86, 255, 0.24);
  font-weight: 700;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.75;
  cursor: wait;
}

.secondary-button {
  padding: 13px 16px;
  color: var(--primary);
  background: rgba(53, 86, 255, 0.08);
  font-weight: 700;
}

.ghost-button {
  padding: 10px 14px;
  background: rgba(19, 36, 94, 0.05);
  color: var(--ink);
}

.auth-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef7ff 100%);
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.94rem;
}

.message {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.94rem;
  line-height: 1.5;
}

.message-error {
  background: rgba(229, 79, 104, 0.1);
  color: #a0243d;
  border: 1px solid rgba(229, 79, 104, 0.16);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
  border-right: 1px solid rgba(19, 36, 94, 0.08);
  box-shadow: 8px 0 32px rgba(14, 28, 84, 0.05);
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border-radius: 26px;
  color: #ffffff;
  background: linear-gradient(160deg, #091349 0%, #1530b2 55%, #1766ff 100%);
  box-shadow: 0 18px 36px rgba(12, 29, 94, 0.24);
}

.sidebar-brand .brand-mark {
  font-size: 2rem;
}

.sidebar-brand small {
  color: rgba(248, 251, 255, 0.82);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-scroll {
  overflow: auto;
  margin-top: 22px;
  padding-right: 4px;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section h3 {
  margin: 0 0 10px;
  color: #7a86aa;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 18px;
  color: #31406f;
  transition: background 150ms ease, transform 150ms ease, color 150ms ease;
}

.nav-link:hover {
  background: rgba(53, 86, 255, 0.07);
  color: var(--ink);
}

.nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #3556ff 0%, #6a62ff 100%);
  box-shadow: 0 12px 28px rgba(53, 86, 255, 0.22);
}

.nav-link .icon {
  width: 20px;
  height: 20px;
}

.role-card {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  border: 1px solid rgba(19, 36, 94, 0.08);
}

.role-card strong {
  font-size: 1rem;
}

.role-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 181, 127, 0.12);
}

.main-panel {
  min-width: 0;
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(19, 36, 94, 0.06);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.topbar-search {
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
}

.search-panel {
  position: absolute;
  inset: calc(100% + 10px) 0 auto;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(19, 36, 94, 0.08);
  box-shadow: var(--shadow);
}

.search-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 6px 6px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.search-result-list {
  display: grid;
  gap: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  transition: background 150ms ease;
}

.search-result:hover {
  background: rgba(53, 86, 255, 0.06);
}

.search-result small,
.meta-text {
  color: var(--muted);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 8px;
  border-radius: 18px;
  background: rgba(53, 86, 255, 0.06);
}

.avatar {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  font-weight: 800;
}

.page {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.hero-card,
.surface-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid rgba(19, 36, 94, 0.08);
  box-shadow: var(--shadow-soft);
}

.hero-card {
  background:
    radial-gradient(circle at top right, rgba(0, 199, 216, 0.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(106, 98, 255, 0.14), transparent 26%),
    linear-gradient(135deg, #ffffff 0%, #f5f8ff 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 20px;
}

.hero-copy h1,
.page-header h1,
.hero-copy h2 {
  margin: 0;
  font-family: "Aptos Display", "Trebuchet MS", sans-serif;
  letter-spacing: -0.05em;
}

.hero-copy h1 {
  font-size: clamp(2rem, 3vw, 3.1rem);
  line-height: 1.02;
}

.hero-copy p,
.page-header p,
.card-copy p,
.list-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-kicker,
.section-header span,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.hero-kicker {
  margin-bottom: 14px;
  background: rgba(53, 86, 255, 0.08);
  color: var(--primary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-art {
  display: grid;
  gap: 14px;
  align-content: center;
}

.mascot-card {
  position: relative;
  min-height: 320px;
  padding: 24px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(21, 48, 178, 0.9) 0%, rgba(54, 86, 255, 0.72) 100%);
  color: #ffffff;
}

.mascot-card::before {
  content: "";
  position: absolute;
  inset: auto 24px 24px auto;
  width: 140px;
  height: 140px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(12deg);
}

.mascot-card::after {
  content: "";
  position: absolute;
  inset: 30px auto auto 24px;
  width: 88px;
  height: 88px;
  border-radius: 24px;
  background: rgba(124, 240, 255, 0.24);
}

.mascot-figure {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 210px;
  height: 220px;
  border-radius: 28px 28px 18px 18px;
  background:
    radial-gradient(circle at 50% 20%, #ffd3b6 0 18%, transparent 18%),
    radial-gradient(circle at 50% 16%, #402459 0 22%, transparent 22%),
    linear-gradient(180deg, transparent 0 26%, #5127c8 26% 68%, #2b226b 68% 100%);
  box-shadow: inset 0 -14px 0 rgba(255, 255, 255, 0.06);
}

.mascot-laptop {
  position: absolute;
  left: 20px;
  bottom: 30px;
  width: 140px;
  height: 82px;
  border-radius: 16px 16px 10px 10px;
  background: linear-gradient(180deg, #dfe6ff 0%, #b0bce8 100%);
  transform: skew(-8deg);
}

.floating-badges {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  max-width: 210px;
}

.floating-badge {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
}

.floating-badge strong {
  display: block;
  margin-bottom: 4px;
}

.stats-grid,
.grid-4,
.grid-3,
.grid-2 {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

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

.stat-card,
.tool-card,
.learning-card,
.announcement-card,
.placeholder-card,
.product-card,
.detail-card {
  padding: 20px;
  border-radius: 22px;
  background: var(--surface-strong);
  border: 1px solid rgba(19, 36, 94, 0.08);
  box-shadow: var(--shadow-soft);
}

.stat-card strong,
.tool-card strong,
.learning-card strong,
.announcement-card strong,
.detail-card strong {
  display: block;
}

.stat-card .stat-value {
  margin-top: 12px;
  font-family: "Aptos Display", "Trebuchet MS", sans-serif;
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.section-header,
.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.page-header {
  align-items: start;
}

.section-header h2,
.page-header h1 {
  font-size: clamp(1.7rem, 2.5vw, 2.4rem);
}

.section-header p,
.page-header p {
  margin: 8px 0 0;
  max-width: 780px;
}

.product-card {
  color: #ffffff;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(160deg, #3556ff 0%, #1730b8 100%);
}

.product-card.accent-emerald {
  background: linear-gradient(160deg, #0ba97a 0%, #066a68 100%);
}

.product-card.accent-violet {
  background: linear-gradient(160deg, #6c4bf7 0%, #2a2d8f 100%);
}

.product-card.accent-sunset {
  background: linear-gradient(160deg, #ff4c5d 0%, #c80f1f 100%);
}

.product-card.accent-ocean {
  background: linear-gradient(160deg, #2f74ff 0%, #1730b8 100%);
}

.product-card p,
.product-card .meta-text {
  color: rgba(255, 255, 255, 0.84);
}

.product-card .secondary-button {
  align-self: start;
  color: #0f1f63;
  background: #ffffff;
}

.tool-card {
  display: grid;
  gap: 14px;
}

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

.tool-index,
.pill {
  color: var(--primary);
  background: rgba(53, 86, 255, 0.08);
}

.tool-index {
  min-width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 800;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-success {
  color: var(--success);
  background: rgba(22, 181, 127, 0.1);
}

.pill-warning {
  color: var(--warning);
  background: rgba(255, 143, 66, 0.12);
}

.pill-neutral {
  color: #4b5a87;
  background: rgba(19, 36, 94, 0.07);
}

.announcement-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.announcement-label {
  align-self: start;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary) 0%, #6a62ff 100%);
}

.learning-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.help-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border-radius: 24px;
  color: #ffffff;
  background:
    radial-gradient(circle at right center, rgba(255, 255, 255, 0.14), transparent 24%),
    linear-gradient(135deg, #091349 0%, #1530b2 58%, #0087ff 100%);
}

.list-grid {
  display: grid;
  gap: 14px;
}

.list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(19, 36, 94, 0.08);
  box-shadow: var(--shadow-soft);
}

.list-copy strong {
  display: block;
  margin-bottom: 6px;
}

.placeholder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}

.placeholder-actions {
  display: grid;
  gap: 12px;
}

.placeholder-action {
  padding: 16px;
  border-radius: 18px;
  background: rgba(53, 86, 255, 0.05);
  color: var(--ink);
}

.section-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.section-list .pill {
  justify-content: center;
  padding: 14px 16px;
}

.empty-state {
  padding: 26px;
  border-radius: 22px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  border: 1px dashed rgba(19, 36, 94, 0.15);
}

.auth-shell {
  grid-template-columns: minmax(320px, 0.96fr) minmax(360px, 0.74fr);
}

.auth-hero {
  padding: 42px 48px;
}

.auth-copy {
  max-width: 540px;
  margin-top: 46px;
}

.auth-copy h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
}

.auth-copy p {
  max-width: 560px;
}

.auth-card-wrap {
  padding: 24px 40px;
}

.auth-card {
  width: min(460px, 100%);
}

.auth-utility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.auth-utility-grid .auth-stat {
  min-height: 100%;
  padding: 16px;
}

.shell {
  grid-template-columns: 284px minmax(0, 1fr);
}

.sidebar {
  padding: 18px;
}

.sidebar-brand {
  padding: 18px;
}

.sidebar-scroll {
  margin-top: 18px;
}

.nav-link {
  padding: 12px 13px;
}

.role-card {
  padding: 16px;
}

.main-panel {
  padding: 20px;
}

.topbar {
  gap: 12px;
  padding: 10px 12px;
}

.search-box {
  min-height: 52px;
}

.search-box:focus-within {
  border-color: rgba(53, 86, 255, 0.28);
  box-shadow: 0 0 0 4px rgba(53, 86, 255, 0.08);
}

.topbar-actions {
  gap: 10px;
}

.topbar-menu {
  position: relative;
}

.topbar-menu summary {
  list-style: none;
}

.topbar-menu summary::-webkit-details-marker {
  display: none;
}

.topbar-summary-button {
  position: relative;
}

.notification-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary) 0%, #6a62ff 100%);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(53, 86, 255, 0.2);
}

.topbar-help-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding-inline: 14px;
}

.profile-summary {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #ffffff;
  cursor: pointer;
  transition: box-shadow 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.profile-summary:hover,
.topbar-menu[open] .profile-summary,
.topbar-menu[open] .topbar-summary-button {
  border-color: rgba(53, 86, 255, 0.2);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.profile-summary-icon {
  color: var(--muted);
}

.topbar-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 40px));
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(19, 36, 94, 0.08);
  box-shadow: var(--shadow);
  z-index: 15;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 12px;
}

.popover-header strong,
.popover-card strong,
.popover-item strong {
  display: block;
}

.popover-header small,
.popover-card small,
.popover-item small,
.tool-preview-item span {
  color: var(--muted);
}

.popover-list {
  display: grid;
  gap: 10px;
}

.popover-card,
.popover-item {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(19, 36, 94, 0.08);
  background: #ffffff;
}

.popover-card p,
.popover-item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.popover-item.is-disabled {
  background: linear-gradient(180deg, #fbfcff 0%, #f5f8ff 100%);
}

.popover-item-button {
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.popover-item-button span,
.popover-item a span {
  color: inherit;
}

.popover-item-danger {
  color: #9d2843;
  background: rgba(229, 79, 104, 0.08);
}

.popover-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 12px 10px;
  text-align: center;
  color: var(--muted);
}

.popover-empty .icon {
  width: 34px;
  height: 34px;
  color: var(--primary);
}

.page {
  gap: 18px;
  margin-top: 16px;
}

.surface-card,
.hero-card {
  padding: 18px;
}

.section-header-compact {
  align-items: start;
}

.section-header-compact h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.section-header-compact p {
  margin-top: 6px;
}

.workspace-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(0, 199, 216, 0.15), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 248, 255, 0.98) 100%);
  border: 1px solid rgba(19, 36, 94, 0.08);
  box-shadow: var(--shadow-soft);
}

.workspace-hero-copy h1 {
  margin: 8px 0 8px;
  font-family: "Aptos Display", "Trebuchet MS", sans-serif;
  font-size: clamp(1.45rem, 1.95vw, 1.8rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.workspace-hero-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.workspace-hero-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 270px;
}

.hero-status-badge,
.hero-status-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(53, 86, 255, 0.08);
  color: #395091;
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-status-link {
  background: rgba(19, 36, 94, 0.06);
}

.section-priority {
  border-color: rgba(53, 86, 255, 0.14);
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.tool-launcher-card {
  width: 100%;
  min-height: 156px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(19, 36, 94, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.tool-launcher-card:hover,
.tool-launcher-card:focus-visible,
.tool-launcher-card.is-selected {
  transform: translateY(-2px);
  border-color: rgba(53, 86, 255, 0.2);
  box-shadow: 0 16px 34px rgba(14, 28, 84, 0.1);
  outline: none;
}

.tool-launcher-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tool-launcher-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--primary);
  background: rgba(53, 86, 255, 0.08);
}

.tool-launcher-index {
  color: #6a78a4;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.tool-launcher-copy strong {
  display: block;
  margin-bottom: 4px;
}

.tool-launcher-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
  font-size: 0.86rem;
}

.tool-launcher-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tool-launcher-action {
  color: #4b5a87;
  font-size: 0.9rem;
  font-weight: 700;
}

.tool-state-active .tool-launcher-icon {
  color: var(--success);
  background: rgba(22, 181, 127, 0.12);
}

.tool-state-coming_soon .tool-launcher-icon,
.tool-state-coming-soon .tool-launcher-icon {
  color: var(--warning);
  background: rgba(255, 143, 66, 0.12);
}

.tool-state-restricted .tool-launcher-icon {
  color: var(--danger);
  background: rgba(229, 79, 104, 0.12);
}

.tool-state-disabled {
  background: linear-gradient(180deg, #fcfdff 0%, #f6f8fc 100%);
}

.tool-state-disabled .tool-launcher-icon {
  color: #8090ba;
  background: rgba(19, 36, 94, 0.07);
}

.tool-preview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(245, 248, 255, 0.95) 0%, rgba(255, 255, 255, 0.95) 100%);
  border: 1px solid rgba(53, 86, 255, 0.12);
}

.tool-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-preview-header h3 {
  margin: 6px 0 0;
  font-size: 1.3rem;
}

.tool-preview-copy p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.tool-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.tool-preview-item {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(19, 36, 94, 0.08);
}

.tool-preview-item strong {
  display: block;
  margin-top: 4px;
}

.tool-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.product-card-compact {
  min-height: 188px;
}

.product-card-compact .secondary-button {
  min-height: 44px;
}

.help-banner-compact {
  padding: 20px 22px;
}

.empty-state-strong {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 34px 26px;
  text-align: center;
}

.empty-state-strong h1 {
  margin: 0;
  font-family: "Aptos Display", "Trebuchet MS", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}

.empty-state-strong p {
  margin: 0;
  max-width: 620px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  display: inline-grid;
  place-items: center;
  border-radius: 22px;
  color: var(--primary);
  background: rgba(53, 86, 255, 0.08);
}

.empty-state-icon .icon {
  width: 30px;
  height: 30px;
}

.empty-state-detail {
  display: grid;
  gap: 4px;
}

.empty-state-detail span {
  color: var(--muted);
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.pill-danger {
  color: var(--danger);
  background: rgba(229, 79, 104, 0.12);
}

.sidebar-backdrop {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

  .auth-utility-grid,
  .launcher-grid,
  .tool-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3,
  .placeholder-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1040px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(320px, calc(100vw - 24px));
    transform: translateX(-110%);
    transition: transform 180ms ease;
  }

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

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    background: rgba(9, 19, 73, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .sidebar-backdrop.sidebar-open {
    opacity: 1;
    pointer-events: auto;
  }

  .main-panel {
    padding: 18px;
  }

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

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .hero-grid,
  .workspace-hero,
  .tool-preview-card,
  .help-banner {
    grid-template-columns: 1fr;
  }

  .workspace-hero-status {
    justify-content: flex-start;
    max-width: none;
  }

  .tool-preview-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    padding: 40px 28px 24px;
  }

  .auth-card-wrap {
    padding: 24px;
  }

  .auth-card {
    padding: 26px;
  }

  .auth-panel-grid,
  .auth-utility-grid,
  .stats-grid,
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .launcher-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-header,
  .page-header,
  .list-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .profile-summary {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  .topbar,
  .hero-card,
  .surface-card,
  .product-card,
  .tool-card,
  .learning-card,
  .announcement-card,
  .placeholder-card,
  .detail-card,
  .stat-card {
    border-radius: 20px;
  }

  .hero-copy h1 {
    font-size: 1.8rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .launcher-grid,
  .tool-preview-grid {
    grid-template-columns: 1fr;
  }

  .workspace-hero {
    padding: 18px;
  }

  .workspace-hero-copy h1 {
    font-size: 1.45rem;
  }
}
