/* Shell-only styles — replace/extend when Stitch + Tailwind lands */
:root {
  --bg: #0b0f14;
  --bg-card: #121821;
  --bg-elevated: #1a222d;
  --text: #e8eef7;
  --muted: #8b98a8;
  --ok: #10b981;
  --warn: #f59e0b;
  --alarm: #e11d48;
  --info: #22d3ee;
  --border: rgba(255, 255, 255, 0.08);
  --app-height: 100dvh;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --tabbar-h: 64px;
  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: var(--app-height);
}

#app {
  min-height: var(--app-height);
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-mark {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  font-size: 16px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-chip {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main.shell-main {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
}

.field input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  padding: 12px 14px;
  min-height: 44px;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

button,
.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-panic-silent {
  background: linear-gradient(180deg, #1f2937, #111827);
  border-color: rgba(34, 211, 238, 0.35);
  color: var(--info);
}

.btn-panic-loud {
  background: linear-gradient(180deg, #3f121c, #1f0a10);
  border-color: rgba(225, 29, 72, 0.5);
  color: #fda4af;
}

.btn-ghost {
  background: transparent;
}

#shell-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.2em;
}

#shell-status[data-kind="ok"] {
  color: var(--ok);
}
#shell-status[data-kind="err"] {
  color: var(--alarm);
}
#shell-status[data-kind="pending"] {
  color: var(--warn);
}
#shell-status[data-kind="info"] {
  color: var(--info);
}

/* Stitch drop zone — keep empty structure ready */
#stitch-root {
  /* Stitch export HTML/Tailwind goes here */
  min-height: 0;
}

#stitch-root:empty {
  display: none;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 6px 8px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: rgba(12, 16, 22, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index: 30;
}

.tabbar a {
  text-decoration: none;
  color: var(--muted);
  font-size: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  border-radius: 12px;
}

.tabbar a[aria-current="page"],
.tabbar a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tabbar .ico {
  font-size: 16px;
  line-height: 1;
}

.shell-only-note {
  font-size: 12px;
  color: var(--muted);
  border-left: 3px solid var(--info);
  padding-left: 10px;
  margin: 0;
}

/* Utility placeholders for Stitch tokens */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* === audit export / fleet panels === */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#account-type-badge[data-kind="pro"] {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
}

.panel[hidden] {
  display: none !important;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-block {
  width: 100%;
  margin-top: 14px;
}

.btn-primary {
  background: linear-gradient(180deg, #164e63, #0e7490);
  border-color: rgba(34, 211, 238, 0.45);
  color: #ecfeff;
}

.export-format-row {
  margin-top: 10px;
}

.fleet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.fleet-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  min-height: 48px;
}

.fleet-row input {
  width: 18px;
  height: 18px;
}

.fleet-id {
  font-weight: 650;
  font-size: 14px;
}

.fleet-meta {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.status-line {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.2em;
}
.status-line[data-kind="ok"] { color: var(--ok); }
.status-line[data-kind="err"] { color: var(--alarm); }
.status-line[data-kind="pending"] { color: var(--warn); }
.status-line[data-kind="info"] { color: var(--info); }
.status-line[data-kind="warn"] { color: var(--warn); }

@media (max-width: 380px) {
  .field-row { grid-template-columns: 1fr; }
}
