@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  src: url("./Inter-Medium.ttf") format("truetype");
}

:root {
  --bg: #111216;
  --panel: #17181d;
  --panel-2: #1e2027;
  --line: #2a2d36;
  --text: #e8e9ee;
  --muted: #8b8f9c;
  --accent: #d97757;
  --accent-2: #e8906f;
  --user: #2a2f3d;
  --danger: #e5646b;
  --wait: #e5b454;
  --ok: #6cc08b;
  color-scheme: dark;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body { background: var(--bg); overflow: hidden; }

button {
  font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer;
}
button:hover:not(:disabled) { border-color: #3a3e4a; }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #1a1310; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-2); }
button.ghost { background: transparent; }
button.block { width: 100%; text-align: left; }
button.active { background: var(--panel-2); }

input, textarea, select {
  font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.center { height: 100%; display: grid; place-items: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px 28px; max-width: 420px; }
.card h2 { margin-top: 0; }
.drag { --wails-draggable: drag; height: 28px; flex: none; }

.layout { display: flex; height: 100%; }
.sidebar {
  width: 240px; flex: none; display: flex; flex-direction: column; gap: 8px;
  padding: 10px; background: var(--panel); border-right: 1px solid var(--line);
}
.sidebar-top { display: flex; align-items: center; height: 28px; flex: none; }
.sidebar-top .drag { flex: 1; }
button.bell { position: relative; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
button.bell:hover { color: var(--text); background: var(--panel-2); }
.bell-count { position: absolute; top: -2px; right: -3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #1a1310; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center; }
.menu.notify-menu { top: calc(100% + 6px); bottom: auto; width: 340px; max-height: 70vh; overflow-y: auto; }
.notify-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 8px; }
.notify-title { flex: 1; font-weight: 600; }
.notify-empty { padding: 10px 8px 12px; }
button.notify-row { display: flex; align-items: flex-start; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-weight: 400; color: var(--muted); }
button.notify-row:hover { background: var(--panel-2); }
button.notify-row.unread { color: var(--text); }
button.notify-row:not(.unread) .notify-body { margin-left: 15px; }
.notify-row .status-mark, .toast .status-mark { margin-top: 5px; }
.notify-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.notify-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toasts { position: fixed; bottom: 16px; right: 16px; z-index: 30; display: flex; flex-direction: column; gap: 8px; width: 320px; }
.toast { display: flex; align-items: flex-start; gap: 4px; padding: 10px 10px 10px 14px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.45); animation: toast-in .18s ease-out; }
.toast.waiting { border-left-color: var(--wait); }
.toast.failed { border-left-color: var(--danger); }
button.toast-body { flex: 1; min-width: 0; display: flex; align-items: flex-start; padding: 0; border: 0; background: transparent; text-align: left; font-weight: 400; color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.setting { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.setting input { margin-top: 3px; }
.setting-note { display: block; }
.setting-warn { color: var(--wait); }
.setting-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.setting-row select { min-width: 160px; }
.phone-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.phone-row > span { flex: 1; min-width: 0; }
.pairing { margin: 8px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.pair-code { display: block; margin: 8px 0; font-size: 28px; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
.project-pick { display: flex; gap: 6px; }
.project-pick select { flex: 1; min-width: 0; }
.project-meta { padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title { flex: 1; min-width: 0; }
.chat-title h3 { margin: 0; }
.conversations { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.conv { display: flex; align-items: center; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.conv:hover, .conv.active { background: var(--panel-2); color: var(--text); }
.conv-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-project { flex: none; max-width: 40%; margin-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-mark { flex: none; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; }
.status-mark.running { background: var(--accent); animation: status-breathe 1.4s ease-in-out infinite; }
.status-mark.waiting { background: var(--wait); box-shadow: 0 0 0 3px rgba(229,180,84,.25); }
.status-mark.done { background: var(--ok); }
.status-mark.failed { background: var(--danger); }
@keyframes status-breathe { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
.conv.attention-waiting { color: var(--text); }
.other-projects { flex: none; max-height: 30%; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.conv-del { opacity: 0; padding: 0 4px; }
.conv:hover .conv-del { opacity: 0.6; }
.conv-del:hover { opacity: 1; color: var(--danger); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.chat { display: flex; flex-direction: column; height: 100%; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 0 20px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chat-head .drag { width: 100%; }
.chat-head h3 { margin: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.totals { color: var(--muted); font-size: 12px; }
.account-pick { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; flex-direction: column; max-width: 760px; width: 100%; margin: 0 auto; }
/* The bundled Inter is one static Medium, so it has no weights to tell a heading from
   body text. Replies and messages use the system font, which has them. */
.msg .bubble { white-space: pre-wrap; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 400; line-height: 1.4286; word-wrap: break-word; }
.msg .bubble:has(> .markdown) { white-space: normal; }
.markdown { display: flex; flex-direction: column; gap: 10px; }
.markdown p, .markdown ul, .markdown ol, .markdown pre, .markdown blockquote, .markdown table { margin: 0; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.markdown h1 { font-size: 1.45em; line-height: 1.25; margin: 16px 0 -2px; }
.markdown h2 { font-size: 1.28em; line-height: 1.3; margin: 14px 0 -2px; }
.markdown h3, .markdown h4 { font-size: 1.1em; line-height: 1.35; margin: 10px 0 -3px; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown strong { font-weight: 500; }
.markdown ul, .markdown ol { display: flex; flex-direction: column; gap: 4px; padding-left: 20px; }
.markdown li > ul, .markdown li > ol { margin-top: 4px; }
.markdown code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; background: rgba(255, 255, 255, .08); border-radius: 4px; padding: 1px 4px; }
.markdown pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.markdown pre code { background: none; padding: 0; font-size: .86em; white-space: pre; }
.code-block { position: relative; }
.code-block pre { margin: 0; padding-right: 72px; }
.code-actions { position: absolute; top: 6px; right: 1px; display: flex; gap: 2px; padding: 0 5px; border-radius: 6px; background: var(--panel-2); }
.code-actions .icon-btn { color: var(--muted); }
.code-actions .icon-btn:hover { color: var(--text); }
.markdown blockquote { display: flex; flex-direction: column; gap: 10px; border-left: 2px solid var(--line); padding-left: 12px; color: var(--muted); }
.markdown a { color: var(--accent-2); }
.markdown table { border-collapse: separate; border-spacing: 2px; display: block; overflow-x: auto; }
.markdown th, .markdown td { padding: 5px 9px; text-align: left; background: rgba(255, 255, 255, .04); }
.markdown th { background: rgba(255, 255, 255, .09); font-weight: 600; }
.markdown hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.msg.user { align-items: flex-end; }
.msg.user .bubble { background: var(--user); padding: 9px 13px; border-radius: 12px; max-width: 80%; }
.msg.user .markdown p, .msg.user .markdown li { white-space: pre-wrap; } /* a line break in a message stays one */
.msg.error .bubble { color: var(--danger); border: 1px solid #5a2a2e; padding: 9px 13px; border-radius: 10px; }
.msg .meta { color: var(--muted); font-size: 11px; margin-top: 4px; }
.reply-actions { display: flex; gap: 2px; margin-top: 4px; opacity: .55; transition: opacity .15s; }
.msg:hover .reply-actions, .reply-actions:focus-within { opacity: 1; }
.reply-actions .icon-btn { padding: 4px; color: var(--muted); }
.reply-actions .icon-btn:hover { color: var(--text); }
.reply-actions .icon-btn.on { color: var(--accent); }
.pinned { display: flex; flex-direction: column; gap: 2px; padding: 6px 20px; border-bottom: 1px solid var(--line); max-height: 96px; overflow-y: auto; }
.pinned-item { display: flex; align-items: center; gap: 4px; }
.pinned-jump {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 3px 6px;
  background: none; border: none; color: var(--muted); font-size: 12px; text-align: left; cursor: pointer;
}
.pinned-jump:hover { color: var(--text); }
.pinned-jump svg { color: var(--accent); flex: none; }
.pinned-jump span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinned-item .icon-btn { padding: 3px; color: var(--muted); }
.waiting { display: flex; align-items: center; gap: 9px; padding: 6px 0 2px; font-size: 13.5px; color: var(--muted); }
.waiting-mark { display: inline-flex; align-items: center; gap: 3px; height: 14px; flex: none; }
.waiting-mark i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: waiting-hop 1.1s ease-in-out infinite; }
.waiting-mark i:nth-child(2) { animation-delay: .14s; }
.waiting-mark i:nth-child(3) { animation-delay: .28s; }
@keyframes waiting-hop { 0%, 70%, 100% { transform: translateY(2px); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }
.waiting-word {
  background: linear-gradient(90deg, var(--muted) 35%, var(--text) 50%, var(--muted) 65%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: waiting-shimmer 2.4s linear infinite;
}
@keyframes waiting-shimmer { from { background-position: 125% 0; } to { background-position: -125% 0; } }
.waiting-time { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .75; }
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  .status-mark.running { animation: none; }
  .waiting-mark i { animation: none; opacity: .8; }
  .waiting-word { animation: none; background: none; color: var(--muted); }
}
.notice { margin: 0 20px 8px; padding: 8px 12px; border-radius: 8px; background: #2b2420; color: var(--accent-2); font-size: 12px; }
.composer { display: flex; flex-direction: column; gap: 6px; padding: 10px 20px 14px; max-width: 800px; width: 100%; margin: 0 auto; }
.composer-box {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 10px 8px 14px; cursor: text; transition: border-color .15s;
}
.composer-box:focus-within { border-color: #4a4e5c; }
.composer-box.dragging { border-color: var(--accent); border-style: dashed; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.attachment {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 4px 6px 4px 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: var(--muted);
}
.attachment img { width: 28px; height: 28px; object-fit: cover; border-radius: 5px; }
.attachment.small { padding: 2px 8px; }
.attachment.image { position: relative; padding: 0; overflow: hidden; }
.attachment.image img { display: block; width: 72px; height: 72px; border-radius: 0; }
.attachment.image .attachment-x { position: absolute; top: 3px; right: 3px; padding: 3px; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; }
.msg-image { display: block; max-width: 320px; max-height: 240px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
.attachment.image img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 32px; background: rgba(0, 0, 0, .85); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: default; }
.lightbox-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; padding: 8px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.lightbox-close:hover { background: rgba(255, 255, 255, .24); }
.attachment-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-x { border: 0; background: transparent; padding: 2px; color: var(--muted); display: grid; place-items: center; }
.attachment-x:hover { color: var(--text); }
.msg-attachments { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.composer-box textarea {
  width: 100%; resize: none; border: 0; outline: none; background: transparent; padding: 2px 0;
  line-height: 1.5; max-height: 240px; overflow-y: auto;
}
.composer-tools { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.spacer { flex: 1; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 99px; padding: 0; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--muted);
}
.icon-btn:hover:not(:disabled) { color: var(--text); background: #2a2d36; }
.icon-btn.listening { color: #fff; background: var(--danger); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229,100,107,.5); } 50% { box-shadow: 0 0 0 6px rgba(229,100,107,0); } }
button.send {
  width: 30px; height: 30px; border-radius: 99px; padding: 0; display: grid; place-items: center;
  background: var(--accent); border: 0; color: #1a1310;
}
button.send:hover:not(:disabled) { background: var(--accent-2); }
button.send.stop { background: var(--text); color: var(--bg); }
button.send.stop:hover { background: #fff; }
button.send:disabled { background: #3a3d47; color: var(--muted); opacity: 1; }
.composer-under { display: flex; align-items: center; gap: 4px; padding: 0 4px; }

.popover { position: relative; }
button.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 8px;
  background: transparent; border: 0; color: var(--muted); border-radius: 6px;
}
button.chip:hover { color: var(--text); background: var(--panel-2); }
.menu {
  position: absolute; bottom: calc(100% + 6px); z-index: 10; min-width: 220px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.menu.left { left: 0; }
.menu.right { right: 0; }
.menu-columns { display: grid; grid-template-columns: minmax(200px, auto) minmax(140px, auto); gap: 6px; }
.menu-head { font-size: 11px; color: var(--muted); padding: 6px 8px 4px; text-transform: uppercase; letter-spacing: .04em; }
button.menu-item {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; font-size: 13px;
  background: transparent; border: 0; border-radius: 6px; padding: 6px 8px;
}
button.menu-item:hover:not(:disabled) { background: var(--panel-2); }
button.menu-item.selected { color: var(--text); }
.menu-check { width: 14px; display: inline-grid; place-items: center; color: var(--accent); }
.menu-label { flex: none; }
.menu-note { margin-left: auto; padding-left: 12px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.menu-label { white-space: nowrap; }

.page { padding: 0 32px 32px; overflow-y: auto; max-width: 720px; }
.accounts { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.account { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.badge { font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 99px; margin-left: 6px; color: var(--muted); border: 1px solid var(--line); }
.badge.ok { color: #7cc79a; border-color: #2f5a40; }
.badge.bad { color: var(--danger); border-color: #5a2a2e; }
.account-label { font-weight: 600; margin-bottom: 3px; }
.org-body { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.org-section { display: flex; flex-direction: column; gap: 4px; }
.org-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line); }
.org-actions { display: flex; gap: 4px; justify-content: flex-end; }
.signin { margin-top: 10px; }
.signin p { margin: 0 0 8px; }
.login-out { white-space: pre-wrap; font-size: 11px; color: var(--muted); max-height: 120px; overflow: auto; margin: 8px 0 0; }
.add { margin-bottom: 18px; }
.add input { flex: 1; }

.tools { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.msg > .bubble + div > .tools { margin-top: 8px; } /* rows the turn reached after writing a paragraph */
.tool {
  display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); min-width: 0; width: 100%;
  padding: 1px 0; background: none; border: none; border-radius: 0; text-align: left; font-weight: 400;
}
.tool:hover:not(:disabled) { background: none; color: var(--text); }
.tool:disabled { opacity: 1; cursor: default; }
.tool > svg:last-child { flex: none; transform: rotate(-90deg); transition: transform .12s; }
.tool.open > svg:last-child { transform: none; }
.tool-state { flex: none; }
.tool-more { margin: 4px 0 8px 5px; padding-left: 12px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tool-more .tools { margin-bottom: 0; }
.tool-text { margin: 0; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 240px; overflow-y: auto; }
.tool-markdown { font-size: 12px; color: var(--muted); max-height: 280px; overflow-y: auto; }
.tool-name { color: var(--text); font-weight: 500; flex: none; }
.tool-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tool.failed .tool-state { color: var(--danger); }
.tool.running svg { color: var(--accent); }
.question { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 12px; margin: 6px 0 10px; display: flex; flex-direction: column; gap: 12px; }
.question-one { display: flex; flex-direction: column; gap: 6px; }
.question-header { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.question-text { font-weight: 500; }
.question-option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; font-weight: 400; }
.question-option.on { border-color: var(--accent); }
.question-description { font-size: 12px; color: var(--muted); }
.question-own { resize: none; line-height: 1.5; max-height: calc(7.5em + 18px); overflow-y: auto; }
.approval { border: 1px solid #5b4632; background: #241c16; border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; }
.approval-head { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 6px; }
.approval-target { font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-bottom: 6px; }
.approval-body { margin: 0 0 10px; font-size: 12px; white-space: pre-wrap; word-break: break-all; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 160px; overflow: auto; }

.chat-wrap { display: flex; height: 100%; min-width: 0; }
.chat-wrap .chat { flex: 1; min-width: 0; }
.session-panel {
  width: 264px; flex: none; border-left: 1px solid var(--line); background: var(--panel);
  padding: 40px 14px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
}
.session-panel section { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.session-panel h4 { margin: 0 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kv { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 2px 0; min-width: 0; }
.kv svg { flex: none; color: var(--muted); }
.kv .small { margin-left: auto; padding-left: 6px; flex: none; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.meter { height: 6px; border-radius: 99px; background: #2a2d36; overflow: hidden; margin: 4px 0 6px; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.meter-fill.high { background: var(--danger); }
.session-panel h5 { margin: 12px 0 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.split { margin: 4px 0 2px; padding-left: 8px; border-left: 2px solid var(--line); }
.small-line { font-size: 11.5px; margin-top: 4px; }
.limit { margin-bottom: 8px; }
.limit-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.limit-name { width: 30px; flex: none; }
.limit-pct { width: 30px; flex: none; text-align: right; }
.meter.small { flex: 1; height: 5px; margin: 3px 0; }
.tiny { font-size: 11px; }
.kv .panel-terminal { margin-left: auto; flex: none; padding: 2px; color: var(--muted); }
.kv .panel-terminal:hover { color: var(--text); }
.kv.check { cursor: pointer; }
.kv.check input { margin: 0; accent-color: var(--accent); }

/* ATL account sign-in */
.top-drag { position: fixed; top: 0; left: 0; right: 0; }
.sign-in { display: flex; flex-direction: column; gap: 12px; width: 360px; }
.sign-in p { margin: 0; }
.sign-in .code-input { font-size: 22px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.sign-in-error { color: var(--danger); font-size: 13px; }
.me { display: flex; align-items: center; gap: 6px; padding: 6px 4px 0; border-top: 1px solid var(--line); }
.me-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-meta.unlinked { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; white-space: normal; }
.project-meta.unlinked button { padding: 2px 6px; }

/* Sharing */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); display: grid; place-items: center; z-index: 50; }
.share-dialog { width: 440px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; gap: 8px; }
.share-dialog h3 { margin: 0; }
.share-dialog h4 { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.share-row { padding: 4px 0; }
.grow { flex: 1; min-width: 0; }
.row.end { justify-content: flex-end; }
.shared-list { flex: none; max-height: 30%; }
.section-label { padding: 6px 10px 2px; }

/* Memory view (#2014) */
.page h3 { margin: 22px 0 6px; font-size: 14px; }
.memory-meter { border-collapse: collapse; margin: 8px 0 4px; }
.memory-meter th, .memory-meter td { padding: 3px 12px 3px 0; text-align: left; font-weight: 400; }
.memory-meter th { color: var(--muted); }
.memory-events { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.memory-event.challenge { color: var(--accent); }


/* The phone (#2101): the sidebar becomes a drawer opened from the top-left button. */
.drawer-btn { display: none; }
@media (max-width: 700px) {
  .drag { height: 8px; }
  .drawer-btn { display: grid; position: fixed; top: max(8px, env(safe-area-inset-top)); left: 8px; z-index: 30; font-size: 18px; width: 36px; height: 36px; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 320px); z-index: 20; transform: translateX(-100%); transition: transform 0.18s ease; padding-top: max(52px, calc(env(safe-area-inset-top) + 44px)); }
  .drawer-open .sidebar { transform: none; }
  .drawer-scrim { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.45); }
  .chat-head { padding: max(8px, env(safe-area-inset-top)) 12px 8px 52px; min-height: 36px; }
  .chat-head .drag { display: none; }
  .composer { padding: 8px 10px max(10px, env(safe-area-inset-bottom)); }
  .messages { padding-left: 12px; padding-right: 12px; }
  .card { margin: 0 16px; padding: 20px; }
  .composer-box textarea { font-size: 16px; } /* below 16px the phone zooms in on focus */
}
