/* Claude Agent Runner – light, Claude-style look: warm off-white, orange accent, a sidebar with projects and
   conversations, and the conversation on the right. */
:root {
  --bg: #faf9f5;
  --side: #f3f1ea;
  --side-hover: #ebe8df;
  --side-active: #e4e0d4;
  --panel: #ffffff;
  --text: #1f1e1d;
  --muted: #6e6b64;
  --faint: #9b978e;
  --border: #e6e3d9;
  --border-strong: #d5d1c4;
  --accent: #d97757;
  --accent-dark: #bd5c39;
  --accent-soft: #f6e6de;
  --bubble: #eeebe2;
  --green: #2f7d4f;
  --red: #b3372e;
  --amber: #9a6200;
  --blue: #2f6fb3;
  --radius: 12px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-family: var(--font);
  font-size: 15px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* The web version (server mode) and the app on one's own computer show a few different things. */
body:not(.server-mode) .server-only { display: none !important; }
body.server-mode .desktop-only { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; overflow: hidden; }
a { color: var(--accent-dark); }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 600; margin: 24px 0 12px; }
h3 { font-size: 16px; font-weight: 600; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono, code, pre { font-family: var(--mono); font-size: 13px; }
pre { white-space: pre-wrap; word-break: break-word; }
.ic { flex-shrink: 0; vertical-align: -2px; }

/* ---------- App layout ---------- */

.app { display: grid; grid-template-columns: 276px minmax(0, 1fr); height: 100vh; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.view { flex: 1; min-height: 0; }
.page-view { overflow-y: auto; padding: 32px max(32px, calc((100% - 1000px) / 2)) 80px; }
.project-view { display: flex; flex-direction: column; overflow: hidden; }
.tab-content { flex: 1; min-height: 0; }
.tab-content.is-chat { display: flex; }
.tab-content.is-page { overflow-y: auto; padding: 24px max(32px, calc((100% - 1000px) / 2)) 80px; }

/* ---------- Sidebar ---------- */

.sidebar { background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; padding: 10px 8px; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 12px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15.5px; color: var(--text); text-decoration: none; }
.brand img { border-radius: 6px; }
.side-close { display: none; }
.side-new-project { display: flex; align-items: center; gap: 8px; margin: 0 4px 14px; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--border); font-weight: 500; }
.side-new-project:hover { border-color: var(--border-strong); }
.side-new-project svg { color: var(--accent-dark); }
.side-label { font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding: 0 12px 6px; }
.side-projects { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 8px; }
.side-empty { color: var(--faint); font-size: 14px; padding: 6px 12px; }
.side-project { margin-bottom: 4px; }
.side-project-head { display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 2px; border-radius: 8px; }
.side-project-head:hover { background: var(--side-hover); }
.side-toggle { border: 0; background: transparent; padding: 4px; border-radius: 6px; color: var(--faint); display: flex; cursor: pointer; }
.side-toggle:hover { color: var(--text); }
.side-toggle .ic { transition: transform .15s; }
.side-project.open .side-toggle .ic { transform: rotate(90deg); }
.side-project-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 0; }
.side-agent { font-size: 11px; font-weight: 600; color: var(--faint); }
.side-agent.claude { color: var(--accent-dark); }
.side-agent.kimi { color: #4062b0; }
.side-agent.codex { color: #0e7d63; }
.side-chats { padding: 2px 0 6px; }
.side-chat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 10px 5px 30px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.side-chat:hover { background: var(--side-hover); }
.side-chat.active { background: var(--side-active); font-weight: 500; }
.side-chat.new { justify-content: flex-start; color: var(--muted); }
.side-chat.new:hover { color: var(--text); }
.side-chat-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; min-width: 0; }
.side-chat-when { color: var(--faint); font-size: 12px; flex-shrink: 0; }
.side-more { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; padding: 4px 10px 4px 30px; cursor: pointer; }
.side-more:hover { color: var(--text); }
.side-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.side-dot.working { background: var(--blue); animation: pulse 1.4s infinite; }
.side-dot.attention { background: var(--red); }
.side-nav { border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.side-nav a:hover { background: var(--side-hover); }
.side-nav a.active { background: var(--side-active); font-weight: 500; }
.side-backdrop { display: none; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Project header ---------- */

.project-top { border-bottom: 1px solid var(--border); background: var(--bg); padding: 10px 20px; }
.top-row { display: flex; align-items: center; gap: 16px; }
.side-open-btn { display: none; }
.top-title { min-width: 0; flex: 1; }
.top-project { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.top-project a { color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-sub { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.top-sub a { color: var(--muted); text-decoration: none; }
.top-sub a:hover { color: var(--text); }
.top-chat { overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.top-sub .sep { color: var(--faint); }
.top-tabs { display: flex; gap: 2px; background: var(--side); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.top-tabs a { display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 7px; text-decoration: none; color: var(--muted); font-size: 14px; }
.top-tabs a:hover { color: var(--text); }
.top-tabs a.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(31, 30, 29, .08); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-note { margin-top: 8px; font-size: 13px; color: var(--muted); background: var(--side); border-radius: 8px; padding: 6px 10px; }
.top-note.bad { color: var(--red); background: #fbeceb; }

/* ---------- Buttons and forms ---------- */

button, .btn {
  font: inherit; cursor: pointer; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--panel); color: var(--text); padding: 7px 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 1.3;
}
button:hover, .btn:hover { border-color: #b9b4a6; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.big, .btn.big { padding: 10px 20px; font-size: 16px; }
button.small, .btn.small { padding: 4px 10px; font-size: 13px; }
button.danger { color: var(--red); border-color: #e3b0aa; }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.ghost:hover { background: var(--side); color: var(--text); }
button:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: transparent; padding: 7px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--side); color: var(--text); }
.linklike { border: 0; background: none; padding: 0; color: var(--accent-dark); font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.linklike:hover { text-decoration: underline; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
input[type=text], input[type=number], input[type=password], input[type=time], select, textarea {
  font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--panel); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(217, 119, 87, .35); outline-offset: 0; border-color: var(--accent); }
input[type=number] { width: 140px; }
input[type=time] { width: 140px; }
textarea { min-height: 120px; resize: vertical; font-family: inherit; line-height: 1.45; }
textarea.big { min-height: 260px; }
textarea.code { font-family: var(--mono); font-size: 13px; }
.field-msg { font-size: 13px; margin-top: 6px; }
.field-msg.ok { color: var(--green); }
.field-msg.bad { color: var(--red); }
.inline-choice { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 400; }
.inline-choice label { font-weight: 400; margin: 0; display: flex; gap: 6px; align-items: center; }
.days label { border: 1px solid var(--border-strong); border-radius: 8px; padding: 4px 10px; }
details.advanced summary { cursor: pointer; color: var(--muted); margin-top: 16px; }

/* ---------- Panels, banners, badges ---------- */

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.page-head { margin-bottom: 20px; }
.banner { padding: 10px 20px; background: #fcefd2; border-bottom: 1px solid #efd7a3; display: flex; gap: 16px; align-items: center; font-size: 14px; }
.banner.danger { background: #f9e0dd; border-color: #e9b4ae; }
.hint-box { background: #fbf6ec; border: 1px solid #eee0c4; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
/* A command to copy into a terminal (Settings → Use from Claude Code). */
.command-box { display: flex; gap: 10px; align-items: center; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.command-box code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.agent-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.agent-card { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin: 0 !important; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px 14px; background: var(--panel); cursor: pointer; }
.agent-card input { margin-top: 4px; }
.agent-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 119, 87, .15); }
.agent-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; vertical-align: middle; }
.agent-badge.claude { background: var(--accent-soft); color: var(--accent-dark); }
.agent-badge.kimi { background: #e5eafa; color: #34529c; }
.agent-badge.codex { background: #dff3ec; color: #0b6b54; }
.status { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: #edebe5; color: #5c5a55; text-transform: uppercase; letter-spacing: .03em; }
.status.success { background: #dcefe2; color: var(--green); }
.status.failed { background: #f8dcd9; color: var(--red); }
.status.running { background: #dde8f6; color: var(--blue); }
.status.limit_reached { background: #fcedcb; color: var(--amber); }
ol.steps { margin: 10px 0 14px; padding-left: 22px; }
ol.steps li { margin: 6px 0; }
ul.plain { list-style: none; margin: 8px 0 0; padding: 0; }
ul.plain li { padding: 6px 0; border-top: 1px solid #eee0c4; gap: 10px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 13px; background: #fbfaf7; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #faf7f1; }

.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.files { columns: 2; font-family: var(--mono); font-size: 12.5px; }
.files .a { color: var(--green); }
.files .m { color: var(--amber); }
.files .d { color: var(--red); }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

/* ---------- Memory, plan, history (Memory tab) ---------- */

.memory-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.subnav { display: flex; flex-direction: column; gap: 2px; }
.subnav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.subnav a:hover { background: var(--side); }
.subnav a.active { background: var(--panel); border: 1px solid var(--border); font-weight: 600; }
.markdown { line-height: 1.6; }
.markdown h1 { font-size: 20px; }
.markdown h2 { font-size: 17px; }
.markdown pre { background: #f4f2ec; padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.markdown code { background: #f1eee6; padding: 1px 5px; border-radius: 4px; font-size: .88em; }
.markdown pre code { background: none; padding: 0; }
.markdown a:not([href]) { color: inherit; }
.plan-step { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.plan-step.done input[type=text] { text-decoration: line-through; color: var(--muted); }
.plan-step .details { grid-column: 2 / 3; font-size: 13px; color: var(--muted); white-space: pre-wrap; }
.timeline-item { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin-bottom: 18px; }
.timeline-item h3 { margin: 0 0 6px; }
.history-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
.history-list { max-height: 60vh; overflow: auto; border-right: 1px solid var(--border); }
.history-list a { display: block; padding: 6px 8px; text-decoration: none; color: var(--text); border-radius: 6px; font-size: 13px; }
.history-list a.active { background: var(--side); }
.history-view pre { max-height: 55vh; overflow: auto; background: #f7f6f2; padding: 10px; border-radius: 8px; }
.search-results li { margin-bottom: 10px; }

/* ---------- Chat ---------- */

.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-scroll { flex: 1; overflow-y: auto; }
.chat-inner { max-width: 800px; margin: 0 auto; padding: 28px 28px 24px; }
.chat-intro { text-align: center; padding: 8vh 10px 28px; }
.chat-intro h1 { font-family: var(--serif); font-weight: 500; font-size: 30px; margin: 14px 0 8px; }
.chat-intro p { max-width: 520px; margin: 0 auto; }
.intro-mark .avatar { width: 44px; height: 44px; font-size: 20px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.suggestions button { border-radius: 99px; font-size: 14px; color: var(--muted); }
.suggestions button:hover { color: var(--text); }
.earlier { text-align: center; margin-bottom: 18px; }
.turn { padding: 2px 0; border-radius: 12px; transition: background .6s; }
.turn.highlight { background: #fbf0e8; }
.turn-divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 26px 0 14px; }
.turn-divider::before, .turn-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.turn-divider span { display: flex; align-items: center; gap: 6px; }
.msg { margin: 16px 0; }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; }
.msg.user .bubble { background: var(--bubble); border-radius: 18px 18px 6px 18px; padding: 10px 16px; max-width: 85%; white-space: pre-wrap; word-break: break-word; }
.msg.agent { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; margin-top: 2px; }
.avatar.claude { background: var(--accent); color: #fff; }
.avatar.kimi { background: #3d5bb5; color: #fff; }
.avatar.codex { background: #10a37f; color: #fff; }
.prose { font-family: var(--serif); font-size: 16.5px; line-height: 1.65; color: #2a2926; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 12px; }
.prose li { margin: 3px 0; }
.prose code { font-family: var(--mono); }
.instructions { margin: 0 0 10px; font-size: 13px; color: var(--faint); }
.instructions summary { cursor: pointer; }
.instructions pre { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; max-height: 320px; overflow: auto; color: var(--muted); }
.note { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--muted); margin: 10px 0 10px 42px; }
.note.warn { color: var(--amber); }
.note.bad { color: var(--red); }
.note.info { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-left: 0; color: var(--text); }
.note .ic { margin-top: 2px; }

details.steps { margin: 10px 0 10px 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
details.steps > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 7px 12px; color: var(--muted); font-size: 13.5px; }
details.steps > summary::-webkit-details-marker { display: none; }
details.steps > summary .steps-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.steps > summary .ic-chevron { transition: transform .15s; }
details.steps[open] > summary .ic-chevron { transform: rotate(90deg); }
details.steps > summary:hover { color: var(--text); }
.steps-list { border-top: 1px solid var(--border); padding: 6px 0 8px; max-height: 420px; overflow-y: auto; }
.step { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 6px; padding: 3px 12px; font-family: var(--mono); font-size: 12.5px; color: #3b3a36; }
.step-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); margin-top: 7px; }
.step.memory .step-dot { background: #a08bd8; }
.step-text { overflow-wrap: anywhere; }
.step-more { grid-column: 2; margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.step-out { margin: 0 12px 4px 32px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.step-out pre { margin: 2px 0; max-height: 240px; overflow: auto; background: #f8f7f3; border-radius: 6px; padding: 6px 8px; }
.step-out summary { cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-out.bad, .step-out.bad pre { color: var(--red); }

.turn-end { margin: 6px 0 4px 42px; }
.end-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.end-head { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.end-row.success .end-head { color: var(--green); }
.end-row.failed .end-head { color: var(--red); }
.end-row.limit_reached .end-head { color: var(--amber); }
.end-row .linklike { font-size: 13px; }
.end-error { color: var(--red); font-size: 13px; margin-top: 4px; white-space: pre-wrap; }
.end-note { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.end-files { margin-top: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.working { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px 42px; color: var(--muted); font-size: 14px; }
.working-time { color: var(--faint); font-variant-numeric: tabular-nums; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.composer-wrap { padding: 0 28px 16px; }
.queue { max-width: 800px; margin: 0 auto 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 8px 8px 4px; box-shadow: 0 1px 8px rgba(31, 30, 29, .05); }
.queue-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; padding: 2px 8px 6px; font-size: 13px; }
.queue-title { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; align-self: center; }
.queue-sub { color: var(--muted); flex: 1; min-width: 220px; }
.queue-head-actions { display: flex; gap: 14px; }
.queue-head-actions .linklike { font-size: 13px; }
.queue-list { list-style: none; margin: 0; padding: 0; max-height: 216px; overflow-y: auto; }
.queue-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 7px 8px; border-top: 1px solid var(--border); }
.queue-num { width: 20px; height: 20px; border-radius: 50%; background: var(--side); color: var(--muted); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.queue-body { min-width: 0; }
.queue-text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.queue-item.held .queue-text { color: var(--muted); }
.queue-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); border-radius: 99px; padding: 0 8px; margin-bottom: 3px; }
.queue-held { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12.5px; color: var(--amber); }
.queue-actions { display: flex; align-items: center; gap: 2px; }
.queue-actions .icon-btn { padding: 5px; }
.queue-actions button.small { margin-right: 4px; }
.composer { max-width: 800px; margin: 0 auto; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: 0 2px 12px rgba(31, 30, 29, .06); padding: 12px 12px 8px 18px; }
.composer:focus-within { border-color: #c9c3b4; box-shadow: 0 2px 16px rgba(31, 30, 29, .09); }
.composer textarea { display: block; width: 100%; border: 0; outline: 0; resize: none; background: transparent; padding: 4px 0 8px; min-height: 28px; max-height: 260px; font-size: 15.5px; line-height: 1.5; }
.composer textarea:focus { outline: 0; border: 0; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-info { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12.5px; min-width: 0; white-space: nowrap; overflow: hidden; }
.composer-info span { overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 4px; }
.composer-actions { display: flex; align-items: center; gap: 8px; }
.send-btn { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 11px; background: var(--accent); border: 0; color: #fff; }
.send-btn:hover { background: var(--accent-dark); }
.send-btn:disabled { background: #e7c2b4; opacity: 1; }
.stop-btn { padding: 6px 12px; border-radius: 10px; font-size: 13px; color: var(--text); }
.composer-hint { max-width: 800px; margin: 8px auto 0; text-align: center; color: var(--faint); font-size: 12px; }
.readonly-bar { max-width: 800px; margin: 0 auto; background: var(--side); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; color: var(--muted); font-size: 14px; }
.readonly-bar .ic { margin-right: 4px; }

/* ---------- Welcome and scheduled tasks ---------- */

.welcome { text-align: center; padding: 14vh 20px 40px; max-width: 560px; margin: 0 auto; }
.welcome h1 { font-family: var(--serif); font-weight: 500; font-size: 32px; margin: 16px 0 10px; }
.welcome p { margin: 0 0 26px; font-size: 16px; }
.welcome-mark { display: inline-flex; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; }
.tasks { display: flex; flex-direction: column; gap: 12px; }
.task { display: flex; justify-content: space-between; gap: 20px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.task.off { background: #fcfbf8; }
.task-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.task-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.task-title a { color: var(--text); text-decoration: none; }
.task-title a:hover { text-decoration: underline; }
.task-when { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.task.off .task-when { color: var(--muted); }
.task-last { font-size: 13px; color: var(--muted); }
.task-note { font-size: 13px; color: var(--muted); }
.task-note.bad { color: var(--red); }
.task-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; margin: 0 6px 0 0; font-weight: 500; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .15s; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::after { transform: translateX(16px); }
.switch input:focus-visible + .slider { outline: 2px solid rgba(217, 119, 87, .5); outline-offset: 2px; }
.switch-label { min-width: 24px; }

/* ---------- Dialogs and messages ---------- */

.modal-backdrop { position: fixed; inset: 0; background: rgba(31, 30, 29, .32); display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px; z-index: 50; overflow: auto; }
.modal { background: var(--panel); border-radius: 16px; width: min(760px, 100%); padding: 22px 26px; box-shadow: 0 12px 40px rgba(31, 30, 29, .22); }
.modal h2 { margin-top: 0; }
#toast-root { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #2b2a27; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); max-width: 420px; font-size: 14px; }
.toast.error { background: var(--red); }
.offline { position: fixed; inset: 0; background: rgba(250, 249, 245, .96); z-index: 200; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.offline .panel { max-width: 520px; }

/* ---------- Sign-in page (web version) ---------- */

body.login-page { overflow: auto; }
.login { max-width: 360px; margin: 14vh auto 40px; padding: 0 20px; text-align: center; }
.login img { border-radius: 12px; }
.login h1 { font-family: var(--serif); font-weight: 500; font-size: 28px; margin: 14px 0 6px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.login input[type=password] { text-align: center; font-size: 16px; padding: 11px 12px; }
.login button { justify-content: center; }

/* ---------- Narrow windows: the sidebar slides in ---------- */

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 290px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 24px rgba(31, 30, 29, .15); }
  body.side-open .sidebar { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(31, 30, 29, .25); z-index: 30; }
  .side-close, .side-open-btn { display: inline-flex; }
  .top-tabs span { display: none; }
  .top-row { gap: 8px; }
  .chat-inner, .composer-wrap { padding-left: 14px; padding-right: 14px; }
  .task { flex-direction: column; align-items: flex-start; }
  .page-view, .tab-content.is-page { padding: 20px 16px 60px; }
}
