.app-shell {
  min-height: 100vh;
  background: var(--paper);
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 27px 18px 20px;
  color: #e9f0eb;
  background: var(--ledger-deep);
  border-right: 1px solid rgb(255 255 255 / 0.08);
}

.sidebar__brand {
  padding: 0 10px 27px;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.side-nav__label {
  margin: 0 12px 7px;
  color: rgb(225 238 229 / 0.52);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar__notice {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  color: rgb(235 244 238 / 0.74);
  background: rgb(255 255 255 / 0.055);
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: var(--radius-md);
}

.sidebar__notice-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #bcd1c2;
}

.sidebar__notice strong {
  display: block;
  margin-bottom: 3px;
  color: #f4f8f5;
  font-size: 12px;
}

.sidebar__notice p {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
}

.sidebar__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 17px;
  padding: 13px 8px 0;
  border-top: 1px solid rgb(255 255 255 / 0.09);
}

.sidebar__profile-copy {
  display: grid;
  min-width: 0;
  flex: 1;
}

.sidebar__profile-copy strong {
  color: #f5f8f6;
  font-size: 13px;
}

.sidebar__profile-copy small {
  color: rgb(225 238 229 / 0.56);
  font-size: 11px;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: rgb(244 243 237 / 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar__mobile-brand {
  display: none;
}

.topbar__context,
.topbar__actions {
  display: flex;
  align-items: center;
}

.topbar__context {
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.topbar__context strong {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-weight: 650;
}

.context-dot {
  width: 7px;
  height: 7px;
  background: var(--ledger);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--ledger-soft);
}

.context-separator {
  color: var(--line-strong);
}

.topbar__actions {
  gap: 11px;
}

.page {
  width: 100%;
  max-width: 1500px;
  min-height: calc(100vh - var(--topbar-height));
  margin: 0 auto;
  padding: 39px 42px 70px;
  outline: none;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 27px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(27px, 2.5vw, 38px);
}

.page-heading__description {
  max-width: 650px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page-heading__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.mobile-nav,
.mobile-upload {
  display: none;
}

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 0.94fr) minmax(520px, 1.06fr);
  background: var(--surface);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(34px, 5vw, 70px);
  color: #edf4ef;
  background: var(--ledger-deep);
}

.login-story::after {
  position: absolute;
  right: -120px;
  bottom: 10%;
  width: 320px;
  height: 320px;
  content: '';
  border: 1px solid rgb(232 242 235 / 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 52px rgb(232 242 235 / 0.025), 0 0 0 104px rgb(232 242 235 / 0.02);
}

.login-story__brand,
.login-story__content,
.login-story__ledger,
.login-story__foot {
  position: relative;
  z-index: 1;
}

.login-story__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-story__brand > div {
  display: grid;
}

.login-story__brand strong {
  color: #f6faf7;
  font-size: 16px;
  letter-spacing: 0.05em;
}

.login-story__brand small {
  color: rgb(225 238 229 / 0.52);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.login-story__content {
  max-width: 620px;
  margin: auto 0;
  padding: 8vh 0;
}

.login-story__kicker {
  margin-bottom: 20px;
  color: #b8cfbf;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.login-story__content h1 {
  margin-bottom: 24px;
  color: #f7faf8;
  font-size: clamp(36px, 4.2vw, 62px);
  font-weight: 580;
  letter-spacing: -0.055em;
  line-height: 1.16;
}

.login-story__content > p:last-child {
  max-width: 510px;
  margin: 0;
  color: rgb(229 239 232 / 0.68);
  font-size: 15px;
  line-height: 1.8;
}

.login-story__ledger {
  display: grid;
  max-width: 560px;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgb(255 255 255 / 0.14);
  border-bottom: 1px solid rgb(255 255 255 / 0.14);
}

.login-story__ledger span {
  display: grid;
  gap: 2px;
  padding: 17px 12px;
  color: rgb(237 244 239 / 0.7);
  font-size: 12px;
}

.login-story__ledger span + span {
  border-left: 1px solid rgb(255 255 255 / 0.14);
}

.login-story__ledger b {
  color: #a9c6b3;
  font-family: var(--font-mono);
  font-size: 10px;
}

.login-story__foot {
  margin: 22px 0 0;
  color: rgb(225 238 229 / 0.42);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  padding: 40px;
  background: var(--surface);
  place-items: center;
}

@media (max-width: 980px) {
  .login-layout {
    grid-template-columns: minmax(350px, 0.8fr) minmax(450px, 1.2fr);
  }

  .login-story__ledger {
    grid-template-columns: 1fr;
  }

  .login-story__ledger span + span {
    border-top: 1px solid rgb(255 255 255 / 0.14);
    border-left: 0;
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-height: 62px;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    padding: 0 17px;
    background: rgb(244 243 237 / 0.96);
  }

  .topbar__mobile-brand {
    display: block;
  }

  .topbar__context,
  .topbar__upload,
  .demo-pill,
  .topbar__actions .avatar {
    display: none;
  }

  .page {
    min-height: calc(100vh - var(--topbar-height) - 70px);
    padding: 27px 17px calc(112px + env(safe-area-inset-bottom));
  }

  .page-heading {
    align-items: flex-start;
    margin-bottom: 22px;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .page-heading__description {
    font-size: 13px;
    line-height: 1.65;
  }

  .page-heading__actions {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    z-index: 30;
    inset: auto 0 0;
    display: grid;
    height: calc(70px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, 1fr);
    padding: 7px 5px env(safe-area-inset-bottom);
    background: rgb(255 254 249 / 0.97);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 30px rgb(23 32 28 / 0.06);
    backdrop-filter: blur(14px);
  }

  .mobile-upload {
    position: fixed;
    z-index: 35;
    right: 17px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    display: grid;
    width: 54px;
    height: 54px;
    color: white;
    background: var(--ledger);
    border: 0;
    border-radius: 17px;
    box-shadow: 0 11px 30px rgb(31 78 54 / 0.28);
    place-items: center;
  }

  .login-layout {
    display: block;
    min-height: 100vh;
    background: var(--paper);
  }

  .login-story {
    min-height: auto;
    padding: 25px 22px 60px;
    border-radius: 0 0 28px 28px;
  }

  .login-story__content {
    margin: 47px 0 0;
    padding: 0;
  }

  .login-story__kicker,
  .login-story__content > p:last-child,
  .login-story__ledger,
  .login-story__foot {
    display: none;
  }

  .login-story__content h1 {
    margin: 0;
    font-size: 31px;
    line-height: 1.23;
  }

  .login-panel {
    min-height: auto;
    margin-top: -32px;
    padding: 0 17px 36px;
    background: transparent;
  }
}
