:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #302e41; background: #fffaf1; color-scheme: light;
  --lunar: #2f3a73; --lilac: #d9c7f0; --line: #d8d6e2;
  --muted: #58586b; --surface: #fff; --danger: #a32437;
  --focus: #2f3a73; --radius: 10px;
}
* { box-sizing: border-box; scrollbar-color: #9289a9 #f1eef6; scrollbar-width: thin; }
body { margin: 0; }
a { color: var(--lunar); text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: inherit; }
button { padding: 10px 15px; min-height: 44px; cursor: pointer; font-weight: 600; }
button:hover:not(:disabled) { background: #f0edf7; border-color: #827699; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.primary { background: var(--lunar); color: white; border-color: var(--lunar); }
button.primary:hover:not(:disabled) { background: #222c5c; }
button.danger { color: var(--danger); }
button[aria-pressed="true"] { background: #ebe4f5; color: var(--lunar); border-color: #827699; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: fixed; top: 8px; left: 12px; background: white; padding: 12px; z-index: 5; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.skip:focus { clip-path: none; width: auto; height: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px max(24px, calc((100vw - 1440px) / 2)); border-bottom: 1px solid var(--line); background: white; }
.brand { font-family: Georgia, serif; font-size: 27px; font-weight: 750; text-decoration: none; }
.brand span { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 10px; }
main { max-width: 1440px; padding: 36px 24px 64px; margin: auto; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
h1 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -.035em; margin: 0 0 8px; color: var(--lunar); }
h2 { font-size: 23px; margin: 0; letter-spacing: -.02em; }
h3 { font-size: 18px; margin: 0; }
p { line-height: 1.6; max-width: 78ch; }
.heading p { margin-top: 0; color: var(--muted); }
.note { background: #eee8f6; border-left: 3px solid #8a6aaf; padding: 12px 16px; font-size: 14px; max-width: none; line-height: 1.5; }
.toolbar { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; padding: 22px 0; border-bottom: 1px solid var(--line); }
label { display: flex; flex-direction: column; gap: 7px; font-size: 14px; font-weight: 600; }
label span { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; }
select { min-width: 128px; }
.search { flex: 1 1 250px; }
.search-control { display: flex; gap: 6px; margin-top: 7px; }
.viewbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 0; }
.viewbar p { margin: 0 auto 0 0; color: var(--muted); }
.viewbar [role="group"] { display: flex; gap: 4px; }
#feedback { min-height: 28px; color: var(--lunar); line-height: 1.5; }
#content { min-height: 300px; }
.state { padding: 44px 24px; border: 1px dashed #b9b2c9; border-radius: var(--radius); background: white; }
.state p { color: var(--muted); }
.ideas { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.idea { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-wrap: anywhere; }
.idea h3 { line-height: 1.4; }
.idea p { white-space: pre-wrap; color: var(--muted); margin: 10px 0 16px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.tag { padding: 4px 8px; background: #f0eef5; font-size: 12px; border-radius: 4px; line-height: 1.5; }
.tag.llm { background: #e6dbf4; color: #49315e; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 16px; overflow-x: auto; padding: 4px 4px 18px; }
.column { background: #eeecf3; border-radius: var(--radius); padding: 14px; min-width: 0; }
.column h2 { display: flex; justify-content: space-between; font-size: 16px; padding: 4px 2px 16px; gap: 12px; }
.column h2 span { font-weight: 400; color: var(--muted); }
.column .idea { padding: 16px; }
dialog { width: min(660px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--line); border-radius: 16px; color: inherit; overflow-y: auto; }
dialog::backdrop { background: rgb(30 26 48 / 48%); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
#idea-form > label { margin-top: 18px; }
#idea-form > input, #idea-form > textarea { margin-top: 7px; }
textarea, .resize-none { resize: none; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.form-grid select { min-width: 0; }
.field-error { color: var(--danger); font-size: 14px; margin: 5px 0; }
[aria-invalid="true"] { border: 2px solid var(--danger); }
#form-error:not(:empty) { background: #fff0f1; padding: 12px; color: #81202c; line-height: 1.5; }
.actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
#delete { margin-right: auto; }
[hidden] { display: none; }
.topbar { border-top: 6px solid var(--lunar); }
.login { max-width: 560px; margin: 36px auto; border-left: 6px solid var(--lilac); padding-left: 28px; }
.login input { margin: 8px 0 16px; }
.login .search-control input { margin: 0; }
.login button { margin: 8px 4px 8px 0; }
.session { display: flex; justify-content: flex-end; gap: 16px; align-items: center; margin-bottom: 24px; overflow-wrap: anywhere; }
#tokens-panel { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; padding: 12px 0; color: var(--lunar); }
summary:hover { text-decoration: underline; }
#token-form { display: grid; gap: 12px; max-width: 560px; }
#token-feedback { min-height: 52px; }
#tokens { padding-left: 20px; }
#tokens li { border-bottom: 1px solid var(--line); padding: 12px 0; overflow-wrap: anywhere; }
#token-secret { width: 100%; padding: 12px; margin: 12px 0; }
#auth-feedback { min-height: 56px; }
*::-webkit-scrollbar { width: 12px; height: 12px; }
*::-webkit-scrollbar-track { background: #edeaf2; }
*::-webkit-scrollbar-thumb { background: #79738e; border: 2px solid #edeaf2; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #51486d; }
@media (max-width: 680px) {
  main { padding: 26px 16px; }
  .topbar { padding: 18px 16px; }
  .brand span { display: block; margin: 0; }
  .heading { align-items: start; flex-direction: column; gap: 8px; }
  .toolbar > label { flex: 1 1 130px; }
  .form-grid { grid-template-columns: 1fr; }
  dialog { padding: 20px; }
  .board { grid-auto-flow: row; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto; } }
@media (forced-colors: active) { * { scrollbar-color: auto; } .tag, .note { border: 1px solid; } }

.turnstile-slot { min-height: 108px; max-width: 100%; margin-block: 12px; }
.turnstile-slot p { min-height: 2.5em; font-size: 0.9rem; }

/* Shared password workflow geometry; existing palette/type remain canonical. */
#password-form { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
#password-form label { margin-bottom: 0; }
#password-form p { margin: 0 0 8px; }
#password-form button { align-self: flex-start; }
.login .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.password-change { max-width: 560px; margin: 24px 0; }
.password-change summary { cursor: pointer; padding: 12px 0; }
.password-change form { display: grid; gap: 10px; }
.password-change button { justify-self: start; }
.password-change summary:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

.auth-heading { display: flex; align-items: center; gap: 12px; }
.auth-heading h1 { margin-block: 0; }
#auth-back { flex: 0 0 44px; font-size: 24px; padding: 0; }
#password-form .auth-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.turnstile-slot p:empty { display: none; }

/* Visibility control belongs to the input, with a full keyboard/touch target. */
.password-field { position: relative; width: 100%; min-width: 0; }
.password-field input { width: 100%; padding-right: 52px; margin: 0; }
.password-field .password-toggle { position: absolute; inset: 0 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; height: 100%; padding: 0; margin: 0; border: 0; border-radius: 0 6px 6px 0; background: transparent; color: var(--lunar); transform: none; }
.password-field .password-toggle:hover { background: var(--surface); transform: none; }
.password-field .password-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }
.password-toggle svg { pointer-events: none; flex-shrink: 0; }
.password-field input::-ms-reveal { display: none; }
