:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  color: #eee8dd;
  background: #100d09;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --gold: #d3ad68;
  --gold-bright: #f0d69e;
  --muted: #9f9689;
  --line: rgba(224, 194, 139, .14);
  --wood: #24180e;
  --panel: rgba(25, 20, 15, .96);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  background:
    radial-gradient(ellipse at 54% -30%, rgba(201, 157, 85, .17), transparent 49%),
    repeating-linear-gradient(178deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px),
    linear-gradient(115deg, #100d09, #1a130d 46%, #110e0a);
}
button, input, textarea { font: inherit; }
button { color: inherit; }
.app-shell { display: flex; width: 100%; height: 100%; }
.rail {
  z-index: 3; display: flex; flex: 0 0 68px; flex-direction: column; align-items: center;
  gap: 14px; padding: 18px 0 15px; border-right: 1px solid var(--line);
  background: linear-gradient(90deg, #17110b, #21170d 55%, #17110b);
  box-shadow: 5px 0 26px rgba(0,0,0,.25);
}
.brand { color: var(--gold-bright); text-decoration: none; }
.brand-mark {
  display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(211,173,104,.48);
  border-radius: 12px; background: linear-gradient(145deg, #322215, #17110b);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 0 22px rgba(211,173,104,.08);
  font-family: Georgia, serif; font-size: 21px; font-weight: 700;
}
.rail-divider { width: 30px; border-top: 1px solid var(--line); margin: 3px 0; }
.rail-button {
  width: 39px; height: 39px; border: 1px solid transparent; border-radius: 11px;
  background: transparent; color: #a99a83; font-size: 24px; cursor: pointer;
}
.rail-button:hover, .rail-button.active { border-color: rgba(211,173,104,.24); background: rgba(211,173,104,.08); color: var(--gold-bright); }
.rail-spacer { flex: 1; }
.rail-status { color: #7cb28a; font-size: 12px; text-shadow: 0 0 10px rgba(124,178,138,.6); }
.main { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.browser-toolbar {
  z-index: 2; display: flex; flex: 0 0 62px; align-items: center; gap: 13px;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #251a10, #1b140c);
}
.navigation-controls { display: flex; gap: 5px; }
.navigation-controls button, .address-form button {
  width: 34px; height: 34px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: #c1b29a; font-size: 21px; cursor: pointer;
}
.navigation-controls button:hover, .address-form button:hover { border-color: var(--line); background: rgba(255,255,255,.04); color: var(--gold-bright); }
.address-form {
  display: flex; flex: 1; align-items: center; gap: 7px; height: 38px; padding: 0 5px 0 13px;
  border: 1px solid var(--line); border-radius: 11px; background: rgba(5,4,3,.43);
}
.address-form:focus-within { border-color: rgba(211,173,104,.5); box-shadow: 0 0 0 3px rgba(211,173,104,.06); }
.address-form input { width: 100%; border: 0; outline: 0; background: transparent; color: #e7dfd1; font-size: 12px; }
.sidebar-toggle { padding: 9px 13px; border: 1px solid rgba(211,173,104,.24); border-radius: 10px; background: rgba(211,173,104,.08); color: var(--gold-bright); font-size: 11px; cursor: pointer; }
.sidebar-toggle span { margin-right: 5px; }
.workspace { display: flex; flex: 1; min-height: 0; }
.browser-stage { position: relative; flex: 1; min-width: 0; overflow: auto; }
.search-view {
  width: min(810px, 100%); min-height: 100%; margin: 0 auto; padding: clamp(45px, 10vh, 105px) 28px 50px;
}
.web-brand { margin: 0 auto 29px; text-align: center; }
.eyebrow { color: #aa9168; font-size: 9px; font-weight: 700; letter-spacing: 1.65px; }
.aurum-wordmark {
  margin: 12px 0 3px; color: #f1e7d6; font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 7vw, 61px); font-weight: 600; letter-spacing: .16em;
  text-shadow: 0 3px 20px rgba(211,173,104,.15);
}
.aurum-wordmark span { color: var(--gold); }
.web-brand p { margin: 10px 0 0; color: #a79a87; font-size: 13px; letter-spacing: .025em; }
.search-form {
  display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 7px 8px 7px 18px;
  border: 1px solid rgba(211,173,104,.38); border-radius: 15px;
  background: linear-gradient(120deg, rgba(42,30,18,.98), rgba(22,17,12,.98));
  box-shadow: 0 17px 46px rgba(0,0,0,.29), inset 0 1px rgba(255,255,255,.04);
}
.search-form:focus-within { border-color: rgba(240,214,158,.78); box-shadow: 0 0 0 4px rgba(211,173,104,.07), 0 17px 46px rgba(0,0,0,.29); }
.search-icon { color: var(--gold); font-size: 26px; line-height: 1; }
.search-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #f0e9dd; font-size: 14px; }
.search-form input::placeholder { color: #8e8477; }
.search-form button {
  display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 16px;
  border: 1px solid rgba(240,214,158,.34); border-radius: 10px;
  background: linear-gradient(140deg, #d8b875, #b48b4b); color: #1c140a;
  font-size: 11px; font-weight: 750; cursor: pointer; box-shadow: inset 0 1px rgba(255,255,255,.23);
}
.search-form button:hover { background: linear-gradient(140deg, #f1d89e, #c9a35f); }
.search-form button span { font-size: 15px; }
.search-caption { margin: 11px 3px 0; color: #71685d; font-size: 10px; text-align: center; }
.results-area { margin-top: 29px; }
.summary-card {
  margin-bottom: 22px; padding: 19px 21px 17px; border: 1px solid rgba(211,173,104,.31);
  border-radius: 13px; background:
    repeating-linear-gradient(177deg, rgba(255,255,255,.014) 0 1px, transparent 1px 5px),
    linear-gradient(135deg, rgba(56,39,20,.75), rgba(30,23,15,.9));
  box-shadow: 0 12px 32px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.035);
}
.summary-heading { display: flex; align-items: center; gap: 11px; }
.summary-icon { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(211,173,104,.37); border-radius: 9px; color: var(--gold-bright); }
.summary-heading > div { display: grid; gap: 4px; }
.summary-heading strong { color: #e4d7bf; font-size: 11px; font-weight: 600; }
.summary-card > p { margin: 14px 0 10px; color: #e7dfd1; font-size: 13px; line-height: 1.75; white-space: pre-wrap; }
.summary-card > small { color: #988b77; font-size: 10px; }
.results-heading { display: flex; justify-content: space-between; gap: 15px; margin: 0 2px 6px; color: #958b7e; font-size: 10px; }
#search-status { overflow-wrap: anywhere; text-align: right; }
.search-results { display: grid; }
.result-card { position: relative; padding: 17px 12px 17px 30px; border-bottom: 1px solid rgba(224,194,139,.09); }
.source-number { position: absolute; top: 19px; left: 2px; color: #ad8b52; font-size: 9px; }
.result-source { overflow: hidden; color: #8ea087; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.result-title { display: inline-block; margin-top: 5px; color: #e3c88f; font-family: Georgia, serif; font-size: 17px; text-decoration: none; }
.result-title:hover { color: #ffe4a8; text-decoration: underline; text-underline-offset: 3px; }
.result-description { margin: 7px 0 0; color: #b8afa1; font-size: 12px; line-height: 1.65; }
.page-placeholder { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 12px; background: #fff; color: #605447; font-size: 12px; }
.placeholder-mark { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid #d5c6ac; border-radius: 14px; color: #997738; font-family: Georgia,serif; font-size: 25px; }
.assistant-panel {
  display: flex; flex: 0 0 340px; flex-direction: column; min-width: 280px; max-width: 390px;
  border-left: 1px solid var(--line);
  background:
    repeating-linear-gradient(177deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #21170e, #17110b);
  box-shadow: -10px 0 32px rgba(0,0,0,.15);
}
.assistant-header { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 15px 19px; border-bottom: 1px solid var(--line); }
.assistant-title { display: flex; align-items: center; gap: 11px; }
.assistant-emblem { display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid rgba(211,173,104,.39); border-radius: 11px; background: linear-gradient(145deg,#392819,#1c140c); color: var(--gold-bright); font-family: Georgia,serif; font-size: 17px; }
.assistant-title h1 { margin: 4px 0 0; color: #eee5d7; font-family: Georgia,serif; font-size: 17px; font-weight: 500; }
.online-indicator { width: 7px; height: 7px; border-radius: 50%; background: #8ab38b; box-shadow: 0 0 10px rgba(138,179,139,.65); }
.context-chip { display: flex; align-items: center; gap: 8px; overflow: hidden; margin: 13px 15px 0; padding: 8px 10px; border: 1px solid rgba(211,173,104,.14); border-radius: 8px; background: rgba(0,0,0,.15); color: #aa9b83; font-size: 10px; }
.context-chip > span:first-child { color: var(--gold); }
#context-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation { display: flex; flex: 1; flex-direction: column; gap: 12px; overflow: auto; padding: 16px 15px; }
.message { max-width: 100%; padding: 12px 13px; border: 1px solid rgba(224,194,139,.11); border-radius: 11px; background: rgba(4,3,2,.22); }
.assistant-message { align-self: flex-start; }
.user-message { align-self: flex-end; border-color: rgba(211,173,104,.24); background: rgba(211,173,104,.08); }
.message-label { color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: 1.25px; }
.user-message .message-label { color: #b9ad9a; }
.message p { margin: 6px 0 0; color: #d7cebf; font-size: 11px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.message small { display: block; margin-top: 8px; color: #928676; font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.chat-form { margin: 0 13px 13px; padding: 8px; border: 1px solid rgba(211,173,104,.21); border-radius: 11px; background: rgba(0,0,0,.22); }
.chat-form textarea { width: 100%; min-height: 62px; max-height: 140px; resize: vertical; border: 0; outline: 0; background: transparent; color: #e8dfd1; font-size: 11px; line-height: 1.6; }
.chat-form textarea::placeholder { color: #82786b; }
.chat-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 5px; color: #796f61; font-size: 9px; }
.chat-form-footer button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 9px; background: linear-gradient(135deg,#e1c17d,#b38a4a); color: #20170d; font-size: 18px; cursor: pointer; }
.chat-form-footer button:disabled { opacity: .5; cursor: wait; }
.page-actions { margin: 0 14px 12px; border-top: 1px solid var(--line); color: #b5a68e; font-size: 10px; }
.page-actions summary { padding: 12px 1px 6px; cursor: pointer; }
.page-actions > p { color: #877c6d; font-size: 9px; }
#save-page-button { width: 100%; padding: 8px; border: 1px solid rgba(211,173,104,.25); border-radius: 7px; background: rgba(211,173,104,.1); color: var(--gold-bright); font-size: 9px; cursor: pointer; }
#save-page-button:disabled { opacity: .55; cursor: wait; }
#click-form { display: flex; gap: 6px; }
#click-form input { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; outline: none; background: #130f0a; color: #eee8dd; font-size: 10px; }
#click-form button { padding: 0 9px; border: 1px solid rgba(211,173,104,.25); border-radius: 7px; background: rgba(211,173,104,.1); color: var(--gold-bright); font-size: 9px; white-space: nowrap; cursor: pointer; }
.assistant-footer { padding: 10px 15px 14px; border-top: 1px solid rgba(224,194,139,.08); color: #746a5d; font-size: 9px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.assistant-collapsed .assistant-panel { display: none; }
.desktop .search-view { padding-top: clamp(35px, 8vh, 80px); }

@media (max-width: 800px) {
  .assistant-panel { flex-basis: 300px; min-width: 250px; }
  .browser-toolbar { gap: 7px; padding: 8px; }
  .navigation-controls { gap: 1px; }
  .sidebar-toggle { padding: 8px; font-size: 0; }
  .sidebar-toggle span { margin: 0; font-size: 14px; }
}
@media (max-width: 620px) {
  .rail { flex-basis: 52px; }
  .assistant-panel { flex: 1; min-width: 0; max-width: none; border-left: 0; }
  .workspace { flex-direction: column; }
  .browser-stage { min-height: 53%; }
  .assistant-panel { min-height: 42%; border-top: 1px solid var(--line); }
  .assistant-header { min-height: 53px; padding: 8px 12px; }
  .conversation { padding: 9px 11px; }
  .assistant-footer { display: none; }
  .search-view { padding: 38px 17px 22px; }
  .web-brand { margin-bottom: 23px; }
  .search-form { min-height: 52px; padding-left: 12px; }
  .search-form button { min-height: 38px; padding: 0 10px; }
  .address-form { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
