/* Themes, after Omarchy's (https://omarchy.org): flat, keyboard-first, one accent colour. The user's theme is set on
   <html data-theme="..."> by the layout; Tokyo Night is the default. Colours below derive from these tokens. */
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root, [data-theme="tokyo-night"] {
    color-scheme: dark;
    --bg: #1a1b26; --surface: #1f2335; --surface-2: #24283b; --text: #c0caf5; --muted: #7a82b0; --border: #2f3549;
    --accent: #7aa2f7; --on-accent: #1a1b26; --good: #9ece6a; --bad: #f7768e; --warn: #e0af68;
}
[data-theme="catppuccin"] {
    color-scheme: dark;
    --bg: #1e1e2e; --surface: #181825; --surface-2: #313244; --text: #cdd6f4; --muted: #9399b2; --border: #313244;
    --accent: #cba6f7; --on-accent: #1e1e2e; --good: #a6e3a1; --bad: #f38ba8; --warn: #f9e2af;
}
[data-theme="gruvbox"] {
    color-scheme: dark;
    --bg: #282828; --surface: #32302f; --surface-2: #3c3836; --text: #ebdbb2; --muted: #a89984; --border: #45403d;
    --accent: #d8a657; --on-accent: #282828; --good: #a9b665; --bad: #ea6962; --warn: #e78a4e;
}
[data-theme="nord"] {
    color-scheme: dark;
    --bg: #2e3440; --surface: #3b4252; --surface-2: #434c5e; --text: #eceff4; --muted: #aab3c5; --border: #4c566a;
    --accent: #88c0d0; --on-accent: #2e3440; --good: #a3be8c; --bad: #bf616a; --warn: #ebcb8b;
}
[data-theme="everforest"] {
    color-scheme: dark;
    --bg: #2d353b; --surface: #343f44; --surface-2: #3d484d; --text: #d3c6aa; --muted: #9da9a0; --border: #475258;
    --accent: #a7c080; --on-accent: #2d353b; --good: #83c092; --bad: #e67e80; --warn: #dbbc7f;
}
[data-theme="rose-pine"] {
    color-scheme: dark;
    --bg: #191724; --surface: #1f1d2e; --surface-2: #26233a; --text: #e0def4; --muted: #908caa; --border: #2f2c46;
    --accent: #ebbcba; --on-accent: #191724; --good: #9ccfd8; --bad: #eb6f92; --warn: #f6c177;
}
[data-theme="kanagawa"] {
    color-scheme: dark;
    --bg: #1f1f28; --surface: #2a2a37; --surface-2: #363646; --text: #dcd7ba; --muted: #9a9888; --border: #3a3a4d;
    --accent: #7e9cd8; --on-accent: #1f1f28; --good: #98bb6c; --bad: #ff5d62; --warn: #e6c384;
}
[data-theme="matte-black"] {
    color-scheme: dark;
    --bg: #121212; --surface: #1a1a1a; --surface-2: #222222; --text: #eaeaea; --muted: #8a8a8d; --border: #2c2c2c;
    --accent: #e68e0d; --on-accent: #121212; --good: #8fbf6f; --bad: #d35f5f; --warn: #e6c07b;
}
[data-theme="catppuccin-latte"] {
    color-scheme: light;
    --bg: #eff1f5; --surface: #ffffff; --surface-2: #e6e9ef; --text: #4c4f69; --muted: #6c6f85; --border: #ccd0da;
    --accent: #8839ef; --on-accent: #ffffff; --good: #40a02b; --bad: #d20f39; --warn: #df8e1d;
}
[data-theme="rose-pine-dawn"] {
    color-scheme: light;
    --bg: #faf4ed; --surface: #fffaf3; --surface-2: #f2e9e1; --text: #575279; --muted: #797593; --border: #dfdad9;
    --accent: #907aa9; --on-accent: #fffaf3; --good: #56949f; --bad: #b4637a; --warn: #ea9d34;
}
:root {
    --radius: 4px;
    --mono: "JetBrains Mono", "JetBrainsMono Nerd Font", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --good-bg: color-mix(in srgb, var(--good) 14%, var(--surface));
    --good-text: var(--good);
    --bad-bg: color-mix(in srgb, var(--bad) 14%, var(--surface));
    --bad-text: var(--bad);
    --warn-bg: color-mix(in srgb, var(--warn) 16%, var(--surface));
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 14px/1.6 var(--mono);
    font-variant-ligatures: none;
    background: var(--bg);
    color: var(--text);
}
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.top nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.top nav a, .top nav button.link { padding: 3px 8px; border-radius: var(--radius); color: var(--muted); text-decoration: none; }
.top nav a:hover, .top nav button.link:hover { color: var(--text); background: var(--surface-2); }
.top nav a[aria-current="page"] { color: var(--on-accent); background: var(--accent); }
.brand { font-weight: 700; color: var(--accent); text-decoration: none; letter-spacing: 0.02em; }
.brand::before { content: "\25C6  "; }
.key-hint { color: var(--muted); font-size: 12px; margin-left: 8px; }
a { color: var(--accent); text-underline-offset: 3px; }

main { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { margin: 0 0 8px; font-size: 1.4rem; font-weight: 700; }
h2 { margin: 0 0 12px; font-size: 1.05rem; font-weight: 700; }
.lead { color: var(--muted); margin: 0 0 24px; }
.muted { color: var(--muted); font-weight: 400; font-size: 0.9em; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 16px;
}
.card.narrow { max-width: 380px; margin: 48px auto; }

.current {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 16px;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.current dt { color: var(--muted); }
.current dd { margin: 0; overflow-wrap: anywhere; }

label { display: block; margin-bottom: 14px; font-weight: 600; }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }

input, select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 9px 10px;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

button {
    padding: 9px 18px;
    font: inherit;
    font-weight: 600;
    color: var(--on-accent);
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
}
button:hover, a.button:hover { filter: brightness(1.08); }
button.link { padding: 0; color: var(--accent); background: none; border: 0; font-weight: 400; }
form.inline { display: inline; margin: 0; }

main:has(.board) { max-width: none; }
textarea {
    display: block; width: 100%; margin-top: 6px; padding: 9px 10px; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); resize: vertical;
}
.new-epic { display: flex; gap: 8px; margin: 16px 0 20px; max-width: 560px; }
.new-epic input { margin: 0; }
.board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; }
.column { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.column h2 { font-size: 0.95rem; margin-bottom: 10px; }
.ticket {
    display: block; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg); color: var(--text); text-decoration: none;
}
.ticket:hover { border-color: var(--muted); }
.ticket:focus-visible, .ticket.kbd-focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ticket span { display: block; font-size: 0.85rem; }
/* The board is made of releases; their cards are nested inside and only shown. */
.board-forms { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 16px 0 20px; }
.board-forms .new-epic { margin: 0; }
.new-release { display: flex; gap: 8px; max-width: 460px; }
.new-release input { margin: 0; }
.release-card .release-head { display: block; color: inherit; text-decoration: none; margin-bottom: 2px; }
.release-card .release-head:hover strong, .release-card .release-head:focus-visible strong { text-decoration: underline; }
.release-card .badge { display: inline-block; margin-top: 4px; }
.release-card ul.nested { list-style: none; padding: 0; margin: 8px 0 0; border-top: 1px solid var(--border); }
.release-card ul.nested li { padding: 4px 0; font-size: 0.85rem; border-bottom: 1px dashed var(--border); }
.release-card ul.nested li:last-child { border-bottom: 0; }
.release-card ul.nested a { color: var(--text); text-decoration: none; }
.release-card ul.nested a:hover { text-decoration: underline; }
.release-card ul.nested span { display: inline; }
.release-card .nested-box summary { cursor: pointer; font-size: 0.85rem; margin-top: 6px; }
.items { padding-left: 18px; }
.items li { margin-bottom: 8px; }
.history { list-style: none; padding-left: 0; }
.pre { white-space: pre-wrap; }
form.action { margin-bottom: 12px; }
button.danger { background: var(--bad); border-color: var(--bad); color: var(--on-accent); }
h3 { font-size: 1rem; margin: 16px 0 8px; }
a.button {
    display: inline-block; padding: 9px 18px; font-weight: 600; color: var(--on-accent); background: var(--accent);
    border-radius: var(--radius); text-decoration: none;
}
.markdown { overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown h2 { font-size: 1.35rem; margin: 24px 0 8px; }
.markdown h3 { font-size: 1.1rem; margin: 20px 0 6px; }
.markdown h4, .markdown h5, .markdown h6 { font-size: 1rem; margin: 16px 0 4px; }
.markdown p, .markdown ul, .markdown ol { margin: 0 0 12px; }
.markdown code { font: 0.9em ui-monospace, monospace; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.markdown pre { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; overflow-x: auto; }
.markdown pre code { padding: 0; background: none; }
.markdown blockquote { margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--border); color: var(--muted); }
.markdown .table-wrap { overflow-x: auto; margin: 0 0 12px; }
.markdown table { border-collapse: collapse; font-size: 0.95em; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.markdown th { background: var(--bg); font-weight: 600; }
.markdown .align-right { text-align: right; }
.markdown .align-center { text-align: center; }
.markdown hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.markdown.doc {
    margin: 0 0 16px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
    max-height: 480px; overflow-y: auto;
}
p.progress { font-weight: 600; color: var(--accent); }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.checklist li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.checklist .mark { display: inline-block; width: 1.4em; font-weight: 700; }
.checklist .ok .mark { color: var(--good-text); }
.checklist .fail .mark { color: var(--bad-text); }
.badge { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; background: var(--border); }
.badge.good { background: var(--good-bg); color: var(--good-text); }
.badge.bad { background: var(--bad-bg); color: var(--bad-text); }

.notice { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 20px; }
.notice.good { background: var(--good-bg); color: var(--good-text); }
.notice.bad { background: var(--bad-bg); color: var(--bad-text); }

.chat { display: flex; flex-direction: column; gap: 14px; }
.msg { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.msg.user { background: var(--bg); margin-left: 10%; }
.msg.assistant { margin-right: 5%; }
.msg header { font-size: 0.85rem; margin-bottom: 6px; }
.proposal { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--accent); border-radius: var(--radius); }
.proposal.added { border-style: solid; border-color: var(--good-text); }
.proposal.dismissed { opacity: 0.55; }
.proposal h3 { margin-top: 0; }
.proposal form.inline + form.inline { margin-left: 12px; }

.avatar {
    display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: 4px; border-radius: 50%;
    background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.8rem; vertical-align: middle;
}
.msg.error { border-color: var(--bad-text); }
.msg.typing[hidden] { display: none; }
.msg.typing { width: fit-content; min-width: 140px; }
.dots { display: inline-flex; gap: 5px; padding: 6px 2px 2px; }
.dots span {
    width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: vd-typing 1.2s infinite ease-in-out;
}
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes vd-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .dots span { animation: none; opacity: 0.8; } }
.chat-form button[disabled] { opacity: 0.5; cursor: wait; }

details.about { margin: 0 0 12px; color: var(--muted); }
details.about summary { cursor: pointer; }
details.about p { margin: 6px 0 0; }
/* Chat fills the rest of the screen: messages scroll inside the frame, the message box stays visible. */
.chat-panel {
    display: flex; flex-direction: column; height: calc(100dvh - 190px); min-height: 360px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden;
}
.chat-panel .chat { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px; overscroll-behavior: contain; }
.chat-panel .msg { min-width: 0; overflow-wrap: anywhere; }
.chat-panel .msg > :last-child, .chat-panel .msg .markdown > :last-child { margin-bottom: 0; }
.chat-panel .markdown pre { white-space: pre-wrap; }
.chat-panel .msg.user { background: var(--bg); }
.chat-form { flex: none; margin: 0; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-form .notice { margin-bottom: 8px; }
.chat-input { display: flex; gap: 10px; align-items: flex-end; }
.chat-input textarea { margin: 0; flex: 1; max-height: 30vh; }
@media (max-width: 600px) { .chat-panel { height: calc(100dvh - 150px); } .msg.user { margin-left: 0; } .msg.assistant { margin-right: 0; } }

main:has(.chat-panel) { padding-bottom: 0; }

button.info {
    display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; margin-left: 4px; padding: 0;
    border-radius: 50%; border: 1px solid var(--muted); background: none; color: var(--muted);
    font: italic 700 0.75rem/1 Georgia, serif; vertical-align: middle; cursor: pointer;
}
button.info:hover, button.info:focus-visible { border-color: var(--accent); color: var(--accent); }
.column h2 { display: flex; align-items: center; gap: 6px; }
.column h2 button.info { margin-left: auto; flex: none; }
.stage-info {
    max-width: min(300px, calc(100vw - 32px)); margin: auto; padding: 12px 14px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
    font-size: 0.9rem; line-height: 1.45;
}
.stage-info p { margin: 6px 0 0; }
.stage-info::backdrop { background: transparent; }
/* Where supported, open the box right under its (i) button instead of in the middle of the screen. */
@supports (anchor-name: --a) {
    .info-idea { anchor-name: --stage-idea; } #stage-idea { position-anchor: --stage-idea; }
    .info-refinement { anchor-name: --stage-refinement; } #stage-refinement { position-anchor: --stage-refinement; }
    .info-implementation { anchor-name: --stage-implementation; } #stage-implementation { position-anchor: --stage-implementation; }
    .info-testing { anchor-name: --stage-testing; } #stage-testing { position-anchor: --stage-testing; }
    .info-ready { anchor-name: --stage-ready; } #stage-ready { position-anchor: --stage-ready; }
    .info-deployed { anchor-name: --stage-deployed; } #stage-deployed { position-anchor: --stage-deployed; }
    .stage-info { margin: 6px 0 0; top: anchor(bottom); left: auto; right: anchor(right); position-try-fallbacks: flip-inline; }
}

.card.rob h2 { display: flex; align-items: center; gap: 8px; }
.questions fieldset { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.questions legend { font-weight: 600; padding: 0 4px; }
.questions label.choice { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 400; cursor: pointer; }
.questions label.choice input { width: auto; margin: 0; }
.questions label.comment { margin: 10px 0 0; font-weight: 400; color: var(--muted); }

.rob-start { margin: 12px 0 0; }

.ref {
    display: inline-block; padding: 1px 8px; margin-right: 4px; border-radius: var(--radius); font-size: 0.75em; font-weight: 700;
    vertical-align: 0.15em; color: var(--accent); border: 1px solid var(--accent); letter-spacing: 0.02em;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label.attach {
    display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin: 0; border-radius: var(--radius);
    border: 1px solid var(--border); color: var(--muted); cursor: pointer;
}
label.attach:hover, label.attach:focus-within { color: var(--accent); border-color: var(--accent); }
label.attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.attachment-chosen { margin: 0 0 8px; font-size: 0.9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.attachment-chosen[hidden] { display: none; }
.chosen-item { display: inline-flex; align-items: center; gap: 4px; }
.chosen-thumb { height: 36px; max-width: 64px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border, currentColor); }
.attachment {
    display: inline-block; margin: 6px 6px 0 0; padding: 3px 10px; border-radius: 999px; font-size: 0.85rem;
    border: 1px solid var(--border); background: var(--surface);
}
details.assessment { margin-bottom: 10px; }
details.assessment > summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
details.assessment[open] > summary { margin-bottom: 8px; }
details.web-log { margin-top: 10px; font-size: 0.9rem; color: var(--muted); }
details.web-log summary { cursor: pointer; }
details.web-log ul ul { margin-top: 2px; }

/* Preview page: the project's app in a frame that fills the window. */
main:has(.preview-panel) { max-width: none; padding-bottom: 0; }
.preview-panel { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.preview-bar input { flex: 1; min-width: 180px; margin: 0; font-family: ui-monospace, monospace; }
.preview-bar button { padding: 7px 12px; }
.preview-bar button.icon { width: 36px; padding: 7px 0; background: none; color: var(--text); border: 1px solid var(--border); }
.preview-bar .widths { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.preview-bar .widths button { border-radius: 0; background: none; color: var(--muted); font-weight: 600; }
.preview-bar .widths button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.preview-bar .newtab { white-space: nowrap; font-size: 0.9rem; }
.preview-stage { flex: 1; min-height: 0; display: flex; justify-content: center; background: var(--bg); overflow: auto; }
.preview-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; transition: width 0.2s; }
p.small { font-size: 0.85rem; margin-top: 8px; }

details.rob-discussion { margin: 14px 0 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
details.rob-discussion > summary { cursor: pointer; font-weight: 600; }
details.rob-discussion[open] > summary { margin-bottom: 8px; }
details.rob-discussion h4 { margin: 14px 0 6px; font-size: 0.95rem; }

details.rob-box > summary { list-style: none; cursor: pointer; }
details.rob-box > summary::-webkit-details-marker { display: none; }
details.rob-box > summary h2 { margin: 0; }
details.rob-box > summary h2::after { content: "▸"; margin-left: auto; color: var(--muted); font-size: 0.9em; transition: transform 0.15s; }
details.rob-box[open] > summary h2::after { transform: rotate(90deg); }
details.rob-box[open] > summary { margin-bottom: 12px; }

.dependency-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 12px; }
.dependency-add label { flex: 1; min-width: 240px; margin: 0; }

.type { display: inline-block; padding: 1px 7px; margin-right: 4px; border-radius: var(--radius); font-size: 0.75rem; font-weight: 700; vertical-align: 0.1em; }
h1 .type { font-size: 0.55em; vertical-align: 0.3em; }
.type-bug { background: var(--bad-bg); color: var(--bad-text); }
.type-change { background: var(--warn-bg); color: var(--warn); }
.new-epic select { width: auto; margin: 0; }
.replace-list { margin: 8px 0 14px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.replace-list label.choice { align-items: flex-start; }
.replace-list label.choice input { margin-top: 4px; }
.replace-list label.choice { display: flex; gap: 8px; margin: 6px 0; font-weight: 400; cursor: pointer; }
.replace-list label.choice input { width: auto; }

nav.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 12px; border-bottom: 1px solid var(--border); }
nav.tabs a { padding: 8px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; color: var(--muted); text-decoration: none; }
nav.tabs a[aria-current="page"] { border-color: var(--border); background: var(--surface); color: var(--text); font-weight: 600; margin-bottom: -1px; }

/* Rob: avatar, floating launcher and panel */
.avatar-img { display: inline-block; vertical-align: middle; border-radius: 50%; margin-right: 4px; }
h1 .avatar-img, h2 .avatar-img { vertical-align: -0.2em; }
.rob-launcher {
    position: fixed; right: 22px; bottom: 22px; z-index: 50; width: 64px; height: 64px; padding: 2px; border: 0;
    border-radius: 50%; background: none; cursor: pointer; box-shadow: 0 8px 24px rgb(80 70 200 / 0.45);
    transition: transform 0.15s;
}
.rob-launcher:hover, .rob-launcher:focus-visible { transform: scale(1.07); }
.rob-launcher img { display: block; width: 100%; height: 100%; }
.rob-launcher.open { box-shadow: 0 0 0 3px var(--accent), 0 8px 24px rgb(80 70 200 / 0.45); }
.rob-panel {
    position: fixed; right: 22px; bottom: 98px; z-index: 50; width: min(440px, calc(100vw - 32px));
    height: min(640px, calc(100vh - 130px)); display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 16px 48px rgb(0 0 0 / 0.35);
}
.rob-panel[hidden] { display: none; }
.rob-panel header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.rob-panel header a { margin-left: auto; font-size: 0.85rem; }
.rob-panel iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
@media (max-width: 600px) { .rob-panel { right: 8px; left: 8px; width: auto; bottom: 90px; height: calc(100vh - 110px); } .rob-launcher { right: 14px; bottom: 14px; } }
/* Embedded chat (inside the Rob panel) */
body.embed main { max-width: none; padding: 0; }
body.embed .chat-panel { border: 0; border-radius: 0; }
/* Epic chat inside the epic page */
.chat-panel.inline { height: 520px; min-height: 320px; resize: vertical; }

/* Product checks (fragmentation warnings) on the epic page */
.warnings { list-style: none; padding: 0; margin: 0 0 12px; }
.warnings li { padding: 8px 12px 8px 34px; margin: 0 0 6px; border-radius: var(--radius); background: var(--bad-bg); color: var(--bad-text); position: relative; }
.warnings li::before { content: "⚠"; position: absolute; left: 12px; }
.older-warnings { margin: 0 0 16px; }
.older-warnings summary { cursor: pointer; color: var(--muted, inherit); }

/* Code review findings on the epic page */
.findings { list-style: none; padding: 0; margin: 0 0 16px; }
.findings li { padding: 8px 12px; margin: 0 0 6px; border-radius: var(--radius); border-left: 4px solid var(--border); background: var(--bg-soft, transparent); }
.findings li div { margin-top: 4px; }
.findings .sev { display: inline-block; font-size: 0.75em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 4px; background: var(--border); }
.findings .sev-blocker { border-left-color: var(--bad-text); }
.findings .sev-blocker .sev { background: var(--bad-bg); color: var(--bad-text); }
.findings .sev-major { border-left-color: var(--warn); }
.findings .sev-major .sev { background: var(--warn-bg); color: var(--warn); }

/* Releases */
.release-tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-weight: 600; font-size: 0.9em;
    background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.release-tag.small { font-size: 0.75em; margin-top: 4px; align-self: flex-start; width: fit-content; }
.release-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.release-chip { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--surface); text-decoration: none; color: inherit; min-width: 180px; }
.release-chip:hover { border-color: var(--accent); }
.release-chip .muted { font-size: 0.85em; }
.release-line { margin: 0 0 16px; }
.release-add, .release-new { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 12px 0; }
.release-add label, .release-new label { flex: 1 1 200px; margin: 0; }
.release-list, .release-cards { list-style: none; padding: 0; margin: 0 0 12px; }
.release-list li, .release-cards li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.release-cards .problems, .problems { margin: 6px 0 0; padding-left: 20px; color: var(--bad-text); font-size: 0.92em; }
.release-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; padding: 0; margin: 0 0 20px; counter-reset: step; }
.release-steps li { counter-increment: step; margin: 0; padding: 4px 12px; line-height: 1.4; white-space: nowrap; border-radius: 999px; border: 1px solid var(--border); font-size: 0.9em; color: var(--muted); }
.release-steps li::before { content: counter(step) ". "; }
.release-steps li.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.send-back summary { cursor: pointer; color: var(--bad-text); font-size: 0.92em; margin-top: 4px; }

/* MVP interview */
.mvp-blueprint { margin: 8px 0; }
.mvp-blueprint summary, .skip-interview summary { cursor: pointer; font-weight: 600; }
.mvp-epics { margin: 8px 0 12px; padding-left: 22px; }
.mvp-epics > li { margin-bottom: 10px; }
.mvp-accept { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.mvp-accept label { flex: 1 1 240px; margin: 0; }
.skip-interview { margin-top: 20px; }

/* Organisations and members */
.org-switch select { padding: 4px 8px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.member-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.member-add > label { flex: 1 1 180px; margin: 0; }
.member-add details { flex: 1 1 100%; }
.member-add details summary { cursor: pointer; margin-bottom: 8px; }
.roles-help dd { margin-bottom: 6px; }

/* Keyboard layer (keys.js): key badges, help overlay, command palette, confirmations */
button[data-key]::after, a[data-key]::after {
    content: attr(data-key); display: inline-block; margin-left: 8px; padding: 0 5px; min-width: 1.4em; text-align: center;
    font-size: 11px; line-height: 1.5; font-weight: 600; border-radius: 3px;
    color: currentColor; border: 1px solid currentColor; opacity: 0.65;
}
button.link[data-key]::after { opacity: 0.5; }
kbd {
    display: inline-block; padding: 0 6px; min-width: 1.6em; text-align: center; font: 600 12px/1.6 var(--mono);
    color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 3px;
}
.kbd-modal {
    position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-start; justify-content: center;
    padding: 12vh 16px 16px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(2px);
}
.kbd-box {
    width: min(640px, 100%); max-height: 76vh; overflow: auto; background: var(--surface);
    border: 2px solid var(--accent); border-radius: var(--radius); box-shadow: 0 16px 48px rgb(0 0 0 / 0.35);
}
.kbd-help { padding: 16px 20px; }
.kbd-help h3 { color: var(--accent); margin: 14px 0 6px; font-size: 0.9rem; text-transform: lowercase; }
.kbd-help ul { list-style: none; margin: 0; padding: 0; }
.kbd-help li { display: flex; gap: 12px; padding: 3px 0; }
.kbd-keys { display: inline-flex; gap: 4px; min-width: 8.5em; }
.kbd-palette input { margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 12px 14px; background: var(--surface); }
.kbd-palette input:focus { box-shadow: none; }
.kbd-results { list-style: none; margin: 0; padding: 4px; }
.kbd-results li { display: grid; grid-template-columns: 8.5em 1fr auto; gap: 10px; padding: 6px 10px; border-radius: 3px; cursor: pointer; }
.kbd-results li.active { background: var(--accent); color: var(--on-accent); }
.kbd-results li.active .kbd-group, .kbd-results li.active .kbd-hint { color: var(--on-accent); opacity: 0.8; }
.kbd-group, .kbd-hint { color: var(--muted); font-size: 12px; align-self: center; }
.kbd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd-confirm { padding: 18px 20px; width: min(460px, 100%); }
.kbd-confirm p { margin: 0 0 14px; font-weight: 600; }
.kbd-actions { display: flex; gap: 14px; align-items: center; }

/* Theme picker (account) */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.theme-choice { margin: 0; cursor: pointer; }
.theme-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme-swatch {
    display: block; padding: 10px; border: 2px solid var(--border); border-radius: var(--radius);
    background: var(--bg); color: var(--text); font-weight: 600; font-size: 13px;
}
.theme-choice input:checked + .theme-swatch, .theme-choice input:focus-visible + .theme-swatch { border-color: var(--accent); }
.theme-swatch .dots { display: flex; gap: 4px; margin-top: 8px; }
.theme-swatch .dots i { width: 14px; height: 14px; border-radius: 2px; display: inline-block; }
.theme-swatch .dots i:nth-child(1) { background: var(--accent); }
.theme-swatch .dots i:nth-child(2) { background: var(--good); }
.theme-swatch .dots i:nth-child(3) { background: var(--warn); }
.theme-swatch .dots i:nth-child(4) { background: var(--bad); }
.theme-swatch .dots i:nth-child(5) { background: var(--surface-2); border: 1px solid var(--border); }
pre.copy { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; user-select: all; }
.vm-choice { flex: 1 1 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 0; }
.vm-choice legend { font-weight: 600; padding: 0 4px; }
.inline-input { display: inline-block; width: auto; min-width: 12em; margin: 0 0 0 6px; padding: 3px 6px; }
.provision-log summary { cursor: pointer; }
.provision-log pre { max-height: 360px; overflow: auto; user-select: text; }

/* Live pages: shown instead of reloading while the user is writing */
.live-notice { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 900; box-shadow: 0 6px 24px rgb(0 0 0 / 0.35); }
details.history-box > summary h2 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
details.history-box > summary h2 .muted { font-weight: 400; }

/* ===================================================================================================================
   Design layer (2026-10-01, Vlad: "more stylish/pretty, also for non-tech users"): a friendly sans-serif for reading,
   the monospace only for codes, rounder and softer surfaces, colour-coded status pills. The theme colours above stay.
   =================================================================================================================== */
@font-face { font-family: "Inter"; src: url("/assets/fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
    --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 2px color-mix(in srgb, black 8%, transparent), 0 6px 18px color-mix(in srgb, black 6%, transparent);
    --shadow-hover: 0 2px 4px color-mix(in srgb, black 10%, transparent), 0 10px 26px color-mix(in srgb, black 10%, transparent);
    --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--surface));
    --warn-text: color-mix(in srgb, var(--warn) 75%, var(--text));
}
body { font: 15px/1.55 var(--sans); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; letter-spacing: -0.005em; }
code, pre, kbd, .ref, .key-hint, .version, textarea.mono { font-family: var(--mono); letter-spacing: 0; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: 1.1rem; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-weight: 650; }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { font-size: 0.92em; }
.subtle { color: var(--muted); margin: 4px 0 0; }

/* top bar */
.top { padding: 10px 24px; font-size: 14px; box-shadow: 0 1px 0 var(--border); border-bottom: 0; }
.brand { font-size: 15px; letter-spacing: -0.01em; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; background: var(--accent); transform: rotate(45deg); }
.top nav a, .top nav button.link { padding: 6px 10px; border-radius: 8px; }
.top select { width: auto; margin: 0; padding: 6px 10px; border-radius: 8px; }

/* surfaces */
.card { border-radius: var(--radius-lg); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--border) 70%, transparent); padding: 20px 22px; }
input, select, textarea { border-radius: 8px; background: var(--surface); padding: 9px 12px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
button, a.button { border-radius: 8px; padding: 9px 16px; transition: filter .15s, transform .05s; }
button:active { transform: translateY(1px); }
.button-secondary { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; }
.button-secondary:hover { border-color: var(--accent); color: var(--accent); }
.notice { border-radius: var(--radius); }

/* pills and badges */
.pill, .badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
    background: var(--surface-2); color: var(--muted); white-space: nowrap; margin: 0;
}
.pill::before, .badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.good, .badge.good { background: var(--good-bg); color: var(--good-text); }
.pill.bad, .badge.bad { background: var(--bad-bg); color: var(--bad-text); }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.live { background: var(--accent-soft); color: var(--accent); }
.pill.live::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
@media (prefers-reduced-motion: reduce) { .pill.live::before { animation: none; } }
.type { border-radius: 999px; padding: 2px 9px; font-weight: 600; }
.release-tag { border-radius: 8px; padding: 2px 9px; }

/* project header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-links { display: flex; flex-wrap: wrap; gap: 4px; }
.page-links a { padding: 6px 12px; border-radius: 999px; color: var(--text); background: var(--surface); box-shadow: 0 0 0 1px var(--border); font-size: 14px; }
.page-links a:hover { text-decoration: none; box-shadow: 0 0 0 1px var(--accent); color: var(--accent); }

/* board */
.board-forms { align-items: flex-start; gap: 12px; margin: 0 0 22px; }
.pill-form { display: flex; gap: 6px; padding: 5px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.pill-form input, .pill-form select { border: 0; background: transparent; margin: 0; box-shadow: none; }
.pill-form input:focus, .pill-form select:focus { box-shadow: none; }
.pill-form select { width: auto; color: var(--muted); }
.new-epic.pill-form { flex: 1 1 420px; max-width: 640px; }
.new-epic.pill-form input { flex: 1; }
.new-release-box { position: relative; }
.new-release-box > summary { list-style: none; }
.new-release-box > summary::-webkit-details-marker { display: none; }
.new-release-box[open] > summary { margin-bottom: 8px; }
.release-board { gap: 16px; grid-template-columns: repeat(6, minmax(230px, 1fr)); align-items: start; padding-bottom: 8px; }
.release-board .column { background: color-mix(in srgb, var(--surface-2) 45%, transparent); border: 0; border-radius: var(--radius-lg); padding: 12px; min-height: 160px; }
.lane-head { display: flex; align-items: center; gap: 8px; margin: 2px 4px 2px; font-size: 0.95rem; }
.lane-head .count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.lane-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.lane-planning .lane-dot { background: var(--warn); }
.lane-building .lane-dot { background: var(--accent); }
.lane-testing .lane-dot, .lane-ready .lane-dot { background: color-mix(in srgb, var(--accent) 55%, var(--good)); }
.lane-released .lane-dot { background: var(--good); }
.lane-hint { margin: 0 4px 12px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.empty { margin: 4px; padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); font-size: 13px; text-align: center; }

.release-card {
    position: relative; display: block; margin-bottom: 12px; padding: 14px 14px 10px; border-radius: var(--radius-lg);
    background: var(--surface); box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
    transition: box-shadow .15s, transform .15s;
}
.release-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.release-card.status-building { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.rc-link { position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.rc-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.release-card .nested, .release-card details, .release-card .nested a { position: relative; z-index: 1; }
.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.version { font-size: 12px; font-weight: 600; color: var(--muted); }
.rc-title { margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.3; color: var(--text); }
.rc-meta { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.meter { height: 6px; margin: 10px 0 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.meter.good span { background: var(--good); }
.meter-label { margin: 0; color: var(--muted); font-size: 12px; }
.release-card ul.nested { margin: 10px -4px 0; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); padding-top: 6px; }
.release-card ul.nested li { border: 0; padding: 0; }
.release-card ul.nested a { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; color: var(--text); font-size: 13.5px; line-height: 1.35; }
.release-card ul.nested a:hover { background: var(--surface-2); text-decoration: none; }
.item-title { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.release-card ul.nested .ref { font-size: 11px; color: var(--muted); }
.item .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.item.type-bug .dot { background: var(--bad); }
.item.type-change .dot { background: var(--warn); }
.nested-box summary { margin-top: 8px; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.card-foot { margin: 8px 4px 2px; color: var(--muted); font-size: 12px; }
.ideas-card { padding-top: 8px; }
.ideas-card ul.nested { border-top: 0; margin-top: 0; padding-top: 0; }
.legend { display: flex; gap: 16px; margin: 14px 4px 0; color: var(--muted); font-size: 12.5px; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
.release-card:hover .rc-title { color: var(--accent); }

/* time and cost tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 4px 0 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-note { color: var(--muted); font-size: 13px; line-height: 1.4; }
.fine-print { margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.fine-print summary { cursor: pointer; }
.fine-print ul { margin: 8px 0 0; padding-left: 18px; }
.fine-print li { margin-bottom: 4px; }

/* design layer, part 2: release page, card lists, chat */
.item.type-bug, .item.type-change, .item.type-epic { background: none; color: inherit; padding: 0; border-radius: 0; font-weight: inherit; }
.release-board { grid-template-columns: repeat(5, minmax(230px, 1fr)); }
.board-intro { margin: -6px 0 18px; color: var(--muted); }
.crumbs { margin: 0 0 6px; font-size: 14px; }
.release-head { margin-bottom: 14px; }
.release-head .version { display: block; margin-bottom: 2px; font-size: 13px; color: var(--accent); }
.release-head h1 { margin: 0; }
.release-steps { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: step; }
.release-steps li {
    counter-increment: step; position: relative; flex: 1 1 0; min-width: 110px; padding: 30px 6px 0; text-align: center;
    border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500; border-radius: 0;
}
.release-steps li::before {
    content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;
    width: 24px; height: 24px; line-height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700;
}
.release-steps li::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--surface-2); }
.release-steps li:first-child::after { display: none; }
.release-steps li.done::before { content: "✓"; background: var(--good); color: var(--on-accent); }
.release-steps li.done::after, .release-steps li.current::after { background: var(--good); }
.release-steps li.current { color: var(--text); font-weight: 650; background: none; }
.release-steps li.current::before { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.count-pill { display: inline-block; min-width: 22px; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: center; vertical-align: 2px; }
.card-list { list-style: none; margin: 4px 0 0; padding: 0; }
.card-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 6px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.card-list li:last-child { border-bottom: 0; }
.card-list li > a { display: flex; flex: 1 1 320px; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.card-list .item-title { -webkit-line-clamp: 3; }
.card-list .ref { font-size: 11.5px; color: var(--muted); }
.card-list .send-back { flex-basis: 100%; margin-left: 18px; }

/* Rob's conversation: soft bubbles instead of boxes */
.msg { border: 0; border-radius: 14px; background: var(--surface-2); padding: 12px 16px; }
.msg.user { background: var(--accent-soft); margin-left: 12%; }
.chat-panel .msg.user { background: var(--accent-soft); }
.msg.assistant { margin-right: 6%; }
.msg.error { box-shadow: inset 0 0 0 1px var(--bad-text); }
.msg header { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.chat-panel { border-radius: var(--radius-lg); border-color: color-mix(in srgb, var(--border) 70%, transparent); }
.chat-panel.inline { box-shadow: none; }
.proposal { border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.proposal.added { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.questions fieldset { border-radius: 12px; background: var(--surface); }
.assessment summary, .web-log summary { cursor: pointer; color: var(--muted); }
.release-card .ref, .card-list .ref { border: 0; background: none; padding: 0; color: var(--muted); font-weight: 500; }

/* top bar: logo, main links and organisation on the left; the user's menu on the right (opens on hover or focus) */
.top { position: sticky; top: 0; z-index: 20; }
.top-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.top-main { display: flex; gap: 2px; }
.top-main a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.top-main a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.org-name { color: var(--muted); font-size: 13.5px; }
.org-switch select { font-size: 13.5px; color: var(--muted); background: transparent; }
.user-menu { position: relative; }
.user-button { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font-weight: 500; }
.user-button:hover, .user-menu:focus-within .user-button { background: var(--surface-2); filter: none; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; }
.caret { color: var(--muted); font-size: 11px; }
.user-menu .menu {
    position: absolute; right: 0; top: 100%; min-width: 210px; padding: 6px; margin-top: 4px; border-radius: 12px;
    background: var(--surface); box-shadow: var(--shadow-hover); border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .12s, transform .12s, visibility .12s;
}
/* a small bridge so the menu stays open while the mouse moves down to it */
.user-menu .menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.user-menu:hover .menu, .user-menu:focus-within .menu { opacity: 1; visibility: visible; transform: none; }
.user-menu .menu a, .user-menu .menu button.link {
    display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 10px; border-radius: 8px;
    color: var(--text); font-size: 14px; font-weight: 500; text-align: left;
}
.user-menu .menu a:hover, .user-menu .menu button.link:hover { background: var(--surface-2); text-decoration: none; }
.user-menu .menu form { display: block; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.user-menu kbd { font-size: 11px; color: var(--muted); padding: 1px 6px; border-radius: 4px; background: var(--surface-2); }
@media (max-width: 600px) { .user-name, .org-name { display: none; } }

/* tabs (Settings) */
.tabs { display: flex; gap: 4px; margin: 6px 0 20px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 8px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Rob's questions: each a card, each answer a tile you click; the chosen one is highlighted */
.questions fieldset { position: relative; margin: 0 0 14px; padding: 14px 14px 12px; border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.questions legend { float: left; width: 100%; margin: 0 0 10px; padding: 0; font-weight: 650; line-height: 1.4; }
.questions legend + * { clear: both; }
.questions label.choice {
    display: flex; align-items: flex-start; gap: 10px; margin: 0 0 6px; padding: 9px 12px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg); font-weight: 400; line-height: 1.45; cursor: pointer; transition: border-color .12s, background .12s;
}
.questions label.choice:hover { border-color: var(--accent); }
.questions label.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.questions label.choice input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; }
.questions label.comment { margin: 10px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.questions label.comment textarea { min-height: 0; height: 2.6em; margin-top: 4px; font-size: 14px; }
.questions label.comment textarea:focus { height: 5em; }
.questions small.muted { display: block; margin: 2px 0 4px; }
.questions > button[type="submit"] { margin-top: 4px; }
