:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #132e2d;
  background: #f3f6f3;
  font-size: 16px;
  --paper: #fff;
  --muted: #526963;
  --border: #d7e2da;
  --accent: #08664e;
  --deep: #132f2d;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 1px solid var(--border); background: #fff; color: inherit; border-radius: 9px; padding: .66rem .87rem; font-weight: 650; }
button:hover { background: #eaf2ed; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #6fb99a; outline-offset: 2px; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary:hover { background: #074d3c; }
a { color: var(--accent); text-underline-offset: .2em; }
h1 { margin: 0; font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 680; letter-spacing: -.07em; }
h2 { margin: 0 0 .9rem; font-size: 1.45rem; letter-spacing: -.035em; }
p { margin: 0; line-height: 1.55; }
.muted { color: var(--muted); }
.error { color: #9d302d; min-height: 1.25em; }
input, textarea, select { width: 100%; color: inherit; border: 1px solid #c6d6cc; border-radius: 8px; background: #fff; padding: .68rem .75rem; }
label { display: grid; gap: .42rem; font-size: .9rem; font-weight: 650; }
textarea { resize: vertical; }
.workspace { display: grid; min-height: 100vh; grid-template-columns: minmax(200px, 225px) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: #f3fbf4; background: var(--deep); padding: 1.5rem .9rem 1rem; }
.brand { display: flex; gap: .65rem; align-items: center; font-weight: 750; margin: 0 .35rem 2.25rem; font-size: 1.1rem; }
.mark { display: inline-grid; place-content: center; width: 36px; height: 36px; border-radius: 11px; background: #b1e7a8; gap: 3px; flex: 0 0 auto; transform: rotate(-7deg); }
.mark i { display: block; height: 2px; width: 17px; border-radius: 2px; background: #173d32; }
.mark i:nth-child(2) { width: 11px; }
nav { display: grid; gap: .28rem; }
.sidebar button { color: #cbdad4; background: transparent; border: 0; text-align: left; }
.sidebar button:hover, .sidebar button[aria-current] { background: #294641; color: #fff; }
.logout { margin-top: auto; }
.main { width: 100%; max-width: 1380px; margin: auto; padding: clamp(1rem, 4vw, 3.3rem); align-self: start; }
.page-heading { display: flex; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 1.35rem; }
.controls { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(130px, 210px) auto auto; gap: .55rem; margin-bottom: 1.3rem; }
.controls select { min-width: 0; }
.columns { display: grid; grid-template-columns: minmax(235px, 2fr) minmax(310px, 3fr); gap: 1rem; align-items: start; }
.note-list, .stack { display: grid; gap: .65rem; }
.card { background: var(--paper); border: 1px solid var(--border); border-radius: 13px; padding: 1.2rem; }
.detail { min-height: 240px; overflow-wrap: anywhere; }
.detail h2 { margin: .45rem 0 .8rem; }
.detail-header, .endpoint, .key-row { display: flex; gap: .65rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.entry { text-align: left; padding: .95rem; display: grid; gap: .46rem; border-radius: 12px; background: var(--paper); }
.entry[aria-current] { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.entry .title { font-size: 1.05rem; line-height: 1.35; }
.entry .excerpt { font-weight: 400; font-size: .91rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 1rem 0; }
.meta { font-size: .85rem; color: var(--muted); font-weight: 550; }
.tag { border-radius: 20px; padding: .18rem .5rem; background: #e7f4e9; color: #24503d; font-size: .82rem; font-weight: 650; display: inline-block; margin-right: .4rem; margin-bottom: .3rem; }
.tag.outdated { background: #fff0d9; color: #754b17; }
.empty { padding: 1rem .8rem; color: var(--muted); }
.export { display: flex; gap: 1.25rem; margin-top: 1.15rem; font-size: .9rem; }
.answer, .endpoint, .banner { margin-bottom: 1rem; }
.banner { padding: .75rem 1rem; border: 1px solid #a8c6b4; background: #e6f1e9; border-radius: 8px; }
.endpoint code { overflow-wrap: anywhere; font-size: .88rem; }
#more { margin-top: .6rem; }
.detail details { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.detail summary { cursor: pointer; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(circle at 18% 14%, #dcebe0 0, transparent 55%), #f3f6f3; }
.login-card { width: min(100%, 405px); padding: 2rem; display: grid; gap: 1rem; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 16px 50px #15392b16; }
.login-card h1 { font-size: 2rem; }
dialog { color: inherit; width: min(610px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; border: 1px solid var(--border); border-radius: 15px; padding: 1.5rem; }
dialog::backdrop { background: #0f2827a6; }
dialog form { display: grid; gap: .8rem; }
#token-dialog p { margin-bottom: .8rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.checkbox { display: flex; align-items: center; gap: .55rem; }
.checkbox input { width: 1.1rem; height: 1.1rem; }
.actions { display: flex; justify-content: flex-end; gap: .55rem; margin-top: .65rem; }
@media (max-width: 850px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: .9rem 1rem; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .6rem; }
  .brand { margin: 0; }
  nav { display: flex; flex-wrap: wrap; grid-row: 2; grid-column: 1 / -1; }
  .logout { margin: 0; }
}
@media (max-width: 620px) {
  .main { padding: 1.15rem .8rem; }
  .columns { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr auto auto; }
  .controls input { grid-column: 1 / -1; }
  .page-heading { gap: .65rem; }
  .page-heading h1 { font-size: 1.9rem; }
  .page-heading button { font-size: .88rem; }
}
