/* Tapestry admin console shell (P2-014) — minimal, keyboard-friendly */
:root {
  color-scheme: light dark;
  --bg: #0f1419;
  --fg: #e7ecf1;
  --muted: #9aa7b2;
  --accent: #3b82f6;
  --border: #2a3441;
  --danger: #f87171;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --fg: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --danger: #b91c1c;
  }
}
* {
  box-sizing: border-box;
}
html {
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}
a {
  color: var(--accent);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
}
.tp-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
.tp-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.tp-locale-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.tp-locale-form label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.tp-locale-form select {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
}

.tp-locale-form button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.65rem;
  background: var(--bg);
  color: var(--accent);
}
.tp-topbar h1 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}
.tp-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.tp-nav a {
  text-decoration: none;
  font-weight: 500;
}
.tp-nav a[aria-current="page"] {
  text-decoration: underline;
}
.tp-main {
  flex: 1;
  padding: 1.25rem;
  max-width: 64rem;
}
.tp-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.tp-muted {
  color: var(--muted);
  font-size: 0.9rem;
}
.tp-error {
  color: var(--danger);
  font-weight: 500;
}
label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
input,
textarea,
select,
button {
  font: inherit;
  margin-top: 0.25rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  max-width: 100%;
}
button {
  cursor: pointer;
  font-weight: 600;
}
.tp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}
pre.tp-json {
  overflow: auto;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  max-height: 24rem;
}

/* Help drawer (P4-016 / EXP-004) */
.tp-help-dialog {
  margin: 0 0 0 auto;
  padding: 0;
  border: none;
  width: min(42rem, 100vw);
  max-width: 100%;
  height: 100vh;
  max-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
}
.tp-help-dialog::backdrop {
  background: rgba(15, 20, 25, 0.55);
}
.tp-help-dialog-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.tp-help-dialog-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}
.tp-help-dialog-head .tp-help-full {
  margin-right: auto;
  font-weight: 600;
  font-size: 0.9rem;
}
.tp-help-close {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  background: var(--bg);
  color: var(--accent);
}
.tp-help-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: var(--bg);
}

.tp-help-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.tp-help-callout {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tp-help-callout--warn {
  border-left-color: #f59e0b;
}
.tp-help-toc-filter {
  margin: 0.5rem 0 1rem;
}
.tp-help-toc-filter input {
  width: min(28rem, 100%);
}
.tp-help-toc section {
  margin-bottom: 1.25rem;
}
.tp-help-toc h2 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}
.tp-help-toc ul {
  margin: 0;
  padding-left: 1.25rem;
}
.tp-help-toc li[data-hidden="1"] {
  display: none;
}
.tp-context-help {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}
.tp-context-help:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
article.tp-help-article h1 {
  font-size: 1.35rem;
  margin-top: 0;
}
article.tp-help-article h2 {
  font-size: 1.05rem;
  margin-top: 1.25rem;
}
