/* Portfel Ongoing — light, professional design system.
 * Direct port of design-handoff/prototype/prototype/styles.css.
 * Source-of-truth tokens + components. Do not edit visual values here without
 * updating the prototype too. Failsafes / WP-specific overrides live in frontend.css.
 */

:root {
  --bg:           #FAFAF7;
  --surface:      #FFFFFF;
  --surface-2:    #F5F5F2;
  --text:         #0A0A0A;
  --text-2:       #525252;
  --text-3:       #737373;
  --text-4:       #A3A3A3;
  --border:       #E7E5E0;
  --border-2:     #D4D4D0;
  --accent:       #2F6BFF;
  --accent-50:    #EEF3FF;
  --accent-100:   #DCE6FF;
  --accent-700:   #1D4ED8;
  --emerald-50:   #ECFDF5;
  --emerald-600:  #059669;
  --emerald-700:  #047857;
  --amber-50:     #FFFBEB;
  --amber-600:    #D97706;
  --amber-700:    #B45309;
  --red-50:       #FEF2F2;
  --red-600:      #DC2626;
  --red-700:      #B91C1C;
  --radius:       10px;
  --radius-lg:    14px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.04);
  --shadow:       0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --pad:          20px;
  --gap:          16px;
  --fz-h1:        28px;
  --fz-h2:        18px;
  --fz-body:      14px;
  --fz-sm:        13px;
  --fz-xs:        12px;
}

[data-theme="dark"] {
  --bg:          #0B0E14;
  --surface:     #11151E;
  --surface-2:   #181D28;
  --text:        #F5F5F0;
  --text-2:      #C5C5BC;
  --text-3:      #9C9C92;
  --text-4:      #6B6B62;
  --border:      #232936;
  --border-2:    #303747;
  --accent-50:   rgba(47,107,255,0.10);
  --accent-100:  rgba(47,107,255,0.18);
}

[data-density="compact"] {
  --pad: 14px;
  --gap: 12px;
  --fz-h1: 24px;
  --fz-h2: 16px;
}

/* The HTML `hidden` boolean attribute should always win against author
 * CSS like `display: flex`. Without this, `.pfo-modal-overlay[hidden]`
 * still paints because the class selector beats the UA `[hidden]` rule. */
[hidden] { display: none !important; }

/* ============================ APP SHELL ============================ */
.pfo-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: var(--fz-body); line-height: 1.5; }
.pfo-shell * { box-sizing: border-box; }
.pfo-topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: saturate(180%) blur(8px);
}
.pfo-topbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.pfo-brand-mark {
  width: 24px; height: 24px;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  letter-spacing: -0.02em;
}
.pfo-topbar-nav {
  display: flex; gap: 2px; flex: 1; margin-left: 16px;
}
.pfo-topbar-nav a {
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 120ms;
}
.pfo-topbar-nav a:hover { background: var(--surface-2); color: var(--text); }
.pfo-topbar-nav a.active { background: var(--surface-2); color: var(--text); }
.pfo-topbar-actions { display: flex; align-items: center; gap: 8px; }

.pfo-cmdk-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
}
.pfo-cmdk-trigger kbd {
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--text-3);
}

.pfo-icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-2);
  transition: all 120ms;
  cursor: pointer;
}
.pfo-icon-btn:hover { background: var(--surface-2); color: var(--text); }

.pfo-main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 64px;
}
.pfo-main-narrow { max-width: 960px; }

@media (max-width: 720px) {
  .pfo-topbar { padding: 0 16px; gap: 8px; }
  .pfo-topbar-nav { display: none; }
  .pfo-main { padding: 20px 16px 80px; }
  .pfo-cmdk-trigger { display: none; }
}

/* ============================ TYPOGRAPHY ============================ */
.pfo-h1 {
  font-size: var(--fz-h1); font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.15;
  margin: 0; color: var(--text);
}
.pfo-h2 {
  font-size: var(--fz-h2); font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0; color: var(--text);
}
.pfo-eyebrow {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3);
  margin: 0;
}
.pfo-muted { color: var(--text-3); }
.pfo-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-feature-settings: 'tnum'; }

/* ============================ CARDS ============================ */
.pfo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pfo-card-pad { padding: var(--pad); }
.pfo-card-header {
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.pfo-card-footer {
  padding: 12px var(--pad);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* ============================ BUTTONS ============================ */
.pfo-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px; height: 34px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent;
  transition: all 120ms;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.pfo-btn:disabled { cursor: not-allowed; opacity: 0.55; }
.pfo-btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.pfo-btn-lg { height: 40px; padding: 0 16px; font-size: 14px; }

.pfo-btn-primary { background: var(--text); color: var(--bg); }
.pfo-btn-primary:hover:not(:disabled) { background: #1F1F1F; }

.pfo-btn-accent { background: var(--accent); color: #fff; }
.pfo-btn-accent:hover:not(:disabled) { background: var(--accent-700); }

.pfo-btn-ghost { background: transparent; color: var(--text-2); }
.pfo-btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.pfo-btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.pfo-btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-2); }

.pfo-btn-success { background: var(--emerald-600); color: #fff; }
.pfo-btn-success:hover:not(:disabled) { background: var(--emerald-700); }

.pfo-btn-danger { background: var(--red-600); color: #fff; }

/* ============================ BADGES ============================ */
.pfo-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
}
.pfo-badge-neutral { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.pfo-badge-accent  { background: var(--accent-50); color: var(--accent); border-color: var(--accent-100); }
.pfo-badge-emerald { background: var(--emerald-50); color: var(--emerald-700); border-color: rgba(5,150,105,0.15); }
.pfo-badge-amber   { background: var(--amber-50);   color: var(--amber-700);   border-color: rgba(217,119,6,0.15); }
.pfo-badge-red     { background: var(--red-50);     color: var(--red-700);     border-color: rgba(220,38,38,0.15); }
.pfo-badge-solid   { background: var(--text); color: var(--bg); }

/* ============================ PROGRESS ============================ */
.pfo-progress {
  width: 100%; background: var(--surface-2); border-radius: 999px; overflow: hidden;
}
.pfo-progress-md { height: 6px; }
.pfo-progress-sm { height: 4px; }
.pfo-progress-lg { height: 8px; }
.pfo-progress-fill { height: 100%; transition: width 400ms cubic-bezier(.4,0,.2,1); }
.pfo-progress-primary { background: var(--text); }
.pfo-progress-accent  { background: var(--accent); }
.pfo-progress-emerald { background: var(--emerald-600); }
.pfo-progress-amber   { background: var(--amber-600); }

/* ============================ AVATAR ============================ */
.pfo-avatar {
  display: inline-grid; place-items: center;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.pfo-avatar-primary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.pfo-avatar-accent  { background: var(--accent-50); color: var(--accent); }
.pfo-avatar-warm    { background: #FEF3E7; color: #B45309; }

/* ============================ FORM ============================ */
.pfo-input, .pfo-select, .pfo-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 120ms, box-shadow 120ms;
}
.pfo-input:focus, .pfo-select:focus, .pfo-textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.pfo-input::placeholder, .pfo-textarea::placeholder { color: var(--text-4); }

.pfo-search { position: relative; }
.pfo-search input { padding-left: 32px; }
.pfo-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-4); pointer-events: none;
}

.pfo-label {
  display: block;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* ============================ MODAL ============================ */
.pfo-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 14, 20, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: pfo-fade 180ms ease-out;
}
.pfo-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 50px -12px rgba(0,0,0,0.25), 0 0 0 1px var(--border);
  animation: pfo-scale 200ms cubic-bezier(.4,0,.2,1);
}
.pfo-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  flex-shrink: 0;
}
.pfo-modal-title { font-size: 16px; font-weight: 600; margin: 0; }
.pfo-modal-subtitle { font-size: 12.5px; color: var(--text-3); margin: 4px 0 0; }
.pfo-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.pfo-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
}

@keyframes pfo-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pfo-scale { from { opacity: 0; transform: scale(0.97) translateY(4px); } to { opacity: 1; transform: scale(1); } }

/* ============================ KPI ============================ */
.pfo-kpi { padding: var(--pad); display: flex; flex-direction: column; gap: 6px; }
.pfo-kpi-label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.pfo-kpi-value { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.pfo-kpi-foot { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }

/* ============================ TABLE ============================ */
.pfo-table { width: 100%; border-collapse: collapse; }
.pfo-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.pfo-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}
.pfo-table tr:last-child td { border-bottom: 0; }
.pfo-table tbody tr { transition: background 120ms; cursor: pointer; }
.pfo-table tbody tr:hover { background: var(--surface-2); }
.pfo-table tbody tr.is-expanded { background: var(--surface-2); }

/* ============================ ACTIVITY ROW ============================ */
.pfo-activity {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 120ms;
}
.pfo-activity:last-child { border-bottom: 0; }
.pfo-activity:hover { background: var(--surface-2); }
.pfo-activity.is-completed .pfo-activity-title { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.pfo-activity-check {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 1.5px solid var(--border-2);
  display: grid; place-items: center;
  background: transparent;
  color: transparent;
  flex-shrink: 0;
  transition: all 150ms;
  cursor: pointer;
}
.pfo-activity-check:hover { border-color: var(--text); color: var(--text-3); }
.pfo-activity.is-completed .pfo-activity-check {
  background: var(--emerald-600);
  border-color: var(--emerald-600);
  color: #fff;
}
.pfo-activity-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.pfo-activity-title { font-size: 13.5px; font-weight: 500; color: var(--text); margin: 0; }
.pfo-activity-sub {
  font-size: 12px; color: var(--text-3);
  display: flex; align-items: center; gap: 6px;
}
.pfo-dot { width: 3px; height: 3px; border-radius: 999px; background: var(--text-4); display: inline-block; }

/* ============================ CHAPTER CARD ============================ */
.pfo-chapter {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 150ms;
}
.pfo-chapter.is-current {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}
.pfo-chapter.is-locked { opacity: 0.7; }
.pfo-chapter-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px var(--pad);
  cursor: pointer;
  background: transparent;
  border: 0;
  width: 100%; text-align: left;
  font-family: inherit;
  color: inherit;
}
.pfo-chapter-head:hover { background: var(--surface-2); }
.pfo-chapter-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--text-2);
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.pfo-chapter.is-current .pfo-chapter-icon { background: var(--text); color: var(--bg); border-color: var(--text); }
.pfo-chapter.is-completed .pfo-chapter-icon { background: var(--emerald-600); color: #fff; border-color: var(--emerald-600); }

.pfo-chapter-body {
  padding: 0 var(--pad) var(--pad);
  border-top: 1px solid var(--border);
}
.pfo-chapter-body.is-flush { padding-top: 4px; }

/* ============================ NOTIFICATION INLINE ============================ */
.pfo-notif {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.pfo-notif:last-child { border-bottom: 0; }
.pfo-notif-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--text-2);
  flex-shrink: 0;
}

/* ============================ SIDEBAR ============================ */
.pfo-sidebar { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.pfo-sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-2);
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 120ms;
  font-family: inherit;
}
.pfo-sidebar-item:hover { background: var(--surface-2); color: var(--text); }
.pfo-sidebar-item.is-active { background: var(--surface-2); color: var(--text); font-weight: 500; }

/* ============================ TOAST ============================ */
.pfo-toast-host {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 200;
  display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
}
.pfo-toast {
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px -6px rgba(0,0,0,0.25);
  animation: pfo-toast-in 220ms cubic-bezier(.4,0,.2,1);
  pointer-events: auto;
}
@keyframes pfo-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================ COMMAND PALETTE ============================ */
.pfo-cmdk-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 14, 20, 0.40);
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 12vh;
  z-index: 150;
}
.pfo-cmdk {
  width: 100%; max-width: 540px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -12px rgba(0,0,0,0.25), 0 0 0 1px var(--border);
  overflow: hidden;
}
.pfo-cmdk-input {
  width: 100%; height: 48px;
  padding: 0 16px;
  border: 0; outline: 0;
  font-size: 14px;
  background: transparent;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-family: inherit;
}
.pfo-cmdk-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.pfo-cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
}
.pfo-cmdk-item.is-active, .pfo-cmdk-item:hover { background: var(--surface-2); color: var(--text); }
.pfo-cmdk-section {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-4); padding: 8px 10px 4px;
}

/* ============================ MISC ============================ */
.pfo-divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.pfo-grid-cards { display: grid; gap: var(--gap); }
.pfo-grid-2 { grid-template-columns: repeat(2, 1fr); }
.pfo-grid-3 { grid-template-columns: repeat(3, 1fr); }
.pfo-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) {
  .pfo-grid-2, .pfo-grid-3, .pfo-grid-4 { grid-template-columns: 1fr; }
}
.pfo-flex { display: flex; }
.pfo-row { display: flex; align-items: center; gap: var(--gap); }
.pfo-row-tight { display: flex; align-items: center; gap: 8px; }
.pfo-col { display: flex; flex-direction: column; gap: var(--gap); }
.pfo-col-tight { display: flex; flex-direction: column; gap: 8px; }
.pfo-spread { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); }
.pfo-grow { flex: 1; min-width: 0; }
.pfo-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfo-tabs {
  display: inline-flex;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--border);
  gap: 1px;
}
.pfo-tab {
  border: 0; background: transparent;
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  font-family: inherit;
}
.pfo-tab:hover { color: var(--text); }
.pfo-tab.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }

.pfo-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
}
.pfo-empty-icon {
  width: 44px; height: 44px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--text-3);
  border: 1px solid var(--border);
}

.pfo-streak-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--amber-50);
  color: var(--amber-700);
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid rgba(217,119,6,0.15);
}

.pfo-link-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: all 150ms;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.pfo-link-card:hover { border-color: var(--text); }
.pfo-link-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--text-2);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.pfo-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
  flex-wrap: wrap;
}
.pfo-page-sub {
  color: var(--text-3); font-size: 13.5px; margin: 6px 0 0;
}

.pfo-route { animation: pfo-route 220ms cubic-bezier(.4,0,.2,1); }
@keyframes pfo-route { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ============================ ACCESSIBILITY ============================ */
/* Focus rings are only shown on keyboard nav (`:focus-visible`); pointer
 * focus stays clean. Single shared style for buttons / links / inputs. */

.pfo-btn:focus-visible,
.pfo-icon-btn:focus-visible,
.pfo-tab:focus-visible,
.pfo-sidebar-item:focus-visible,
.pfo-cmdk-trigger:focus-visible,
.pfo-link-card:focus-visible,
.pfo-table tbody tr:focus-visible,
.pfo-chapter-head:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 8px;
}

.pfo-input:focus-visible,
.pfo-select:focus-visible,
.pfo-textarea:focus-visible {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-100);
}

/* Make the topbar nav links also receive a visible ring. */
.pfo-topbar-nav a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Skip-to-content target for keyboard users (templates can render a
 * `<a class="pfo-skip" href="#main">…</a>` pair if they want to opt in). */
.pfo-skip {
	position: absolute; left: 8px; top: 8px;
	padding: 6px 10px;
	background: var(--text); color: var(--bg);
	border-radius: 8px;
	font-size: 13px;
	z-index: 999;
	transform: translateY(-150%);
	transition: transform 150ms;
}
.pfo-skip:focus { transform: translateY(0); }

/* Toast host announces politely to screen readers. */
.pfo-toast-host { /* ARIA live applied via the markup */ }

/* ============================ RESPONSIVE SWEEP ============================ */
/* Mobile breakpoint sweeps. The pfo-shell main padding already shrinks at
 * 720px; here we tighten tables, kpi grids and dashboard 2-col. */

@media (max-width: 960px) {
	/* Dashboard hero + right-rail collapse to a single column. */
	.pfo-dashboard-grid { grid-template-columns: 1fr !important; }
	.pfo-superadmin-grid { grid-template-columns: 1fr !important; }
	.pfo-hub-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 720px) {
	/* Make wide tables horizontally scrollable inside the card so layout
	 * doesn't break. Cards keep their rounded corners; the table just
	 * becomes a scroll viewport. */
	.pfo-card > .pfo-table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}
	.pfo-card > .pfo-table thead,
	.pfo-card > .pfo-table tbody,
	.pfo-card > .pfo-table tr {
		display: table;
		width: 100%;
		table-layout: auto;
	}
	.pfo-page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
	.pfo-card-header { flex-wrap: wrap; gap: 8px; }
	.pfo-kpi-value { font-size: 24px; }
}
