/* Components and layouts. Edit semantic values in tokens.css. */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: var(--font-body);
  color: var(--ink);
  font-size: var(--text-base);
}

a {
  color: inherit;
  text-decoration: none;
}

button,input,select {
  font: inherit;
}

button,a,input,select {
  touch-action: manipulation;
}

button {
  cursor: pointer;
  color: inherit;
}

a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}

h1,h2,h3,p {
  margin: 0;
}

h1 {
  font-family: var(--font-body);
  font-size: var(--text-display);
  letter-spacing: -2px;
  line-height: 1.2;
  font-weight: 650;
}

h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -.3px;
}

.sidebar {
  width: 245px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--color-sidebar);
  border-right: 1px solid var(--border);
  padding: 37px 23px var(--space-5);
  display: flex;
  flex-direction: column;
  border-right-color: var(--color-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.7px;
}

.brandmark {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--color-text);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -4px;
  padding-right: 4px;
}

.brandmark span {
  color: var(--color-muted);
}

.workspace-label {
  font-size: var(--text-xs);
  letter-spacing: 1.8px;
  color: var(--color-muted);
  font-weight: 600;
  margin: 58px var(--space-3) 18px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: var(--text-sm);
  color: var(--color-muted);
  padding: 13px 14px;
  border-radius: var(--radius-control);
  min-height: 48px;
}

nav a span {
  font-size: 21px;
  width: 22px;
}

nav a.selected {
  background: var(--color-accent-soft);
  color: var(--color-accent-text);
  font-weight: 600;
}

.sidebar-bottom {
  margin-top: auto;
  font-size: var(--text-xs);
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 22px 10px;
}

.private-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border-strong);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.avatar {
  background: var(--color-subtle);
  color: var(--color-muted);
  border-radius: 50%;
  width: 37px;
  height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.user-chip strong {
  font-size: var(--text-sm);
}

.user-chip small {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}

.chevron {
  margin-left: auto;
  color: var(--color-muted);
}

main {
  margin-left: 245px;
  padding: 0 52px;
  max-width: 1680px;
}

.topline {
  height: 94px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.slash {
  color: var(--color-muted);
  margin: 0 var(--space-3);
}

.today {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.page-heading {
  padding: var(--space-12) 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  padding-top: 46px;
  padding-bottom: var(--space-8);
}

.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--color-muted);
  margin-bottom: 15px;
}

.subtitle {
  color: var(--color-muted);
  margin-top: 13px;
  font-size: var(--text-base);
}

.app-count {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--color-muted);
  border-left: 1px solid var(--border);
  padding-left: 24px;
}

.app-count strong {
  font-size: 38px;
  line-height: 1;
  font-weight: 400;
  color: var(--color-accent);
}

.app-count span {
  font-size: var(--text-xs);
  max-width: 90px;
  line-height: 1.6;
}

.search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  margin: 0 0 36px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--color-surface);
  padding: 10px 13px;
  width: 360px;
  min-height: 48px;
  box-shadow: 0 2px 3px #22382003;
}

.search>span {
  font-size: 23px;
  color: var(--color-muted);
}

.search input {
  border: 0;
  outline: none;
  background: none;
  width: 100%;
  font-size: var(--text-sm);
  color: var(--ink);
}

kbd {
  font-size: var(--text-xs);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--color-muted);
}

.quiet {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
}

.section-title>span {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.count {
  font-size: var(--text-xs);
  background: var(--color-subtle);
  color: var(--color-muted);
  padding: 3px 7px;
  border-radius: 5px;
  margin-left: 7px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: var(--space-5);
}

.app-section {
  margin-bottom: 35px;
}

.app-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-subtle);
  border-radius: var(--radius-card);
  transition: transform .15s,box-shadow .15s;
  position: relative;
  border-color: var(--color-border);
  box-shadow: 0 2px 3px #2a422a03;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px #263e3410;
  border-color: var(--color-border-strong);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb,var(--app-color) 10%,white);
  color: var(--app-color);
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 28px;
}

.star {
  border: 0;
  background: none;
  font-size: var(--text-xl);
  color: var(--color-muted);
  line-height: 1;
  padding: 2px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-control);
  margin: -6px -8px 0 0;
}

.starred {
  color: var(--color-favorite);
}

.card-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -.35px;
}

.card-name span {
  font-size: var(--text-base);
  color: var(--color-muted);
}

.app-card p {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-muted);
  min-height: 47px;
  margin-top: var(--space-2);
}

.card-footer {
  margin-top: 25px;
  border-top: 1px solid var(--color-success-soft);
  padding-top: 13px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--color-muted);
  border-color: var(--color-subtle);
  align-items: center;
}

.connection {
  color: var(--color-muted);
  font-size: var(--text-xs);
  background: var(--color-success-soft);
  border-radius: 5px;
  padding: var(--space-1) 6px;
  white-space: nowrap;
}

.recent {
  margin: var(--space-10) 0;
}

.recent>div {
  display: flex;
  gap: var(--space-3);
  margin-top: 18px;
  flex-wrap: wrap;
}

.recent a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 13px var(--space-4);
  min-width: 190px;
  font-size: var(--text-sm);
  min-height: 48px;
}

.recent a span:last-child {
  margin-left: auto;
  color: var(--color-muted);
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 45px;
  padding: 25px 0 30px;
  font-size: var(--text-xs);
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

footer>span:last-child {
  margin-left: auto;
}

.footer-mark {
  font-weight: 700;
  font-size: 20px;
  color: var(--color-muted);
}

.welcome {
  min-height: 100vh;
  max-width: 1400px;
  margin: auto;
  padding: 35px 55px;
  display: flex;
  flex-direction: column;
}

.welcome-content {
  margin: auto;
  text-align: center;
  padding: 60px var(--space-5);
  max-width: 600px;
}

.welcome-content h1 {
  font-size: 58px;
  letter-spacing: -2px;
}

.welcome-content>p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.8;
  margin: 22px 0;
  font-size: var(--text-base);
}

.welcome-content>small {
  display: block;
  color: var(--color-muted);
  font-size: var(--text-xs);
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: var(--color-surface);
  border-radius: var(--radius-control);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  min-height: 44px;
}

.button.secondary {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-muted);
}

.welcome-art {
  position: relative;
  width: 165px;
  height: 145px;
  margin: 0 auto 30px;
}

.welcome-art>span {
  position: absolute;
  left: 42px;
  top: 25px;
  width: 84px;
  height: 84px;
  background: var(--color-accent-soft);
  color: var(--color-muted);
  border-radius: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 67px;
  font-weight: 700;
  letter-spacing: -9px;
  padding-right: 10px;
}

.welcome-art>span span {
  color: var(--color-muted);
}

.orbit {
  font-style: normal;
  position: absolute;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px #10203008;
  background: var(--color-surface);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--color-muted);
  font-size: 25px;
}

.one {
  right: 0;
  top: 0;
  transform: rotate(12deg);
}

.two {
  left: 0;
  top: 40px;
  transform: rotate(-12deg);
}

.three {
  right: 8px;
  bottom: 0;
  transform: rotate(8deg);
}

.alert {
  background: var(--color-danger-soft);
  border-radius: var(--radius-control);
  padding: var(--space-3);
}

.panel {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px;
  margin-bottom: 22px;
}

.panel h2 {
  margin-bottom: var(--space-3);
}

.muted {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.7;
  margin-bottom: var(--space-5);
}

.profile {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.profile .button {
  margin-left: auto;
}

.profile p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: 10px;
}

.large {
  width: 64px;
  height: 64px;
  font-size: var(--text-xl);
}

.tag {
  font-size: var(--text-xs);
  background: var(--color-success-soft);
  color: var(--color-accent);
  border-radius: 5px;
  padding: 5px var(--space-2);
}

.session-row,.member-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

small {
  font-size: var(--text-xs);
}

.session-row small,.member-heading small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.session-row strong,.member-heading strong {
  font-size: var(--text-sm);
}

.info-note {
  border-left: 3px solid var(--color-border-strong);
  background: var(--color-success-soft);
  font-size: var(--text-sm);
  line-height: 1.6;
  padding: 17px var(--space-5);
  margin-bottom: 25px;
  color: var(--color-muted);
}

.member-heading>div {
  margin-right: auto;
}

.grant-list {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding-bottom: var(--space-5);
}

.grant {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: white;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.grant.allowed {
  background: var(--color-success-soft);
  border-color: var(--color-border-strong);
  color: var(--color-muted);
}

.app-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.app-form label {
  font-size: var(--text-sm);
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.app-form input,.app-form select {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 11px;
  color: var(--color-accent);
  background: var(--color-surface);
}

.wide {
  grid-column: 1/-1;
}

.form-submit {
  display: flex;
  align-items: end;
  justify-content: end;
}

.audit-row {
  display: flex;
  gap: var(--space-5);
  font-size: var(--text-sm);
  border-top: 1px solid var(--border);
  padding: 13px 0;
}

.audit-row span {
  min-width: 90px;
  color: var(--muted);
}

.audit-row strong {
  font-weight: 400;
}

.audit-row small {
  margin-left: auto;
  color: var(--muted);
}

.empty {
  padding: 70px 25px;
  background: white;
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
}

.empty>span {
  font-size: 35px;
  color: var(--color-muted);
}

.empty h3 {
  margin: 15px 0;
}

.empty p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: var(--space-2);
}

[hidden] {
  display: none!important;
}

.search:focus-within {
  border-color: var(--color-muted);
  box-shadow: 0 0 0 3px #52795e15;
}

.search input:focus-visible {
  outline: none;
}

.quiet,.section-title>span {
  color: var(--color-muted);
}

.star:hover {
  background: var(--color-success-soft);
  color: var(--color-favorite);
}

.section-title h2 {
  font-size: var(--text-lg);
}

#favorites .app-card {
  background: linear-gradient(135deg,var(--color-surface) 45%,var(--color-canvas));
  border-color: var(--color-border-strong);
}

#favorites .app-grid {
  grid-template-columns: repeat(3,minmax(0,1fr));
}

.user-chip small,.sidebar-bottom {
  color: var(--color-muted);
}

.empty .button {
  margin-top: var(--space-5);
}

.button:hover {
  filter: brightness(.96);
}

@media(min-width:1450px) {
  .app-grid {
    grid-template-columns: repeat(4,minmax(0,1fr));
  }

  #favorites .app-grid {
    grid-template-columns: repeat(4,minmax(0,1fr));
  }

}
@media(max-width:1080px) {
  .sidebar {
    width: 210px;
    padding-left: 18px;
    padding-right: 18px;
  }

  main {
    margin-left: 210px;
    padding: 0 30px;
  }

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

  .quiet {
    display: none;
  }

  .app-count {
    display: none;
  }

  #favorites .app-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

}
@media(max-width:650px) {
  .sidebar {
    position: relative;
    width: 100%;
    padding: var(--space-4) var(--space-5);
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    gap: var(--space-5);
  }

  .brand {
    font-size: 19px;
  }

  .brandmark {
    width: 32px;
    height: 32px;
    font-size: 25px;
  }

  .workspace-label,.sidebar-bottom,.user-chip {
    display: none;
  }

  nav {
    margin-left: auto;
    flex-direction: row;
    gap: 0;
  }

  nav a {
    padding: var(--space-2);
    font-size: 0;
    gap: 0;
    min-width: 44px;
    justify-content: center;
  }

  nav a span {
    font-size: 22px;
  }

  main {
    margin-left: 0;
    padding: 0 var(--space-5);
  }

  .topline {
    height: 58px;
  }

  .today {
    display: none;
  }

  .page-heading {
    padding: 30px 0 var(--space-6);
    padding-top: 30px;
    padding-bottom: 26px;
  }

  h1 {
    font-size: 35px;
    letter-spacing: -1.5px;
  }

  .app-grid {
    gap: var(--space-3);
  }

  .app-card {
    padding: var(--space-5);
  }

  .card-name {
    font-size: var(--text-lg);
  }

  .app-card p {
    font-size: var(--text-xs);
    min-height: 0;
  }

  .card-footer {
    flex-direction: row;
    font-size: var(--text-xs);
    margin-top: 18px;
  }

  .search {
    width: 100%;
  }

  .section-title>span {
    display: none;
  }

  .recent>div {
    flex-direction: column;
  }

  .welcome {
    padding: 25px;
  }

  .welcome-content h1 {
    font-size: 45px;
  }

  .welcome-content {
    padding: 50px 0;
  }

  .profile {
    flex-wrap: wrap;
  }

  .profile .button {
    margin-left: 0;
  }

  .app-form {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .panel {
    padding: var(--space-5);
  }

  .audit-row {
    flex-wrap: wrap;
  }

  .audit-row small {
    margin-left: 0;
  }

  .session-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  footer>span:last-child {
    display: none;
  }

  .member-heading {
    flex-wrap: wrap;
  }

  .app-grid,#favorites .app-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card-top {
    margin-bottom: 14px;
  }

  .app-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .app-section {
    margin-bottom: 30px;
  }

}
@media(prefers-reduced-motion:reduce) {
  * {
    transition: none!important;
  }

}
/* Shared interaction states: every control follows the same contract. */
.button, .grant, .star {
  min-height: var(--control-height);
  transition: background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.button { background: var(--color-accent); border-color: var(--color-accent); }
.button:hover { background: var(--color-accent-hover); filter: none; }
.button.secondary { background: var(--color-surface); color: var(--color-accent); border-color: var(--color-border-strong); }
.button.secondary:hover, .grant:hover { background: var(--color-accent-soft); }
button:disabled, input:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
button[aria-busy="true"] { cursor: progress; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--color-danger); }
.field-error { color: var(--color-danger); font-size: var(--text-sm); }
.app-form input, .app-form select { min-height: var(--control-height); }
.alert { color: var(--color-danger); background: var(--color-danger-soft); }
.info-note { color: var(--color-accent-text); background: var(--color-accent-soft); }
.app-card, .panel { border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.app-card:hover { box-shadow: var(--shadow-hover); }
nav a:focus-visible, .button:focus-visible, .grant:focus-visible, .star:focus-visible,
input:focus-visible, select:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
nav a svg { flex-shrink: 0; }
.skip-link { position: fixed; top: -100px; left: var(--space-4); z-index: 10; background: var(--color-surface); padding: var(--space-3); border-radius: var(--radius-control); }
.skip-link:focus { top: var(--space-4); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .app-card:hover { transform: none; }
}
