:root {
  color-scheme: dark;
  --bg: #111820;
  --panel: #19232d;
  --panel-2: #202d38;
  --text: #eef3f6;
  --muted: #aebbc5;
  --line: #344552;
  --accent: #d5a84f;
  --accent-text: #17120a;
  --link: #8dc7ee;
}

:root[data-brand="myorigin"] {
  color-scheme: light;
  --bg: #f1f5f1;
  --panel: #ffffff;
  --panel-2: #e7efeb;
  --text: #1d2b2c;
  --muted: #5a6967;
  --line: #b9cbc5;
  --accent: #2e6e70;
  --accent-text: #ffffff;
  --link: #1f6065;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--link); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

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

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(24px, 3vw, 34px); }
h2 { margin-bottom: 5px; font-size: 20px; }
h3 { margin-bottom: 6px; font-size: 16px; }
.subhead, .section-heading p { margin-bottom: 0; color: var(--muted); }

.tree-link, button, .action-link {
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: none;
}

.tree-link, .action-link { padding: 8px 11px; }

main {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 40px;
}

.panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.library-form {
  display: grid;
  grid-template-columns: 180px 1fr 160px auto;
  align-items: end;
  gap: 10px;
}

label { color: var(--muted); font-size: 13px; font-weight: 650; }

input, select, button {
  width: 100%;
  min-height: 38px;
  margin-top: 5px;
  padding: 7px 9px;
  border-radius: 4px;
  font: inherit;
}

input, select {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}

button { cursor: pointer; }

.library-result {
  display: none;
  margin-top: 14px;
  padding: 13px;
  border-left: 3px solid var(--accent);
  background: var(--panel-2);
}

.library-result.visible { display: block; }
.library-result p:last-child { margin-bottom: 0; }
.library-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.source-filter { width: min(380px, 100%); margin: 0; }

.source-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.source-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
}

.source-card p { min-height: 42px; margin-bottom: 11px; color: var(--muted); }
.source-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tag { padding: 2px 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: 12px; }
.privacy-note { padding: 12px 14px; border: 1px solid var(--line); color: var(--muted); }

@media (max-width: 760px) {
  .topbar, .section-heading { align-items: stretch; flex-direction: column; }
  .library-form { grid-template-columns: 1fr; }
  .source-filter { width: 100%; }
}
