:root {
  --bg: #f5f7f9; --card: #fff; --ink: #1d2733; --muted: #5d6b7a; --line: #dde3ea;
  --accent: #1f5f8b; --accent-ink: #fff; --user: #e6f0f7; --ok: #1d7a46; --err: #b3261e; --warn: #fff6d6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--accent); }
.brand span { font-weight: 400; color: var(--muted); margin-left: 6px; }
.banner { background: var(--warn); padding: 8px 16px; font-size: 14px; text-align: center; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.narrow { max-width: 460px; margin: 24px auto; }
h1 { font-size: 24px; margin: 0 0 8px; } h2 { font-size: 18px; margin: 0 0 12px; } h3 { font-size: 15px; margin: 18px 0 6px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
label { display: block; margin: 12px 0; font-weight: 600; }
label small { display: block; font-weight: 400; color: var(--muted); }
input, textarea { width: 100%; margin-top: 4px; padding: 10px; font: inherit; border: 1px solid var(--line); border-radius: 6px; }
textarea { resize: vertical; }
button { font: inherit; padding: 10px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { border: 0; background: none; color: var(--accent); padding: 6px 0; margin-left: 8px; }
.tabs { display: flex; gap: 4px; margin: 16px 0 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; }
.tabs button.active { border-bottom-color: var(--accent); font-weight: 700; }
.msg { min-height: 1.2em; color: var(--err); font-size: 14px; } .msg.ok { color: var(--ok); }
.stories { list-style: none; padding: 0; }
.stories li button { width: 100%; text-align: left; margin-bottom: 8px; }
.stories .submitted { color: var(--ok); } .stories .draft { color: var(--accent); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; align-items: start; }
.messages { height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.bubble { max-width: 85%; padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; }
.bubble.assistant { background: var(--bg); align-self: flex-start; }
.bubble.user { background: var(--user); align-self: flex-end; }
.bubble.thinking { color: var(--muted); }
.send { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.send button { flex: none; }
.summary ul { margin: 0; padding-left: 20px; }
.summary .row { display: flex; gap: 12px; align-items: center; }
.uploads li { font-size: 14px; }
label.file { display: inline-block; font-weight: 400; padding: 8px 14px; border: 1px dashed var(--accent); border-radius: 6px; color: var(--accent); cursor: pointer; }
label.file input { display: none; }
.submit, .sent { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
label.check { display: flex; gap: 8px; font-weight: 400; } label.check input { width: auto; margin-top: 5px; }
.sent h3 { color: var(--ok); }
.foot { text-align: center; padding: 24px 16px; }
table { width: 100%; border-collapse: collapse; } td, th { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.pick { cursor: pointer; } tr.pick:hover { background: var(--bg); }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } .messages { height: 45vh; } }

/* standard password field (vanilla/modules/auth) */
.password-wrapper { position: relative; display: block; }
.password-wrapper input { padding-right: 2.75rem; width: 100%; box-sizing: border-box; }
.password-toggle { position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0.25rem; margin: 0; display: flex; align-items: center; }
.password-toggle svg { width: 20px; height: 20px; }
.switch-page { margin-top: 18px; text-align: center; }
.brand a { color: inherit; text-decoration: none; }
.brand a.back-app { font-weight: 400; color: var(--accent); margin-left: 14px; text-decoration: underline; }
