.space-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #152029;
  color: #fff;
  z-index: 1000;
}
.workspace[hidden] {
  display: none !important;
}
#save-status {
  font-size: 11px;
  color: var(--muted, #b7c4cd);
  padding: 4px 32px;
  text-align: right;
  min-height: 22px;
  flex-shrink: 0;
}
#save-status.save-problem {
  text-align: left;
  color: #ffe2ba;
  background: #79552a45;
  padding: 10px 24px;
}
#save-status button {
  font-size: 11px;
  margin-left: 10px;
  padding: 5px 9px;
}
.panel + .panel {
  margin-top: 22px;
}
.setting p {
  line-height: 1.65;
}
.account-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
}
.conversation-list {
  display: grid;
  gap: 8px;
}
.conversation-list button {
  display: flex;
  text-align: left;
  justify-content: space-between;
  gap: 14px;
  padding: 15px;
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.conversation-list small {
  flex-shrink: 0;
  opacity: 0.6;
}
.conversation-list [aria-current] {
  border-color: currentColor;
}
.historical-action {
  margin: 10px 0 20px;
  font-size: 13px;
}
.historical-action small {
  display: block;
  margin-top: 10px;
  opacity: 0.65;
}
#context-tip {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  border-left: 2px solid currentColor;
  padding: 10px 15px;
  margin: 0 0 18px;
  background: #ffffff0a;
  font-size: 12px;
  line-height: 1.7;
}
#context-tip button {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 11px;
}
.onboarding-dialog {
  width: min(490px, calc(100vw - 32px));
  max-height: calc(100svh - 40px);
  padding: 34px;
  border-radius: 26px;
  color: #edf4f7;
  background: #17242ef5;
  border: 1px solid #ffffff30;
  box-shadow: 0 30px 120px #0006;
  overflow: auto;
}
.onboarding-dialog::backdrop {
  background: #07121b99;
  backdrop-filter: blur(8px);
}
.onboarding-dialog h2 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -1px;
  margin: 20px 0 12px;
}
.onboarding-dialog p:not(.micro) {
  font-size: 13px;
  line-height: 1.8;
  color: #bacbd6;
}
.onboarding-dialog .field {
  display: block;
  margin: 20px 0;
  font-size: 13px;
}
.onboarding-dialog input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  padding: 13px;
  border: 1px solid #ffffff40;
  background: #ffffff08;
  border-radius: 10px;
  color: inherit;
  margin-top: 8px;
}
.onboarding-dialog footer {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  gap: 12px;
}
.guide-options {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}
.guide-options label {
  display: flex;
  gap: 12px;
  font-size: 13px;
  padding: 14px;
  background: #ffffff08;
  border-radius: 10px;
}
.guide-actions {
  display: grid;
  gap: 12px;
  margin-top: 25px;
}
.guide-actions button {
  text-align: left;
  padding: 16px;
}
.guide-actions small {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  opacity: 0.6;
}
.onboarding-dialog button:focus-visible {
  outline: 2px solid #b9def1;
  outline-offset: 3px;
}
#account-error,
.guide-error {
  color: #ffb7a9 !important;
}
.top-actions {
  flex-wrap: wrap;
}
.top-actions > button[data-space] {
  font-size: 12px;
}
.profile-hero h2 {
  overflow-wrap: anywhere;
}
html[data-background-mode="day"] .onboarding-dialog {
  color: #1b3542;
  background: #f7fafaf7;
  border-color: white;
}
html[data-background-mode="day"] .onboarding-dialog p:not(.micro) {
  color: #536b78;
}
html[data-background-mode="day"]
  .onboarding-dialog
  input:not([type="checkbox"]) {
  border-color: #25445450;
  background: white;
}
html[data-background-mode="day"] .guide-options label {
  background: #2544540b;
}
html[data-background-mode="day"] #save-status.save-problem {
  color: #7b380a;
  background: #fff0d8;
}
html[data-background-mode="day"] #account-error {
  color: #a23121 !important;
}
@media (max-width: 700px) {
  #save-status {
    padding: 3px 18px;
    font-size: 10px;
  }
  .onboarding-dialog {
    padding: 25px;
  }
  .top-actions > button[data-space] {
    font-size: 10px;
    padding: 7px;
  }
  #context-tip {
    gap: 10px;
    font-size: 11px;
  }
  .setting {
    gap: 16px;
  }
  .setting > div {
    min-width: 0;
  }
  .setting h3,
  .setting p {
    overflow-wrap: anywhere;
  }
  .setting > button {
    flex-shrink: 0;
  }
  .conversation-list button {
    flex-wrap: wrap;
  }
  .topbar {
    gap: 8px;
  }
  .top-actions {
    gap: 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .onboarding-dialog,
  .onboarding-dialog::backdrop {
    scroll-behavior: auto;
    transition: none;
  }
}

body:is([data-page="calendar"], [data-page="memory"], [data-page="account"])
  .ambient:after {
  background: linear-gradient(180deg, #07141ecc, #07141ea6);
}
body:is([data-page="calendar"], [data-page="memory"], [data-page="account"])
  .panel,
body:is([data-page="calendar"], [data-page="memory"], [data-page="account"])
  .profile-hero {
  background: #152a38df;
  backdrop-filter: blur(24px);
}
html[data-background-mode="day"]
  body:is([data-page="calendar"], [data-page="memory"], [data-page="account"])
  .panel,
html[data-background-mode="day"]
  body:is([data-page="calendar"], [data-page="memory"], [data-page="account"])
  .profile-hero {
  background: #f1f7f5ed;
}
@media (max-width: 700px) {
  .topbar > .top-actions {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 4px;
  }
  .top-actions > button {
    min-width: 0;
    padding: 7px;
    font-size: 10px;
  }
  .topbar .top-brand {
    min-width: 100px;
  }
  .topbar {
    padding-inline: 16px;
  }
  .top-actions .icon-button {
    width: 30px;
    height: 30px;
  }
}

.conversation-row {
  display: flex;
  gap: 8px;
}
.conversation-row > button:first-child {
  flex: 1;
  min-width: 0;
}
.conversation-row > button:last-child {
  flex-shrink: 0;
  font-size: 12px;
}
@media (max-width: 700px) {
  .topbar > .top-actions button {
    white-space: nowrap;
  }
  .topbar .top-brand {
    min-width: 90px;
  }
  .topbar .top-brand small {
    font-size: 7px;
  }
}

/* Guided tour keeps the actual destination visible behind the explanation. */
.onboarding-dialog.page-tour {
  position: fixed;
  inset: auto 28px 28px auto;
  margin: 0;
  width: 420px;
  padding: 26px;
  max-height: calc(100dvh - 48px);
}
.page-tour::backdrop {
  background: #07121b33;
  backdrop-filter: none;
}
.page-tour h2 {
  font-size: 24px;
  line-height: 1.4;
  margin: 15px 0 10px;
  outline: none;
}
.page-tour .micro {
  margin: 16px 0 0;
  font-size: 10px;
  letter-spacing: 1.1px;
}
.tour-progress {
  display: flex;
  gap: 6px;
}
.tour-progress span {
  height: 3px;
  flex: 1;
  border-radius: 3px;
  background: #ffffff25;
}
.tour-progress .visited {
  background: #ffffff80;
}
.tour-progress .current {
  background: #fff;
}
.tour-features {
  padding-left: 18px;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.85;
  color: #d7e3eb;
}
.tour-features li + li {
  margin-top: 7px;
}
.page-tour .tour-location {
  padding-top: 12px;
  border-top: 1px solid #ffffff24;
  font-size: 11px;
  color: #c5deed;
}
.page-tour footer {
  margin-top: 18px;
  align-items: center;
  gap: 8px;
}
.page-tour footer > div {
  display: flex;
  gap: 8px;
}
.page-tour footer button {
  padding: 9px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.tour-highlight {
  outline: 2px solid #d6efff !important;
  outline-offset: 7px;
  box-shadow: 0 0 0 10px #d6efff15 !important;
  border-radius: 18px;
}
html[data-background-mode="day"] .tour-features {
  color: #345264;
}
html[data-background-mode="day"] .tour-progress span {
  background: #163b5224;
}
html[data-background-mode="day"] .tour-progress .current {
  background: #163b52;
}
html[data-background-mode="day"] .tour-progress .visited {
  background: #163b5277;
}
html[data-background-mode="day"] .tour-highlight {
  outline-color: #183f56 !important;
}
@media (max-width: 700px) {
  .onboarding-dialog.page-tour {
    inset: auto 12px 14px 12px;
    width: auto;
    padding: 20px;
    max-height: 58dvh;
    border-radius: 22px;
  }
  .page-tour h2 {
    font-size: 21px;
    margin-top: 12px;
  }
  .tour-features {
    font-size: 12px;
    line-height: 1.7;
    margin: 12px 0;
  }
  .tour-features li + li {
    margin-top: 5px;
  }
  .page-tour footer {
    margin-top: 12px;
  }
  .page-tour .tour-location {
    font-size: 10px;
  }
  .page-tour p:not(.micro) {
    font-size: 12px;
  }
  .page-tour footer button {
    padding: 8px 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tour-highlight {
    transition: none;
  }
}

/* Keep navigation motion inside the workspace viewport. */
.workspace > .main { overflow: hidden; }
