
:root {
  color-scheme: light;
  --ink: #121a17;
  --muted: #5e6964;
  --paper: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --line: #d6dddb;
  --line-strong: #b7c3bf;
  --accent: #0d6b57;
  --accent-ink: #063c31;
  --warn: #9f3826;
  --focus: #8fc8bd;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(16px);
}

.topbar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  margin: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--accent-ink);
  background: var(--surface);
  font: 800 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
}

.workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px 24px 56px;
}

.workspace__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.workspace__subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
  max-width: 680px;
}

.summary {
  min-width: 230px;
  display: grid;
  gap: 5px;
  justify-items: end;
  color: var(--muted);
}

.summary__count {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.summary__status {
  max-width: 320px;
  text-align: right;
  line-height: 1.35;
}

.app-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.app-card {
  min-height: 164px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.app-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 28px rgba(17, 24, 22, .08);
  transform: translateY(-1px);
}

.app-card h2,
.empty-panel h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: 0;
}

.app-card p,
.empty-panel p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.app-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-card__surfaces {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.surface-chip {
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #e6d5ce;
  border-radius: 999px;
  padding: 5px 7px;
  color: var(--warn);
  background: #fff7f4;
  font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
}

.app-card__open {
  flex: 0 0 auto;
  color: var(--accent);
  text-decoration: none;
  font: 800 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
}

.app-card__open:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-card__open:focus-visible,
.auth-badge:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.empty-panel {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.empty-panel--error {
  border-color: #e8c2b8;
  background: #fff8f6;
}

.empty-panel--loading {
  background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface));
  background-size: 200% 100%;
  animation: loading-pulse 1.6s ease-in-out infinite;
}

@keyframes loading-pulse {
  0% { background-position: 0 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 760px) {
  .topbar__inner,
  .workspace__header {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .workspace {
    padding: 22px 18px 42px;
  }

  h1 {
    font-size: 25px;
  }

  .summary {
    justify-items: start;
  }

  .summary__status {
    text-align: left;
  }
}
