.app-shell {
  min-height: 100vh;
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
}
.app-header-inner {
  width: min(100%, 1080px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand actions"
    "tabs tabs";
  align-items: center;
  gap: 10px 12px;
}
.header-actions {
  grid-area: actions;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.account-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-1);
  box-shadow: var(--shadow);
}
.theme-toggle {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  box-shadow: var(--shadow);
}
.theme-toggle:hover {
  color: var(--accent);
}
.theme-icon {
  display: none;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle[data-theme-mode="light"] .sun-icon,
.theme-toggle[data-theme-mode="dark"] .moon-icon {
  display: block;
}
.account-chip img,
.account-chip span:first-of-type {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.account-chip img {
  object-fit: cover;
}
.account-chip span:first-of-type {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--surface);
  font-weight: 500;
}
.account-chip span:last-of-type {
  display: none;
}
.brand {
  grid-area: brand;
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  color: var(--text-1);
  text-decoration: none;
  font-family: var(--font-timer);
  font-size: 18px;
  line-height: 1;
  min-width: 0;
}
.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  flex: 0 0 auto;
}
.tab-nav {
  grid-area: tabs;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0;
  background: transparent;
}
.tab-button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  padding: 0 8px;
}
.tab-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab-button.is-active {
  background: var(--surface-alt);
  color: var(--accent);
}
.app-main {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 22px 18px 34px;
}
.page { display: none; }
.page.is-active { display: block; }
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.page-heading h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
}
.inline-banner {
  width: min(100%, 540px);
  margin: 14px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
}
.inline-banner span {
  color: var(--text-2);
}
.inline-banner button {
  padding: 0 14px;
  border-radius: var(--radius);
  background: var(--surface);
}
@media (min-width: 1200px) and (hover: hover) and (pointer: fine) {
  .app-header {
    padding-inline: 30px;
  }
  .app-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "brand tabs actions";
  }
  .brand {
    font-size: 20px;
  }
  .brand img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }
  .account-chip {
    width: auto;
    min-width: 44px;
    max-width: 190px;
    justify-content: flex-start;
    gap: 8px;
    padding: 4px 10px 4px 5px;
    border-radius: 999px;
  }
  .account-chip span:last-of-type {
    display: inline;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }
  .header-actions {
    justify-content: flex-end;
    gap: 10px;
  }
  .tab-nav {
    display: flex;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .tab-button {
    padding: 0 16px;
    font-size: 14px;
  }
  .app-main { padding-top: 34px; }
}

@media (max-width: 420px) {
  .app-header {
    padding-inline: 10px;
  }
  .brand {
    gap: 7px;
    font-size: 16px;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 340px) {
  .brand span {
    display: none;
  }
}
