/* ─────────────────────────────────────────────────────────────
   tissue.systems — design system
   Fonts: JetBrains Mono (body/mono) + DM Serif Display (display)
   ───────────────────────────────────────────────────────────── */

/* ── tokens ──────────────────────────────────────────────────── */
:root {
  /* palette */
  --bg:              #f7f5f0;
  --bg-offset:       #edeae2;
  --bg-secondary:    #edeae2;
  --bg-hover:        rgba(0,0,0,.04);

  --text:            #0f1724;
  --text-secondary:  #5c6677;
  --text-tertiary:   #9aa3b2;

  --accent:          #00875f;
  --accent-dark:     #007050;
  --accent-light:    rgba(0,135,95,.08);
  --accent-glow:     rgba(0,135,95,.18);

  --border:          rgba(0,0,0,.07);
  --border-light:    rgba(0,0,0,.05);
  --border-med:      rgba(0,0,0,.13);

  /* code blocks */
  --code-bg:         #0f1724;
  --code-header-bg:  #0a1020;
  --code-text:       #c9d5e8;
  --code-bright:     #ffffff;

  /* inline code */
  --inline-code-bg:  rgba(0,0,0,.05);
  --inline-code-fg:  #0f1724;
  --inline-code-br:  rgba(0,0,0,.12);

  /* layout */
  --sidebar-w:       250px;
  --header-h:        58px;
  --max-width:       1080px;
  --content-max:     740px;

  /* type */
  --font-body:       "JetBrains Mono", "Menlo", "Consolas", monospace;
  --font-mono:       "JetBrains Mono", "Menlo", "Consolas", monospace;
  --font-display:    "DM Serif Display", serif;

  /* radii + shadow */
  --radius:          4px;
  --radius-md:       6px;
  --radius-lg:       8px;
  --shadow-xs:       0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:       0 2px 8px rgba(0,0,0,.08);
  --shadow-card:     0 4px 24px rgba(0,0,0,.08);
}

/* ── reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { font-size: 16px; -webkit-text-size-adjust: 100% }
body {
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
}
img, svg { display: block; max-width: 100% }
a { color: var(--accent); text-decoration: none }
a:hover { text-decoration: underline }
button { cursor: pointer; font-family: inherit }

/* ── header ──────────────────────────────────────────────────── */
header {
  height: var(--header-h);
  background: rgba(247,245,240,.88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
}
.logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0 }
.logo img { opacity: .85; transition: opacity .15s }
.logo:hover img { opacity: 1 }
.logo:hover { text-decoration: none }

/* header nav */
.hdr-right { display: flex; align-items: center; gap: 1.25rem }
.hdr-link {
  font-size: .72rem; letter-spacing: .03em;
  color: var(--text-secondary); text-decoration: none; transition: color .15s;
}
.hdr-link:hover { color: var(--text); text-decoration: none }
.hdr-btn {
  font-family: var(--font-body); font-size: .72rem; font-weight: 500;
  padding: .35rem .8rem;
  border: 1px solid var(--border-med); border-radius: var(--radius);
  color: var(--text-secondary); background: rgba(0,0,0,.025);
  text-decoration: none; transition: all .15s;
}
.hdr-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-light); text-decoration: none;
}

/* ── footer ──────────────────────────────────────────────────── */
footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-width); margin: 0 auto;
}
.foot-links { display: flex; gap: 1.5rem }
.foot-links a {
  font-size: .7rem; color: var(--text-tertiary); text-decoration: none;
  transition: color .15s; letter-spacing: .02em;
}
.foot-links a:hover { color: var(--text-secondary); text-decoration: none }
.foot-mark { font-size: .65rem; color: var(--text-tertiary); letter-spacing: .04em }

/* ── marketing main ──────────────────────────────────────────── */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

/* hero */
.hero { margin-bottom: 4rem }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1rem;
}
.hero .tagline {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.7;
}
.hero .tagline .tech { color: var(--text); font-weight: 400 }

/* sections */
section { margin-bottom: 3rem }
h2 {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
p { margin-bottom: 1rem; font-size: 0.875rem; line-height: 1.7; color: var(--text) }
ul { list-style: none; margin-bottom: 1rem }
li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.6rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
}
li::before { content: '—'; position: absolute; left: 0; color: var(--text-tertiary) }

/* ── inline code + pre ───────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--inline-code-bg);
  color: var(--inline-code-fg);
  border: 1px solid var(--inline-code-br);
  padding: 0.1em 0.38em;
  border-radius: var(--radius);
}
pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  background: var(--code-bg);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
  color: var(--code-text);
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}

/* ── auth pages ──────────────────────────────────────────────── */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 5rem 2rem;
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.375rem;
}
.auth-card .auth-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}
.auth-card .auth-sub a { color: var(--accent) }
.auth-card .auth-sub a:hover { text-decoration: underline }

.auth-form { display: flex; flex-direction: column; gap: 1.25rem }
.field { display: flex; flex-direction: column; gap: 0.4rem }
.field label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.field input {
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-med);
  border-radius: var(--radius-md);
  background: var(--bg-offset);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  -webkit-appearance: none;
}
.field input::placeholder { color: var(--text-tertiary) }
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.auth-submit {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.65rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  transition: background .15s, box-shadow .15s;
  margin-top: 0.25rem;
}
.auth-submit:hover { background: var(--accent-dark); box-shadow: 0 4px 20px var(--accent-glow) }
.auth-submit:disabled { opacity: 0.55; cursor: not-allowed }

.auth-error {
  font-size: 0.8rem;
  color: #c0392b;
  background: rgba(192,57,43,.07);
  border: 1px solid rgba(192,57,43,.2);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  display: none;
  line-height: 1.5;
}
.auth-success {
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid rgba(0,135,95,.25);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  display: none;
  line-height: 1.5;
}

/* ── logout button ───────────────────────────────────────────── */
.logout-btn {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border-med);
  border-radius: var(--radius);
  color: var(--text-secondary);
  background: rgba(0,0,0,.025);
  transition: border-color .15s, color .15s;
}
.logout-btn:hover { border-color: var(--accent); color: var(--accent) }

/* ── account selector ────────────────────────────────────────── */
.acct-selector {
  position: relative; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.72rem; color: var(--text);
  border: 1px solid var(--border-med); border-radius: var(--radius);
  padding: 0.3rem 0.65rem;
  transition: border-color 0.15s;
}
.acct-selector:hover { border-color: var(--accent) }
.acct-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.acct-name {
  font-weight: 500; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-caret { font-size: 0.6rem; color: var(--text-tertiary); flex-shrink: 0 }
.acct-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--bg); border: 1px solid var(--border-med);
  border-radius: var(--radius-lg); min-width: 230px; z-index: 200;
  box-shadow: var(--shadow-card); overflow: hidden;
}
.acct-dropdown.open { display: block }
.acct-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.9rem; font-size: 0.75rem;
  cursor: pointer; transition: background 0.1s;
}
.acct-item:hover { background: var(--bg-offset) }
.acct-item.active { color: var(--accent) }
.acct-item-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; opacity: 0;
}
.acct-item.active .acct-item-dot { opacity: 1 }
.acct-item-name { flex: 1 }
.acct-item-role {
  font-size: 0.62rem; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.acct-footer {
  padding: 0.5rem 0.9rem; font-size: 0.68rem; color: var(--text-tertiary);
  border-top: 1px solid var(--border);
}

/* ── user menu ───────────────────────────────────────────────── */
.user-menu {
  position: relative; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.72rem; color: var(--text-secondary);
  border: 1px solid var(--border-med); border-radius: var(--radius);
  padding: 0.3rem 0.65rem;
  transition: border-color 0.15s;
}
.user-menu:hover { border-color: var(--accent) }
.user-menu-email {
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-menu-caret { font-size: 0.6rem; color: var(--text-tertiary); flex-shrink: 0 }
.user-menu-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg); border: 1px solid var(--border-med);
  border-radius: var(--radius-lg); min-width: 220px; z-index: 200;
  box-shadow: var(--shadow-card); overflow: hidden;
}
.user-menu-dropdown.open { display: block }
.user-menu-header {
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
  font-size: 0.68rem; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-menu-item {
  display: flex; align-items: center;
  padding: 0.6rem 1rem; font-size: 0.78rem; cursor: pointer;
  transition: background 0.1s; color: var(--text);
  text-decoration: none; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font-body);
}
.user-menu-item:hover { background: var(--bg-offset); text-decoration: none; color: var(--text) }
.user-menu-item-danger { color: #dc2626 }
.user-menu-item-danger:hover { background: #fee2e2; color: #dc2626 }
.user-menu-sep { border: none; border-top: 1px solid var(--border); margin: 0 }

/* ── docs layout ─────────────────────────────────────────────── */
.docs-shell { display: block }
.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  align-items: start;
}

/* sidebar */
.docs-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--bg-offset);
  border-right: 1px solid var(--border);
  padding: 1.75rem 0;
}
.sidebar-list { list-style: none }
.sidebar-list--top { margin-bottom: 0.75rem }
.sidebar-section { margin-bottom: 0.75rem }
.sidebar-heading {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  padding: 0.6rem 1.5rem 0.25rem;
}
.sidebar-link {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.32rem 1.5rem;
  border-left: 2px solid transparent;
  line-height: 1.45;
  transition: color .1s, background .1s;
}
.sidebar-link:hover {
  color: var(--text);
  background: rgba(0,0,0,.04);
  text-decoration: none;
}
.sidebar-link.active {
  color: var(--accent);
  font-weight: 500;
  border-left-color: var(--accent);
  background: var(--accent-light);
}

/* doc main content area */
.docs-main {
  padding: 2.5rem 3rem 5rem;
  min-width: 0;
  max-width: 940px;
}
.doc-breadcrumb {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.doc-breadcrumb__sep { opacity: 0.5 }

/* doc content typography */
.doc-content { color: var(--text) }
.doc-content h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.625rem;
}
.doc-content h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 2.5rem 0 0.625rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.doc-content h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.75rem 0 0.4rem;
}
.doc-content h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.25rem 0 0.3rem;
}
.doc-content p {
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 1rem;
}
.doc-content ul, .doc-content ol { margin: 0 0 1rem 1.25rem }
.doc-content li {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 0.3rem;
  padding-left: 0;
}
.doc-content li::before { display: none }
.doc-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
.doc-content a { color: var(--accent) }
.doc-content a:hover { text-decoration: underline }

/* doc code */
.doc-content pre {
  background: var(--code-bg);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0.75rem 0 1.5rem;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--code-text);
  font-family: var(--font-mono);
}
.doc-content pre code {
  background: none; border: none; padding: 0;
  color: inherit; font-size: inherit; border-radius: 0;
}
.doc-content code {
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--inline-code-bg); color: var(--inline-code-fg);
  border: 1px solid var(--inline-code-br);
  padding: 0.1em 0.38em; border-radius: var(--radius);
}

/* doc tables */
.doc-content table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
  margin: 0.75rem 0 1.5rem; border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
}
.doc-content th, .doc-content td {
  text-align: left; padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.doc-content th {
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-secondary);
  background: var(--bg-offset);
}
.doc-content tr:last-child td { border-bottom: none }

/* ── dashboard ───────────────────────────────────────────────── */
.dash {
  display: none;
  padding: 2.5rem 2rem 6rem;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative; z-index: 2;
}
.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}
.dash-email { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.125rem }

/* section header */
.section-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2.5rem 0 0.75rem;
}
.section-hd h2 {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin: 0;
}
.section-hd .count { font-size: 0.75rem; color: var(--text-tertiary) }

/* sparse list */
.sparse-list {
  border: 1px solid var(--border-med);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  background: rgba(255,255,255,.6);
}
.sparse-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s;
}
.sparse-row:last-child { border-bottom: none }
.sparse-row:hover { background: var(--bg-offset) }
.sparse-name {
  font-size: 0.85rem; font-weight: 500; color: var(--text); min-width: 120px;
}
.sparse-url {
  flex: 1; font-size: 0.75rem; color: var(--accent);
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono);
}
.sparse-url:hover { text-decoration: underline }
.sparse-meta {
  font-size: 0.75rem; color: var(--text-tertiary); white-space: nowrap; margin-left: auto;
}
.sparse-arrow { font-size: 0.75rem; color: var(--text-tertiary); margin-left: 0.375rem; flex-shrink: 0 }

/* badges */
.badge {
  display: inline-block; font-size: 0.6rem; font-weight: 600;
  padding: 0.12rem 0.45rem; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0;
}
.badge-js     { background: #fef9c3; color: #854d0e }
.badge-wasm   { background: #ede9fe; color: #5b21b6 }
.badge-sqlite { background: var(--accent-light); color: var(--accent) }

.binding-chip {
  font-family: var(--font-mono); font-size: 0.65rem;
  padding: 0.12rem 0.4rem; border: 1px solid var(--border-med);
  border-radius: 3px; color: var(--text-secondary); flex-shrink: 0;
}

/* empty state */
.empty-state {
  padding: 3rem 1rem; text-align: center; color: var(--text-secondary);
  font-size: 0.875rem; border: 1px solid var(--border-med);
  border-radius: var(--radius-md); background: rgba(255,255,255,.5);
}
.empty-state a { color: var(--accent) }

/* detail view */
.detail-view { display: none }
.back-btn {
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 500;
  background: none; border: 1px solid var(--border-med);
  border-radius: var(--radius); color: var(--text-secondary);
  padding: 0.35rem 0.75rem; transition: border-color .1s, color .1s;
  margin-bottom: 1.75rem;
}
.back-btn:hover { border-color: var(--accent); color: var(--accent) }

.detail-title {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 800;
  letter-spacing: -0.02em; color: var(--text); margin-bottom: 0.25rem;
}
.detail-sub { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 1.75rem }

.detail-actions { display: flex; gap: 0.5rem; margin-bottom: 2rem; flex-wrap: wrap }
.btn-visit, .btn-danger, .btn-primary {
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 500;
  padding: 0.42rem 1rem; border-radius: var(--radius); cursor: pointer;
  transition: all .1s; text-decoration: none; border: 1px solid;
  display: inline-flex; align-items: center;
}
.btn-visit {
  border-color: var(--border-med); color: var(--text-secondary); background: rgba(0,0,0,.02);
}
.btn-visit:hover {
  border-color: var(--accent); color: var(--accent); text-decoration: none;
  background: var(--accent-light);
}
.btn-danger { border-color: #dc2626; color: #dc2626; background: rgba(220,38,38,.03) }
.btn-danger:hover { background: #dc2626; color: #fff }
.btn-primary { border-color: var(--accent); color: var(--accent); background: rgba(0,135,95,.03) }
.btn-primary:hover { background: var(--accent); color: #fff }

.info-grid {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 0.6rem 1rem; font-size: 0.85rem; margin-bottom: 1.75rem;
}
.info-label { color: var(--text-secondary) }
.info-val { color: var(--text); word-break: break-all }
.info-val a { color: var(--accent) }
.info-val a:hover { text-decoration: underline }

.detail-section { margin-top: 2rem }
.detail-section-hd {
  font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-secondary); margin-bottom: 0.75rem;
}

/* SQL runner */
.sql-wrap { display: flex; flex-direction: column; gap: 0.5rem }
.sql-input {
  width: 100%; font-family: var(--font-mono); font-size: 0.8rem;
  background: rgba(255,255,255,.7); border: 1px solid var(--border-med);
  border-radius: var(--radius-md); color: var(--text);
  padding: 0.6rem 0.75rem; resize: vertical; min-height: 80px;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.sql-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light) }
.sql-result {
  font-family: var(--font-mono); font-size: 0.78rem;
  background: var(--bg-offset); border: 1px solid var(--border-med);
  border-radius: var(--radius-md); padding: 0.75rem; overflow-x: auto;
  white-space: pre; color: var(--text); max-height: 300px; overflow-y: auto; display: none;
}
.sql-result.show { display: block }

/* tables list in detail */
.table-list {
  border: 1px solid var(--border-med); border-radius: var(--radius-md);
  overflow: hidden; background: rgba(255,255,255,.6);
}
.table-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0.875rem; border-bottom: 1px solid var(--border); font-size: 0.85rem;
}
.table-row:last-child { border-bottom: none }
.table-name { color: var(--text); font-weight: 500 }
.table-rows { color: var(--text-secondary); font-size: 0.78rem }

/* schema block */
.schema-block {
  font-family: var(--font-mono); font-size: 0.78rem;
  background: var(--code-bg); border-radius: var(--radius-md);
  padding: 0.875rem 1rem; color: var(--code-text); overflow-x: auto; white-space: pre;
}

.cell-chips { display: flex; gap: 0.375rem; flex-wrap: wrap }
.cell-chip {
  font-size: 0.78rem; padding: 0.2rem 0.55rem;
  border: 1px solid var(--border-med); border-radius: var(--radius);
  color: var(--text); background: rgba(255,255,255,.5); cursor: pointer;
  transition: border-color .1s, color .1s;
}
.cell-chip:hover { border-color: var(--accent); color: var(--accent) }

/* confirm modal */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,36,.35);
  backdrop-filter: blur(2px); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex }
.modal {
  background: var(--bg); border: 1px solid var(--border-med);
  border-radius: var(--radius-lg); padding: 1.5rem; max-width: 380px; width: 90%;
  box-shadow: var(--shadow-card);
}
.modal h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem }
.modal p  { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1.25rem }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end }
.btn-cancel {
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 500;
  padding: 0.4rem 0.875rem; border: 1px solid var(--border-med);
  border-radius: var(--radius); background: rgba(0,0,0,.02); color: var(--text-secondary); cursor: pointer;
  transition: border-color .1s, color .1s;
}
.btn-cancel:hover { border-color: var(--text-secondary); color: var(--text) }
.btn-delete {
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 500;
  padding: 0.4rem 0.875rem; border: none;
  border-radius: var(--radius); background: #dc2626; color: #fff; cursor: pointer;
  transition: background .1s;
}
.btn-delete:hover { background: #b91c1c }

.placeholder { color: var(--text-tertiary); font-size: 0.85rem }
.danger-zone { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(220,38,38,.2) }
.danger-zone .detail-section-hd { color: #dc2626 }

/* tech highlight (homepage) */
.tech-highlight { color: var(--text); font-weight: 400 }

/* ── responsive ──────────────────────────────────────────────── */
@media (min-width: 600px) {
  .architecture-grid { grid-template-columns: repeat(3, 1fr) }
}
@media (min-width: 1400px) {
  :root { --sidebar-w: 280px }
}
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: 1fr }
  .docs-sidebar { display: none }
  .docs-main { padding: 1.5rem 1.25rem 3rem; max-width: 100% }
}
@media (max-width: 600px) {
  .header-inner { padding: 0 1.25rem }
  main { padding: 2.5rem 1.25rem 4rem }
  .dash { padding: 1.5rem 1.25rem 4rem }
  .hdr-link { display: none }
  footer { flex-direction: column; gap: 0.75rem; text-align: center }
}
