/* ============================================================
   NASYWA OS: DESKTOP SHELL, HOME SCREEN & 8 APP VIEWS
   Original personal OS interface, mobile-first and accessible.
   ============================================================ */

/* ------------------------------------------------------------
   1. TOP BAR (MINIMAL, NO FAKE SYSTEM NOTIFICATIONS)
   ------------------------------------------------------------ */
.os-topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  min-height: 60px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.os-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text-heading);
  font-weight: 700;
  font-size: 0.98rem;
}

.os-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background-color: var(--btn-bg);
  color: var(--btn-text);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.os-brand-mark.has-logo {
  background-color: transparent;
}

.os-brand-mark.has-logo.is-fallback {
  background-color: var(--btn-bg);
}

.os-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.os-brand-mark-fallback {
  display: none;
}

.os-brand-mark.is-fallback img {
  display: none;
}

.os-brand-mark.is-fallback .os-brand-mark-fallback {
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  transition: transform var(--ease), background-color var(--ease), border-color var(--ease), color var(--ease);
}

.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn-primary {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--btn-bg);
}

.btn-primary:hover {
  background-color: var(--btn-hover);
  border-color: var(--btn-hover);
  color: var(--btn-text);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--window-bg);
  color: var(--link);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background-color: var(--surface-hover);
  border-color: var(--link);
  color: var(--link-hover);
  transform: translateY(-2px);
}

.btn-sm {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--window-bg);
  color: var(--text-heading);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  transition: border-color var(--ease), background-color var(--ease), color var(--ease);
}

.icon-btn:hover {
  border-color: var(--link);
  background-color: var(--surface-hover);
  color: var(--link);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.theme-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background-color: var(--window-bg);
  color: var(--text-heading);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  transition: border-color var(--ease), background-color var(--ease), color var(--ease);
}

.theme-toggle-pill:hover {
  border-color: var(--link);
  background-color: var(--surface-hover);
  color: var(--link);
}

.theme-toggle-pill svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.icon-sun {
  display: none;
}

.icon-moon {
  display: block;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* Shared Glass Cards & Pills */
.os-card {
  background-color: var(--glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.label-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background-color: var(--accent-soft);
  color: var(--link);
  border: 1px solid var(--border);
}

.label-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  background-color: var(--surface-sub);
  color: var(--text-body);
  border: 1px solid var(--border);
}

/* ------------------------------------------------------------
   2. HOME SCREEN (PROFILE + APPS, CURRENTLY, KEY NUMBERS, FEATURED)
   Mobile order: Profile -> Featured Projects -> Currently -> Key Numbers
   Desktop layout: [Profile | Currently + Key Numbers] then [Featured Projects]
   ------------------------------------------------------------ */
.home-stage {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding: 22px 16px 40px;
  display: grid;
  gap: 20px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

/* Profile Widget */
.profile-widget {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
}

.profile-widget-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 26px;
  overflow: hidden;
  border: 2px solid var(--border-strong);
  background: linear-gradient(145deg, #14204A, #6A4FB3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 75%;
  transform: scale(1.45);
  transform-origin: 48% 85%;
}

.profile-avatar-fallback {
  display: none;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFFFFF;
}

.profile-avatar.is-fallback img {
  display: none;
}

.profile-avatar.is-fallback .profile-avatar-fallback {
  display: block;
}

.profile-info {
  display: grid;
  gap: 6px;
}

.profile-name {
  font-size: clamp(1.38rem, 2.7vw, 2rem);
  line-height: 1.14;
}

.profile-role {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--link);
}

.profile-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 2px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--surface-sub);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.profile-location svg {
  width: 13px;
  height: 13px;
  color: var(--link);
  flex-shrink: 0;
}

.profile-intro {
  font-size: 0.96rem;
  line-height: 1.62;
  color: var(--text-body);
  max-width: 62ch;
}

.profile-availability {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-heading);
}

.availability-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background-color: var(--link);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex-shrink: 0;
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 2px;
}

.profile-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 50px;
  min-height: 50px;
  padding: 0 16px;
  gap: 8px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.profile-actions .btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* APPS Grid inside Profile Card */
.profile-apps-section {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 12px;
}

.home-apps-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.home-apps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 80px;
  padding: 12px 8px;
  border-radius: 16px;
  background-color: var(--surface-sub);
  border: 1px solid rgba(106, 79, 179, 0.28);
  color: var(--text-heading);
  text-align: center;
  min-width: 0;
  transition: transform var(--ease), background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}

[data-theme="dark"] .home-app-item {
  border-color: rgba(195, 177, 242, 0.28);
}

.home-app-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--link);
  flex-shrink: 0;
  transition: color var(--ease), transform var(--ease);
}

.home-app-icon svg,
.home-app-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: block;
}

.home-app-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-heading);
  transition: color var(--ease);
}

.home-app-item:hover {
  transform: translateY(-2px);
  background-color: var(--accent-soft);
  border-color: var(--link);
  box-shadow: var(--shadow-card);
}

.home-app-item:hover .home-app-icon,
.home-app-item:hover .home-app-name {
  color: var(--link);
}

/* Currently Widget */
.currently-widget {
  display: grid;
  gap: 12px;
  align-content: start;
}

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.widget-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--link);
}

.currently-list {
  display: grid;
  gap: 10px;
}

.currently-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background-color: var(--surface-sub);
  border: 1px solid var(--border);
  color: var(--text-body);
  transition: border-color var(--ease), background-color var(--ease);
}

.currently-item:hover {
  border-color: var(--link);
  background-color: var(--surface-hover);
}

.currently-item-title {
  font-weight: 700;
  color: var(--text-heading);
  font-size: 0.94rem;
}

.currently-item-meta {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Key Numbers Widget */
.stats-widget {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-box {
  padding: 14px 12px;
  border-radius: var(--radius-md);
  background-color: var(--surface-sub);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.stat-value {
  font-size: clamp(1.02rem, 2.1vw, 1.38rem);
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.2;
  white-space: nowrap;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
  overflow-wrap: break-word;
}

/* Featured Projects Section */
.featured-projects-section {
  display: grid;
  gap: 16px;
}

.featured-projects-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.featured-project-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background-color: var(--surface-sub);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.featured-project-card:hover {
  transform: translateY(-2px);
  border-color: var(--link);
  box-shadow: var(--shadow-card);
}

.featured-project-card.is-lead {
  border-color: var(--border-strong);
  background:
    radial-gradient(circle at 96% 12%, var(--accent-soft), transparent 52%),
    var(--surface-sub);
}

.featured-project-body {
  display: grid;
  gap: 8px;
}

.featured-project-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-heading);
}

.featured-project-card.is-lead .featured-project-title {
  font-size: 1.24rem;
}

.featured-project-desc {
  font-size: 0.94rem;
  line-height: 1.58;
  color: var(--text-body);
}

.featured-project-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.featured-detail-btn {
  width: fit-content;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.featured-detail-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.featured-projects-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.featured-projects-footer .btn {
  width: 100%;
}

/* ------------------------------------------------------------
   3. APP WINDOW SHELL (FULL-SCREEN MOBILE / WINDOW + SIDEBAR DESKTOP)
   ------------------------------------------------------------ */
.app-shell {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.app-window {
  flex: 1 0 auto;
  width: 100%;
  background-color: var(--window-bg);
  display: flex;
  flex-direction: column;
  animation: windowOpen 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes windowOpen {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-sidebar {
  display: none;
}

.app-main-col {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Mobile Header Bar (Hidden on Desktop where Sidebar is visible) */
.app-header-bar {
  position: sticky;
  top: 0;
  z-index: 850;
  padding: 10px 16px;
  background-color: var(--glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-nav-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--window-bg);
  color: var(--text-heading);
  font-size: 0.86rem;
  font-weight: 600;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}

.app-nav-chip svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.app-nav-chip:hover {
  background-color: var(--surface-hover);
  border-color: var(--link);
  color: var(--link);
}

.app-workspace {
  flex: 1 0 auto;
  padding: 20px 16px 24px;
  display: grid;
  align-content: start;
  gap: 22px;
  max-width: 960px;
  width: 100%;
  margin-inline: auto;
  min-width: 0;
}

.app-workspace > * {
  min-width: 0;
}

.app-intro-block {
  display: grid;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.app-page-title {
  font-size: clamp(1.7rem, 5vw, 2.35rem);
}

.app-page-lead {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 64ch;
}

.app-page-subnote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.app-page-subnote svg {
  width: 14px;
  height: 14px;
  color: var(--link);
  flex-shrink: 0;
}

/* Bottom Next App Bar */
.app-footer-nav {
  margin-top: auto;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background-color: var(--surface-sub);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.app-footer-nav .btn {
  width: 100%;
}

/* ------------------------------------------------------------
   4. APP-SPECIFIC INTERFACES
   ------------------------------------------------------------ */

/* APP 01: ABOUT (NOTES APP) */
.notes-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.notes-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.note-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--surface-sub);
  color: var(--text-body);
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  text-align: left;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}

.note-tab[aria-selected="true"] {
  background-color: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-text);
}

.note-sheet {
  padding: 22px;
  border-radius: var(--radius-lg);
  background-color: var(--surface-sub);
  border: 1px solid var(--border);
  display: grid;
  gap: 14px;
  min-width: 0;
  overflow-wrap: break-word;
}

.note-sheet p,
.note-sheet-list li {
  font-size: 1rem;
  line-height: 1.65;
}

.note-sheet strong {
  color: var(--text-heading);
  font-weight: 700;
}

.note-sheet-list {
  display: grid;
  gap: 10px;
}

.note-sheet-list li {
  position: relative;
  padding-left: 18px;
}

.note-sheet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--link);
}

.note-groups {
  display: grid;
  gap: 18px;
  margin-top: 4px;
}

.note-group {
  display: grid;
  gap: 10px;
}

.note-group-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
}

.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.note-actions .btn {
  font-size: 1rem;
}

/* APP 02: PROJECTS (APP GALLERY & APP STORE DETAIL) */
.gallery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.project-app-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background-color: var(--surface-sub);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-margin-top: 96px;
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.project-app-card:hover {
  border-color: var(--link);
  transform: translateY(-2px);
}

.project-app-card.is-featured {
  border-color: var(--border-strong);
  background:
    radial-gradient(circle at 95% 10%, var(--accent-soft), transparent 50%),
    var(--surface-sub);
}

.project-app-card.is-targeted {
  border-color: var(--link);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-card);
}

.project-app-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.project-monogram {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, #14204A, #6A4FB3);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.project-app-actions {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-app-actions .btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.store-banner {
  padding: 22px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 15%, rgba(195, 177, 242, 0.35), transparent 55%),
    #14204A;
  color: #FFFFFF;
  display: grid;
  gap: 16px;
}

.store-banner h1,
.store-banner p {
  color: #FFFFFF;
}

.store-banner-sub {
  color: #D9D3F5 !important;
}

.store-banner .btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.store-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.store-block {
  padding: 18px;
  border-radius: var(--radius-md);
  background-color: var(--surface-sub);
  border: 1px solid var(--border);
  display: grid;
  gap: 8px;
  align-content: start;
}

.store-block-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--link);
}

/* APP 03: RESEARCH (DOCUMENT READER + REAL METRIC CHARTS) */
.reader-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reader-doc {
  padding: 22px;
  border-radius: var(--radius-lg);
  background-color: var(--surface-sub);
  border: 1px solid var(--border);
  border-top: 4px solid var(--navy);
  display: grid;
  gap: 20px;
}

.reader-doc .btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.metric-chart {
  padding: 18px;
  border-radius: var(--radius-md);
  background-color: var(--window-bg);
  border: 1px solid var(--border);
  display: grid;
  gap: 14px;
}

.metric-row {
  display: grid;
  gap: 6px;
}

.metric-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.metric-bar-track {
  height: 12px;
  border-radius: var(--radius-pill);
  background-color: var(--surface-sub);
  border: 1px solid var(--border);
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--link), var(--accent));
}

/* APP 04: LEADERSHIP (FOLDERS PER CATEGORY) */
.folder-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.folder-btn {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--surface-sub);
  color: var(--text-heading);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  transition: border-color var(--ease), background-color var(--ease);
}

.folder-btn[aria-selected="true"] {
  background-color: var(--accent-soft);
  border-color: var(--link);
  color: var(--link);
}

.folder-contents {
  display: grid;
  gap: 16px;
}

.role-entry {
  padding: 20px;
  border-radius: var(--radius-lg);
  background-color: var(--surface-sub);
  border: 1px solid var(--border);
  display: grid;
  gap: 12px;
}

.role-impact {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-soft);
  border: 1px solid var(--border-strong);
  font-weight: 600;
  color: var(--text-heading);
}

/* APP 05: JOURNEY (CALENDAR YEARLY LIST) */
.year-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.calendar-groups {
  display: grid;
  gap: 22px;
}

.calendar-year-box {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background-color: var(--surface-sub);
  overflow: hidden;
}

.calendar-year-head {
  padding: 12px 18px;
  background-color: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--link);
}

.calendar-events {
  display: grid;
}

.calendar-event {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 6px;
}

.calendar-event:last-child {
  border-bottom: none;
}

/* APP 06: SKILLS (ICON CARDS GRID, NO PERCENTAGES) */
.settings-list {
  display: grid;
  gap: 18px;
}

.settings-group {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background-color: var(--surface-sub);
  overflow: hidden;
}

.settings-group-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background-color: var(--window-bg);
  display: grid;
  gap: 3px;
}

.settings-group-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.skills-card-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.skill-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 118px;
  height: 100%;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  background-color: var(--window-bg);
  border: 1px solid var(--border);
  text-align: center;
  min-width: 0;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease), background-color var(--ease);
}

.skill-card:hover {
  transform: translateY(-2px);
  border-color: var(--link);
  background-color: var(--surface-hover);
  box-shadow: var(--shadow-card);
}

.skill-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background-color: #FFFFFF;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 8px;
}

[data-theme="dark"] .skill-icon-box {
  background-color: #F4F1FC;
  border-color: rgba(195, 177, 242, 0.35);
}

.skill-icon-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

.skill-icon-svg,
.skill-icon-fallback {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.skill-icon-svg svg,
.skill-icon-fallback svg {
  width: 40px;
  height: 40px;
  display: block;
}

.skill-icon-fallback {
  display: none;
}

.skill-icon-box.is-fallback .skill-icon-img {
  display: none;
}

.skill-icon-box.is-fallback .skill-icon-fallback {
  display: inline-flex;
}

.skill-card-name {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.32;
  color: var(--text-heading);
  overflow-wrap: break-word;
  word-break: break-word;
}

/* APP 07: CERTIFICATES (TAPPABLE CARD WALLET + FILTERS) */
.wallet-app {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.wallet-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  max-width: 100%;
}

.wallet-groups {
  display: grid;
  gap: 28px;
}

.wallet-group {
  display: grid;
  gap: 14px;
}

.wallet-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallet-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.wallet-card {
  width: 100%;
  text-align: left;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(150deg, var(--surface-sub) 0%, var(--window-bg) 100%);
  display: grid;
  gap: 12px;
  min-width: 0;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.wallet-card-trigger {
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.wallet-card-trigger:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.wallet-card.is-primary {
  background: linear-gradient(145deg, #14204A 0%, #263473 100%);
  color: #FFFFFF;
  border-color: var(--accent);
}

.wallet-card.is-primary h3,
.wallet-card.is-primary p,
.wallet-card.is-primary .wallet-hint,
.wallet-card.is-primary .wallet-period,
.wallet-card.is-primary .wallet-card-issuer,
.wallet-card.is-primary .wallet-card-detail {
  color: #FFFFFF;
}

.wallet-card.is-primary .wallet-period {
  color: #D9D3F5;
}

.wallet-card.is-primary .label-pill {
  background-color: rgba(195, 177, 242, 0.2);
  color: #E9E5FA;
  border-color: rgba(195, 177, 242, 0.45);
}

.wallet-card:hover {
  transform: translateY(-2px);
  border-color: var(--link);
  box-shadow: var(--shadow-card);
}

.wallet-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wallet-card-title {
  font-size: 1.08rem;
  line-height: 1.35;
}

.wallet-card.is-primary .wallet-card-title {
  font-size: 1.2rem;
}

.wallet-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.wallet-card-issuer {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-heading);
}

.wallet-card-detail {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-body);
  overflow-wrap: break-word;
}

.wallet-hint {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--link);
}

.wallet-unit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 4px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background-color: #C3B1F2;
  color: #10173A;
  font-size: 0.86rem;
  font-weight: 700;
  transition: background-color var(--ease), transform var(--ease);
}

.wallet-card.is-primary:hover .wallet-unit-btn {
  background-color: #D6C8F8;
}

.wallet-units-heading {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #D9D3F5;
}

.wallet-details {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 8px;
}

.wallet-card.is-primary .wallet-details {
  border-top-color: rgba(195, 177, 242, 0.35);
}

.wallet-card.is-primary .note-sheet-list li::before {
  background-color: var(--accent);
}

.wallet-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.wallet-card-actions .btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* APP 08: CONTACT (MESSAGES APP) */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.contact-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background-color: var(--surface-sub);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  min-width: 0;
  transition: border-color var(--ease), transform var(--ease);
}

.contact-card:hover {
  border-color: var(--link);
  transform: translateY(-2px);
}

.contact-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-card-actions .btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.channel-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.channel-meta strong {
  font-size: 1.05rem;
  color: var(--text-heading);
}

.channel-handle {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--link);
  overflow-wrap: break-word;
  word-break: normal;
}

.contact-email-handle {
  font-weight: 600;
  white-space: nowrap;
  overflow: visible;
}

.channel-note {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Toast Notification */
.os-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 3000;
  transform: translate(-50%, 16px);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background-color: #14204A;
  color: #FFFFFF;
  border: 1px solid var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-window);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease);
}

.os-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------
   5. RESPONSIVE BREAKPOINTS (360PX, 600PX, 720PX, 900PX, 1140PX)
   ------------------------------------------------------------ */
@media (max-width: 359px) {
  .contact-email-handle {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 360px) {
  .skills-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 600px) {
  .profile-widget-top {
    flex-direction: row;
    align-items: center;
  }

  .profile-avatar {
    width: 116px;
    height: 116px;
    border-radius: 28px;
  }

  .home-apps-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .featured-projects-grid,
  .gallery-grid,
  .store-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-project-card.is-lead,
  .project-app-card.is-featured,
  .store-block.is-full {
    grid-column: 1 / -1;
  }

  .featured-projects-footer .btn {
    width: auto;
  }

  .folder-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .skills-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wallet-filters {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .app-footer-nav .btn {
    width: auto;
  }
}

@media (min-width: 720px) {
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .home-stage {
    padding: 28px 24px 44px;
  }

  .home-grid {
    grid-template-columns: 1.45fr 1fr;
    grid-template-rows: auto auto auto;
    align-items: stretch;
  }

  .profile-widget {
    grid-column: 1;
    grid-row: 1 / 3;
    padding: 28px;
    gap: 18px;
    justify-content: flex-start;
  }

  .profile-widget-top {
    gap: 20px;
  }

  .profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 32px;
  }

  .currently-widget {
    grid-column: 2;
    grid-row: 1;
    padding: 24px;
  }

  .stats-widget {
    grid-column: 2;
    grid-row: 2;
    padding: 24px;
  }

  .featured-projects-section {
    grid-column: 1 / -1;
    grid-row: 3;
    padding: 26px 28px;
  }

  /* Desktop App Window with Left Sidebar */
  .app-shell {
    padding: 20px 24px 28px;
    align-items: center;
    justify-content: center;
  }

  .app-window {
    max-width: 1200px;
    min-height: calc(100vh - 112px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-window);
    flex-direction: row;
    overflow: hidden;
  }

  .app-sidebar {
    width: 244px;
    flex-shrink: 0;
    background-color: var(--surface-sub);
    border-right: 1px solid var(--border);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .sidebar-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-inline: 10px;
  }

  .sidebar-nav {
    display: grid;
    gap: 4px;
  }

  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-body);
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background-color var(--ease), color var(--ease), border-color var(--ease);
  }

  .sidebar-link svg {
    width: 19px;
    height: 19px;
    color: var(--link);
    flex-shrink: 0;
  }

  .sidebar-link:hover {
    background-color: var(--surface-hover);
    color: var(--text-heading);
  }

  .sidebar-link.active {
    background-color: var(--window-bg);
    border-color: var(--border-strong);
    color: var(--link);
  }

  .app-header-bar {
    display: none;
  }

  .app-workspace {
    padding: 26px 32px 28px;
  }

  .app-footer-nav {
    padding: 14px 32px;
  }

  .notes-layout {
    grid-template-columns: 220px 1fr;
    align-items: start;
  }

  .notes-tabs {
    flex-direction: column;
    overflow-x: visible;
  }

  .skills-card-grid {
    padding: 18px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .wallet-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-card.is-primary {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1140px) {
  .skills-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  }
}
