:root {
  color-scheme: light;
  font: 16px/1.5 system-ui, sans-serif;
  color: #252a28;
  background: #f3f1e9;
  --paper: #fffdf7;
  --ink: #1b3029;
  --muted: #4b5a50;
  --line: #cbcfc2;
  --accent: #23583e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.frame { width: min(100% - 2rem, 66rem); margin-inline: auto; }
.masthead { border-bottom: 1px solid #416153; background: var(--ink); color: #fffdf7; }
.header-row, .intro, .panel-title, .search-row, .actions {
  display: flex; align-items: center; gap: .75rem;
}
.header-row, .intro, .panel-title { justify-content: space-between; }
.header-row { min-height: 4.4rem; }
.brand { color: inherit; font-size: 1.2rem; text-decoration: none; font-weight: 750; }
.brand span { font-weight: 400; color: #c1d8c6; }
.stage { font-size: .85rem; color: #dfebdf; }
.header-links { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 0 .85rem; }
.admin-link { display: inline-flex; align-items: center; min-height: 2.75rem; color: inherit; font-size: .9rem; }
.admin-link:focus-visible { outline-color: #dfebdf; }
main { padding-block: clamp(1.5rem, 4vw, 3.25rem); }
h1, h2, p, dl, dd { margin: 0; }
h1 { font: 500 clamp(2rem, 6vw, 3.5rem)/1.1 Georgia, serif; letter-spacing: -.035em; color: var(--ink); }
h2 { font: 600 1.33rem/1.2 Georgia, serif; color: var(--ink); }
p { color: var(--muted); }
p:empty { margin: 0; }
p + form, h1 + p, summary + p, dl, .settings .actions, #token-box { margin-top: .65rem; }
.intro { align-items: end; margin-bottom: 1.5rem; flex-wrap: wrap; }
.usage { min-width: 0; max-width: 100%; padding: .65rem 1rem; border-left: 2px solid var(--accent); background: #e9eee4; }
.usage p { font-size: .895rem; }
#workspace-reference { margin-top: .25rem; overflow-wrap: anywhere; }
progress { width: 10rem; max-width: 100%; accent-color: var(--accent); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.panel, .entry-card { background: var(--paper); border: 1px solid var(--line); border-radius: .6rem; padding: clamp(1rem, 3vw, 1.5rem); min-width: 0; }
.entry-card { max-width: 38rem; margin: 3vh auto; }
.entry-section { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.usage-label { margin-bottom: .25rem; }
.panel-title { flex-wrap: wrap; }
label { display: block; margin: 1rem 0 .3rem; font-weight: 650; }
input, textarea, select, button { font: inherit; }
input, textarea, select {
  min-width: 0; padding: .55rem .7rem;
  background: white; color: #222; border: 1px solid #7e8d81; border-radius: .25rem;
}
input, textarea { width: 100%; }
select { max-width: 100%; }
textarea { resize: vertical; min-height: 9rem; }
input[readonly] { background: #eeefe7; }
button {
  min-height: 2.75rem; padding: .5rem .85rem; border: 1px solid var(--accent);
  border-radius: .3rem; color: white; background: var(--accent); font-weight: 650; cursor: pointer;
}
.primary-link {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem .85rem;
  border-radius: .3rem; color: white; background: var(--accent); font-weight: 650; text-decoration: none;
}
.primary-link:hover { background: #15452d; }
button:disabled { opacity: .65; cursor: wait; }
button:hover:not(:disabled) { background: #15452d; }
button.quiet { background: transparent; color: var(--accent); }
button.quiet:hover:not(:disabled) { background: #e7efe6; }
button.danger { background: #8b2b2d; border-color: #8b2b2d; }
:focus-visible { outline: 2px solid #2379a8; outline-offset: 3px; }
.actions { flex-wrap: wrap; margin-top: .6rem; }
form > button { margin-top: .7rem; }
form p, .settings p + p, #permission-guidance, #source-status, #client-status, #recovery-status { margin-top: .65rem; }
[data-kind="error"] { color: #8b2b2d; }
#results { list-style: none; padding: 0; margin: 0; }
#results li { border-top: 1px solid var(--line); padding: .85rem 0; margin-top: .55rem; }
#results button { text-align: left; overflow-wrap: anywhere; }
#results p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: .45rem; }
.settings { margin-top: 1rem; }
summary { cursor: pointer; font-weight: 650; color: var(--ink); }
dt { font-weight: 650; }
dd { overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
a { color: var(--accent); }
@media (max-width: 660px) {
  .grid { grid-template-columns: 1fr; }
  .intro { align-items: start; }
}

.connection { border-top: 3px solid var(--accent); }
.connection h2 + p, .connection .copy, .connection #codex-token-help, .connection #openclaw-token-help,
.connection section > p, .knowledge .grid { margin-top: .65rem; }
.connection-state { font-weight: 700; color: var(--ink); }
#test-prompt { padding: .75rem; background: #e9eee4; border-radius: .25rem; }
