@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --night: #0B1624;
  --night-deep: #07121B;
  --surface: #101F31;
  --surface-alt: #14253A;
  --gold: #D7BD83;
  --gold-dark: #B89A58;
  --text: #F3F0E9;
  --muted: #B7C2D0;
  --border: rgba(255, 255, 255, 0.14);
  --border-gold: rgba(184, 154, 88, 0.5);
  --ink: #0B1624;
  --teal: #D7BD83;
  --mint: rgba(215, 189, 131, 0.16);
  --paper: #0B1624;
  --line: rgba(255, 255, 255, 0.12);
  --white: #F3F0E9;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --consule-navy: #182C49;
  --consule-gold: #B89A58;
  --consule-ivory: #F7F4ED;
  /* Compat: --ink:#122b3b; --teal:#087f8c; */
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--night);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography floating directly on background */
h1, h2, h3, h4 {
  font-family: Georgia, 'Times New Roman', serif;
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: normal;
  color: #F7F4ED;
  position: relative;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.45);
}

p {
  line-height: 1.7;
  margin: 12px 0;
  color: var(--muted);
}

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

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

button, a, input, textarea, select {
  outline-offset: 4px;
}

button, a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

/* Brand Identity */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: Georgia, serif;
  font-weight: normal;
  font-size: 20px;
  letter-spacing: 2px;
  color: #F7F4ED;
}

.brand img {
  height: 38px;
  width: auto;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-family: Georgia, serif;
  font-size: 20px;
  letter-spacing: 3px;
  color: #F7F4ED;
}

.brand-sub {
  font-family: Arial, sans-serif;
  font-size: 8px;
  letter-spacing: 4px;
  color: var(--gold);
  margin-top: 3px;
}

.mark {
  width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: #14273b;
  border: 1px solid rgba(184, 154, 88, 0.6);
  border-radius: 3px;
  font-size: 18px;
  font-family: Georgia, serif;
}

.eyebrow {
  color: var(--gold) !important;
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}

/* Buttons with discrete borders and gold accents (2-4px radius) */
.btn, .button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 22px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: #14273b;
  color: #F7F4ED;
  border: 1px solid rgba(184, 154, 88, 0.6);
  border-left: 3px solid var(--gold);
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}

.btn:hover, .button:hover {
  background: #203850;
  border-color: var(--gold);
  color: #FFFFFF;
}

.btn.secondary, .button.secondary {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-left: 1px solid rgba(255, 255, 255, 0.24);
}

.btn.secondary:hover, .button.secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(215, 189, 131, 0.08);
}

.btn.small, .button.small {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 12px;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 3px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.18s;
}

.tool-button:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(215, 189, 131, 0.08);
}

/* Translucent inputs darker than surroundings */
.field input,
.field textarea,
.field select,
input.search,
textarea.compose,
input.text-input,
.input,
#document-title,
#document-body {
  display: block;
  width: 100%;
  background: rgba(2, 9, 16, 0.76) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid #7f96ae55 !important;
  border-radius: 6px;
  padding: 12px 14px;
  color: #F3F0E9 !important;
  box-shadow: inset 0 1px 10px rgba(0, 0, 0, 0.35);
  transition: border-color 0.18s, background 0.18s, outline 0.18s;
}

.field input::placeholder,
.field textarea::placeholder,
input.search::placeholder,
textarea.compose::placeholder,
.input::placeholder {
  color: #B7C2D0;
  opacity: 0.85;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
input.search:focus,
textarea.compose:focus,
input.text-input:focus,
.input:focus,
#document-title:focus,
#document-body:focus {
  background: rgba(2, 9, 16, 0.87) !important;
  border-color: var(--gold) !important;
  outline: 2px solid var(--gold) !important;
  outline-offset: 3px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  font-size: 14px;
  color: var(--muted);
}

.field small {
  color: var(--muted);
  font-size: 12px;
}

/* Navigation & Glass Topbar */
.topnav {
  height: 84px;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  z-index: 10;
}

.topnav nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0 auto;
  font-size: 14px;
}

.topnav nav a {
  position: relative;
  padding: 8px 0;
  color: #C3CCD7;
  transition: color 0.18s;
  white-space: nowrap;
}

.topnav nav a:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.18s;
}

.topnav nav a:hover {
  color: #F7F4ED;
}

.topnav nav a:hover:after {
  width: 100%;
}

.topnav .mobile-toggle {
  display: none;
  font-size: 24px;
  color: #F7F4ED;
}

.wrap {
  max-width: 1240px;
  margin: auto;
  padding: 0 32px;
  position: relative;
}

/* Hero Section with Tribunal & Balance */
.hero {
  position: relative;
  min-height: 680px;
  background: #0B1624 url('assets/consule/hero-tribunal.png') right center / cover no-repeat;
  border-bottom: 1px solid rgba(184, 154, 88, 0.28);
  color: #FFFFFF;
  padding: 40px 0 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hero:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #07121b 0%, #0B1624 35%, rgba(11, 24, 38, 0.94) 52%, rgba(11, 24, 38, 0.4) 80%, rgba(11, 24, 38, 0.1) 100%);
  z-index: 1;
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-content {
  max-width: 580px;
  padding: 20px 0;
}

.hero h1 {
  font-size: clamp(38px, 4.8vw, 62px);
  line-height: 1.1;
  margin: 20px 0;
  color: #F7F4ED;
  font-weight: normal;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.hero h1 em {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--gold);
}

.hero p {
  font-size: 17px;
  line-height: 1.7;
  color: #DDE4EF;
  max-width: 520px;
  margin: 16px 0 28px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.trust {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--gold);
  margin-top: 28px;
  flex-wrap: wrap;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Floating Aside / Sample */
.sample {
  display: none !important;
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  display: inline-block;
  border-radius: 50%;
  margin-right: 8px;
}

/* Mockup preview in Hero */
.mockup {
  position: relative;
  background: #122239 url('assets/consule/hero-tribunal.png') center/cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  margin-top: 48px;
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 340px;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
  isolation: isolate;
}

.mockup:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 20, 32, 0.95), rgba(11, 24, 38, 0.85) 60%, rgba(11, 24, 38, 0.65));
  z-index: -1;
}

.mockside {
  background: rgba(7, 18, 27, 0.65);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  padding: 24px 18px;
  font-size: 13px;
}

.mockside .item {
  padding: 12px 10px;
  color: var(--muted);
  margin-top: 6px;
  border-radius: 2px;
}

.mockside .item.active {
  background: rgba(184, 154, 88, 0.1);
  color: #F7F4ED;
  border-left: 2px solid var(--gold);
}

.mockmain {
  padding: 34px 40px;
}

.mockbubble {
  margin-top: 20px;
  padding: 20px;
  background: rgba(2, 9, 16, 0.76);
  border: 1px solid #7f96ae55;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.7;
}

.source-tag {
  display: inline-block;
  color: var(--gold);
  background: rgba(184, 154, 88, 0.12);
  border: 1px solid rgba(184, 154, 88, 0.3);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 2px;
  margin-right: 6px;
  margin-top: 8px;
}

/* Sections & Open Columns */
.section {
  padding: 76px 0;
  position: relative;
}

.section h2 {
  font-size: 38px;
  line-height: 1.2;
  margin: 12px 0 24px;
}

.sectionhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 40px;
}

.features, .cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin: 40px 0;
}

.card {
  background: transparent;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  padding: 36px 32px;
  position: relative;
}

.card:first-child {
  padding-left: 0;
}

.card:last-child {
  border-right: 0;
}

.card h3 {
  font-size: 22px;
  color: #F7F4ED;
  margin-top: 24px;
}

.card p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}

.number {
  font: 16px Georgia, serif;
  color: var(--gold);
  display: inline-block;
  border-bottom: 1px solid rgba(184, 154, 88, 0.5);
  padding-bottom: 8px;
  width: 40px;
}

.iconbox {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  font-size: 20px;
  color: var(--gold);
  background: rgba(184, 154, 88, 0.12);
  border: 1px solid rgba(184, 154, 88, 0.3);
}

/* Darksection & Editorial */
.darksection {
  background: #07121B;
  border-top: 1px solid rgba(184, 154, 88, 0.2);
  border-bottom: 1px solid rgba(184, 154, 88, 0.2);
  padding: 72px 0;
}

.darksection .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.editorial {
  background: rgba(16, 31, 49, 0.5);
  border: 1px solid rgba(184, 154, 88, 0.35);
  border-left: 3px solid var(--gold);
  padding: 44px;
  border-radius: 4px;
  display: grid;
  gap: 20px;
}

.editorial blockquote {
  font: italic 30px/1.3 Georgia, serif;
  margin: 0;
  color: #F7F4ED;
}

/* FAQ Details */
.faq {
  max-width: 820px;
  margin: 36px auto;
}

.faq details {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 22px 0;
}

.faq summary {
  font-weight: 500;
  font-size: 16px;
  color: #F7F4ED;
  cursor: pointer;
}

.faq summary:hover {
  color: var(--gold);
}

.faq p {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.7;
}

/* Footer */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 48px 0;
  color: var(--muted);
  background: #07121B;
  font-size: 13px;
}

.footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: wrap;
}

/* Authenticated Workspace Shell */
.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  background: var(--night);
}

.sidebar {
  background: #0C1928;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
}

.sidebar .brand {
  margin: 0 10px 24px;
}

.sidebar a, .sidebar button.navitem {
  text-align: left;
  padding: 12px 14px;
  border-radius: 2px;
  color: #B7C2D0;
  font-size: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: all 0.18s;
}

.sidebar .active, .sidebar a:hover, .sidebar button.navitem:hover {
  background: rgba(184, 154, 88, 0.1);
  color: #F7F4ED;
  border-left: 2px solid var(--gold);
}

.side-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  padding: 22px 14px 6px;
  text-align: left;
}

.history {
  font-size: 12px;
  overflow: auto;
}

.history button {
  padding: 10px 14px;
  width: 100%;
  text-align: left;
  color: #B7C2D0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history button:hover {
  color: #F7F4ED;
  background: rgba(255, 255, 255, 0.03);
}

.side-bottom {
  margin-top: auto;
  padding-top: 24px;
}

.trial {
  border: 1px solid rgba(184, 154, 88, 0.35);
  background: rgba(16, 31, 49, 0.5);
  padding: 14px;
  border-radius: 3px;
  font-size: 12px;
}

.trial strong {
  color: #F7F4ED;
}

.trial p {
  font-size: 11px;
  margin: 6px 0 10px;
}

.account {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin-top: 16px;
  font-size: 12px;
  color: #F3F0E9;
  padding: 8px;
  border-radius: 3px;
}

.account:hover {
  background: rgba(255, 255, 255, 0.04);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  background: #14273b;
  border: 1px solid var(--gold);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}

/* Workspace Area */
.workspace {
  min-width: 0;
  overflow: auto;
  background: radial-gradient(circle at 80% 15%, rgba(20, 39, 59, 0.35), transparent 55%), var(--night);
  position: relative;
  display: flex;
  flex-direction: column;
}

.appheader {
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  background: rgba(11, 22, 36, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 5;
  font-size: 13px;
}

.appheader .mobile-toggle {
  display: none;
}

.crumb {
  color: var(--muted);
}

.crumb strong {
  color: #F7F4ED;
}

.appbody {
  padding: 36px 48px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.appbody h1 {
  font-size: 32px;
  margin-bottom: 24px;
}

/* Chat & Consultation Area */
.chatbody {
  height: calc(100% - 64px);
  display: flex;
  flex-direction: column;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 40px 18px;
  width: 100%;
}

.welcome {
  text-align: center;
  padding-top: 48px;
}

.welcome h1 {
  font-size: clamp(32px, 4vw, 48px);
  max-width: 650px;
  margin: 18px auto;
}

.welcome p {
  font-size: 15px;
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 36px 0;
  text-align: left;
}

.suggestion {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(16, 31, 49, 0.5);
  transition: all 0.18s;
  text-align: left;
}

.suggestion:hover {
  border-color: var(--gold);
  background: rgba(20, 39, 59, 0.7);
  transform: translateY(-1px);
}

.suggestion strong {
  font-size: 14px;
  display: block;
  color: #F7F4ED;
}

.suggestion span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 6px;
}

.chats {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding-right: 6px;
}

.message {
  padding: 22px;
  margin: 20px 0;
  border-radius: 4px;
  line-height: 1.7;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(16, 31, 49, 0.45);
}

.message.user {
  background: rgba(20, 39, 59, 0.7);
  border-left: 3px solid var(--gold);
  border-color: rgba(184, 154, 88, 0.3);
  margin-left: 48px;
}

.message.assistant {
  background: rgba(12, 22, 34, 0.85);
  border-left: 3px solid rgba(255, 255, 255, 0.2);
}

.message .msgtools {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--gold);
}

.message .msgtools button {
  color: var(--gold);
  padding: 4px 8px;
  border: 1px solid rgba(184, 154, 88, 0.3);
  border-radius: 2px;
  font-size: 11px;
}

.message .msgtools button:hover {
  background: rgba(184, 154, 88, 0.12);
}

/* Chat Composer */
.composer {
  margin-top: auto;
  border: 1px solid rgba(184, 154, 88, 0.3);
  border-radius: 6px;
  padding: 12px;
  background: rgba(16, 31, 49, 0.5);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.compose {
  border: 1px solid #7f96ae55 !important;
  background: rgba(2, 9, 16, 0.76) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 4px;
  padding: 14px !important;
  resize: none;
  height: 78px;
  outline: none;
  color: #F3F0E9 !important;
}

.compose-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
}

.compose-tools .btn {
  margin-left: auto;
}

.disclaimer {
  text-align: center;
  font-size: 11px;
  margin: 10px 0 4px;
  color: var(--muted);
  opacity: 0.8;
}

/* Toolbar & Layout */
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  align-items: center;
}

.search {
  max-width: 420px;
}

.empty {
  text-align: center;
  padding: 70px 20px;
}

.empty h2 {
  font-size: 24px;
  margin: 18px 0 10px;
}

.empty .iconbox {
  margin: auto;
  width: 64px;
  height: 64px;
  font-size: 28px;
}

.empty p {
  font-size: 14px;
  max-width: 480px;
  margin: 12px auto 22px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 12px;
  margin: 24px 0;
}

.tabs button {
  padding: 10px 18px;
  border-radius: 2px;
  color: var(--muted);
  font-size: 13px;
  border: 1px solid transparent;
}

.tabs button.selected, .selected {
  background: rgba(184, 154, 88, 0.12) !important;
  color: #F7F4ED !important;
  border: 1px solid rgba(184, 154, 88, 0.4) !important;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.collection-grid .card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 31, 49, 0.45);
  border-radius: 4px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.18s;
}

.collection-grid .card:hover {
  border-color: var(--gold);
  background: rgba(20, 39, 59, 0.6);
}

.docrow {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 22px;
  margin: 14px 0;
  background: rgba(16, 31, 49, 0.4);
}

.docrow h3 {
  font-size: 18px;
}

.docrow p {
  font-size: 13px;
}

.docrow .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.doc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
}

.document {
  line-height: 1.85;
  font-family: Georgia, serif;
}

.document h2 {
  margin-top: 28px;
  font-size: 24px;
}

/* Modals & Dialogs */
dialog {
  border: 1px solid rgba(184, 154, 88, 0.4);
  border-radius: 4px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: 90dvh;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85);
  color: var(--text);
  background: #0E1A2B;
}

dialog::backdrop {
  background: rgba(4, 9, 15, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modalhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.modalhead h2 {
  font-size: 20px;
}

.modalbody {
  padding: 24px;
}

.modalfoot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 24px;
}

.dropzone {
  border: 2px dashed rgba(184, 154, 88, 0.4);
  background: rgba(16, 31, 49, 0.5);
  border-radius: 4px;
  padding: 40px 20px;
  text-align: center;
}

.dropzone p {
  font-size: 12px;
}

.listactions {
  display: grid;
  gap: 8px;
}

.listactions button {
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  background: rgba(16, 31, 49, 0.4);
  color: #F7F4ED;
  transition: all 0.18s;
}

.listactions button:hover {
  background: rgba(184, 154, 88, 0.12);
  border-color: var(--gold);
}

/* Toast & Badges */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  background: #14273b;
  color: #FFFFFF;
  border: 1px solid var(--gold);
  border-radius: 3px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  font-size: 13px;
  z-index: 99;
  display: none;
  max-width: 90vw;
}

.badge {
  padding: 4px 10px;
  font-size: 11px;
  color: var(--gold);
  background: rgba(184, 154, 88, 0.14);
  border: 1px solid rgba(184, 154, 88, 0.3);
  border-radius: 2px;
  display: inline-block;
}

.badge.unsaved {
  background: rgba(220, 130, 40, 0.2);
  color: #F4A442;
  border-color: rgba(220, 130, 40, 0.4);
}

.badge.saved {
  background: rgba(40, 160, 100, 0.2);
  color: #6EDBA4;
  border-color: rgba(40, 160, 100, 0.4);
}

.count {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--muted);
}

.status-note {
  padding: 14px 18px;
  background: rgba(184, 154, 88, 0.1);
  border: 1px solid rgba(184, 154, 88, 0.3);
  border-left: 3px solid var(--gold);
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.6;
  margin: 18px 0;
  color: #F7F4ED;
}

.loading {
  color: var(--gold);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% { opacity: 0.4; }
}

.doc-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lib-docs {
  display: grid;
  gap: 10px;
}

.attachment {
  font-size: 11px;
  background: rgba(184, 154, 88, 0.18);
  border: 1px solid rgba(184, 154, 88, 0.4);
  color: #F7F4ED;
  padding: 4px 10px;
  border-radius: 2px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 4px;
}

/* Settings */
.settings {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
}

.settings nav {
  display: grid;
  gap: 4px;
  align-content: start;
}

.settings nav button {
  text-align: left;
  font-size: 13px;
  padding: 12px;
  border-radius: 2px;
  color: var(--muted);
}

.settings nav button:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #F7F4ED;
}

.settings nav button.selected {
  background: rgba(184, 154, 88, 0.1);
  color: #F7F4ED;
  border-left: 2px solid var(--gold);
}

.setting-card {
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  margin: 18px 0;
  background: rgba(16, 31, 49, 0.4);
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px 0;
  font-size: 14px;
  gap: 12px;
}

.setting-row:last-child {
  border: 0;
}

.authbox {
  max-width: 460px;
  margin: 60px auto;
  padding: 38px;
  background: rgba(16, 31, 49, 0.6);
  border: 1px solid rgba(184, 154, 88, 0.35);
  border-radius: 4px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
}

.authbox h1 {
  font-size: 28px;
  margin-bottom: 20px;
}

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

.shell.collapsed .sidebar {
  visibility: hidden;
  padding: 0;
}

.shell.collapsed .appheader .mobile-toggle {
  display: inline-block;
}

/* Pricing Table */
.plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 30px 0;
}

.plan-table th, .plan-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.table-scroll {
  overflow: auto;
}

.price-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 26px 0;
}

.price-tabs button {
  padding: 10px 18px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
}

.price {
  font-size: 32px;
  margin: 20px 0;
  color: #F7F4ED;
}

.checklist {
  list-style: none;
  padding: 0;
  font-size: 14px;
  line-height: 2.4;
}

.checklist li:before {
  content: '✓ ';
  color: var(--gold);
  margin-right: 8px;
}

/* Filters Modal */
.filters {
  display: grid;
  gap: 14px;
}

.filters details {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 0;
}

.filters summary {
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  color: #F7F4ED;
}

.filterchoices {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
}

.filterchoices label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

[hidden] {
  display: none !important;
}

/* Fallback for backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
  .field input, .field textarea, textarea.compose, .input {
    background: #06101A !important;
  }
}

/* Responsive & Mobile QA (390px - 760px) */
@media (max-width: 1050px) {
  .topnav {
    gap: 20px;
  }
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .chatbody {
    padding: 24px;
  }
  .collection-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .settings {
    grid-template-columns: 180px 1fr;
  }
}

@media (max-width: 760px) {
  .topnav {
    height: 72px;
    padding: 0 20px;
  }
  .topnav nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #0B1624;
    padding: 24px;
    z-index: 15;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .topnav nav.open {
    display: grid;
    gap: 16px;
  }
  .topnav .mobile-toggle {
    display: block;
    margin-left: auto;
  }
  .topnav > .btn {
    display: none;
  }
  .hero {
    min-height: auto;
    padding: 40px 0 60px;
    background-position: 75% center;
  }
  .hero:before {
    background: linear-gradient(90deg, rgba(8, 20, 32, 0.98), rgba(11, 24, 38, 0.88));
  }
  .hero h1 {
    font-size: 38px;
  }
  .hero p {
    font-size: 16px;
  }
  .features, .cards {
    grid-template-columns: 1fr;
    border-bottom: 0;
  }
  .card, .card:first-child {
    padding: 28px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .mockup {
    grid-template-columns: 1fr;
    margin: 24px 0 0;
  }
  .mockside {
    display: none;
  }
  .mockmain {
    padding: 22px;
  }
  .proof-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 270px;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.22s;
    box-shadow: 20px 0 80px rgba(0, 0, 0, 0.8);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .appheader {
    padding: 0 18px;
    height: 60px;
  }
  .appheader .mobile-toggle {
    display: inline-block;
  }
  .appheader .crumb {
    display: none;
  }
  .compose-tools {
    flex-wrap: wrap;
  }
  .chatbody {
    padding: 16px;
    height: calc(100% - 60px);
  }
  .welcome h1 {
    font-size: 30px;
  }
  .suggestions {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .message.user {
    margin-left: 12px;
  }
  .collection-grid {
    grid-template-columns: 1fr;
  }
  .settings {
    grid-template-columns: 1fr;
  }
  .doc-layout {
    grid-template-columns: 1fr;
  }
  .wrap {
    padding: 0 20px;
  }
  .actions .btn, .actions .button {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
