/* WritePlainly v2 — app shell (top bar, sidebar, language menu, modal)
   Classes extracted from docs/designs/redesign-v2/project/redesign/wp-shell.jsx inline styles. */

/* ── Layout frame ── */
.wp-frame { display: flex; height: 100vh; overflow: hidden; }
.wp-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wp-content-row { flex: 1; min-height: 0; display: flex; }

/* ── Top bar ── */
.wp-topbar {
  height: 52px; flex: 0 0 52px; display: flex; align-items: center;
  padding: 0 12px 0 10px; gap: 8px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--bg); position: relative; z-index: 20;
}
.wp-topbar-brand { font-size: 13.5px; font-weight: 700; letter-spacing: -0.02em; margin-left: 2px; color: var(--ink); text-decoration: none; }
.wp-topbar-spacer { flex: 1; }
.wp-topbar-divider { width: 1px; height: 18px; background: var(--hairline-soft); margin: 0 4px; }

/* ── Sidebar ── */
.wp-sidebar {
  width: 236px; flex: 0 0 236px; overflow: hidden;
  transition: width 0.22s var(--ease), flex-basis 0.22s var(--ease);
  background: var(--bg-sidebar); border-right: 1px solid var(--hairline-soft);
  display: flex; flex-direction: column;
}
.wp-sidebar[data-collapsed] { width: 0; flex-basis: 0; border-right: none; }
.wp-sidebar-inner { width: 236px; display: flex; flex-direction: column; height: 100%; padding: 14px 10px 12px; }
.wp-sidebar-logo { display: flex; align-items: center; gap: 8px; padding: 0 6px; margin-bottom: 16px; }
.wp-logo-mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent);
  color: var(--on-accent); display: inline-flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700;
}
.wp-sidebar-title { font-size: 13.5px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.wp-sidebar .wp-row { min-height: 34px; }
.wp-sidebar-action { color: var(--ink-2); font-weight: 500; }
.wp-sidebar-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); padding: 16px 8px 6px;
}
.wp-sidebar-docs { display: flex; flex-direction: column; gap: 2px; }
.wp-doc-row { font-size: 12.5px; font-weight: 400; border: 1px solid transparent; }
.wp-doc-row .wp-doc-icon { color: var(--ink-3); flex-shrink: 0; }
.wp-doc-row .wp-doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-doc-row[aria-current="page"] {
  font-weight: 600; background: var(--bg);
  border: 1px solid var(--hairline-soft);
  box-shadow: 0 1px 2px rgba(17,17,20,0.04);
}
.wp-sidebar-grow { flex: 1; }
.wp-account {
  display: flex; align-items: center; gap: 9px; padding: 10px 8px 4px;
  border-top: 1px solid var(--hairline-soft); margin-top: 8px;
}
.wp-account-avatar {
  width: 26px; height: 26px; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--hairline); display: inline-flex; align-items: center;
  justify-content: center; font-size: 10.5px; font-weight: 700; color: var(--ink-2);
  flex-shrink: 0;
}
.wp-account-meta { display: flex; flex-direction: column; min-width: 0; }
.wp-account-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.wp-account-sub { font-size: 10.5px; color: var(--ink-3); }

/* ── Language menu ── */
.wp-langmenu { position: relative; }
.wp-langmenu-trigger { gap: 6px; border: 0; color: var(--ink-2); font-weight: 500; }
.wp-langmenu-code { text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.03em; }
.wp-langmenu-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  background: var(--bg); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow-pop);
  padding: 4px; min-width: 150px;
}
.wp-langmenu-pop .wp-row { min-height: 32px; font-size: 12.5px; }
.wp-langmenu-pop .wp-row .wp-lang-label { flex: 1; }
.wp-langmenu-pop[hidden] { display: none; }

/* ── Modal (upsell etc.) ── */
.wp-modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(17,17,20,0.28);
  display: flex; align-items: center; justify-content: center;
}
.wp-modal-overlay[hidden] { display: none; }
.wp-modal-card {
  width: 380px; max-width: calc(100vw - 32px); background: var(--bg);
  border-radius: var(--radius-l); box-shadow: var(--shadow-modal); padding: 28px;
}
.wp-modal-stack { display: flex; flex-direction: column; gap: 14px; }
.wp-modal-icon {
  width: 40px; height: 40px; border-radius: 12px; background: var(--bg-subtle);
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2);
}
.wp-modal-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.wp-modal-body { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }

/* ── A11y chrome (production additions) ── */
.wp-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 16px; border-radius: 0 0 var(--radius-s) 0;
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.wp-skip-link:focus { left: 0; }
.wp-impersonate-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--nearly-bg); color: var(--ink); border-bottom: 1px solid var(--hairline);
  font-size: 12px; padding: 6px 12px;
}
.wp-impersonate-bar a { color: var(--ink); font-weight: 600; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Responsive: sidebar overlays on narrow viewports ── */
@media (max-width: 880px) {
  .wp-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 90;
    box-shadow: var(--shadow-pop);
  }
  .wp-sidebar[data-collapsed] { box-shadow: none; }
}
