:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --panel-muted: #f4f6f8;
  --text: #16181d;
  --muted: #68707d;
  --border: #d9dee7;
  --strong-border: #bac4d1;
  --accent: #1f6feb;
  --accent-soft: #eaf2ff;
  --success: #13795b;
  --success-soft: #e7f6ef;
  --warning: #9a6700;
  --warning-soft: #fff4d6;
  --danger: #b42318;
  --danger-soft: #fff0ed;
  --code: #0f172a;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.6rem, 2vw, 2.15rem); line-height: 1.15; letter-spacing: 0; }
.topbar-title { color: var(--text); font-size: clamp(1.6rem, 2vw, 2.15rem); font-weight: 800; line-height: 1.15; }
h2 { margin-bottom: 0.85rem; font-size: 1rem; line-height: 1.25; letter-spacing: 0; }
h3 { font-size: 0.95rem; }
p { color: var(--muted); }
strong { color: var(--text); }
code {
  color: var(--code);
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.08rem 0.28rem;
  font-size: 0.88em;
}
pre {
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--code);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
form { margin: 1rem 0 0; }
label { display: block; margin: 0.8rem 0 0.35rem; color: var(--text); font-weight: 650; }
input, select, button, textarea {
  min-height: 2.45rem;
  font: inherit;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--strong-border);
  border-radius: 7px;
  padding: 0.5rem 0.65rem;
}
input, select, textarea { width: 100%; max-width: 34rem; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; margin-right: 0.35rem; }
textarea { width: 100%; max-width: none; min-height: 9rem; resize: vertical; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  color: #ffffff;
  background: var(--text);
  border-color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
button:hover, .button:hover { text-decoration: none; filter: brightness(1.08); }
button.secondary, .button.secondary {
  color: var(--text);
  background: #ffffff;
  border-color: var(--strong-border);
}
ul { padding-left: 1.25rem; }
li + li { margin-top: 0.65rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { padding: 0.72rem 0.85rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; }

.app-shell { display: grid; grid-template-columns: 17rem minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1.35rem 1rem;
  background: #ffffff;
  border-right: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
}
.brand::before {
  content: "";
  width: 0.72rem;
  height: 0.72rem;
  margin-right: 0.55rem;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0.36rem 0.36rem 0 #13a085;
}
.app-nav { margin-top: 2rem; }
.app-nav-section + .app-nav-section { margin-top: 1.5rem; }
.app-nav-heading {
  margin: 0 0 0.45rem 0.65rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.app-nav-link {
  display: flex;
  align-items: center;
  min-height: 2.15rem;
  padding: 0.35rem 0.65rem;
  color: #344054;
  border-radius: 7px;
  font-weight: 650;
}
.app-nav-link:hover { background: var(--panel-muted); text-decoration: none; }
.app-nav-link.is-active { color: var(--accent); background: var(--accent-soft); }
.workspace { min-width: 0; padding: 1.25rem 1.5rem 2rem; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  max-width: 80rem;
  margin: 0 auto 1.15rem;
  padding: 0.3rem 0;
}
.eyebrow {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.content-grid { display: grid; max-width: 80rem; margin: 0 auto; gap: 1rem; }
.content-grid.has-aside { grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem); align-items: start; }
.content-panel, .context-panel, .public-panel, .section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.content-panel { min-width: 0; padding: 1.25rem; }
.context-panel { position: sticky; top: 1rem; padding: 1rem; }
.section { padding: 1rem; box-shadow: none; }
.section + .section, .notice + .section, .section + .notice { margin-top: 1rem; }
.notice {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-muted);
}
.notice p:last-child { margin-bottom: 0; }
.notice.info { background: var(--accent-soft); border-color: #c7dcff; }
.notice.success { background: var(--success-soft); border-color: #b8e4d0; }
.notice.warning { background: var(--warning-soft); border-color: #f1d58d; }
.notice.danger { background: var(--danger-soft); border-color: #ffc9c2; }
.error { color: var(--danger); margin: 1rem 0; font-weight: 650; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.15rem 0.48rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: #344054;
  background: var(--panel-muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.badge.success { color: var(--success); background: var(--success-soft); border-color: #b8e4d0; }
.badge.warning { color: var(--warning); background: var(--warning-soft); border-color: #f1d58d; }
.badge.danger { color: var(--danger); background: var(--danger-soft); border-color: #ffc9c2; }
.meta-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
  margin: 0;
}
.meta-list div {
  min-width: 0;
  padding: 0.75rem;
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.meta-list dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.meta-list dd { margin: 0.2rem 0 0; overflow-wrap: anywhere; }
.item-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.item-card {
  padding: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.item-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.item-title { margin: 0; color: var(--text); font-weight: 800; overflow-wrap: anywhere; }
.item-subtitle { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.92rem; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 1rem; }
.public-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}
.public-brand { position: fixed; top: 1.25rem; left: 1.25rem; }
.public-panel {
  width: min(100%, 34rem);
  padding: 1.35rem;
}
.doc-content { max-width: 48rem; }
.doc-content h1 { margin-bottom: 1rem; }
.doc-content .lead { color: var(--muted); font-size: 1.05rem; }

/* Replaces style="display:inline" on the forms that sit mid-sentence — a sign-out button
   inside a paragraph, a remove button at the end of a list item. */
.inline-form { display: inline; margin: 0; }
.inline-form button { min-height: 1.9rem; padding: 0.2rem 0.55rem; font-size: 0.88rem; }

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .app-nav { display: flex; gap: 1rem; overflow-x: auto; margin-top: 1rem; padding-bottom: 0.25rem; }
  .app-nav-section { min-width: max-content; }
  .app-nav-section + .app-nav-section { margin-top: 0; }
  .workspace { padding: 1rem; }
  .topbar { display: block; }
  .topbar-actions { margin-top: 0.9rem; }
  .content-grid.has-aside { grid-template-columns: 1fr; }
  .context-panel { position: static; }
}

@media (max-width: 560px) {
  .workspace, .content-panel, .public-panel { padding: 1rem; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--border); }
  td { border-bottom: 0; padding: 0.45rem 0; }
}
