:root {
  --bg: #fcfbf8;
  --panel: #ffffff;
  --border: #e8e5df;
  --text: #1c1917;
  --muted: #78716c;
  --accent: #1c1917;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
code { font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }
.hidden { display: none !important; }
.view { height: 100%; display: flex; flex-direction: column; }

/* ---------- Top bar ---------- */
.topbar {
  height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; gap: 12px; border-bottom: 1px solid transparent;
}
#workspace .topbar { background: var(--panel); border-bottom-color: var(--border); }
.topbar .left, .topbar .right { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.topbar .right { justify-content: flex-end; flex: none; }
.topbar .right > * { flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.logo {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 15px;
  background: linear-gradient(135deg, #ff7a59, #ec4899 55%, #6366f1);
}
.logo.big { width: 56px; height: 56px; border-radius: 16px; font-size: 26px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  border: 1px solid var(--border); background: var(--panel); border-radius: 10px; padding: 8px 14px;
  cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center;
  transition: background 0.15s, opacity 0.15s;
}
.btn:hover { background: #f5f3ee; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { opacity: 0.88; background: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.round { width: 36px; height: 36px; padding: 0; border-radius: 50%; justify-content: center; font-size: 16px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; }
.icon-btn:hover { background: #f1eee8; }
.name-btn { background: none; border: 0; font-weight: 600; font-size: 15px; padding: 6px 8px; border-radius: 8px; cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-btn:hover { background: #f1eee8; }
.select { border: 1px solid var(--border); background: var(--panel); border-radius: 10px; padding: 7px 10px; font-size: 13px; cursor: pointer; max-width: 190px; }
.select.small { padding: 5px 8px; font-size: 12px; }

.tabs { display: flex; justify-content: center; gap: 4px; background: #f1eee8; padding: 3px; border-radius: 10px; flex: none !important; }
.tab { border: 0; background: none; padding: 6px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--muted); }
.tab.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.seg { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 7px 10px; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.seg button.active { background: #f1eee8; color: var(--text); }

/* ---------- Layout shell and project sidebar ---------- */
.shell { display: flex; height: 100%; }
.content { flex: 1; min-width: 0; height: 100%; }
.sidebar { width: 280px; flex: none; background: #f6f4ef; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 0; min-height: 0; }
.shell.in-workspace .sidebar { width: 360px; }
.shell.sb-closed .sidebar { display: none; }
.sb-head { position: relative; display: flex; align-items: center; justify-content: space-between; height: 32px; }
.sb-head-actions { display: flex; align-items: center; gap: 6px; }
.user-chip { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; cursor: pointer; }
.user-chip:hover { background: #f5f3ee; }
.sb-new { justify-content: center; text-align: center; }
.sb-search { border: 1px solid var(--border); background: var(--panel); border-radius: 10px; padding: 8px 10px; font-size: 13px; outline: none; width: 100%; }
.sb-search:focus { border-color: #b8b2a7; }
.sb-projects { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.shell:not(.in-workspace) .sb-projects { flex: 1; padding-bottom: 12px; }
.sb-label { display: flex; align-items: center; gap: 4px; width: 100%; background: none; border: 0; cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; padding: 4px 6px; border-radius: 6px; }
.sb-label:hover { background: #ebe8e1; }
.sb-label .chev { display: inline-block; width: 12px; transition: transform 0.15s; }
.sb-label .count { margin-left: auto; font-weight: 500; }
.shell.projects-collapsed .sb-label .chev { transform: rotate(-90deg); }
.shell.projects-collapsed .sb-search, .shell.projects-collapsed .sb-list { display: none; }
.shell.in-workspace .sb-search { display: none; }
.shell.in-workspace .sb-list { flex: none; max-height: 190px; }
.shell.in-workspace .sb-projects { padding-bottom: 8px; }
.sb-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; margin: 0 -4px; padding: 0 4px; }
.sb-group { font-size: 11px; font-weight: 600; color: var(--muted); padding: 12px 8px 4px; }
.sb-group:first-child { padding-top: 2px; }
.shell.in-workspace .sb-group { display: none; }
.sb-item { --row-bg: #f6f4ef; position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; cursor: pointer; }
.sb-item:hover { --row-bg: #ece9e2; background: var(--row-bg); }
.sb-item.active { --row-bg: #ffffff; background: var(--row-bg); box-shadow: 0 0 0 1px var(--border), 0 1px 3px rgba(28, 25, 23, 0.06); }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
.sb-item .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sb-item .name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-item.active .name { font-weight: 600; }
.sb-item .meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-actions { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; padding-left: 18px; background: linear-gradient(90deg, transparent, var(--row-bg) 14px); }
.sb-item:hover .item-actions { display: flex; }
.icon-action { width: 26px; height: 26px; border: 0; background: none; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.icon-action:hover { background: rgba(28, 25, 23, 0.08); color: var(--text); }
.icon-action.danger:hover { background: #fee2e2; color: var(--danger); }
/* Inside a project the list is compact: smaller avatars, no second line. */
.shell.in-workspace .sb-item { padding: 5px 8px; }
.shell.in-workspace .avatar { width: 24px; height: 24px; border-radius: 8px; font-size: 12px; }
.shell.in-workspace .sb-item .meta { display: none; }
.sb-empty { color: var(--muted); font-size: 13px; padding: 8px 10px; }
.sb-open-btn { display: none; }
.shell.sb-closed .sb-open-btn { display: grid; }
.shell:not(.sb-closed) #home .topbar .brand { display: none; }

/* ---------- Home ---------- */
#home { overflow-y: auto; background:
  radial-gradient(ellipse 60% 45% at 20% 0%, rgba(255, 122, 89, 0.18), transparent 70%),
  radial-gradient(ellipse 55% 45% at 80% 5%, rgba(99, 102, 241, 0.16), transparent 70%),
  radial-gradient(ellipse 50% 40% at 50% 25%, rgba(236, 72, 153, 0.12), transparent 70%), var(--bg); }
.hero { text-align: center; padding: 72px 20px 24px; max-width: 760px; margin: 0 auto; width: 100%; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 14px; }
.grad { background: linear-gradient(90deg, #ff7a59, #ec4899, #6366f1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); font-size: 18px; margin: 0 0 32px; }

.prompt-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 14px 14px 10px;
  box-shadow: var(--shadow); text-align: left; transition: border-color 0.15s;
}
.prompt-box:focus-within { border-color: #b8b2a7; }
.prompt-box textarea { width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-size: 16px; line-height: 1.5; max-height: 220px; }
.prompt-box.compact { border-radius: 16px; margin: 12px; padding: 10px 10px 8px; box-shadow: none; }
.prompt-box.compact textarea { font-size: 14px; }
.prompt-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 8px; }
.prompt-actions .btn { margin-left: auto; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.chip { border: 1px solid var(--border); background: rgba(255, 255, 255, 0.7); border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.chip:hover { background: #fff; }
.warning { margin-top: 16px; padding: 10px 14px; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: 14px; }

.projects-wrap { max-width: 1040px; width: 100%; margin: 40px auto 60px; padding: 0 20px; }
.projects-wrap h2 { font-size: 16px; margin: 0 0 14px; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; position: relative; transition: transform 0.15s, box-shadow 0.15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card .thumb { height: 104px; display: grid; place-items: center; color: #fff; font-size: 42px; font-weight: 700; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18); }
.card .meta { padding: 12px 14px; }
.card .title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .date { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.card:hover .card-actions { opacity: 1; }
.card-actions .icon-action { background: rgba(255, 255, 255, 0.92); color: #44403c; }
.card-actions .icon-action:hover { background: #fff; }
.card-actions .icon-action.danger:hover { background: #fee2e2; color: var(--danger); }
.muted-note { color: var(--muted); font-size: 14px; }

/* ---------- Workspace ---------- */
.chat { display: none; }
.shell.in-workspace .chat { display: flex; flex: 1; min-height: 0; flex-direction: column; margin: 0 -12px; background: var(--panel); border-top: 1px solid var(--border); }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.msg { font-size: 14px; line-height: 1.55; max-width: 100%; word-wrap: break-word; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: #f1eee8; padding: 9px 13px; border-radius: 16px 16px 4px 16px; max-width: 88%; }
.msg.assistant { align-self: flex-start; }
.msg.error { color: var(--danger); background: #fef2f2; padding: 9px 13px; border-radius: 12px; }
.progress { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-top: 8px; }
.stage { flex: 1; min-width: 0; background: #f1eee8; position: relative; }
.pane { position: absolute; inset: 0; }
.frame-wrap { height: 100%; margin: 0 auto; transition: width 0.25s; background: #fff; }
.frame-wrap.desktop { width: 100%; }
.frame-wrap.tablet { width: 768px; max-width: 100%; box-shadow: var(--shadow); }
.frame-wrap.mobile { width: 390px; max-width: 100%; box-shadow: var(--shadow); }
.frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; color: var(--muted); background: var(--bg); }
.preview-errors { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 8px; background: #1c1917; color: #fff; padding: 6px 6px 6px 16px; border-radius: 999px; font-size: 13px; box-shadow: var(--shadow); white-space: nowrap; }
.preview-errors .btn { border-radius: 999px; background: transparent; color: #fff; border-color: #57534e; }
.preview-errors .btn.primary { background: #fff; color: #1c1917; border-color: #fff; }
.building { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: var(--accent); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; box-shadow: var(--shadow); }
/* ---------- VS Code style code view ---------- */
.vsc { background: #1e1e1e; color: #cccccc; display: flex; flex-direction: column; font-size: 13px; }
.vsc-main { flex: 1; display: flex; min-height: 0; }
.vsc-activity { width: 44px; flex: none; background: #333333; display: flex; flex-direction: column; align-items: center; padding-top: 4px; }
.vsc-act { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-left: 2px solid transparent; color: #858585; cursor: pointer; }
.vsc-act:hover { color: #fff; }
.vsc-act.active { color: #fff; border-left-color: #fff; }
.vsc-side { width: var(--vsc-side-width, 220px); flex: none; background: #252526; display: flex; flex-direction: column; min-width: 0; }
.vsc-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.vsc-resizer { width: 5px; margin: 0 -2px; flex: none; cursor: col-resize; position: relative; z-index: 2; }
.vsc-resizer:hover, .vsc-resizer.dragging { background: #007acc; }
.vsc-side.hidden + .vsc-resizer { display: none; }
.vsc-title { padding: 8px 12px 8px 20px; font-size: 11px; letter-spacing: 0.04em; color: #bbbbbb; display: flex; align-items: center; justify-content: space-between; }
.vsc-icon-btn { background: none; border: 0; color: #cccccc; font-size: 18px; line-height: 1; width: 22px; height: 22px; border-radius: 4px; cursor: pointer; }
.vsc-icon-btn:hover { background: #3a3d41; }
.vsc-icon-btn.on { background: #264f78; color: #fff; }
.vsc-folder { padding: 3px 8px; font-size: 11px; font-weight: 700; color: #cccccc; display: flex; gap: 4px; background: #2a2d2e; overflow: hidden; white-space: nowrap; }
.vsc-folder .chev { width: 12px; flex: none; }
.vsc-folder #vsc-project { overflow: hidden; text-overflow: ellipsis; }
.vsc-tree { flex: 1; overflow-y: auto; padding: 2px 0; }
.vsc-row { position: relative; display: flex; align-items: center; gap: 6px; height: 22px; padding-right: 6px; cursor: pointer; color: #cccccc; white-space: nowrap; user-select: none; }
.vsc-row:hover { background: #2a2d2e; }
.vsc-row.active { background: #37373d; color: #fff; }
.vsc-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.vsc-row .chev { width: 12px; flex: none; text-align: center; font-size: 11px; color: #c5c5c5; }
.vsc-row .row-actions { display: none; gap: 2px; }
.vsc-row:hover .row-actions { display: flex; }
.vsc-row .row-actions button { background: none; border: 0; color: #cccccc; cursor: pointer; font-size: 12px; width: 20px; height: 18px; border-radius: 3px; padding: 0; }
.vsc-row .row-actions button:hover { background: #4b4f55; }
.vsc-row.writing .name::after { content: ' ●'; color: #ca5010; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.2; } }
.file-icon { font: 700 10px 'JetBrains Mono', monospace; letter-spacing: -1px; width: 16px; flex: none; text-align: center; color: #9d9d9d; }
.file-icon[data-ext='html'] { color: #e37933; }
.file-icon[data-ext='css'] { color: #519aba; }
.file-icon[data-ext='js'], .file-icon[data-ext='mjs'] { color: #cbcb41; }
.file-icon[data-ext='json'] { color: #cbcb41; }
.file-icon[data-ext='svg'] { color: #ffb13b; }
.file-icon[data-ext='md'] { color: #519aba; }
.vsc-editor-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vsc-tabs { height: 35px; flex: none; background: #252526; display: flex; align-items: stretch; justify-content: space-between; min-width: 0; }
.vsc-tab-list { display: flex; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.vsc-tab { display: flex; align-items: center; gap: 6px; padding: 0 8px 0 12px; background: #2d2d2d; color: #969696; border-right: 1px solid #252526; border-top: 1px solid transparent; cursor: pointer; white-space: nowrap; flex: none; }
.vsc-tab.active { background: #1e1e1e; color: #fff; border-top-color: #007acc; }
.vsc-tab .tab-end { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; font-size: 13px; line-height: 1; color: #c5c5c5; }
.vsc-tab .tab-end:hover { background: #4b4f55; }
.vsc-tab .tab-end.dirty { color: #d4d4d4; }
.vsc-actions { display: flex; align-items: center; gap: 6px; padding: 0 10px; flex: none; }
.vsc-btn { background: #3a3d41; color: #cccccc; border: 0; border-radius: 4px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.vsc-btn:hover { background: #4b4f55; }
.vsc-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.vsc-search-box { display: flex; gap: 4px; padding: 0 10px 6px; }
.vsc-search-box input { flex: 1; min-width: 0; background: #3c3c3c; border: 1px solid transparent; color: #cccccc; border-radius: 3px; padding: 4px 6px; font: inherit; outline: none; }
.vsc-search-box input:focus { border-color: #007acc; }
.vsc-search-box .vsc-icon-btn { font-size: 12px; width: 26px; flex: none; }
.vsc-search-summary { padding: 0 12px 6px; font-size: 11px; color: #9d9d9d; }
.vsc-row .count { color: #9d9d9d; font-size: 11px; background: #3a3d41; border-radius: 8px; padding: 0 6px; }
.vsc-match { display: flex; gap: 8px; align-items: center; height: 20px; padding: 0 8px 0 28px; cursor: pointer; color: #bbbbbb; white-space: nowrap; overflow: hidden; }
.vsc-match:hover { background: #2a2d2e; }
.vsc-match .ln { color: #858585; flex: none; }
.vsc-match .text { overflow: hidden; text-overflow: ellipsis; }
.vsc-match mark { background: #613214; color: #f0d0b0; border-radius: 2px; }
.vsc-crumbs { height: 22px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 14px; font-size: 12px; color: #a9a9a9; white-space: nowrap; overflow: hidden; background: #1e1e1e; }
.vsc-crumbs .sep { color: #6b6b6b; }
.vsc-crumbs .last { color: #d4d4d4; }
.vsc-btn.on { background: #264f78; color: #fff; }
.vsc-console { height: 170px; flex: none; border-top: 1px solid #3c3c3c; background: #1e1e1e; display: flex; flex-direction: column; }
.vsc-console-head { height: 28px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 8px 0 12px; font-size: 11px; letter-spacing: 0.04em; color: #bbbbbb; background: #252526; }
.vsc-console-head .spacer { flex: 1; }
.vsc-console-list { flex: 1; overflow-y: auto; font: 12px/1.5 'JetBrains Mono', monospace; }
.con-line { display: flex; gap: 8px; padding: 2px 12px; border-bottom: 1px solid #2a2a2a; white-space: pre-wrap; word-break: break-word; color: #cccccc; }
.con-line.error { color: #f48771; background: rgba(244, 135, 113, 0.08); }
.con-line.warn { color: #cca700; }
.con-empty { padding: 12px; color: #6b6b6b; font-family: Inter, sans-serif; }
.status-btn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0 8px; height: 100%; }
.status-btn:hover { background: rgba(255, 255, 255, 0.18); }
.status-btn.has-errors { background: #c72e0f; }
.vsc-editor-wrap { flex: 1; min-height: 0; position: relative; }
.vsc-nofile { position: absolute; inset: 0; display: grid; place-items: center; color: #6b6b6b; background: #1e1e1e; }
.vsc-editor { position: absolute; inset: 0; }
.vsc-status { height: 22px; flex: none; background: #007acc; color: #fff; display: flex; align-items: center; gap: 16px; padding: 0 12px; font-size: 12px; }
.vsc-status.busy { background: #ca5010; }
.vsc-status .spacer { flex: 1; }

.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(120, 113, 108, 0.3); border-top-color: currentColor; animation: spin 0.7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); z-index: 10; }

@media (max-width: 900px) {
  .sidebar, .shell.in-workspace .sidebar { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: min(360px, 100vw); box-shadow: 0 0 40px rgba(0, 0, 0, 0.18); }
  .topbar .right .seg, #open-new, #version-select { display: none; }
}

/* ---------- Inline editing and inline confirmation (no browser popups) ---------- */
.is-editing { display: none !important; }
.inline-edit { font: inherit; color: var(--text); background: #fff; border: 1px solid var(--text); border-radius: 6px; padding: 2px 6px; outline: none; min-width: 0; width: 100%; box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.08); }
.inline-edit.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14); animation: shake 0.25s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.sb-item .info .inline-edit { font-size: 13.5px; font-weight: 600; }
.card .meta .inline-edit { font-size: 14px; font-weight: 600; }
.name-btn + .inline-edit { width: 280px; font-size: 15px; font-weight: 600; padding: 5px 8px; }
.vsc-row .inline-edit { flex: 1; height: 20px; background: #3c3c3c; color: #cccccc; border: 1px solid #007acc; border-radius: 2px; box-shadow: none; padding: 0 4px; font-size: 13px; }
.vsc-row .inline-edit.invalid { border-color: #f48771; }

.inline-confirm { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--row-bg, #fff); border-radius: inherit; font-size: 12.5px; font-weight: 500; white-space: nowrap; color: var(--text); }
.inline-confirm .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.inline-confirm .btns { display: flex; gap: 6px; }
.inline-confirm button { border: 0; border-radius: 7px; padding: 4px 10px; font: inherit; cursor: pointer; }
.inline-confirm .yes { background: var(--danger); color: #fff; }
.inline-confirm .yes:hover { background: #b91c1c; }
.inline-confirm .no { background: rgba(28, 25, 23, 0.08); }
.inline-confirm .no:hover { background: rgba(28, 25, 23, 0.14); }
.card .inline-confirm { flex-direction: column; justify-content: center; gap: 10px; padding: 0 14px; background: #fff; border-radius: var(--radius); font-size: 13.5px; }
.card .inline-confirm .label { flex: none; max-width: 100%; }
.vsc-row .inline-confirm { background: #37373d; color: #cccccc; border-radius: 0; font-size: 12px; padding: 0 6px; }
.vsc-row .inline-confirm button { padding: 1px 8px; border-radius: 3px; }
.vsc-row .inline-confirm .no { background: #4b4f55; color: #ccc; }
.sb-item:has(.inline-edit) .item-actions { display: none !important; }

/* ---------- Model picker ---------- */
.select option:disabled { color: #a8a29e; }

/* ---------- Usage note ---------- */
.usage-note { margin: 18px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---------- Sharing and ownership ---------- */
.admin-link { display: grid; place-items: center; text-decoration: none; color: var(--text); font-size: 15px; }
.admin-link:hover, .user-chip:hover { background: #f1eee8; }
.icon-action.danger:hover { color: var(--danger); }

.share-panel { background: var(--panel); border-bottom: 1px solid var(--border); padding: 14px 20px 16px; display: flex; flex-direction: column; gap: 10px; max-width: 100%; }
.share-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.share-note { color: var(--muted); font-size: 13px; }
.share-people { display: flex; flex-direction: column; gap: 6px; max-width: 560px; }
.share-person { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: #fcfbf8; font-size: 14px; --row-bg: #fcfbf8; }
.share-avatar { width: 26px; height: 26px; border-radius: 50%; background: #eee9df; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.share-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-tag { font-size: 12px; color: var(--muted); }
.share-form { display: flex; gap: 8px; max-width: 560px; }
.share-form input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: 14px; outline: none; background: #fff; }
.share-form input:focus, .data-form input:focus, .data-form textarea:focus, .data-form select:focus { border-color: #a8a29e; box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.06); }
.share-message { margin: 0; font-size: 13px; color: #166534; }
.share-message.error { color: var(--danger); }

/* ---------- Data tab ---------- */
.data-pane { display: flex; flex-direction: column; overflow: auto; background: var(--bg); padding: 16px 20px 28px; gap: 12px; }
.data-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.data-bar .btn { text-decoration: none; }
.data-access { color: var(--muted); font-size: 13px; margin-left: 4px; }
.data-banner { margin: 0; padding: 10px 14px; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: 14px; }
.data-body { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: auto; }
.data-empty { padding: 36px 24px; text-align: center; color: var(--muted); font-size: 14px; }
.data-empty p { max-width: 460px; margin: 6px auto 0; line-height: 1.5; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; padding: 10px 14px; background: #f6f4ef; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--muted); white-space: nowrap; position: sticky; top: 0; }
.data-table td { padding: 9px 14px; border-bottom: 1px solid #f0ede7; vertical-align: top; max-width: 280px; overflow-wrap: anywhere; }
.data-table tr { position: relative; --row-bg: #fff; }
.data-table tr:last-child td { border-bottom: 0; }
.data-actions { white-space: nowrap; text-align: right; }
.data-actions .btn { margin-left: 6px; }
.data-body > .muted-note { padding: 10px 14px; margin: 0; }
.data-form { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; max-width: 640px; }
.data-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.data-form input[type="text"], .data-form input[type="email"], .data-form input[type="url"], .data-form input[type="number"], .data-form input[type="date"], .data-form textarea, .data-form select {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; color: var(--text); background: #fff; outline: none; width: 100%;
}
.data-form textarea { resize: vertical; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.data-form-buttons { display: flex; gap: 8px; }
.share-person .inline-confirm, .data-table .inline-confirm { padding: 0 12px; }
