/* OpenOwn — GitHub Primer light theme */

:root {
  /* Canvas */
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f6f8fa;
  --bg-inset: #ffffff;
  --card: #ffffff;
  --card-hover: #f6f8fa;

  /* Borders */
  --border: #d0d7de;
  --border-muted: #d8dee4;
  --border-light: #afb8c1;

  /* Text */
  --text: #1f2328;
  --muted: #656d76;
  --text-secondary: #57606a;

  /* Accent (links, focus) */
  --accent: #0969da;
  --accent-dim: rgba(9, 105, 218, 0.12);
  --accent-emphasis: #0550ae;

  /* GitHub green — primary actions */
  --btn-primary-bg: #1f883d;
  --btn-primary-hover: #1a7f37;
  --btn-primary-border: rgba(27, 31, 36, 0.15);

  /* Semantic */
  --ok: #1a7f37;
  --ok-subtle: #dafbe1;
  --err: #cf222e;
  --err-subtle: #ffebe9;
  --warn: #9a6700;
  --warn-subtle: #fff8c5;
  --term: #8250df;

  /* Shape */
  --radius: 6px;
  --radius-lg: 6px;
  --shadow: 0 1px 0 rgba(27, 31, 36, 0.04);
  --shadow-overlay: 0 8px 24px rgba(140, 149, 159, 0.2);

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono {
  font-family: var(--mono);
  font-size: 0.85em;
  background: rgba(175, 184, 193, 0.2);
  padding: 0.12em 0.35em;
  border-radius: 4px;
  color: var(--text);
}

.hidden { display: none !important; }

/* ─── Shell & header (GitHub top bar) ─── */
.sb-shell { position: relative; min-height: 100vh; }

.sb-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 100;
}

.sb-topbar .sb-brand { justify-self: start; }
.sb-topbar-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.sb-topbar-center {
  justify-self: center;
  display: flex;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.sb-nav-link {
  padding: 0.5rem 0.75rem;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  margin-bottom: -1px;
}

.sb-nav-link:hover { color: var(--text); text-decoration: none; }

.sb-nav-link.active {
  background: transparent;
  color: var(--text);
  border-bottom-color: #fd8c73;
  font-weight: 600;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}

.sb-brand:hover { text-decoration: none; color: var(--text); }

/* Text logo: My.OpenOwn.org */
.oo-logo {
  display: inline-flex;
  align-items: baseline;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.oo-logo-muted {
  font-weight: 500;
  color: var(--muted);
}

.oo-logo-core {
  font-weight: 700;
  color: var(--text);
}

.oo-logo-badge {
  margin-left: 8px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  color: var(--muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 2em;
  vertical-align: middle;
}

.sb-brand-mark {
  display: none;
}

.sb-user-chip {
  font-size: 12px;
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
}

/* ─── Buttons (GitHub) ─── */
.sb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 5px 12px;
  min-height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.sb-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sb-btn-primary {
  background: var(--btn-primary-bg);
  border-color: rgba(27, 31, 36, 0.15);
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(27, 31, 36, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.sb-btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover);
}

.sb-btn-block { width: 100%; margin-top: 0.5rem; }

.sb-auth-card-wide { max-width: 30rem; }

.sb-field-hint {
  margin: 0.35rem 0 0;
  font-size: 12px;
  color: var(--err);
}

.sb-btn-ghost {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}

.sb-btn-ghost:hover:not(:disabled) {
  background: var(--card-hover);
  border-color: var(--border-light);
}

.sb-btn-sm {
  padding: 3px 8px;
  min-height: 28px;
  font-size: 12px;
}

/* ─── Cards & forms ─── */
.sb-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.sb-card-lg {
  border-radius: var(--radius);
  padding: 24px;
}

.sb-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
}

.sb-label {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.sb-input, .sb-select {
  width: 100%;
  padding: 5px 12px;
  min-height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.sb-input:focus, .sb-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.sb-field { margin-bottom: 16px; }
.sb-field:last-child { margin-bottom: 0; }

.sb-msg {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid transparent;
}

.sb-msg.ok { background: var(--ok-subtle); color: var(--ok); border-color: rgba(26, 127, 55, 0.4); }
.sb-msg.err { background: var(--err-subtle); color: var(--err); border-color: rgba(207, 34, 46, 0.4); }
.sb-msg.warn { background: var(--warn-subtle); color: var(--warn); border-color: rgba(154, 103, 0, 0.35); }

.sb-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0 7px;
  border-radius: 2em;
  line-height: 22px;
}

/* ─── Tabs (GitHub underline style) ─── */
.sb-tabs {
  display: flex;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 16px;
}

.sb-tabs button {
  flex: 0 0 auto;
  padding: 8px 12px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}

.sb-tabs button:hover { color: var(--text); }

.sb-tabs button.active {
  background: transparent;
  color: var(--text);
  border-bottom-color: #fd8c73;
  font-weight: 600;
}

.sb-tab-panel { display: none; }
.sb-tab-panel.active { display: block; }

/* ─── Auth ─── */
.sb-auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px 16px;
  background: var(--bg);
}

.sb-auth-card {
  width: 100%;
  max-width: 26rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.sb-auth-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sb-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12px;
}

.sb-auth-divider::before, .sb-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Admin ─── */
.sb-admin-wrap { max-width: 960px; margin: 0 auto; padding: 24px 16px; }

.sb-apps-grid { display: flex; flex-direction: column; gap: 8px; }

.sb-app-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.sb-app-row:hover { border-color: var(--border-light); }

.sb-app-row-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
  cursor: pointer;
}

.sb-app-row-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.sb-app-row-head .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.sb-app-row-title { min-width: 0; }
.sb-app-row-actions { display: flex; gap: 6px; flex-wrap: wrap; position: relative; z-index: 2; flex-shrink: 0; }
.sb-app-row-actions button { pointer-events: auto; }

.sb-app-row-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.sb-app-row.open .sb-app-row-body { display: block; padding-top: 16px; }

.sb-url-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.sb-url-chip.primary { border-color: var(--accent-emphasis); background: var(--accent-dim); }

.sb-url-chip code {
  flex: 1;
  font-size: 12px;
  word-break: break-all;
  background: transparent;
  padding: 0;
}

.sb-upload-zone {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: border-color 0.12s;
}

.sb-upload-zone:hover { border-color: var(--accent); }

.sb-upload-zone input[type=file] { margin-top: 12px; }

.sb-id-preview {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
}

.sb-id-preview strong { color: var(--accent); font-family: var(--mono); background: transparent; padding: 0; }

/* ─── Wizard layout ─── */
.sb-wizard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 49px);
}

@media (max-width: 768px) {
  .sb-wizard-layout { grid-template-columns: 1fr; }
  .sb-sidebar { border-right: none !important; border-bottom: 1px solid var(--border); }
}

.sb-sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}

.sb-sidebar h2 {
  font-size: 12px;
  margin: 0 0 4px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.sb-progress {
  height: 2px;
  background: var(--border-muted);
  border-radius: 0;
  margin: 12px 0;
  overflow: hidden;
}

.sb-progress span {
  display: block;
  height: 100%;
  background: var(--btn-primary-bg);
  transition: width 0.25s ease;
}

.sb-step-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }

.sb-step-list li {
  padding: 6px 8px;
  border-radius: var(--radius);
  margin-bottom: 2px;
  color: var(--muted);
  cursor: pointer;
}

.sb-step-list li:hover { background: var(--bg-subtle); color: var(--text); }
.sb-step-list li.active { background: var(--bg-subtle); color: var(--text); font-weight: 600; }
.sb-step-list li.done { color: var(--ok); }
.sb-step-list li.done::before { content: "✓ "; }

.sb-step-list .phase-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 12px 0 4px;
  padding-left: 4px;
  font-weight: 600;
  cursor: default;
}

.sb-main { padding: 24px 32px 48px; max-width: 42rem; }
.sb-main.wide { max-width: 50rem; }

.sb-screen { display: none; }
.sb-screen.active { display: block; }

.sb-screen h2 {
  font-size: 24px;
  margin: 0 0 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sb-guide {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.sb-guide h3 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.sb-guide ol, .sb-guide ul { margin: 8px 0 0; padding-left: 20px; }
.sb-guide li { margin-bottom: 4px; color: var(--muted); }
.sb-guide p { margin: 0; color: var(--muted); font-size: 14px; }

.sb-nav { display: flex; gap: 8px; margin-top: 24px; }
.sb-nav .sb-btn { flex: 1; }
.sb-nav .sb-btn-ghost { flex: 0 0 auto; min-width: 6rem; }

pre.sb-pre {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius);
  overflow: auto;
  white-space: pre-wrap;
  margin: 8px 0 0;
  border: 1px solid var(--border);
}

/* ─── Overlay / modal ─── */
.sb-welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(31, 35, 40, 0.5);
}

.sb-welcome-overlay.open { display: flex; }

.sb-welcome-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-overlay);
}

.sb-welcome-emoji { font-size: 32px; margin-bottom: 8px; display: block; }

.sb-welcome-modal h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: unset;
}

.sb-welcome-modal .lead {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
  line-height: 1.5;
}

.sb-welcome-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

@media (max-width: 480px) { .sb-welcome-steps { grid-template-columns: 1fr; } }

.sb-welcome-step {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}

.sb-welcome-step strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  margin-bottom: 2px;
}

.sb-welcome-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.sb-welcome-close:hover { background: var(--card-hover); color: var(--text); }

.sb-inst-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
  background: var(--card);
}

.sb-inst-card h4 { margin: 0 0 4px; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.sb-status-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 0 7px;
  border-radius: 2em;
  line-height: 22px;
  border: 1px solid transparent;
}

.sb-status-pill.ok { background: var(--ok-subtle); color: var(--ok); border-color: rgba(26, 127, 55, 0.4); }
.sb-status-pill.warn { background: var(--warn-subtle); color: var(--warn); border-color: rgba(154, 103, 0, 0.35); }
.sb-status-pill.muted { background: var(--bg-subtle); color: var(--muted); border-color: var(--border); }

.sb-row-flex { display: flex; gap: 8px; margin-top: 8px; align-items: stretch; }
.sb-row-flex .sb-input { margin: 0; font-size: 12px; flex: 1; }
.sb-row-flex .sb-btn { margin: 0; width: auto; }

.sb-status-line { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ─── Setup wizard (dashboard) ─── */
.wz-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 49px);
}

@media (max-width: 900px) {
  .wz-layout { grid-template-columns: 1fr; }
  .wz-sidebar { border-right: none !important; border-bottom: 1px solid var(--border); }
}

.wz-sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}

.wz-sidebar.hidden { display: none; }

.wz-main {
  display: flex;
  justify-content: center;
  padding: 32px 24px 48px;
  overflow-y: auto;
  background: var(--bg);
}

.wz-center { width: 100%; max-width: 640px; }

.wz-screen { display: none; }
.wz-screen.active { display: block; }

.wz-step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.wz-step-card .wz-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0 7px;
  border-radius: 2em;
  line-height: 22px;
  margin-bottom: 12px;
}

.wz-step-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: left;
}

.wz-step-card .wz-lead {
  text-align: left;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
  line-height: 1.5;
}

.wz-guide {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 14px;
}

.wz-guide h3 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.wz-guide ol { margin: 8px 0 0; padding-left: 20px; }
.wz-guide li { margin-bottom: 4px; color: var(--muted); }
.wz-guide li strong { color: var(--text); }

.wz-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
}

.wz-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.wz-field input, .wz-field textarea {
  width: 100%;
  padding: 5px 12px;
  min-height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
}

.wz-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.wz-nav {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  justify-content: flex-start;
}

.wz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 16px;
  min-height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  min-width: auto;
}

.wz-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.wz-btn-primary {
  background: var(--btn-primary-bg);
  border-color: rgba(27, 31, 36, 0.15);
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(27, 31, 36, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.wz-btn-primary:hover:not(:disabled) { background: var(--btn-primary-hover); }

.wz-btn-ghost {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}

.wz-btn-ghost:hover:not(:disabled) { background: var(--card-hover); }

.wz-btn-block { width: 100%; max-width: none; }

button.wz-btn { width: auto; }
button.wz-btn.wz-btn-ghost {
  background: var(--bg-subtle);
  color: var(--text);
  padding: 5px 12px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
}

.wz-msg {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid transparent;
}

.wz-msg.ok { background: var(--ok-subtle); color: var(--ok); border-color: rgba(26, 127, 55, 0.4); }
.wz-msg.err { background: var(--err-subtle); color: var(--err); border-color: rgba(207, 34, 46, 0.4); }
.wz-msg.warn { background: var(--warn-subtle); color: var(--warn); border-color: rgba(154, 103, 0, 0.35); }

.wz-progress {
  height: 2px;
  background: var(--border-muted);
  border-radius: 0;
  margin: 12px 0;
  overflow: hidden;
}

.wz-progress span {
  display: block;
  height: 100%;
  background: var(--btn-primary-bg);
  transition: width 0.3s ease;
}

.wz-step-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }

.wz-step-list li {
  padding: 6px 8px;
  border-radius: var(--radius);
  margin-bottom: 2px;
  color: var(--muted);
  cursor: pointer;
}

.wz-step-list li:hover { background: var(--bg-subtle); color: var(--text); }

.wz-step-list li.active {
  background: var(--bg-subtle);
  color: var(--text);
  font-weight: 600;
  padding: 6px 8px;
  font-size: 13px;
}

.wz-step-list li.done { color: var(--ok); }
.wz-step-list li.done::before { content: "✓ "; }

.wz-step-list .phase-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 12px 0 4px;
  font-weight: 600;
  cursor: default;
}

.wz-apps-view { max-width: 640px; }

.wz-apps-view h2 {
  text-align: left;
  font-size: 24px;
  margin: 0 0 8px;
}

.sb-complete-url {
  display: block;
  margin: 16px 0;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  text-align: left;
  color: var(--accent);
}

.sb-full-view {
  width: 100%;
  min-height: calc(100vh - 49px);
  padding: 32px 24px 48px;
  box-sizing: border-box;
  background: var(--bg);
}

.sb-full-view.hidden { display: none !important; }
.wz-layout.hidden { display: none !important; }

.sb-full-inner { max-width: 960px; margin: 0 auto; width: 100%; }

#view-my-apps h2, #view-profile h2 {
  text-align: left;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

/* Dashboard wizard screens */
.screen { display: none; }
.screen.active {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 640px;
  margin: 0 auto;
}

.screen.active h2 {
  text-align: left;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.badge {
  display: inline-flex;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0 7px;
  border-radius: 2em;
  line-height: 22px;
}

.screen.active > .badge {
  display: inline-flex;
  width: fit-content;
}

.guide {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 14px;
}

.guide h3 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.guide ol { margin: 8px 0 0; padding-left: 20px; }
.guide li { margin-bottom: 4px; color: var(--muted); }

.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
}

.panel label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.panel input, .panel textarea {
  width: 100%;
  padding: 5px 12px;
  min-height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  margin-top: 0;
}

.panel input:focus, .panel textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.nav {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  justify-content: flex-start;
}

.nav button:not(.secondary) {
  flex: 0 0 auto;
  padding: 5px 16px;
  min-height: 32px;
  border-radius: var(--radius);
  border: 1px solid rgba(27, 31, 36, 0.15);
  background: var(--btn-primary-bg);
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  box-shadow: 0 1px 0 rgba(27, 31, 36, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.nav button:not(.secondary):hover:not(:disabled) { background: var(--btn-primary-hover); }

.nav button.secondary {
  flex: 0 0 auto;
  min-width: auto;
  padding: 5px 12px;
  min-height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
}

.nav button.secondary:hover { background: var(--card-hover); }

.nav button:disabled, .panel button:disabled { opacity: 0.5; cursor: not-allowed; }

.msg {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  text-align: left;
  border: 1px solid transparent;
}

.msg.ok { background: var(--ok-subtle); color: var(--ok); border-color: rgba(26, 127, 55, 0.4); }
.msg.err { background: var(--err-subtle); color: var(--err); border-color: rgba(207, 34, 46, 0.4); }
.msg.warn { background: var(--warn-subtle); color: var(--warn); border-color: rgba(154, 103, 0, 0.35); }

pre, .mono { font-family: var(--mono); font-size: 12px; }

pre {
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: auto;
  white-space: pre-wrap;
  margin: 8px 0 0;
}

.api { color: var(--muted); font-size: 13px; text-align: left; }

.status-line {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  text-align: left;
}

.terminal-callout {
  background: var(--warn-subtle);
  border: 1px solid rgba(210, 153, 34, 0.4);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--warn);
  text-align: left;
  line-height: 1.5;
}

.terminal-callout strong { color: var(--text); }

.panel .wz-btn { width: 100%; margin-top: 12px; }
.panel .wz-btn + .wz-btn { margin-top: 8px; }

.wz-reset-btn { margin-top: 16px; width: 100%; }

.dl-progress-wrap { margin: 16px 0 12px; }

.dl-progress-bar {
  height: 8px;
  background: var(--border-muted);
  border-radius: var(--radius);
  overflow: hidden;
}

.dl-progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--btn-primary-bg);
  border-radius: var(--radius);
  transition: width 0.15s linear;
}

.dl-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.dl-stats strong { color: var(--text); font-weight: 600; }

.dl-complete { color: var(--ok); font-weight: 600; text-align: left; margin-top: 12px; }

.os-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 8px;
}

.os-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
}

.os-card:hover { border-color: var(--border-light); background: var(--card-hover); }

.os-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.os-card svg { width: 48px; height: 48px; color: var(--muted); }
.os-card.selected svg { color: var(--accent); }
.os-card .os-name { font-size: 13px; }

.os-picker-compact { gap: 8px; margin: 8px 0 12px; max-width: 22rem; }
.os-picker-compact .os-card { padding: 8px; }
.os-picker-compact .os-card svg { width: 28px; height: 28px; }
.os-picker-compact .os-card .os-name { font-size: 12px; }

@media (max-width: 540px) {
  .os-picker { grid-template-columns: 1fr; }
  .os-card { flex-direction: row; justify-content: flex-start; padding: 12px 16px; }
  .os-card svg { width: 32px; height: 32px; }
}

.apps-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.apps-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.apps-table th, .apps-table td {
  padding: 8px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.apps-table th {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 600;
  background: var(--bg-subtle);
}

.apps-table tbody tr.apps-row:hover { background: var(--bg-subtle); }
.apps-table tbody tr.apps-row:last-child td { border-bottom: none; }

.apps-detail-row td { background: var(--bg); padding: 12px 16px; font-size: 13px; }
.apps-detail-inner { display: grid; gap: 8px; }
.apps-detail-inner .inst-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.apps-detail-inner input, .apps-detail-inner pre { flex: 1; min-width: 12rem; }

.inst-status {
  font-size: 12px;
  font-weight: 500;
  padding: 0 7px;
  border-radius: 2em;
  line-height: 22px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.inst-status.ok { background: var(--ok-subtle); color: var(--ok); border-color: rgba(26, 127, 55, 0.4); }
.inst-status.warn { background: var(--warn-subtle); color: var(--warn); border-color: rgba(154, 103, 0, 0.35); }
.inst-status.muted { background: var(--bg-subtle); color: var(--muted); border-color: var(--border); }
