#dashboard {
  --account-ink: #352820;
  --account-muted: #67584e;
  --account-accent: #784f3a;
  --account-line: #dfd2c8;
  --account-card: #fbf8f5;
  color: var(--account-ink);
}

#dashboard [hidden] { display: none; }
#dashboard .dash-side { background: #2a1d17; }
#dashboard .dash-main { min-width: 0; }
#dashboard .dash-top { gap: .75rem; }
#dashboard .dash-top a { color: var(--account-accent); text-decoration: none; }
#dashboard .dash-content { padding-bottom: 64px; }

#accountNav a {
  display: flex;
  align-items: center;
  min-height: 43px;
  padding: .4rem .68rem;
  border-radius: 6px;
  color: #e5d5cb;
  text-decoration: none;
  font-size: .9rem;
}

#accountNav a:hover, #accountNav a[aria-current="page"] {
  background: #ffffff18;
  color: #fff9f4;
}

#accountNav a[aria-current="page"] { box-shadow: inset -3px 0 #c7997e; }
#dashboard :is(a, button, input, summary):focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
#dashboard .user-mini { min-width: 0; }
#accountName { overflow-wrap: anywhere; }

.account-top-support {
  min-height: 42px;
  padding: .4rem .78rem;
  border: 1px solid var(--account-line);
  border-radius: 7px;
  color: var(--account-accent);
  background: var(--account-card);
  font: inherit;
  font-size: .83rem;
}

.account-top-support:hover { background: #eee4db; }

.account-welcome, .account-heading { margin-bottom: 1.2rem; }

.account-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .45rem 1rem;
}

.account-welcome h1, .account-heading h1 {
  margin: 0;
  line-height: 1.35;
  font-size: clamp(1.6rem, 3.1vw, 2.65rem);
}

.account-welcome p { margin: .35rem 0 0; color: var(--account-muted); }
.account-hint { margin: 0 0 1rem; color: var(--account-muted); line-height: 1.8; }
.account-empty { margin: .2rem 0 0; color: var(--account-muted); line-height: 1.8; }
.account-heading a, .account-card a { color: var(--account-accent); text-underline-offset: .23em; }

.account-stats, .account-overview-grid {
  display: grid;
  gap: .75rem;
}

.account-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.account-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block-start: .85rem; }

.account-card, .account-stats a {
  border: 1px solid var(--account-line);
  border-radius: 11px;
  padding: clamp(13px, 1.9vw, 26px);
  background: var(--account-card);
}

.account-card h2 { margin: 0 0 .35rem; font-size: 1.04rem; }
.account-card > a { display: inline-block; margin-block-start: .85rem; font-size: .88rem; }

.account-stats a {
  display: grid;
  gap: .45rem;
  color: var(--account-muted);
  text-decoration: none;
  font-size: .85rem;
}

.account-stats a:hover { border-color: var(--account-accent); }
.account-stats strong { color: var(--account-ink); font-size: clamp(1.3rem, 2.5vw, 2.1rem); }

.account-order + .account-order, .account-entry + .account-entry { border-top: 1px solid var(--account-line); }

.account-order summary, .account-entry {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .5rem 1rem;
  padding-block: .75rem;
}

.account-order summary { cursor: pointer; list-style: none; }
.account-order summary::-webkit-details-marker { display: none; }
.account-order summary::after { content: "+"; color: var(--account-accent); font-size: 1.2rem; }
.account-order[open] summary::after { content: "−"; }
.account-order summary small { display: block; color: var(--account-muted); font-size: .77rem; }
.account-order-lines { margin: .2rem 0; padding: 0 0 .6rem; list-style: none; border-bottom: 1px solid var(--account-line); }
.account-order-lines li, .account-order-facts > div {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  padding: .35rem .2rem;
}
.account-order-facts { margin: 0 0 .65rem; font-size: .85rem; color: var(--account-muted); }
.account-order-facts dd { margin: 0; }

.account-entry h2 { margin: 0; }
.account-entry p, .account-entry small { margin: .2rem 0 0; color: var(--account-muted); font-size: .86rem; }
.account-entry-state { display: flex; flex-wrap: wrap; gap: .4rem; }
.account-file-link { font-weight: 700; }

.account-form {
  display: grid;
  gap: .85rem;
  max-width: 620px;
}
.account-form label { display: grid; gap: .3rem; color: var(--account-muted); font-size: .9rem; }
.account-form input {
  width: 100%;
  min-height: 44px;
  padding: .45rem .65rem;
  border: 1px solid #cebbb0;
  border-radius: 7px;
  background: white;
  color: var(--account-ink);
  font: inherit;
}
.account-form .btn { justify-self: start; }

.account-messages {
  max-height: 310px;
  overflow-y: auto;
  padding: 0;
  margin: 0 0 1rem;
  list-style: none;
}
.account-messages li { padding: .65rem; border-block-end: 1px solid var(--account-line); }
.account-messages p { margin: 0 0 .3rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.account-messages time { color: var(--account-muted); font-size: .78rem; }
#accountChat { margin-top: .85rem; }

#chatMessages .message { white-space: pre-wrap; overflow-wrap: anywhere; }
#chatMessages > p { color: #615751; font-size: .89rem; }

@media (max-width: 660px) {
  #dashboard .dash-side { padding: 15px 14px; }
  #dashboard .user-mini { margin-block: .55rem; }
  #accountNav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #accountNav a { font-size: .82rem; }
  #dashboard .dash-top { height: auto; min-height: 61px; padding: .45rem 14px; }
  .account-overview-grid { grid-template-columns: minmax(0, 1fr); }
  .account-stats { gap: .36rem; }
  .account-stats a { padding: .55rem; font-size: .77rem; }
}
