:root { --fg:#222; --muted:#666; --bg:#fff; --pri:#2563eb; --bd:#e5e7eb; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; padding: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: var(--fg); background: #f1f5f9; height: 100vh; height: 100dvh; overflow: hidden; }

/* App Wrapper: Fixed viewport frame */
.app-wrapper {
max-width: 840px; margin: 0 auto; background: #fff; height: 100vh; height: 100dvh;
position: relative; box-shadow: 0 0 20px rgba(0,0,0,0.05);
display: flex; flex-direction: column; overflow: hidden;
}

/* Header */
.app-header {
display: flex; align-items: center; padding: 12px 16px;
border-bottom: 1px solid var(--bd); background: #fff;
flex-shrink: 0; z-index: 10;
}
.hamburger {
font-size: 24px; cursor: pointer; margin-right: 16px;
background: none; border: none; padding: 0; color: var(--fg);
margin-top: 0px;
}
.app-title { font-size: 18px; font-weight: 600; margin: 0; }

/* Mobile Navigation Menu (Drawer) - Absolute within wrapper */
.nav-overlay {
position: absolute; top: 0; left: 0; width: 100%; height: 100%;
background: rgba(0,0,0,0.4); z-index: 1000;
opacity: 0; visibility: hidden; transition: opacity 0.3s;
}
.nav-overlay.open { opacity: 1; visibility: visible; }

.nav-drawer {
position: absolute; top: 0; left: 0; width: 280px; height: 100%;
background: #fff; transform: translateX(-100%); transition: transform 0.3s;
z-index: 1001; display: flex; flex-direction: column;
border-right: 1px solid var(--bd);
}
.nav-drawer.open { transform: translateX(0); }

.drawer-header {
padding: 16px; font-size: 20px; font-weight: bold;
border-bottom: 1px solid var(--bd); background: #f8fafc;
}
.nav-item {
padding: 16px; cursor: pointer; font-size: 16px; color: var(--fg);
border-bottom: 1px solid var(--bd);
text-decoration: none; display: block;
}
.nav-item:hover { background: #f1f5f9; }
.nav-item.active { background: #eef2ff; color: var(--pri); font-weight: 600; }

/* Content Area - Scrollable */
.content { padding: 16px; padding-bottom: 80px; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; }

h1 { margin: 0 0 8px; font-size: 20px; }
.desc { color: var(--muted); margin-bottom: 16px; }

/* Sub Tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab { border: 1px solid var(--bd); padding: 8px 12px; border-radius: 8px; cursor: pointer; background: #f8fafc; text-decoration: none; color: inherit; display: inline-block; }
.tab.active { background: #eef2ff; border-color: #c7d2fe; color: #1e40af; }

.card { border: 1px solid var(--bd); border-radius: 12px; padding: 16px; background: #fff; }
label { font-weight: 600; display: block; margin: 12px 0 6px; }
textarea, input, select { width: 100%; padding: 10px; border: 1px solid var(--bd); border-radius: 8px; font: inherit; }
button { margin-top: 12px; padding: 10px 14px; border: 0; border-radius: 8px; background: var(--pri); color: #fff; cursor: pointer; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
pre { background: #0b1020; color: #d1e7ff; padding: 12px; border-radius: 8px; overflow: auto; max-height: 400px; white-space: pre-wrap; word-wrap: break-word; }
.muted { color: var(--muted); font-size: 12px; }
.btn-secondary { background: #64748b; }
button:focus-visible, summary:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(37,99,235,0.25);
  outline-offset: 2px;
}


.main-pane { display: none; }
.main-pane.active { display: block; }

/* Login View (Full Screen) */
#login-view {
position: fixed; inset: 0; background: #f8fafc; z-index: 2000;
display: none; align-items: center; justify-content: center; flex-direction: column;
}
.login-card {
background: #fff; padding: 32px; border-radius: 16px;
width: 100%; max-width: 360px; box-shadow: 0 4px 24px rgba(0,0,0,0.1);
text-align: center;
}
.login-card h2 { margin-top: 0; margin-bottom: 8px; }
.login-desc { color: var(--muted); margin-bottom: 24px; font-size: 14px; }
.login-step { display: none; flex-direction: column; gap: 12px; }
.login-step.active { display: flex; }
.link-btn { background: none; border: none; color: var(--pri); cursor: pointer; padding: 0; font-size: 13px; text-decoration: underline; }

/* Other PR Samples */
.other-pr-card { box-shadow: 0 8px 30px rgba(2,6,23,0.06); }
.other-pr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bd);
}
.other-pr-title-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.other-pr-title-value { font-weight: 650; line-height: 1.35; }
.other-pr-section { padding-top: 12px; }
.section-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.other-pr-text { line-height: 1.75; }
.pr-text { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bd); }

.expandable {
  margin: 0;
}
.expandable summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: baseline;
  white-space: pre-wrap;
}
.expandable summary::-webkit-details-marker { display: none; }
.expandable-text { flex: 1; }
.expandable-more {
  flex: none;
  color: var(--pri);
  font-size: 12px;
  text-decoration: underline;
  white-space: nowrap;
}
.expandable[open] .expandable-more { display: none; }
.expandable-body {
  margin-top: 8px;
  line-height: 1.75;
}

@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  .other-pr-header { align-items: stretch; flex-direction: column; }
}
