:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #6b7280;
  --accent: #6366f1;
}

* { box-sizing: border-box; }

html, body, #root {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.boot {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

#root.full { height: 100vh; }

.shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.title { font-size: 16px; font-weight: 600; }

.btn {
  font: inherit;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: #fff; border: none; font-weight: 500; }
.btn.ghost { color: var(--muted); }

.pad { padding: 20px; }
.scroll { overflow: auto; flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { background: #fef2f2; color: #991b1b; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }

.empty { text-align: center; padding: 48px 0; display: grid; gap: 12px; justify-items: center; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--card);
}
.row-open { flex: 1; text-align: left; background: transparent; border: 0; cursor: pointer; padding: 0; font: inherit; color: inherit; }
.row-name { font-weight: 500; }
.row-sub { font-size: 12px; margin-top: 2px; }

.name-input {
  flex: 1; font: inherit; font-size: 14px; font-weight: 500;
  padding: 6px 8px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: inherit;
}
.name-input:focus { border-color: var(--border); outline: none; }

.pill { font-size: 12px; min-width: 60px; text-align: right; }
.pill.active { color: var(--accent); }

.canvas-host { flex: 1; min-height: 0; }
.canvas-host .excalidraw { height: 100%; }

.overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: var(--card); color: var(--text); border-radius: 12px; padding: 20px;
  width: min(440px, 90%); box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.x { background: transparent; border: 0; font-size: 18px; cursor: pointer; color: inherit; }
.share-row { display: flex; gap: 8px; margin: 12px 0; }
.share-url { flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: #f9fafb; font: inherit; font-size: 12px; }
