/* Phone-first styling for the tunnel viewer + linking pages.
   Dark by default, with a light-mode override via prefers-color-scheme. */

:root {
  --bg: #0f1115;
  --surface: #181b22;
  --surface-2: #21252e;
  --text: #e8eaed;
  --text-dim: #9aa0aa;
  --border: #2b2f3a;
  --accent: #3b82f6;
  --accent-text: #ffffff;
  --danger: #ef4444;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #eef0f3;
    --text: #1a1d23;
    --text-dim: #5b616e;
    --border: #d8dbe0;
    --accent: #2563eb;
    --accent-text: #ffffff;
    --danger: #dc2626;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --- Viewer (full-screen iframe + toolbar) --- */
.viewer-shell { display: flex; flex-direction: column; height: 100dvh; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.toolbar .title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}
.toolbar .spacer { flex: 1 1 auto; }

.frame-wrap { position: relative; flex: 1 1 auto; min-height: 0; }
iframe.tunnel {
  border: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
}

/* Fallback shown when the embedded app refuses to be framed */
.fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 32px;
  background: var(--bg);
}
.fallback.show { display: flex; }
.fallback p { color: var(--text-dim); max-width: 30rem; line-height: 1.5; }

/* --- Centered card pages (landing / error) --- */
.center {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 28rem;
  width: 100%;
  text-align: center;
}
.card h1 { font-size: 20px; margin: 0 0 12px; }
.card p { color: var(--text-dim); line-height: 1.6; margin: 8px 0; }
.card ol { text-align: left; color: var(--text-dim); line-height: 1.7; padding-left: 1.2em; }
.logo { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 18px; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn.small { padding: 7px 12px; font-size: 13px; }

.note { font-size: 12px; color: var(--text-dim); margin-top: 18px; }
