:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #e6ebf2;
  background: #10151c;
  font-synthesis: none;
  --muted: #9ba8b9;
  --line: #2c3542;
  --surface: #18202b;
  --accent: #99d5bd;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid #465364;
  background: #263344;
  color: #eef3f8;
  border-radius: 8px;
  padding: 11px 16px;
  min-height: 44px;
}
button:hover {
  background: #35485d;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.primary {
  background: var(--accent);
  color: #10291f;
  border-color: var(--accent);
  font-weight: 650;
}
button.danger {
  border-color: #d58f84;
  color: #ffd1c9;
}
a {
  color: #b6d3ff;
  text-underline-offset: 4px;
}
input,
textarea,
select {
  width: 100%;
  background: #0f151e;
  border: 1px solid #465364;
  border-radius: 7px;
  padding: 11px;
  color: #e6ebf2;
  min-height: 44px;
}
textarea {
  resize: vertical;
  min-height: 100px;
}
label {
  display: grid;
  gap: 8px;
  color: #c7d0dd;
  font-size: 14px;
  margin-bottom: 16px;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.7px;
  margin: 0 0 10px;
}
h2 {
  font-size: 19px;
  margin: 0 0 18px;
}
h3 {
  font-size: 15px;
  margin: 0 0 8px;
}
p {
  line-height: 1.6;
}
small,
.muted {
  color: var(--muted);
  line-height: 1.6;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.65 ui-monospace,
    monospace;
  background: #10151c;
  padding: 14px;
  border-radius: 8px;
  max-height: 420px;
  overflow: auto;
}
.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100dvh;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 28px 18px;
  background: #121a24;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 35px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.brand img {
  width: 34px;
}
.brand small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 1.6px;
}
.nav {
  display: grid;
  gap: 7px;
  margin-top: 25px;
}
.nav button {
  text-align: left;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.nav button.active {
  background: #25332e;
  color: #b5e6ce;
}
.sidebar footer {
  margin-top: 40px;
  font-size: 12px;
  color: var(--muted);
}
main {
  padding: 35px clamp(20px, 4vw, 64px);
  max-width: 1500px;
  width: 100%;
  margin: auto;
}
.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.stack {
  display: grid;
  gap: 20px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.metric strong {
  display: block;
  font-size: 32px;
  font-weight: 600;
  margin: 10px 0;
}
.metric small {
  font-size: 12px;
}
.section {
  margin-top: 28px;
}
.task {
  display: grid;
  gap: 12px;
  text-align: left;
  width: 100%;
  background: var(--surface);
  padding: 20px;
  border-color: var(--line);
}
.task strong {
  font-size: 16px;
}
.tag {
  font-size: 11px;
  letter-spacing: 0.7px;
  padding: 5px 8px;
  border: 1px solid #506276;
  border-radius: 5px;
  color: #c7d8eb;
  white-space: nowrap;
}
.tag.good {
  color: #a7dbc0;
  border-color: #456657;
}
.tag.warn {
  color: #edc994;
  border-color: #80663f;
}
.empty {
  padding: 35px 20px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.login {
  width: calc(100% - 24px);
  max-width: 460px;
  margin: 10vh auto;
  padding: 28px;
}
.login h1 {
  margin-bottom: 24px;
}
.notice {
  padding: 14px 18px;
  border: 1px solid #7b6743;
  background: #2b261c;
  border-radius: 8px;
  color: #eed1a3;
  margin: 18px 0;
  line-height: 1.6;
}
.success {
  color: #9ed9bd;
}
.error {
  color: #ffb5a9;
}
.split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}
.wide {
  grid-column: 1/-1;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
th {
  color: var(--muted);
  font-weight: 500;
}
.scroll {
  overflow-x: auto;
}
.chat-message {
  padding: 18px;
  border-left: 2px solid var(--accent);
  background: #1d2a29;
  white-space: pre-wrap;
  line-height: 1.6;
}
.offline {
  background: #654b20;
  color: white;
  padding: 12px;
  text-align: center;
}
.hidden {
  display: none !important;
}
dialog {
  background: var(--surface);
  color: #e6ebf2;
  border: 1px solid #536278;
  border-radius: 14px;
  width: min(600px, 95vw);
  max-height: 90dvh;
  padding: 25px;
}
dialog::backdrop {
  background: #000a;
}
dialog .row {
  margin-top: 20px;
}
#toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  max-width: 440px;
  z-index: 10;
  padding: 0;
  background: #35465b;
  border-radius: 8px;
  box-shadow: 0 8px 35px #0005;
}
#toast:not(:empty) {
  padding: 16px 20px;
}
.danger-panel {
  border-color: #845149;
}
.checklist {
  display: grid;
  gap: 12px;
}
.checklist div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
details summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
  color: #bbcee8;
}
.meta {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 180px 1fr;
  }
  .sidebar {
    padding: 24px 12px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  main {
    padding: 28px 20px;
  }
}
.project-menu-toggle,
.mobile-logout {
  display: none;
}
@media (max-width: 650px) {
  html {
    scroll-padding-top: calc(60px + env(safe-area-inset-top));
  }
  .shell {
    display: block;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px;
    height: auto;
    padding: calc(4px + env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right)) 4px
      max(8px, env(safe-area-inset-left));
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    display: none;
  }
  .brand small {
    display: none;
  }
  .nav {
    display: flex;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    gap: 2px;
    margin: 0;
    scrollbar-width: none;
    scroll-padding-inline: 8px;
  }
  .project-menu {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
  }
  .project-menu-toggle {
    display: block;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 23px;
  }
  .project-menu-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(280px, calc(100vw - 32px));
    max-height: calc(100dvh - 80px - env(safe-area-inset-top));
    overflow-y: auto;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 8px 24px #0006;
  }
  .project-menu.is-open .project-menu-panel {
    display: block;
  }
  .mobile-logout {
    display: block;
    width: 100%;
    margin-top: 16px;
  }
  .desktop-logout {
    display: none;
  }
  .nav button {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 6px 8px;
    font-size: 12px;
  }
  .nav button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -3px;
  }
  .sidebar footer {
    display: none;
  }
  .topline {
    align-items: flex-start;
    margin-bottom: 14px;
  }
  .topline .eyebrow {
    font-size: 10px;
    letter-spacing: 1px;
    margin-bottom: 4px;
  }
  #connection {
    font-size: 11px;
  }
  main {
    padding: 16px 16px calc(35px + env(safe-area-inset-bottom));
  }
  h1 {
    font-size: 26px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .card {
    padding: 16px;
  }
  .metric strong {
    font-size: 27px;
  }
  .metric small {
    font-size: 11px;
  }
  .task-grid {
    grid-template-columns: 1fr;
  }
  .topline button {
    font-size: 12px;
    padding: 8px;
  }
  .login {
    margin: 5vh 12px;
  }
  .row > button {
    flex-grow: 1;
  }
  #toast {
    right: 12px;
    left: 12px;
    bottom: 15px;
    max-width: none;
  }
}
:root .mfa-qr {
  max-width: 100%;
  height: auto;
}
:root input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
}
.chat-photo {
  width: 150px;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
}
.chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-photos {
  flex-wrap: wrap;
}
.account-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 160px;
}
.account-history table {
  min-width: 760px;
}
.account-history th,
.account-history td {
  overflow-wrap: normal;
  white-space: nowrap;
}
