@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

/* ==========================================
   1. DESIGN TOKENS (HSL-BASED DESIGN SYSTEM)
   ========================================== */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: hsl(150, 15%, 97%);
  --bg-gradient: linear-gradient(135deg, hsl(150, 15%, 97%) 0%, hsl(210, 20%, 95%) 100%);
  --surface: hsl(0, 0%, 100%);
  --surface-glass: rgba(255, 255, 255, 0.85);
  --ink: hsl(215, 28%, 17%);
  --muted: hsl(215, 16%, 47%);
  --line: hsl(214, 20%, 90%);
  --soft: hsl(214, 15%, 95%);
  --green: hsl(162, 94%, 30%);
  --green-dark: hsl(162, 94%, 22%);
  --green-soft: hsla(162, 94%, 30%, 0.1);
  --blue: hsl(217, 91%, 50%);
  --blue-soft: hsla(217, 91%, 50%, 0.1);
  --amber: hsl(35, 92%, 45%);
  --amber-soft: hsla(35, 92%, 50%, 0.1);
  --danger: hsl(354, 70%, 50%);
  --danger-soft: hsla(354, 70%, 50%, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 50px rgba(11, 93, 69, 0.06);
  --border-glow: 1px solid rgba(255, 255, 255, 0.5);
  --highlight: hsla(48, 100%, 75%, 0.6);
  --scrollbar-thumb: hsl(214, 15%, 80%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: hsl(224, 40%, 8%);
  --bg-gradient: radial-gradient(at 100% 0%, hsla(162, 94%, 30%, 0.08) 0, transparent 40%),
                radial-gradient(at 0% 100%, hsla(217, 91%, 50%, 0.08) 0, transparent 40%);
  --surface: hsl(222, 28%, 12%);
  --surface-glass: rgba(15, 23, 42, 0.8);
  --ink: hsl(210, 40%, 98%);
  --muted: hsl(215, 20%, 65%);
  --line: hsl(222, 20%, 20%);
  --soft: hsl(222, 20%, 15%);
  --green: hsl(162, 80%, 43%);
  --green-dark: hsl(162, 80%, 35%);
  --green-soft: hsla(162, 80%, 43%, 0.18);
  --blue: hsl(217, 91%, 65%);
  --blue-soft: hsla(217, 91%, 65%, 0.18);
  --amber: hsl(35, 92%, 60%);
  --amber-soft: hsla(35, 92%, 60%, 0.18);
  --danger: hsl(354, 80%, 63%);
  --danger-soft: hsla(354, 80%, 63%, 0.18);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.5);
  --border-glow: 1px solid rgba(255, 255, 255, 0.05);
  --highlight: hsla(162, 80%, 43%, 0.25);
  --scrollbar-thumb: hsl(222, 20%, 30%);
}

/* ==========================================
   2. RESET & BASE
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Premium Scrollbars */
::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ==========================================
   3. LAYOUT & CONTAINERS
   ========================================== */
.shell {
  margin: 0 auto;
  max-width: 1280px;
  padding: 40px 24px;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 24px;
}

.brand {
  flex: 1;
}

.brand-logo {
  display: block;
  height: 32px;
  margin-bottom: 16px;
  object-fit: contain;
  width: auto;
}

h1 {
  background: linear-gradient(135deg, var(--ink) 0%, var(--muted) 100%);
  background-clip: text;
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin: 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  margin-top: 6px;
}

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

/* Premium Segmented Theme Switch */
.theme-switch {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 99px;
  display: flex;
  position: relative;
  padding: 3px;
  user-select: none;
  width: 146px;
  height: 36px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.theme-btn {
  align-items: center;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
  height: 100%;
  justify-content: center;
  min-height: auto;
  padding: 0;
  position: relative;
  z-index: 2;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.1s ease;
}

.theme-btn:hover {
  color: var(--ink);
  background: transparent;
  transform: none;
}

.theme-btn:active {
  transform: scale(0.95);
}

.theme-btn[aria-checked="true"] {
  color: var(--ink);
}

.theme-btn svg {
  stroke: var(--muted);
  transition: stroke 0.3s ease, transform 0.3s ease;
}

.theme-btn[aria-checked="true"] svg {
  stroke: var(--ink);
}

.theme-btn.light[aria-checked="true"] svg {
  stroke: var(--green);
  transform: rotate(15deg);
}

.theme-btn.dark[aria-checked="true"] svg {
  stroke: var(--blue);
  transform: rotate(-10deg);
}

.theme-slider {
  background: var(--surface);
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
  height: calc(100% - 6px);
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease, box-shadow 0.3s ease;
  width: calc(50% - 3px);
  z-index: 1;
}

/* Toggle positioning logic */
:root[data-theme="dark"] .theme-slider {
  transform: translateX(100%);
  background: var(--surface-glass);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .theme-switch {
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(255, 255, 255, 0.06);
}

/* ==========================================
   4. FORM ELEMENTS & INTERACTION
   ========================================== */
.question-box {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  border: var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding: 32px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.question-box::before {
  background: linear-gradient(90deg, var(--green), var(--blue));
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

label {
  color: var(--ink);
  display: block;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
}

.textarea-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

textarea {
  background: var(--soft);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  color: var(--ink);
  font-size: 15.5px;
  min-height: 140px;
  padding: 18px;
  resize: vertical;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  width: 100%;
}

textarea:focus {
  background: var(--surface);
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
  outline: none;
}

/* File chip styling */
.file-chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 0 4px;
}

.file-chip {
  align-items: center;
  background: var(--green-soft);
  border: 1px solid rgba(5, 150, 105, 0.15);
  border-radius: 8px;
  color: var(--green-dark);
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 700;
  gap: 6px;
  padding: 6px 12px;
  animation: fadeIn 0.25s ease;
}

.file-chip svg {
  stroke: var(--green);
}

.file-chip-delete {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  min-height: auto;
  padding: 0 2px;
  transition: color 0.15s ease;
}

.file-chip-delete:hover {
  color: var(--danger);
}

/* Buttons styling */
button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: inline-flex;
  font-size: 14.5px;
  font-weight: 750;
  gap: 8px;
  justify-content: center;
  min-height: 46px;
  padding: 8px 18px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

button:active {
  transform: scale(0.97);
}

button.primary {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  border: none;
  box-shadow: 0 4px 14px var(--green-soft);
  color: #fff;
}

button.primary:hover {
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
  transform: translateY(-2px);
}

button.primary.nudged {
  position: relative;
  overflow: visible;
}

.nudge-badge {
  background: hsla(0, 0%, 100%, 0.18);
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 0.2px;
  padding: 1px 6px;
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  vertical-align: middle;
}

button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

button.secondary:hover {
  background: var(--soft);
  border-color: var(--muted);
  transform: translateY(-1px);
}

.ai-generate-btn {
  background: var(--surface);
  border: 1.5px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.ai-generate-btn::before {
  content: '';
  position: absolute;
  top: -1.5px;
  bottom: -1.5px;
  left: -1.5px;
  right: -1.5px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  border-radius: 12px;
  z-index: -1;
  transition: opacity 0.25s ease;
  opacity: 0.45;
}

.ai-generate-btn:hover::before {
  opacity: 1;
}

.ai-generate-btn svg {
  color: var(--blue);
  transition: all 0.25s ease;
  margin-right: 6px;
}

.ai-generate-btn:hover svg {
  transform: rotate(15deg) scale(1.15);
  color: var(--green);
}

button.attach {
  align-items: center;
  background: var(--soft);
  border: 1px dashed var(--muted);
  border-radius: 10px;
  box-shadow: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  min-height: 32px;
  padding: 6px 14px;
  align-self: flex-end;
  position: static;
  transition: all 0.2s ease;
}

button.attach:hover {
  background: var(--surface);
  border-color: var(--green);
  color: var(--green-dark);
}

button.attach svg {
  stroke: var(--muted);
  transition: stroke 0.2s ease;
}

button.attach:hover svg {
  stroke: var(--green);
}

button:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.5;
  transform: none !important;
}

/* Search controls */
.query-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(330px, auto) 1fr;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 18px;
}

.scope-picker {
  align-items: center;
  display: flex;
  flex: 0 1 auto;
  gap: 10px;
  height: 46px;
  min-width: 0;
}

.scope-label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  height: 46px;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

.scope-toggle {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  height: 46px;
  padding: 4px;
}

.scope-option {
  align-items: center;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 850;
  justify-content: center;
  line-height: 1;
  min-height: 36px;
  min-width: 104px;
  padding: 0 14px;
  position: relative;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}

.scope-option input {
  height: 0;
  opacity: 0;
  position: absolute;
  width: 0;
}

.scope-option:hover {
  color: var(--ink);
}

.scope-option:has(input:checked) {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--green-dark);
}

.scope-option:has(input:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.scope-option:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.45;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-left: auto;
}

.actions .secondary {
  min-width: 200px;
}

.form-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
  min-height: 18px;
}

.form-note:empty {
  display: none;
}

/* ==========================================
   5. STATUS & PILLS
   ========================================= */
.status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pill {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 700;
  gap: 6px;
  min-height: 32px;
  padding: 4px 14px;
  white-space: nowrap;
}

/* Neon Pulse Indicator */
.pill::before {
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 8px;
  width: 8px;
}

.pill.good {
  background: var(--green-soft);
  border-color: rgba(5, 150, 105, 0.15);
  color: var(--green-dark);
}
.pill.good::before {
  animation: pulseGreen 2s infinite;
  background-color: var(--green);
}

.pill.warn {
  background: var(--amber-soft);
  border-color: rgba(217, 119, 6, 0.15);
  color: var(--amber);
}
.pill.warn::before {
  animation: pulseAmber 2s infinite;
  background-color: var(--amber);
}

.pill.bad {
  background: var(--danger-soft);
  border-color: rgba(220, 38, 38, 0.15);
  color: var(--danger);
}
.pill.bad::before {
  animation: pulseDanger 2s infinite;
  background-color: var(--danger);
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}
@keyframes pulseAmber {
  0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(217, 119, 6, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}
@keyframes pulseDanger {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* ==========================================
   6. GRID LAYOUT PANELS
   ========================================== */
main {
  display: grid;
  gap: 32px;
  margin-top: 40px;
}

.answer-panel,
.evidence-panel {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  border: var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.answer-panel:not(.is-collapsed) {
  min-height: 260px;
}

.answer-panel.is-collapsed .panel-head {
  border-bottom: 0;
}

.answer-panel.is-collapsed .panel-body {
  display: none;
}

.evidence-panel {
  min-height: 520px;
}

.panel-head {
  align-items: center;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 16px 28px;
}

.panel-head h2 {
  align-items: center;
  display: flex;
  font-size: 17.5px;
  font-weight: 800;
  gap: 10px;
}

.panel-head h2::before {
  background: linear-gradient(to bottom, var(--green), var(--blue));
  border-radius: 99px;
  content: "";
  display: inline-block;
  height: 18px;
  width: 4px;
}

.panel-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 28px;
}

/* Answer Body styling */
.answer {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.8;
  min-height: 200px;
}

.answer p {
  margin-bottom: 16px;
}

/* Gradient highlight marker tags */
.answer strong,
mark {
  background: var(--highlight);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  color: var(--ink);
  font-weight: 850;
  padding: 1px 6px;
}

/* Empty states */
.empty {
  align-items: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  display: flex;
  flex: 1;
  font-size: 14.5px;
  font-weight: 600;
  justify-content: center;
  min-height: 360px;
  padding: 24px;
  text-align: center;
}

/* Advanced Aurora Loader */
.loading {
  align-items: center;
  color: var(--green-dark);
  display: flex;
  flex-direction: column;
  font-weight: 700;
  gap: 16px;
  height: 100%;
  justify-content: center;
  min-height: 300px;
  width: 100%;
}

.loading::before {
  animation: auroraspin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border: 4px solid var(--soft);
  border-radius: 50%;
  border-top: 4px solid var(--green);
  border-right: 4px solid var(--blue);
  content: "";
  height: 48px;
  width: 48px;
}

@keyframes auroraspin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error {
  background: var(--danger-soft);
  border-left: 5px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-weight: 700;
  padding: 20px;
}

/* ==========================================
   7. EVIDENCE RESULT CARDS
   ========================================== */
.result-list {
  display: grid;
  gap: 20px;
}

.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: cardFadeIn 0.4s ease-out both;
}

.result:hover {
  border-color: var(--muted);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.result.law {
  background: var(--soft);
  border-color: var(--blue-soft);
  border-left: 5px solid var(--blue);
}

.result-index {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.result.law .result-index {
  color: var(--blue);
}

.meta {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.result h3 {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 12px;
}

.excerpt {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 16px;
  max-height: 140px;
  opacity: 0.9;
  overflow-y: auto;
  padding-right: 6px;
}

/* Custom Read More Button replacing direct Details tags */
.view-original-btn {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 750;
  min-height: auto;
  padding: 6px 14px;
  transition: all 0.2s ease;
}

.view-original-btn:hover {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green-dark);
}

.result.law .view-original-btn:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue);
}

.source {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
  margin-top: 18px;
  padding-top: 12px;
  word-break: break-all;
}

@keyframes cardFadeIn {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   8. SLIDE-IN DRAWER MODAL OVERLAY
   ========================================== */
.drawer-overlay {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  bottom: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  transition: opacity 0.35s ease;
  z-index: 1000;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  background: var(--surface);
  border-left: 1px solid var(--line);
  bottom: 0;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  max-width: 600px;
  position: absolute;
  right: 0;
  top: 0;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.drawer-overlay.active .drawer {
  transform: translateX(0);
}

.drawer-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 24px 28px;
}

.drawer-header-title {
  align-items: center;
  display: flex;
  gap: 10px;
}

.icon-drawer-title {
  stroke: var(--green);
}

.drawer-header h3 {
  font-size: 18px;
  font-weight: 850;
}

.drawer-close-btn {
  background: var(--soft);
  border: none;
  border-radius: 50%;
  box-shadow: none;
  color: var(--muted);
  cursor: pointer;
  height: 38px;
  min-height: auto;
  padding: 0;
  transition: all 0.2s ease;
  width: 38px;
}

.drawer-close-btn:hover {
  background: var(--danger-soft);
  color: var(--danger);
  transform: rotate(90deg);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.drawer-meta {
  background: var(--soft);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 24px;
  padding: 14px 18px;
}

.drawer-content {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==========================================
   8.5 STACKED RESULT LAYOUT
   ========================================== */
main.results-stack {
  grid-template-columns: 1fr;
}

/* Deep Legislation external link badge styling */
.law-link {
  color: var(--blue);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  background: var(--blue-soft);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  vertical-align: middle;
}

.law-link:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px var(--blue-soft);
}

.law-link svg {
  transition: transform 0.2s ease;
}

.law-link:hover svg {
  transform: translate(1.5px, -1.5px);
}

/* ==========================================
   9. RESPONSIVE BREAKPOINTS
   ========================================== */
@media (max-width: 1024px) {
  main {
    grid-template-columns: 1fr;
  }
  
  .answer-panel,
  .evidence-panel {
    min-height: 460px;
  }
}

@media (max-width: 768px) {
  .shell {
    padding: 24px 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
  }

  .topbar-actions {
    justify-content: space-between;
    width: 100%;
  }

  .question-box {
    padding: 20px;
  }

  .query-actions {
    align-items: stretch;
    flex-direction: column;
    display: flex;
    gap: 20px;
  }

  .scope-picker {
    align-items: center;
    flex-direction: row;
    min-width: 0;
    width: 100%;
  }

  .scope-toggle {
    flex: 1;
    min-width: 0;
  }

  .scope-option {
    min-width: 0;
  }

  .actions {
    flex-direction: column;
    width: 100%;
  }

  .actions button {
    width: 100%;
  }

  button.attach {
    align-self: stretch;
  }
}
