:root {
  --accent: #265caa;
  --accent-hover: #1e4b8f;
  --accent-ink: #ffffff;
  --bg: #ffffff;
  --side-bg: #f6f7f9;
  --ink: #1e1f21;
  --muted: #59606d;
  --line: #e3e5e8;
  --field-border: #c4c7ce;
  --bubble: var(--accent);
  --danger: #b92525;
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
circle[r="1.3"] { fill: currentColor; }

.brand-logo { display: block; width: 44px; height: 44px; object-fit: contain; flex: none; }
.brand-name { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
.startup { display: grid; align-content: center; justify-items: center; padding: 24px; min-height: 100dvh; text-align: center; }
.startup p { margin: 0 0 8px; }
.startup a { color: var(--accent); padding: 12px 0; }

/* login — Asana-inspired clean workspace sign-in */
.login { position: fixed; inset: 0; display: flex; flex-direction: column; min-height: 100dvh; overflow-y: auto; background: #ffffff; }
.login-head { flex: none; padding: calc(24px + var(--safe-t)) 32px 16px; }
.login-main { flex: 1; width: 100%; max-width: 416px; margin: 0 auto; padding: 24px 24px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-title { font-size: 32px; font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 24px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.login-field label { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.login-field input { width: 100%; height: 44px; padding: 10px 14px; font-size: 16px; color: var(--ink); background: #ffffff; border: 1px solid var(--field-border); border-radius: 8px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.login-field input:hover { border-color: #8d939f; }
.login-field input:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.login-err { background: #fdf2f2; border: 1px solid #f2c4c4; color: var(--danger); border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.4; }
.login-err:empty { display: none; }
.err { color: var(--danger); font-size: 14px; margin-top: 6px; }
.login-btn { height: 44px; width: 100%; margin-top: 4px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; font-size: 16px; font-weight: 500; transition: background-color .15s ease; }
.login-btn:hover { background: var(--accent-hover); }
.login-btn:active { background: #173c73; }

/* layout */
.app { display: flex; height: 100dvh; overflow: hidden; }
.sidebar { width: 296px; flex: none; background: var(--side-bg); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding-top: var(--safe-t); }
.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; padding-top: var(--safe-t); }

.side-head { min-height: 72px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.side-head .brand-logo { width: 36px; height: 36px; }
.side-head .brand-name { font-size: 16px; }
.new-chat-btn { min-height: 44px; padding: 0 12px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 600; white-space: nowrap; transition: background-color .12s ease; }
.new-chat-btn:hover { background: var(--accent-hover); }
.side-head { position: relative; z-index: 2; }
.create-button { width: 44px; padding: 0; font-size: 24px; }
.side-head .menu { top: calc(100% - 6px); right: 16px; }
.side-head .menu button:disabled { color: var(--muted); cursor: default; }

.chat-head { height: 56px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); position: relative; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--ink); flex: none; }
.icon-btn:hover { background: rgba(15, 23, 42, 0.05); }
.icon-btn:disabled { opacity: .38; cursor: default; }

.chat-list { flex: 1; overflow-y: auto; padding: 10px 8px 14px; }
.chat-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; text-align: left; padding: 8px; border-radius: 6px; font-size: 16px; color: var(--ink); transition: background-color .12s ease; }
.chat-item:hover, .folder-row button:hover { background: rgba(15, 23, 42, 0.045); }
.chat-item.active, .folder-row.active { background: #e8eff9; font-weight: 600; }
.chat-item .t { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-item .pin { color: var(--muted); font-size: 13px; }
.chat-item .busy { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.list-sep { height: 1px; background: var(--line); margin: 8px; }
.side-foot { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 16px calc(4px + var(--safe-b)); font-size: 16px; font-weight: 500; border-top: 1px solid var(--line); }
.account-label { display: flex; align-items: center; min-width: 0; }
#meName { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#accountSettings { width: 44px; height: 44px; color: var(--muted); }
#accountSettings svg { width: 19px; height: 19px; }
.side-foot .account-menu { inset: auto auto calc(100% + 6px) 12px; min-width: 180px; }
.account-menu button { min-height: 44px; }
.side-foot .link-btn { min-height: 44px; padding: 0; font-size: 16px; }
.link-btn { color: var(--accent); font-size: 14px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

.chat-title { flex: 1; min-width: 0; font-weight: 600; font-size: 17px; text-align: left; padding-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { display: none; }
.model-btn { height: 32px; padding: 0 9px; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 500; color: var(--muted); flex: none; transition: background-color .12s ease, color .12s ease; }
.model-btn:hover { background: rgba(15, 23, 42, 0.05); color: var(--ink); }
.model-btn svg { width: 14px; height: 14px; stroke-width: 2; opacity: .75; }
.menu { position: absolute; right: 12px; top: 52px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 16px rgba(15, 23, 42, 0.09); padding: 6px; z-index: 20; min-width: 200px; }
.menu button { display: block; width: 100%; text-align: left; padding: 11px 12px; border-radius: 8px; font-size: 16px; }
.menu button:hover { background: var(--side-bg); }
.menu .danger { color: var(--danger); }
.model-menu { right: 52px; min-width: 244px; }
.model-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; }
.model-opt-t { display: block; font-size: 14.5px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.model-opt-d { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.model-chk { width: 15px; height: 15px; color: var(--accent); flex: none; opacity: 0; }
.model-menu button.active .model-chk { opacity: 1; }
.model-menu button.active .model-opt-t { font-weight: 600; }

/* messages */
.messages { flex: 1; overflow-y: auto; padding: 20px 16px 12px; -webkit-overflow-scrolling: touch; }
.msg { max-width: 760px; margin: 0 auto 22px; display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; margin: 24px auto 18px; }
.msg.user:first-child { margin-top: 2px; }
.msg.user .bubble { background: var(--bubble); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--radius); border-bottom-right-radius: 6px; max-width: 85%; white-space: pre-wrap; word-wrap: break-word; font-size: 16px; line-height: 1.45; }
.msg.assistant .md { font-size: 16px; line-height: 1.58; word-wrap: break-word; overflow-wrap: anywhere; }
.md p { margin: 0 0 .7em; } .md p:last-child { margin-bottom: 0; }
.md ul, .md ol { padding-left: 1.3em; margin: .3em 0 .7em; }
.md li { margin: .2em 0; }
.md h1, .md h2, .md h3 { font-size: 1.12em; margin: 1em 0 .4em; }
.md code { background: #f1f3f5; padding: .1em .35em; border-radius: 6px; font-size: .9em; }
.md pre { background: #f6f8fa; border: 1px solid var(--line); padding: 12px 14px; border-radius: 12px; overflow-x: auto; font-size: 13px; margin: .6em 0 1em; }
.md pre:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { font-size: 1.12em; margin: 1.1em 0 .45em; }
.md h1:first-child, .md h2:first-child, .md h3:first-child { margin-top: 0; }
.md pre + p, .md pre + ul, .md pre + ol { margin-top: .9em; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 14px; margin: .5em 0; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md a { color: var(--accent); }
.md img { max-width: 100%; border-radius: 12px; }
.work-log { width: 100%; margin: 0 0 12px; }
.work-sum { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 8px; background: var(--side-bg); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.3; cursor: pointer; user-select: none; list-style: none; transition: background-color .12s ease, color .12s ease; }
.work-sum::-webkit-details-marker { display: none; }
.work-sum:hover { background: #eef0f4; color: var(--ink); }
.work-sum:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.work-sum svg.w-ico { width: 13px; height: 13px; stroke-width: 1.9; flex: none; }
.work-sum svg.w-chev { width: 13px; height: 13px; stroke-width: 2; flex: none; opacity: .7; transition: transform .15s ease; }
.work-log[open] .work-sum svg.w-chev { transform: rotate(90deg); }
.work-body { margin-top: 8px; padding: 10px 14px; background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; line-height: 1.5; color: var(--muted); word-wrap: break-word; overflow-wrap: anywhere; }
.work-step + .work-step { margin-top: 8px; padding-top: 8px; border-top: 1px solid #eceef1; }
.work-step p { margin: 0 0 .4em; } .work-step p:last-child { margin-bottom: 0; }
.work-step code { background: #eef1f4; padding: .08em .32em; border-radius: 5px; font-size: .9em; }
.work-tools-meta { font-size: 12.5px; color: #737b88; }
.work-step + .work-tools-meta { margin-top: 8px; padding-top: 7px; border-top: 1px solid #eceef1; }
.files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; max-width: 85%; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--side-bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; font-size: 13px; color: var(--ink); text-decoration: none; max-width: 220px; }
.file-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-thumb { width: 120px; height: 120px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.empty { color: var(--muted); text-align: center; margin-top: 30vh; font-size: 16px; padding: 0 24px; }
.card { max-width: 760px; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.card .q { font-size: 15px; margin-bottom: 10px; white-space: pre-wrap; }
.card pre { background: #f6f8fa; padding: 10px; border-radius: 10px; font-size: 13px; overflow-x: auto; margin: 0 0 10px; }
.card .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.card .acts button { padding: 9px 14px; border-radius: 10px; background: var(--side-bg); border: 1px solid var(--line); font-size: 15px; }
.card .acts button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.card .acts button.danger { color: var(--danger); }
.typing { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; padding: 4px 0; min-width: 0; }
.typing .lbl { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.spin-icon { width: 15px; height: 15px; stroke-width: 2.2; color: var(--accent); flex: none; animation: spin .9s linear infinite; }

/* composer */
.composer-wrap { flex: none; padding: 6px 12px calc(10px + var(--safe-b)); background: var(--bg); }
.status { max-width: 760px; margin: 0 auto 6px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.status #statusText { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.attachments { max-width: 760px; margin: 0 auto; display: flex; gap: 8px; overflow-x: auto; }
.attachments:not(:empty) { padding-bottom: 8px; }
.att { position: relative; flex: none; }
.att img, .att .doc { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); background: var(--side-bg); display: grid; place-items: center; font-size: 12px; color: var(--muted); padding: 4px; text-align: center; overflow: hidden; word-break: break-all; }
.att .x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: #333; color: #fff; font-size: 13px; line-height: 22px; text-align: center; }
.composer { max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 6px; }
.icon-btn.round { border-radius: 50%; width: 40px; height: 40px; margin-bottom: 2px; }
.input-box { flex: 1; min-width: 0; position: relative; background: var(--side-bg); border: 1px solid var(--line); border-radius: 22px; min-height: 44px; display: flex; align-items: center; }
.input-box textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; line-height: 1.35; padding: 11px 16px; max-height: 40vh; color: var(--ink); }
.input-box textarea::placeholder { color: var(--muted); opacity: 1; }
.rec-timer { position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 16px; color: var(--danger); background: var(--side-bg); border-radius: 22px; font-variant-numeric: tabular-nums; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); flex: none; }
#micBtn.recording { background: var(--danger); color: #fff; }
#micBtn.busy { opacity: .5; }
.send { background: var(--accent); color: var(--accent-ink); }
.send:disabled { background: #d5d9e0; color: #fff; opacity: 1; }
.send:hover { background: var(--accent-hover); }
.send:disabled:hover { background: #d5d9e0; }
.stop { background: var(--ink); color: #fff; }
.stop:hover { background: #2c303a; }
.stop:disabled { opacity: .45; }
.stop svg rect { fill: currentColor; stroke: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* mobile: list ↔ chat */
@media (max-width: 820px) {
  .login-head { padding: calc(20px + var(--safe-t)) 24px 12px; }
  .login-title { font-size: 28px; }
  .sidebar { width: 100%; border-right: 0; background: var(--bg); }
  .side-head { padding-inline: 20px; }
  .side-head .brand-logo { width: 38px; height: 38px; }
  .chat-list { padding-inline: 12px; }
  .side-foot { padding-inline: 20px; }
  .chat { position: fixed; inset: 0; transform: translateX(100%); transition: transform .22s ease; background: var(--bg); z-index: 10; }
  body.show-chat .chat { transform: none; }
  .back { display: grid; }
  .model-menu { right: 12px; }
  .messages { padding: 12px 12px 6px; }
}

.plan-tag { font-size: 12px; font-weight: 600; color: var(--accent); background: #e8eff9; border-radius: 6px; padding: 2px 8px; margin-bottom: 4px; align-self: flex-end; }

/* оформление ответов агента */
.msg.assistant .md { font-size: 16px; line-height: 1.62; }
.md h1, .md h2, .md h3, .md h4 { line-height: 1.3; font-weight: 650; margin: 1.3em 0 .45em; }
.md h1 { font-size: 1.28em; } .md h2 { font-size: 1.16em; } .md h3 { font-size: 1.06em; } .md h4 { font-size: 1em; }
.md > :first-child { margin-top: 0; }
.md p { margin: 0 0 .85em; }
.md ul, .md ol { padding-left: 1.4em; margin: .4em 0 .9em; }
.md li { margin: .3em 0; } .md li > p { margin: 0 0 .3em; }
.md ul li::marker { color: var(--accent); } .md ol li::marker { color: var(--accent); font-weight: 600; }
.md blockquote { margin: .8em 0; padding: .1em 1em; border-left: 1px solid var(--field-border); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md strong { font-weight: 650; }
.md th { background: #f6f8fa; }

/* примеры промтов — спокойный линейный список в духе Asana */
.prompts-wrap { max-width: 760px; margin: 0 auto; padding: 0 0 40px; }
.prompts-tabs { display: flex; align-items: center; gap: 18px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 24px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.prompts-tabs::-webkit-scrollbar { display: none; }
.prompts-tab { position: relative; padding: 6px 0 11px; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; flex: none; transition: color .12s ease, border-color .12s ease; }
.prompts-tab:hover { color: var(--ink); }
.prompts-tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.prompts-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.prompts-sec { margin-top: 30px; }
.prompts-sec:first-of-type { margin-top: 0; }
.prompts-sec-title { font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; color: var(--ink); margin: 0 0 8px; }
.prompts-list { border-top: 1px solid var(--line); }
.prompt-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: calc(100% + 20px); margin: 0 -10px; text-align: left; padding: 12px 10px; border-bottom: 1px solid #eceef1; border-radius: 8px; transition: background-color .1s ease; }
.prompt-row:hover { background: var(--side-bg); }
.prompt-row:active { background: #eff1f5; }
.prompt-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.prompt-row.loading { pointer-events: none; opacity: .68; background: var(--side-bg); }
.prompt-row-text { min-width: 0; flex: 1; }
.prompt-row-title { display: block; font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--ink); }
.prompt-row-desc { display: block; font-size: 13.5px; line-height: 1.42; color: var(--muted); margin-top: 2px; }
.prompt-row-end { width: 18px; height: 18px; display: grid; place-items: center; flex: none; color: #8c93a0; opacity: 0; transition: opacity .12s ease, transform .12s ease, color .12s ease; }
.prompt-row-end svg { width: 16px; height: 16px; stroke-width: 1.8; }
.prompt-row:hover .prompt-row-end, .prompt-row:focus-visible .prompt-row-end { opacity: 1; color: var(--ink); transform: translateX(2px); }
.prompt-row.loading .prompt-row-end { opacity: 1; transform: none; }
@media (hover: none) {
  .prompt-row-end { opacity: .45; }
}
@media (max-width: 700px) {
  .prompts-wrap { padding: 0 0 28px; }
  .prompts-tabs { gap: 16px; margin: 0 -12px 20px; padding: 0 12px; }
  .prompt-row { width: calc(100% + 12px); margin: 0 -6px; padding: 13px 6px; gap: 12px; }
}

.folder-row { display: flex; align-items: center; border-radius: 6px; }
.folder-row button { min-height: 44px; border-radius: 6px; }
.folder-t { flex: 1; text-align: left; padding: 8px; font-weight: inherit; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-chev { width: 44px; display: grid; place-items: center; color: var(--muted); flex: none; }
.menu button[data-act="new-object"] { min-height: 44px; font-size: 16px; }
.folder-chev svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.folder-chev.open svg { transform: rotate(90deg); }
.folder-kids { margin: 0 0 6px 12px; padding-left: 10px; border-left: 1px solid var(--field-border); }
.chat-item.kid { color: var(--muted); }
.chat-item.kid.active { color: var(--accent-hover); }
.chat-item.archived { opacity: .55; }
.folder-empty { color: var(--muted); font-size: 13px; padding: 6px 10px; }
.folder-arch { display: block; width: 100%; min-height: 44px; text-align: left; color: var(--muted); padding: 8px; }

.users-view, .groups-view { max-width: 680px; margin: 0 auto; padding: 12px 0 24px; }
.users-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.add-user { margin-left: auto; }
.users-view button:disabled { opacity: .6; cursor: default; }
.user-notice { color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.user-notice:empty { display: none; }
.user-credentials:empty { display: none; }
.user-credentials { display: grid; gap: 12px; margin: 0 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; }
.credential-login { margin: 0; overflow-wrap: anywhere; }
.user-credentials label { display: grid; gap: 6px; }
.credential-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.credential-actions button { min-height: 44px; font-size: 16px; }
.user-row { min-height: 68px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.user-row div { min-width: 0; overflow-wrap: anywhere; }
.user-row small { display: block; color: var(--muted); margin-top: 4px; }
.user-row small:empty { display: none; }
.user-row .link-btn { min-height: 44px; flex: none; font-size: 16px; }
.user-dialog { width: min(480px, calc(100% - 24px)); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.user-dialog::backdrop { background: rgba(15, 23, 42, .4); }
.user-editor { display: grid; gap: 16px; }
.user-editor h2 { margin: 0; font-size: 20px; }
.user-name-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.user-editor label { display: grid; gap: 6px; min-width: 0; font-weight: 500; }
.user-editor input, .user-editor select, .user-credentials input { box-sizing: border-box; min-width: 0; width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--field-border); border-radius: 6px; color: var(--ink); background: var(--bg); font: inherit; font-size: 16px; }
.user-editor .group-note { color: var(--muted); font-size: 14px; font-weight: 400; }
.user-editor .group-note:empty { display: none; }
.user-editor .login-err { margin: 0; }
.user-dialog-actions, .user-access-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.user-dialog-actions { justify-content: flex-end; }
.user-access-actions { justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); }
.user-editor .link-btn { min-height: 44px; font-size: 16px; padding: 0; }
.user-editor .danger { color: var(--danger); }
.groups-view section { padding: 16px 0; border-top: 1px solid var(--line); }
.groups-view h2 { margin: 0 0 8px; font-size: 17px; }
.groups-view ul { margin: 0; padding-left: 20px; line-height: 1.6; }
@media (max-width: 820px) {
  .users-toolbar { flex-wrap: wrap; }
  .user-dialog { padding: 16px; }
}

.refresh-list { cursor: pointer; color: var(--muted, #888); }
.refresh-list:hover { color: var(--accent); }

.brand-logo-btn { background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; }
.brand-logo-btn .brand-logo { pointer-events: none; }

.user-editor .new-group { display: grid; gap: 8px; margin: 4px 0 8px; }
.user-editor .new-group.hidden { display: none; }
.user-editor .add-group-toggle { justify-self: start; }
