:root {
  --bg: #f8fafc;
  --bg-soft: #eef4fb;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-light: #ffffff;
  --surface-card: #ffffff;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(43, 130, 255, 0.28);
  --text: #112138;
  --text-dark: #0f172a;
  --muted: #60708a;
  --brand: #1fb6ff;
  --brand-strong: #1167f1;
  --accent: #1167f1;
  --danger: #d9485f;
  --good: #5bf2b3;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(31, 182, 255, 0.08), transparent 26%),
    radial-gradient(circle at 0% 10%, rgba(17, 103, 241, 0.08), transparent 22%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  color: var(--text);
  font-family: "Plus Jakarta Sans", sans-serif;
}

body {
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

#app {
  min-height: 100vh;
}

.loading-screen,
.auth-shell,
.shell {
  min-height: 100vh;
}

.loading-screen {
  display: grid;
  place-items: center;
  gap: 16px;
}

.spinner {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

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

.auth-shell {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  padding: 28px;
}

.auth-hero,
.auth-panel {
  position: relative;
}

.auth-hero,
.panel-card,
.sidebar,
.workspace {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-hero {
  overflow: hidden;
  border-radius: 36px;
  padding: 56px;
  background: linear-gradient(180deg, #ffffff, #f4f9ff);
}

.hero-gradient {
  position: absolute;
  inset: auto -12% -30% auto;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(57, 216, 255, 0.4) 0%, rgba(43, 130, 255, 0.12) 38%, transparent 65%);
  filter: blur(6px);
}

.hero-logo {
  width: 180px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-hero h1,
.topbar h2,
.brand-block h1,
.panel-card h3,
.panel-card h2 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  letter-spacing: -0.03em;
}

.auth-hero h1 {
  max-width: 680px;
  font-size: clamp(2.4rem, 4vw, 4.4rem);
  line-height: 0.98;
}

.auth-hero p:not(.eyebrow) {
  max-width: 620px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-badges,
.badge-row,
.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-badges span,
.badge-row span,
.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: #ffffff;
  font-size: 0.88rem;
}

.auth-panel {
  display: grid;
  align-content: center;
  gap: 20px;
}

.panel-card {
  border-radius: var(--radius-lg);
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  backdrop-filter: blur(16px);
}

.panel-card.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 248, 255, 0.98));
}

.panel-card p {
  color: var(--muted);
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.form-grid label span {
  font-size: 0.9rem;
  color: var(--text-dark);
  font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #ffffff;
  color: var(--text-dark);
  resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: 2px solid rgba(57, 216, 255, 0.35);
  border-color: var(--line-strong);
}

.span-2 {
  grid-column: span 2;
}

.primary-button,
.secondary-button,
.ghost-button,
.nav-item {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.nav-item:hover,
.matter-item:hover,
.clickable-row:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #021220;
  font-weight: 800;
}

.secondary-button {
  background: rgba(17, 103, 241, 0.08);
  border: 1px solid var(--line-strong);
  color: var(--text-dark);
  font-weight: 700;
}

.ghost-button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text-dark);
}

.form-actions {
  grid-column: span 2;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 24px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.98);
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.brand-block h1 {
  font-size: 1.5rem;
}

.nav-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.nav-item {
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text-dark);
  display: grid;
  gap: 4px;
}

.nav-item small {
  color: var(--muted);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(31, 182, 255, 0.12), rgba(17, 103, 241, 0.12));
  border-color: var(--line-strong);
}

.sidebar-footer {
  display: grid;
  gap: 16px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid var(--line);
}

.user-chip span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #00141d;
  font-weight: 800;
}

.workspace {
  overflow: hidden;
  border-radius: 30px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.94);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar h2 {
  font-size: clamp(1.8rem, 2vw, 2.6rem);
}

.topbar-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.notice-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  font-weight: 600;
}

.notice-banner.success {
  background: rgba(91, 242, 179, 0.14);
  border-color: rgba(91, 242, 179, 0.28);
  color: #0f5132;
}

.notice-banner.error {
  background: rgba(217, 72, 95, 0.08);
  border-color: rgba(217, 72, 95, 0.2);
  color: #8a1f34;
}

.status-pill.saving {
  background: rgba(140, 243, 255, 0.18);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stat-card,
.feature-card,
.list-card,
.detail-card,
.profile-card,
.step-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.stat-card {
  padding: 22px;
  display: grid;
  gap: 8px;
}

.stat-card span,
.list-card span,
.list-card small,
.muted,
.helper-text,
.empty-state p {
  color: var(--muted);
}

.stat-card strong {
  font-family: "Outfit", sans-serif;
  font-size: 2rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

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

.feature-card,
.profile-card {
  padding: 18px;
}

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

.step-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  text-align: left;
  color: var(--text-dark);
}

.step-card span,
.guide-chip span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.step-card small {
  color: var(--muted);
  font-weight: 600;
}

.step-card.done,
.guide-chip.done {
  border-color: rgba(14, 165, 164, 0.24);
  background: linear-gradient(180deg, rgba(14, 165, 164, 0.08), rgba(56, 189, 248, 0.08));
}

.guide-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 255, 0.98));
}

.guide-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.guide-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.guide-chip strong {
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
}

.feature-card strong,
.list-card strong,
.profile-card strong,
.detail-card h4,
.panel-card h3 {
  display: block;
  margin-bottom: 6px;
}

.table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  vertical-align: top;
  color: var(--text-dark);
}

th {
  color: #5c6c84;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.clickable-row {
  cursor: pointer;
}

.helper-text {
  margin-top: 16px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.no-margin {
  margin-top: 0;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.list-stack.compact .list-card {
  padding: 14px 16px;
}

.list-card,
.detail-card {
  padding: 16px 18px;
}

.table-actions,
.matter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selectable,
.matter-item {
  width: 100%;
  text-align: left;
  color: var(--text);
}

.matter-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.matter-list {
  display: grid;
  gap: 10px;
  max-height: 980px;
  overflow: auto;
  padding-right: 4px;
}

.matter-item {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 10px;
}

.matter-item.active {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(31, 182, 255, 0.12), rgba(17, 103, 241, 0.08));
}

.matter-detail {
  display: grid;
  gap: 16px;
}

.detail-card p {
  margin: 10px 0 0;
}

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

.link-card {
  text-decoration: none;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.status-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.good::before { background: var(--good); }
.status-dot.muted::before { background: var(--muted); }

.empty-state {
  display: grid;
  gap: 8px;
  place-items: start;
  padding: 18px;
}

.divider-top {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.inline-button {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
}

.danger-button {
  color: var(--danger);
  border-color: rgba(217, 72, 95, 0.18);
}

.matter-action {
  margin-top: 6px;
  color: var(--danger);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 700;
}

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

.logo-preview-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  text-align: center;
}

.logo-preview-card img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.ecosystem-panel {
  position: relative;
  overflow: hidden;
}

.law-panel::before,
.academic-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
}

.law-panel::before {
  background: linear-gradient(180deg, #1167f1, #1fb6ff);
}

.academic-panel::before {
  background: linear-gradient(180deg, #0ea5a4, #38bdf8);
}

@media (max-width: 1280px) {
  .shell,
  .auth-shell,
  .matter-layout,
  .dual-list {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-rows: auto;
  }

  .stats-row,
  .feature-grid,
  .logo-preview-grid,
  .step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }
}

@media (max-width: 720px) {
  .auth-shell,
  .shell {
    padding: 14px;
  }

  .auth-hero,
  .workspace,
  .sidebar,
  .panel-card {
    padding: 18px;
    border-radius: 24px;
  }

  .stats-row,
  .feature-grid,
  .logo-preview-grid,
  .step-grid,
  .form-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: span 1;
  }

  .form-actions,
  .topbar {
    grid-column: span 1;
    flex-direction: column;
    align-items: stretch;
  }

  table {
    min-width: 560px;
  }
}

/* Apple-inspired visual refresh */
:root {
  --bg: #f5f5f7;
  --bg-soft: #fbfbfd;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: #ffffff;
  --surface-light: rgba(255, 255, 255, 0.9);
  --surface-card: rgba(255, 255, 255, 0.92);
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(0, 113, 227, 0.2);
  --line-hard: rgba(15, 23, 42, 0.12);
  --text: #1d1d1f;
  --text-dark: #111111;
  --muted: #6e6e73;
  --brand: #0a84ff;
  --brand-strong: #0071e3;
  --accent: #0071e3;
  --danger: #d6405c;
  --good: #16a34a;
  --shadow: 0 28px 80px rgba(15, 23, 42, 0.1);
  --shadow-card: 0 18px 42px rgba(15, 23, 42, 0.06);
  --shadow-float: 0 32px 90px rgba(15, 23, 42, 0.1);
  --radius-lg: 34px;
  --radius-md: 26px;
  --radius-sm: 18px;
}

html,
body {
  background:
    radial-gradient(circle at top left, rgba(130, 185, 255, 0.2), transparent 22%),
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.78), transparent 30%),
    linear-gradient(180deg, #fdfdfe 0%, #f2f2f7 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 38vw;
  height: 38vw;
  max-width: 520px;
  max-height: 520px;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(70px);
  opacity: 0.55;
  z-index: 0;
}

body::before {
  top: -12%;
  right: -10%;
  background: radial-gradient(circle, rgba(190, 228, 255, 0.85) 0%, rgba(214, 235, 255, 0.28) 42%, transparent 72%);
}

body::after {
  bottom: -18%;
  left: -10%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(228, 234, 244, 0.2) 44%, transparent 72%);
}

::selection {
  background: rgba(10, 132, 255, 0.18);
  color: var(--text-dark);
}

#app,
.loading-screen,
.auth-shell,
.shell {
  position: relative;
  z-index: 1;
}

.spinner {
  border: 4px solid rgba(15, 23, 42, 0.08);
  border-top-color: var(--brand);
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.14);
}

.auth-shell {
  max-width: 1680px;
  margin: 0 auto;
  gap: 22px;
  padding: 22px;
  align-items: stretch;
}

.auth-hero,
.panel-card,
.sidebar,
.workspace {
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(24px) saturate(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.08);
}

.auth-hero {
  border-radius: 42px;
  padding: clamp(40px, 5vw, 76px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(248, 248, 250, 0.96));
  isolation: isolate;
}

.auth-hero::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 28%);
  pointer-events: none;
  z-index: -1;
}

.hero-gradient {
  inset: auto -8% -24% auto;
  width: min(46vw, 520px);
  height: min(46vw, 520px);
  background: radial-gradient(circle, rgba(10, 132, 255, 0.2) 0%, rgba(146, 206, 255, 0.18) 26%, rgba(255, 255, 255, 0) 68%);
  filter: blur(14px);
}

.hero-logo {
  width: 172px;
  margin-bottom: 30px;
  filter: drop-shadow(0 16px 30px rgba(15, 23, 42, 0.08));
}

.eyebrow {
  margin: 0 0 12px;
  color: #4f7aa8;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.auth-hero h1,
.topbar h2,
.brand-block h1,
.panel-card h3,
.panel-card h2,
.stat-card strong,
.guide-chip strong {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--text-dark);
  letter-spacing: -0.05em;
}

.auth-hero h1 {
  max-width: 11.5ch;
  font-size: clamp(2.8rem, 4.8vw, 5.4rem);
  line-height: 0.9;
  font-weight: 700;
}

.auth-hero p:not(.eyebrow) {
  max-width: 58ch;
  font-size: 1.07rem;
  line-height: 1.72;
  color: var(--muted);
}

.hero-badges,
.badge-row,
.topbar-actions {
  gap: 10px;
}

.hero-badges span,
.badge-row span,
.status-pill {
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 22px rgba(15, 23, 42, 0.04);
  color: var(--text);
  font-weight: 600;
}

.auth-panel {
  gap: 18px;
}

.panel-card {
  border-radius: var(--radius-lg);
  padding: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(249, 249, 251, 0.98));
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.panel-card.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 248, 250, 0.94));
}

.panel-card p {
  color: var(--muted);
}

.form-grid {
  gap: 18px;
}

.form-grid label {
  gap: 9px;
}

.form-grid label span {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 18px;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease, background 0.22s ease;
  appearance: none;
}

.form-grid input::placeholder,
.form-grid textarea::placeholder {
  color: #96969d;
}

.form-grid input:hover,
.form-grid select:hover,
.form-grid textarea:hover {
  border-color: rgba(15, 23, 42, 0.14);
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.ghost-button:focus-visible,
.nav-item:focus-visible {
  outline: none;
  border-color: rgba(0, 113, 227, 0.24);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12), 0 16px 32px rgba(15, 23, 42, 0.08);
}

.form-grid textarea {
  min-height: 120px;
}

.form-grid input[disabled],
.form-grid select[disabled],
.form-grid textarea[disabled] {
  color: var(--muted);
  background: rgba(246, 246, 248, 0.94);
}

.primary-button,
.secondary-button,
.ghost-button,
.nav-item {
  border-radius: 18px;
  padding: 14px 20px;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.24s ease, background 0.24s ease, border-color 0.24s ease, opacity 0.24s ease;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.nav-item:hover,
.matter-item:hover,
.clickable-row:hover,
.step-card:hover,
.list-card.link-card:hover {
  transform: translateY(-2px);
}

.primary-button {
  background: linear-gradient(180deg, #1590ff 0%, #0071e3 100%);
  color: #ffffff;
  box-shadow: 0 18px 34px rgba(0, 113, 227, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.primary-button:hover {
  box-shadow: 0 22px 40px rgba(0, 113, 227, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text-dark);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.ghost-button {
  background: rgba(245, 245, 247, 0.76);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: var(--text);
}

button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-actions {
  gap: 12px;
  padding-top: 2px;
}

.shell {
  max-width: 1720px;
  margin: 0 auto;
  grid-template-columns: 308px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 18px;
  min-height: calc(100vh - 36px);
  padding: 26px;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(248, 248, 250, 0.92));
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.brand-block {
  gap: 16px;
  padding-bottom: 6px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.brand-block h1 {
  font-size: 1.48rem;
  font-weight: 650;
  line-height: 1.04;
}

.nav-list {
  gap: 12px;
}

.nav-item {
  min-height: 78px;
  align-content: center;
  text-align: left;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.nav-item span {
  font-weight: 650;
}

.nav-item small {
  color: var(--muted);
  font-size: 0.84rem;
}

.nav-item.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 255, 0.98));
  border-color: rgba(0, 113, 227, 0.15);
  box-shadow: 0 16px 30px rgba(0, 113, 227, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.sidebar-footer {
  gap: 14px;
}

.user-chip {
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.user-chip span {
  border-radius: 16px;
  background: linear-gradient(180deg, #1590ff 0%, #0071e3 100%);
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(0, 113, 227, 0.22);
}

.workspace {
  min-height: calc(100vh - 36px);
  padding: 28px;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(249, 249, 251, 0.96));
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  isolation: isolate;
}

.workspace::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 16%);
  pointer-events: none;
  z-index: -1;
}

.topbar {
  margin-bottom: 26px;
  padding: 4px 2px 2px;
  align-items: flex-end;
}

.topbar h2 {
  font-size: clamp(2rem, 2.4vw, 3rem);
  line-height: 0.95;
  font-weight: 700;
}

.topbar-copy {
  margin-top: 10px;
  max-width: 50rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.topbar-actions {
  justify-content: flex-end;
}

.status-pill {
  color: var(--text);
}

.status-pill.saving {
  background: rgba(0, 113, 227, 0.12);
  border-color: rgba(0, 113, 227, 0.16);
  color: #0057cc;
}

.notice-banner {
  margin-bottom: 20px;
  padding: 15px 18px;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.notice-banner.success {
  background: rgba(22, 163, 74, 0.09);
  border-color: rgba(22, 163, 74, 0.14);
  color: #166534;
}

.notice-banner.error {
  background: rgba(214, 64, 92, 0.08);
  border-color: rgba(214, 64, 92, 0.14);
  color: #9f1239;
}

.content-grid {
  gap: 20px;
}

.stat-card,
.feature-card,
.list-card,
.detail-card,
.profile-card,
.step-card,
.logo-preview-card {
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 249, 251, 0.98));
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.stat-card {
  padding: 24px;
  gap: 10px;
}

.stat-card span,
.list-card span,
.list-card small,
.muted,
.helper-text,
.empty-state p {
  color: var(--muted);
}

.stat-card strong {
  font-size: clamp(2.15rem, 3vw, 3rem);
  font-weight: 700;
  line-height: 0.94;
}

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

.section-head h3 {
  font-size: 1.28rem;
  font-weight: 650;
  line-height: 1.05;
}

.feature-grid,
.step-grid,
.logo-preview-grid {
  gap: 16px;
}

.feature-card,
.profile-card {
  min-height: 118px;
  padding: 20px;
}

.feature-card p,
.profile-card p {
  margin: 0;
}

.step-card {
  padding: 22px;
  color: var(--text-dark);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 247, 250, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.step-card p {
  color: var(--muted);
}

.step-card.done,
.guide-chip.done {
  background: linear-gradient(180deg, rgba(241, 248, 255, 0.96), rgba(248, 251, 255, 0.98));
  border-color: rgba(0, 113, 227, 0.16);
}

.guide-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(249, 249, 251, 0.98));
}

.guide-strip {
  gap: 10px;
}

.guide-chip {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.guide-chip strong {
  font-size: 0.98rem;
}

.feature-card strong,
.list-card strong,
.profile-card strong,
.detail-card h4,
.panel-card h3 {
  margin-bottom: 8px;
}

.table-wrap {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

table {
  min-width: 680px;
  background: transparent;
}

thead {
  background: rgba(248, 248, 250, 0.88);
}

th,
td {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

th {
  color: #8b8b92;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

tbody tr {
  transition: background 0.22s ease;
}

tbody tr:hover {
  background: rgba(0, 113, 227, 0.035);
}

.clickable-row {
  cursor: pointer;
}

.helper-text {
  font-size: 0.9rem;
  line-height: 1.68;
}

.list-stack {
  gap: 14px;
}

.list-stack.compact .list-card {
  padding: 14px 16px;
}

.list-card,
.detail-card {
  padding: 18px 20px;
}

.table-actions,
.matter-actions {
  gap: 10px;
}

.selectable,
.matter-item {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid transparent;
  border-radius: 22px;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.selectable:hover,
.matter-item:hover {
  border-color: rgba(0, 113, 227, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
}

.matter-layout {
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.matter-list {
  gap: 12px;
  padding-right: 8px;
}

.matter-item {
  padding: 18px;
}

.matter-item.active {
  border-color: rgba(0, 113, 227, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.98));
  box-shadow: 0 18px 34px rgba(0, 113, 227, 0.08);
}

.matter-detail {
  gap: 18px;
}

.detail-card p {
  line-height: 1.7;
}

.dual-list {
  gap: 18px;
}

.link-card {
  text-decoration: none;
}

.status-dot {
  gap: 10px;
}

.status-dot::before {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.04);
}

.status-dot.good::before {
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.status-dot.muted::before {
  box-shadow: 0 0 0 4px rgba(110, 110, 115, 0.08);
}

.empty-state {
  padding: 22px;
  border-radius: 22px;
  background: rgba(246, 247, 249, 0.72);
  border: 1px dashed rgba(15, 23, 42, 0.1);
}

.divider-top {
  margin-top: 22px;
  padding-top: 22px;
}

.inline-button {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.84rem;
}

.danger-button {
  color: var(--danger);
  border-color: rgba(214, 64, 92, 0.16);
  background: rgba(214, 64, 92, 0.04);
}

.matter-action {
  color: var(--danger);
  font-weight: 700;
}

.logo-preview-card {
  min-height: 168px;
  padding: 22px;
}

.logo-preview-card img {
  width: 88px;
  height: 88px;
  padding: 10px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
}

.ecosystem-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 247, 250, 0.98));
}

.law-panel::before,
.academic-panel::before {
  top: 22px;
  bottom: 22px;
  left: 0;
  width: 5px;
  border-radius: 999px;
}

.law-panel::before {
  background: linear-gradient(180deg, #0071e3, #6cbcff);
}

.academic-panel::before {
  background: linear-gradient(180deg, #16a34a, #74d890);
}

@media (max-width: 1360px) {
  .auth-shell,
  .shell,
  .matter-layout,
  .dual-list {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .workspace {
    min-height: auto;
  }

  .sidebar {
    position: relative;
    top: 0;
  }

  .stats-row,
  .feature-grid,
  .logo-preview-grid,
  .step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .topbar,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-hero h1 {
    max-width: 100%;
    font-size: clamp(2.4rem, 8vw, 4rem);
  }

  .panel-card,
  .workspace,
  .sidebar {
    padding: 22px;
  }
}

@media (max-width: 720px) {
  body::before,
  body::after {
    width: 68vw;
    height: 68vw;
    filter: blur(52px);
  }

  .auth-shell,
  .shell {
    padding: 12px;
    gap: 14px;
  }

  .auth-hero,
  .workspace,
  .sidebar,
  .panel-card {
    padding: 18px;
    border-radius: 26px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .brand-logo {
    width: 64px;
    height: 64px;
  }

  .stats-row,
  .feature-grid,
  .logo-preview-grid,
  .step-grid,
  .form-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: span 1;
  }

  table {
    min-width: 560px;
  }
}

/* Immersive full redesign */
body {
  background:
    radial-gradient(circle at 14% 12%, rgba(105, 178, 255, 0.2), transparent 18%),
    radial-gradient(circle at 88% 10%, rgba(255, 255, 255, 0.94), transparent 24%),
    radial-gradient(circle at 80% 85%, rgba(196, 229, 255, 0.2), transparent 20%),
    linear-gradient(180deg, #fafafc 0%, #eef2f7 100%);
}

body::before {
  top: -14%;
  right: -8%;
  width: 44vw;
  height: 44vw;
  max-width: 580px;
  max-height: 580px;
  background: radial-gradient(circle, rgba(179, 220, 255, 0.78) 0%, rgba(215, 236, 255, 0.3) 46%, transparent 74%);
  filter: blur(82px);
}

body::after {
  bottom: -18%;
  left: -8%;
  width: 40vw;
  height: 40vw;
  max-width: 520px;
  max-height: 520px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.98) 0%, rgba(233, 239, 248, 0.34) 44%, transparent 72%);
  filter: blur(78px);
}

.loading-screen {
  gap: 22px;
  padding: 32px;
}

.loading-screen p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.auth-shell.auth-shell-immersive {
  max-width: 1760px;
  gap: 20px;
  padding: 20px;
  align-items: stretch;
}

.auth-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 28px;
  align-items: stretch;
  min-height: calc(100vh - 40px);
  border-radius: 48px;
  padding: clamp(34px, 4vw, 58px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(247, 248, 251, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
  box-shadow:
    0 30px 90px rgba(15, 23, 42, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.hero-preview {
  position: relative;
  display: grid;
  align-items: center;
}

.hero-gradient {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-gradient.hero-gradient-primary {
  right: -6%;
  bottom: -14%;
  width: min(34vw, 440px);
  height: min(34vw, 440px);
  background: radial-gradient(circle, rgba(0, 113, 227, 0.16) 0%, rgba(135, 202, 255, 0.16) 38%, transparent 72%);
  filter: blur(18px);
}

.hero-gradient.hero-gradient-secondary {
  left: 6%;
  top: -4%;
  width: min(22vw, 280px);
  height: min(22vw, 280px);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0) 72%);
  filter: blur(10px);
}

.hero-logo {
  width: 156px;
  margin: 0;
  padding: 14px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.auth-hero .eyebrow {
  color: #45698f;
}

.auth-hero h1 {
  max-width: 12ch;
  font-size: clamp(3.2rem, 5.2vw, 6rem);
  line-height: 0.9;
  margin-top: 2px;
}

.auth-hero p:not(.eyebrow) {
  max-width: 58ch;
  font-size: 1.05rem;
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.hero-highlight {
  display: grid;
  gap: 8px;
  padding: 18px 18px 20px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

.hero-highlight strong {
  font-size: 1rem;
  color: var(--text-dark);
}

.hero-highlight span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.hero-window {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 248, 251, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    0 28px 70px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.hero-window::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 24%);
  pointer-events: none;
}

.hero-window-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.window-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
}

.window-dot.red { background: #ff5f57; }
.window-dot.amber { background: #febb2e; }
.window-dot.green { background: #28c840; }

.hero-window-body {
  display: grid;
  gap: 14px;
}

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

.hero-window-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.hero-window-card.primary {
  padding: 22px;
  background: linear-gradient(180deg, rgba(244, 249, 255, 0.96), rgba(255, 255, 255, 0.8));
  border-color: rgba(0, 113, 227, 0.1);
}

.hero-window-card span,
.hero-window-card small {
  color: var(--muted);
}

.hero-window-card strong {
  color: var(--text-dark);
  font-size: 1.04rem;
  line-height: 1.35;
}

.hero-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-metric-strip div {
  display: grid;
  gap: 6px;
  padding: 16px 14px;
  border-radius: 22px;
  background: rgba(248, 249, 252, 0.86);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.hero-metric-strip strong {
  font-size: 1.55rem;
  line-height: 1;
  color: var(--text-dark);
}

.hero-metric-strip span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.hero-badges.compact {
  gap: 8px;
}

.hero-badges.compact span {
  padding: 9px 12px;
  font-size: 0.82rem;
}

.auth-panel {
  gap: 16px;
  align-content: center;
}

.auth-login-card,
.auth-support-card,
.auth-trust-card {
  border-radius: 34px;
}

.auth-login-card {
  padding: 32px;
}

.auth-login-card h2,
.auth-support-card h2,
.auth-trust-card h3 {
  font-size: 1.7rem;
  line-height: 1;
}

.auth-trust-card p:last-of-type {
  margin-bottom: 0;
}

.shell {
  max-width: 1760px;
  margin: 0 auto;
  grid-template-columns: 322px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.shell-ambient {
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.78;
  z-index: 0;
}

.shell-ambient-a {
  top: 30px;
  right: 14%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(175, 219, 255, 0.42) 0%, rgba(175, 219, 255, 0) 72%);
}

.shell-ambient-b {
  bottom: 80px;
  left: 6%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0) 72%);
}

.shell > :not(.shell-ambient) {
  position: relative;
  z-index: 1;
}

.sidebar {
  min-height: calc(100vh - 36px);
  padding: 24px;
  border-radius: 38px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(248, 249, 251, 0.94));
}

.sidebar-top {
  display: grid;
  gap: 18px;
}

.sidebar-context-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sidebar-context-kicker {
  color: #4a7198;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-context-card strong {
  font-size: 1.18rem;
  color: var(--text-dark);
}

.sidebar-context-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.nav-list {
  gap: 12px;
}

.nav-item {
  position: relative;
  min-height: 84px;
  padding: 16px 18px;
  border-radius: 22px;
}

.nav-item::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  transition: background 0.22s ease, transform 0.22s ease;
}

.nav-item.active::after {
  background: var(--brand);
  transform: scale(1.15);
}

.sidebar-session {
  display: grid;
  gap: 12px;
}

.connection-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-weight: 600;
}

.connection-chip.saving {
  color: #0057cc;
}

.connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #1fc77d;
  box-shadow: 0 0 0 4px rgba(31, 199, 125, 0.16);
}

.connection-chip.saving .connection-dot {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.16);
}

.workspace {
  min-height: calc(100vh - 36px);
  padding: 18px 20px 24px;
  border-radius: 38px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(249, 249, 251, 0.96));
}

.workspace-chrome {
  display: flex;
  gap: 8px;
  margin: 2px 0 18px;
}

.workspace-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 24px;
}

.topbar-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 4px;
}

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

.topbar-panel-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.topbar-panel-card span {
  color: #6d7b8a;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.topbar-panel-card strong {
  color: var(--text-dark);
  font-size: 1.08rem;
  line-height: 1.2;
}

.topbar-panel-card small {
  color: var(--muted);
  line-height: 1.5;
}

.topbar-panel-card.status {
  background: linear-gradient(180deg, rgba(245, 250, 255, 0.92), rgba(255, 255, 255, 0.8));
}

.content-grid {
  gap: 22px;
}

.panel-card {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: 28px;
}

.panel-card::before,
.stat-card::before,
.feature-card::before,
.list-card::before,
.detail-card::before,
.profile-card::before,
.step-card::before,
.logo-preview-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 20%);
  pointer-events: none;
}

.panel-card > *,
.stat-card > *,
.feature-card > *,
.list-card > *,
.detail-card > *,
.profile-card > *,
.step-card > * {
  position: relative;
  z-index: 1;
}

.stat-card {
  min-height: 170px;
  padding: 24px;
}

.stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stat-card-glow {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7cc0ff 0%, #0071e3 100%);
  box-shadow: 0 0 0 6px rgba(10, 132, 255, 0.12);
}

.stat-card strong {
  font-size: clamp(2.4rem, 3vw, 3.6rem);
}

.feature-grid {
  gap: 16px;
}

.feature-card,
.profile-card {
  min-height: 132px;
}

.list-card,
.detail-card,
.logo-preview-card {
  position: relative;
}

.list-card {
  border-radius: 24px;
}

.list-card.link-card:hover,
.step-card:hover,
.panel-card:hover .logo-preview-card,
.matter-item:hover {
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.08);
}

.empty-state {
  display: grid;
  gap: 10px;
  padding: 26px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(248, 249, 251, 0.88), rgba(242, 244, 247, 0.76));
  border: 1px dashed rgba(15, 23, 42, 0.12);
}

.empty-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #68788b;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-wrap {
  border-radius: 26px;
  overflow: hidden;
}

thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:hover td {
  background: rgba(0, 113, 227, 0.03);
}

.shell-theme-legal .stat-card-glow,
.shell-theme-legal .nav-item.active::after,
.shell-theme-legal .connection-chip.saving .connection-dot {
  background: linear-gradient(180deg, #4fa7ff 0%, #006be4 100%);
}

.shell-theme-academic .stat-card-glow,
.shell-theme-academic .nav-item.active::after {
  background: linear-gradient(180deg, #33c488 0%, #0f9f66 100%);
}

.shell-theme-academic .topbar-panel-card.status,
.shell-theme-academic .matter-item.active {
  background: linear-gradient(180deg, rgba(245, 255, 249, 0.94), rgba(255, 255, 255, 0.84));
}

.shell-theme-academic .nav-item.active,
.shell-theme-academic .guide-chip.done,
.shell-theme-academic .step-card.done {
  border-color: rgba(15, 159, 102, 0.16);
  box-shadow: 0 16px 30px rgba(15, 159, 102, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.shell-theme-admin .topbar-panel-card.status {
  background: linear-gradient(180deg, rgba(244, 247, 255, 0.96), rgba(255, 255, 255, 0.84));
}

.shell-theme-legal .topbar-panel-card.status,
.shell-theme-legal .matter-item.active {
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.96), rgba(255, 255, 255, 0.84));
}

.shell-theme-legal .nav-item.active,
.shell-theme-legal .guide-chip.done,
.shell-theme-legal .step-card.done {
  border-color: rgba(0, 113, 227, 0.14);
}

.shell-theme-admin .nav-item.active {
  border-color: rgba(15, 23, 42, 0.09);
}

.form-grid > button,
.form-grid > .primary-button,
.form-grid > .secondary-button,
.form-grid > .ghost-button {
  grid-column: span 2;
  justify-self: start;
}

@media (max-width: 1360px) {
  .auth-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-preview {
    order: 2;
  }

  .topbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .hero-highlights,
  .hero-window-grid,
  .topbar-panels,
  .hero-metric-strip {
    grid-template-columns: 1fr;
  }

  .auth-hero h1 {
    max-width: 100%;
  }

  .shell {
    padding: 14px;
  }
}

@media (max-width: 720px) {
  .auth-shell.auth-shell-immersive,
  .shell {
    padding: 12px;
  }

  .auth-hero,
  .panel-card,
  .sidebar,
  .workspace {
    border-radius: 28px;
  }

  .hero-logo {
    width: 132px;
  }

  .topbar-panel-card,
  .sidebar-context-card,
  .hero-window-card,
  .hero-highlight {
    border-radius: 22px;
  }
}

/* Minimal refinement */
.auth-shell.auth-shell-minimal {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
  max-width: none;
  width: 100%;
}

.auth-stage {
  position: relative;
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 430px);
  gap: 28px;
  align-items: center;
  justify-items: stretch;
  margin: 0 auto;
  padding: 26px;
  border-radius: 42px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 249, 251, 0.94));
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.auth-stage-glow {
  position: absolute;
  top: -18%;
  left: -8%;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(173, 217, 255, 0.52) 0%, rgba(173, 217, 255, 0) 74%);
  filter: blur(60px);
  pointer-events: none;
}

.auth-welcome,
.auth-stack {
  position: relative;
  z-index: 1;
}

.auth-welcome {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  max-width: 560px;
  width: 100%;
  padding: clamp(28px, 4vw, 52px);
  min-height: 520px;
}

.hero-logo.minimal {
  width: 144px;
  padding: 12px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.07);
}

.auth-welcome h1 {
  margin: 0;
  font-size: clamp(3.4rem, 6vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
  color: var(--text-dark);
}

.auth-subcopy {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.security-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  color: var(--text);
  font-weight: 600;
}

.security-pill i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #1fc77d;
  box-shadow: 0 0 0 4px rgba(31, 199, 125, 0.14);
}

.auth-stack {
  display: grid;
  align-content: center;
  justify-self: center;
  width: 100%;
  max-width: 430px;
  gap: 14px;
}

.auth-login-card.minimal,
.auth-support-card.compact {
  border-radius: 30px;
}

.auth-login-card.minimal {
  padding: 30px;
  width: 100%;
  margin: 0 auto;
}

.auth-login-card.minimal h2 {
  font-size: 1.55rem;
}

.auth-login-card.minimal p {
  margin-top: 8px;
  margin-bottom: 0;
}

.auth-support-card.compact {
  padding: 16px 20px;
  text-align: center;
}

.auth-support-card.compact p {
  margin: 0;
  font-size: 0.92rem;
}

body.app-authenticated {
  overflow: hidden;
}

#app.app-authenticated {
  position: fixed;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
}

.shell {
  max-width: 1500px;
  width: min(1500px, 100%);
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  align-content: start;
}

.sidebar {
  min-height: calc(100vh - 32px);
  padding: 18px;
  border-radius: 32px;
}

.sidebar-top.minimal {
  gap: 0;
}

.brand-block.minimal {
  align-items: center;
}

.brand-block.minimal .eyebrow {
  margin-bottom: 6px;
}

.nav-list.minimal {
  gap: 8px;
}

.nav-list.minimal .nav-item {
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.nav-list.minimal .nav-item small,
.sidebar-context-card,
.workspace-chrome,
.topbar-panels,
.shell-theme-legal .sidebar-context-card,
.shell-theme-admin .sidebar-context-card,
.shell-theme-academic .sidebar-context-card {
  display: none;
}

.nav-list.minimal .nav-item::after {
  top: 50%;
  transform: translateY(-50%);
}

.nav-list.minimal .nav-item.active::after {
  transform: translateY(-50%) scale(1.1);
}

.user-chip.minimal {
  border-radius: 20px;
}

.ghost-button.minimal {
  width: 100%;
  justify-content: center;
}

.ghost-button.subtle-link {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: #6f7784;
  padding-left: 4px;
  padding-right: 4px;
}

.ghost-button.subtle-link:hover {
  transform: none;
  color: var(--text-dark);
  background: transparent;
}

.workspace {
  min-height: calc(100vh - 32px);
  padding: 24px;
  border-radius: 32px;
}

.topbar.minimal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar-heading.minimal .eyebrow {
  color: #7b8793;
  letter-spacing: 0.12em;
}

.topbar-heading.minimal {
  max-width: 760px;
}

.topbar-heading.minimal h2 {
  font-size: clamp(1.6rem, 2.2vw, 2.25rem);
  line-height: 0.96;
  text-wrap: balance;
}

.topbar-heading.minimal .topbar-copy {
  margin-top: 8px;
  font-size: 0.96rem;
}

.topbar-actions.minimal {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.panel-card {
  padding: 24px;
  border-radius: 28px;
  height: 100%;
}

.section-head {
  margin-bottom: 16px;
}

.section-head .eyebrow {
  margin-bottom: 6px;
}

.section-head h3 {
  font-size: 1.14rem;
}

.stats-row {
  gap: 16px;
  align-items: stretch;
}

.stat-card {
  min-height: 150px;
  padding: 22px;
}

.stat-card strong {
  font-size: clamp(2rem, 3vw, 3rem);
}

.feature-card,
.profile-card,
.list-card,
.detail-card,
.logo-preview-card,
.step-card {
  border-radius: 22px;
}

.feature-grid,
.step-grid,
.logo-preview-grid {
  align-items: stretch;
}

.feature-card,
.profile-card {
  min-height: 120px;
}

.list-card,
.detail-card {
  padding: 16px 18px;
}

.table-wrap {
  border-radius: 22px;
  -webkit-overflow-scrolling: touch;
}

th,
td {
  padding: 15px 14px;
}

.helper-text {
  font-size: 0.84rem;
  line-height: 1.58;
}

.empty-state {
  padding: 22px;
  border-radius: 20px;
}

@media (max-width: 1180px) {
  .auth-stage {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .auth-welcome {
    min-height: auto;
    padding: 28px;
    max-width: none;
  }

  .auth-stack {
    max-width: 520px;
  }

  .topbar-heading.minimal {
    max-width: none;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .workspace {
    min-height: auto;
  }

  .topbar.minimal {
    flex-direction: column;
    align-items: stretch;
  }

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

  body.app-authenticated {
    overflow: auto;
  }

  #app.app-authenticated {
    position: relative;
    inset: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .sidebar {
    gap: 14px;
  }

  .sidebar-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .ghost-button.minimal {
    width: auto;
  }
}

@media (max-width: 720px) {
  .auth-shell.auth-shell-minimal {
    padding: 14px;
  }

  .auth-stage,
  .auth-login-card.minimal,
  .auth-support-card.compact,
  .workspace,
  .sidebar {
    border-radius: 24px;
  }

  .auth-stage {
    padding: 14px;
    gap: 14px;
  }

  .auth-welcome,
  .auth-stack,
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .auth-stack {
    max-width: none;
  }

  .hero-logo.minimal {
    width: 124px;
  }

  .shell {
    width: 100%;
    max-width: 100%;
    gap: 12px;
    padding: 12px;
  }

  .sidebar,
  .workspace {
    width: 100%;
    min-width: 0;
  }

  .sidebar {
    padding: 14px;
  }

  .sidebar-top.minimal .brand-block {
    gap: 12px;
  }

  .sidebar-top.minimal .brand-logo {
    width: 56px;
    height: 56px;
  }

  .sidebar-top.minimal h1 {
    font-size: 1.12rem;
    line-height: 1.05;
  }

  .nav-list.minimal {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
  }

  .nav-list.minimal::-webkit-scrollbar {
    height: 6px;
  }

  .nav-list.minimal::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.12);
    border-radius: 999px;
  }

  .nav-list.minimal .nav-item {
    min-width: 170px;
    min-height: 48px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

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

  .user-chip.minimal,
  .ghost-button.minimal,
  .topbar-actions.minimal,
  .topbar-actions.minimal .status-pill {
    width: 100%;
  }

  .workspace {
    padding: 16px;
  }

  .topbar.minimal {
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar-heading.minimal h2 {
    font-size: 1.35rem;
    line-height: 1.05;
  }

  .topbar-heading.minimal .topbar-copy {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .content-grid {
    gap: 14px;
  }

  .panel-card {
    padding: 18px;
    border-radius: 22px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .table-actions,
  .matter-actions,
  .form-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .inline-button,
  .table-actions .ghost-button,
  .table-actions .secondary-button,
  .table-actions .primary-button,
  .matter-actions .ghost-button,
  .matter-actions .secondary-button,
  .matter-actions .primary-button,
  .form-actions .ghost-button,
  .form-actions .secondary-button,
  .form-actions .primary-button {
    width: 100%;
    justify-content: center;
  }

  .feature-grid,
  .stats-row,
  .logo-preview-grid,
  .step-grid,
  .hero-highlights,
  .hero-window-grid,
  .hero-metric-strip,
  .dual-list,
  .matter-layout {
    grid-template-columns: 1fr;
  }

  .matter-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  table {
    min-width: 0;
    background: transparent;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
  }

  td {
    padding: 0;
    border-bottom: 0;
  }

  td + td {
    margin-top: 12px;
  }

  td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: #6d7b8a;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  td[colspan]::before {
    display: none;
  }

  .helper-text {
    font-size: 0.82rem;
  }
}
