.mock-desktop-shell,
.mock-mobile-app {
  --shell-bg: #f2f7f6;
  --shell-surface: #ffffff;
  --shell-surface-alt: #f4f9f8;
  --shell-text: #1a2b28;
  --shell-muted: #7a9490;
  --shell-border: #e0edeb;
  --shell-input: #eef5f4;
  --shell-teal: #1bbeaa;
  --shell-yellow: #ffd32d;
  --shell-green: #5cb85c;
}

.mock-desktop-shell[data-theme="dark"],
.mock-mobile-app[data-theme="dark"] {
  --shell-bg: #0e1f1c;
  --shell-surface: #162622;
  --shell-surface-alt: #1a2e2b;
  --shell-text: #e8f4f1;
  --shell-muted: #5e8178;
  --shell-border: #1e3530;
  --shell-input: #1a2e2b;
  color-scheme: dark;
}

.mock-desktop-shell button:focus-visible,
.mock-mobile-app button:focus-visible {
  outline: 2px solid #1bbeaa;
  outline-offset: 2px;
}

.brand-mark {
  display: inline-flex;
  align-items: flex-start;
  flex-direction: column;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: .95;
  text-align: left;
  white-space: nowrap;
}

.is-refreshing-app .brand-mark {
  opacity: .55;
  pointer-events: none;
}

.brand-mark span {
  font-size: 19px;
  font-weight: 900;
}

.brand-mark[data-compact="true"] span {
  font-size: 17px;
}

.brand-mark__discipline {
  display: block;
}

.brand-mark__academy,
.brand-mark__tiro,
.brand-mark__com,
.brand-mark__arco {
  color: #1bbeaa;
}

.brand-mark__tiro {
  letter-spacing: 0;
}

.ui-avatar {
  display: flex;
  width: var(--avatar-size);
  height: var(--avatar-size);
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--avatar-accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--avatar-accent), transparent 67%);
  font-size: var(--avatar-font-size);
  font-weight: 800;
}

.mock-desktop-content > .feed,
.mock-desktop-content > .process-feed,
.mock-desktop-content > .documents-panel,
.mock-desktop-content > .materials-panel,
.mock-desktop-content > .account-panel,
.mobile-scroll-region > .feed,
.mobile-scroll-region > .process-feed,
.mobile-scroll-region > .documents-panel,
.mobile-scroll-region > .materials-panel,
.mobile-scroll-region > .account-panel {
  padding: 14px 16px 24px;
}

.shell-loading {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.shell-loading i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1bbeaa;
  animation: shell-loading 850ms ease-in-out infinite alternate;
}

.shell-loading i:nth-child(2) { animation-delay: 140ms; }
.shell-loading i:nth-child(3) { animation-delay: 280ms; }

.error-state {
  margin: 16px;
  padding: 14px 16px;
  border: 1px solid #ff606055;
  border-radius: 14px;
  color: #ff6060;
  background: #ff606012;
}

.ios-preview-shell {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 20%, #0d3530 0%, #071412 60%);
}

@keyframes shell-loading {
  from { transform: translateY(2px); opacity: 0.35; }
  to { transform: translateY(-2px); opacity: 1; }
}

@media (max-width: 767px) {
.mobile-scroll-region > .feed,
  .mobile-scroll-region > .process-feed,
  .mobile-scroll-region > .documents-panel,
  .mobile-scroll-region > .materials-panel,
  .mobile-scroll-region > .account-panel {
    padding-bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell-loading i { animation: none; }
}

/* Vanilla shell DOM mirrors the V2 component structure and values. */
.app-shell {
  --process-status-active: #1bbeaa;
  --process-status-pending: #f59e0b;
  --process-status-completed: #5cb85c;
  --process-status-cancelled: #ff6060;
  --shell-tab-bg: #fff;
  position: fixed;
  inset: 0;
  display: flex;
  min-width: 0;
  color: var(--shell-text, #1a2b28);
  background: var(--shell-bg, #f2f7f6);
  letter-spacing: 0;
}

.app-shell[data-theme="dark"] {
  --shell-tab-bg: #0a1917;
}

.app-loading {
  display: flex;
  margin: auto;
  gap: 6px;
}

.app-loading i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--shell-teal, #1bbeaa);
  animation: loading 850ms ease-in-out infinite alternate;
}

.app-loading i:nth-child(2) { animation-delay: 140ms; }
.app-loading i:nth-child(3) { animation-delay: 280ms; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  width: var(--sidebar-width);
  height: 100%;
  flex: 0 0 var(--sidebar-width);
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid var(--shell-border, #e0edeb);
  background: var(--shell-surface, #fff);
}

.sidebar__brand {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--shell-border, #e0edeb);
}

.mock-login-selector {
  display: grid;
  gap: 4px;
  width: 100%;
  margin-top: 14px;
}

.mock-login-selector > span {
  color: var(--shell-muted, #7a9490);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.mock-login-selector > select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--shell-border, #e0edeb);
  border-radius: 8px;
  color: var(--shell-text, #1a2b28);
  background: var(--shell-input, #eef5f4);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.sidebar__section {
  padding: 12px;
  border-bottom: 1px solid var(--shell-border, #e0edeb);
}

.sidebar__label {
  margin: 0 0 8px 4px;
  color: var(--shell-muted, #7a9490);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.process-button,
.sidebar-nav__button {
  display: flex;
  width: 100%;
  align-items: center;
  border: 0;
  background: transparent;
  text-align: left;
}

.process-button {
  gap: 9px;
  padding: 8px 10px;
  margin-bottom: 3px;
  border-radius: var(--radius-md);
}

.process-button[aria-pressed="true"] {
  color: var(--process-accent);
  background: color-mix(in srgb, var(--process-accent), transparent 91.8%);
}

.process-button > i {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--process-accent);
}

.process-button__text {
  display: block;
  flex: 1;
  min-width: 0;
}

.process-button__name,
.process-button__meta {
  display: block;
}

.process-button__name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-button__meta {
  overflow: hidden;
  color: var(--shell-muted, #7a9490);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav {
  display: block;
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.sidebar-nav__button {
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 3px;
  border-radius: 12px;
  color: var(--shell-muted, #7a9490);
  font-size: 14px;
  font-weight: 600;
}

.sidebar-nav__button[aria-current="page"] {
  color: var(--shell-teal, #1bbeaa);
  background: color-mix(in srgb, var(--shell-teal, #1bbeaa), transparent 91.8%);
  font-weight: 800;
}

.sidebar-nav__icon,
.tabbar__icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  font-size: 17px;
  line-height: 1;
}

.sidebar-account {
  padding: 12px;
  border-top: 1px solid var(--shell-border, #e0edeb);
}

.sidebar-account > button {
  display: flex;
  width: 100%;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  color: var(--shell-muted, #7a9490);
  background: transparent;
  text-align: left;
}

.sidebar-account > button[aria-current="page"] {
  background: color-mix(in srgb, var(--shell-teal, #1bbeaa), transparent 91.8%);
}

.sidebar-account > button > span {
  flex: 1;
  min-width: 0;
}

.sidebar-account strong,
.sidebar-account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account strong {
  color: var(--shell-text, #1a2b28);
  font-size: 13px;
  font-weight: 700;
}

.sidebar-account small {
  color: var(--shell-muted, #7a9490);
  font-size: 11px;
}

.mobile-header,
.tabbar {
  display: none;
}

.mobile-header__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
}

.mock-login-selector--compact {
  display: flex;
  width: min(190px, 52vw);
  flex: 0 1 190px;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.mock-login-selector--compact > span { flex: 0 0 auto; font-size: 8px; }
.mock-login-selector--compact > select { height: 30px; font-size: 10px; }

.mobile-header__processes {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 18px 12px;
}

.mobile-header__process em,
.process-picker__option em {
  color: var(--process-status-active);
  font-style: normal;
  font-weight: 800;
}

.mobile-header__process em {
  padding: 2px 7px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--process-status-active), transparent 87.5%);
  font-size: 10px;
}

.mobile-header__process em[data-status="pending"],
.mobile-header__process em[data-status="draft"] {
  color: var(--process-status-pending);
  background: color-mix(in srgb, var(--process-status-pending), transparent 87.5%);
}

.mobile-header__process em[data-status="completed"],
.mobile-header__process em[data-status="closed"] {
  color: var(--process-status-completed);
  background: color-mix(in srgb, var(--process-status-completed), transparent 87.5%);
}

.mobile-header__process em[data-status="cancelled"] {
  color: var(--process-status-cancelled);
  background: color-mix(in srgb, var(--process-status-cancelled), transparent 87.5%);
}

.mobile-header__chevron {
  flex-shrink: 0;
  margin-left: 2px;
}

.workspace {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
}

.workspace__content {
  width: min(100%, var(--content-width));
  min-height: 100%;
  margin: 0 auto;
  padding-bottom: 40px;
}

.placeholder-view {
  margin: 16px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  text-align: center;
}

.placeholder-view h1 {
  font-size: 18px;
}

.placeholder-view p {
  margin-top: 4px;
  color: var(--color-muted);
}

.process-picker {
  position: absolute;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  inset: 0;
}

.process-picker__backdrop {
  position: absolute;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.5);
  inset: 0;
  touch-action: none;
}

.process-picker__panel {
  position: relative;
  z-index: 1;
  padding: 0 0 32px;
  border-radius: 28px 28px 0 0;
  background: var(--shell-surface, #fff);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
}

.process-picker__handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

.process-picker__handle i {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--shell-border, #e0edeb);
}

.process-picker__panel > h2 {
  padding: 8px 20px 16px;
  color: var(--shell-text, #1a2b28);
  font-size: 18px;
  font-weight: 900;
}

.process-picker__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

.process-picker__option {
  display: flex;
  width: 100%;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 2px solid var(--shell-border, #e0edeb);
  border-radius: 18px;
  color: var(--shell-text, #1a2b28);
  background: transparent;
  text-align: left;
}

.process-picker__option[aria-pressed="true"] {
  border-color: var(--process-accent);
  background: color-mix(in srgb, var(--process-accent), transparent 92.9%);
}

.process-picker__option > span:not(.ui-avatar) {
  flex: 1;
  min-width: 0;
}

.process-picker__option strong,
.process-picker__option small {
  display: block;
}

.process-picker__option strong {
  overflow: hidden;
  color: var(--shell-text, #1a2b28);
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-picker__option small {
  margin-top: 1px;
  color: var(--shell-muted, #7a9490);
  font-size: 12px;
}

.process-picker__option em {
  padding: 3px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--process-status-active), transparent 90.6%);
  font-size: 11px;
}

.process-picker__option em[data-status="pending"],
.process-picker__option em[data-status="draft"] {
  color: var(--process-status-pending);
  background: color-mix(in srgb, var(--process-status-pending), transparent 90.6%);
}

.process-picker__option em[data-status="completed"],
.process-picker__option em[data-status="closed"] {
  color: var(--process-status-completed);
  background: color-mix(in srgb, var(--process-status-completed), transparent 90.6%);
}

.process-picker__option em[data-status="cancelled"] {
  color: var(--process-status-cancelled);
  background: color-mix(in srgb, var(--process-status-cancelled), transparent 90.6%);
}

.process-picker__arrow {
  flex-shrink: 0;
  color: var(--process-accent);
}

.tabbar__button > i {
  width: 20px;
  height: 3px;
  margin-top: 1px;
  border-radius: 2px;
  background: var(--shell-teal, #1bbeaa);
}

@media (max-width: 767px) {
  .app-shell {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    flex-direction: column;
    overflow: hidden;
    overflow-x: hidden;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    display: block;
    flex: 0 0 auto;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 0 0;
    border-bottom: 1px solid var(--shell-border, #e0edeb);
    background: var(--shell-surface, #fff);
    z-index: 5;
  }

  .mobile-header__process {
    display: flex;
    width: calc(100% - 36px);
    min-width: 0;
    gap: 7px;
    align-items: center;
    padding: 7px 14px;
    margin: 0 18px 12px;
    border: 2px solid var(--process-accent);
    border-radius: 20px;
    color: var(--process-accent);
    background: color-mix(in srgb, var(--process-accent), transparent 91.8%);
  }

  .mobile-header__process strong {
    flex: 1;
    overflow: hidden;
    color: var(--process-accent);
    font-size: 14px;
    font-weight: 800;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-header__process small {
    color: var(--shell-muted, #7a9490);
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-header__processes .mobile-header__process--compact {
    width: auto;
    padding: 7px 14px;
    margin: 0;
    border-color: var(--process-chip-border);
    color: var(--process-chip-text);
    background: var(--process-chip-bg);
    transition: all 0.2s;
  }

  .mobile-header__processes .mobile-header__process--compact strong {
    flex: 0 1 auto;
    color: var(--process-chip-text);
    font-size: 13px;
    font-weight: 700;
  }

  .workspace {
    min-height: 0;
    overflow-x: hidden;
  }

  .workspace__content {
    padding-bottom: 16px;
  }

  .workspace__content--feed {
    padding-bottom: 0;
  }

  .tabbar {
    display: flex;
    height: var(--mobile-navigation-height);
    flex: 0 0 var(--mobile-navigation-height);
    align-items: flex-start;
    padding: var(--mobile-navigation-top-gap) 0 var(--mobile-navigation-safe-gap);
    border-top: 1px solid var(--shell-border, #e0edeb);
    background: var(--shell-tab-bg, #fff);
    box-sizing: border-box;
    z-index: 10;
  }

  .tabbar__button {
    display: flex;
    height: var(--mobile-navigation-item-height);
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0 0;
    border: 0;
    color: var(--shell-muted, #7a9490);
    background: none;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
  }

  .tabbar__button[aria-current="page"] {
    color: var(--shell-teal, #1bbeaa);
    font-weight: 900;
  }
}

@media (min-width: 768px) {
  .process-picker {
    display: none;
  }
}

@keyframes loading {
  from { opacity: 0.35; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .app-loading i { animation: none; }
}
