/* The DANE chat page: a header, the chat, a source panel, a footer. The chat itself is styled by
   the component inside its shadow root (look.colors); only --chat-* variables cross into it. */
:root {
  --dane: #a01840;
  --dane-dark: #7a1230;
  --bg: #fafafa;
  --surface: #fff;
  --text: #2d2d2d;
  --muted: #6b7280;
  --border: #e5e5e5;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
html, body { height: 100%; margin: 0; }
.dane * { box-sizing: border-box; }
.dane {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100dvh;
}

.top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: var(--surface);
  border-bottom: 3px solid var(--dane);
}
.brand img { display: block; height: 40px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; color: var(--dane-dark); }
.brand-text span { font-size: 12.5px; color: var(--muted); }
.beta {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dane);
  border: 1px solid var(--dane);
  border-radius: 999px;
  padding: 2px 8px;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  min-height: 0;
  transition: grid-template-columns 0.15s ease;
}
.shell.with-panel { grid-template-columns: minmax(0, 1fr) min(420px, 42vw); }
.chat-host { min-height: 0; display: flex; }
#chat {
  flex: 1;
  min-height: 0;
  height: 100%;
  --chat-primary: var(--dane);
  --chat-background: var(--bg);
  --chat-surface: var(--surface);
  --chat-foreground: var(--text);
  --chat-font: var(--font);
}

.panel {
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.panel[hidden] { display: none; }
.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
}
.panel-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.panel-title strong { font-size: 14px; overflow-wrap: anywhere; }
.kind {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dane);
}
.ghost {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}
.ghost:hover { color: var(--text); }
.panel-ref {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--border);
}
.panel-ref:empty { display: none; }
.panel-body {
  padding: 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.panel-body.empty { color: var(--muted); font-style: italic; }
.panel-body a { color: var(--dane); }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 8px 18px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.foot .status:empty { display: none; }
.foot .note { margin-left: auto; }

@media (max-width: 720px) {
  .top { padding: 8px 12px; gap: 10px; }
  .brand img { height: 32px; }
  .brand-text span { display: none; }
  .shell, .shell.with-panel { grid-template-columns: minmax(0, 1fr); }
  .panel {
    position: fixed;
    inset: auto 0 0 0;
    height: 70dvh;
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
    z-index: 10;
  }
  .foot { padding: 6px 12px; }
  .foot .note { margin-left: 0; }
}
.foot .signin { color: var(--muted); }
.foot .signin:hover { color: var(--dane); }
