/* Account views share the board's window controls and text faces. */
.account-box {
  width: min(100%, 410px);
}
.account-box h1 {
  margin: 0 0 14px;
}
.account-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 2px;
  padding-inline: 4px;
  border-bottom: 1px solid #8998ae;
  font: 11px/1.4 var(--ui);
}
.account-tabs a,
.account-tabs a:visited {
  position: relative;
  margin: 0 0 -1px;
  padding: 6px 12px;
  border: 1px solid #8998ae;
  border-radius: 3px 3px 0 0;
  background: #edece4;
  color: #253146;
  text-decoration: none;
}
.account-tabs a:hover {
  text-decoration: underline;
}
.account-tabs a[aria-current] {
  border-bottom-color: #fff;
  background: #fff;
  box-shadow: inset 0 2px #316ac5;
  color: #000;
  font-weight: bold;
}
.account-panel {
  border: 1px solid #8998ae;
  border-top: 0;
  padding: 17px;
}
.account-fields {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  gap: 4px;
}
.account-fields label,
.account-art label {
  font: 700 11px/1.5 var(--ui);
}
.account-fields > label:not(:first-child),
.account-password {
  margin-top: 9px;
}
.account-fields :is(input, textarea) {
  width: 100%;
  font: 14px/1.4 Tahoma, sans-serif;
}
.account-fields small,
#art-types,
.account-feedback {
  font: 11px/1.55 var(--ui);
}
.account-fields small,
#art-types {
  color: #4d4d4d;
}
.account-password,
.account-submit,
.account-art-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.account-password {
  justify-content: space-between;
}
.account-password-tools {
  display: flex;
  gap: 4px;
}
.account-generate {
  gap: 4px;
}
.account-submit {
  margin-top: 10px;
}
.account-feedback {
  margin: 0;
}
.account-feedback:empty {
  display: none;
}
.account-warning {
  margin: 9px 0 0;
  padding: 6px 9px;
  border-left: 3px solid #a40000;
  background: #fff5f2;
  color: #921c12;
  font: 12px/1.5 Tahoma, Arial, sans-serif;
}
.account-warning a,
.account-warning a:visited {
  color: inherit;
  white-space: nowrap;
}
.account-dashboard,
.public-profile {
  max-width: 920px;
}
.profile-header {
  margin-bottom: 16px;
  border-bottom: 1px solid #aca899;
}
.profile-wallpaper {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  outline: 1px solid #8998ae;
  outline-offset: -1px;
}
.profile-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 0 0 12px;
}
.profile-wallpaper + .profile-identity {
  padding-top: 10px;
}
.profile-avatar {
  display: block;
  width: 64px;
  height: 64px;
  padding: 2px;
  border: 1px solid #8998ae;
  object-fit: cover;
  background: white;
}
.profile-initial {
  display: grid;
  place-items: center;
  background: #e8edf7;
  color: #224984;
  font: bold 30px/1 var(--ui);
}
.profile-name {
  min-width: 0;
}
.profile-name h1 {
  margin: 0 0 4px;
}
.profile-details,
.profile-context,
.account-art,
.account-credentials summary {
  font: 11px/1.5 var(--ui);
}
.profile-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1px 12px;
  color: #4d4d4d;
}
.profile-details .profile-handle {
  flex-basis: 100%;
}
.profile-stat, .profile-action .button, .profile-action button {
  white-space: nowrap;
}
.profile-action { text-align: end; }
.profile-action .account-feedback:empty { display: none; }
.profile-bio {
  white-space: pre-wrap;
  max-width: 70ch;
  margin: 0 0 12px;
}
.profile-action .account-feedback {
  max-width: 24ch;
  margin-top: 3px;
}
.account-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 16px;
  align-items: start;
}
.account-pane,
.account-credentials {
  border: 1px solid #aca899;
  padding: 12px;
}
.account-pane h2 {
  margin: -12px -12px 12px;
  padding: 6px 12px;
  border-bottom: 1px solid #c2cde0;
  background: #edf2fb;
  font: bold 12px/1.4 var(--ui);
}
.account-art {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}
.account-art + .account-art {
  padding-top: 10px;
  border-top: 1px solid #d6d4c9;
}
.account-art input {
  width: 100%;
}
.account-credentials {
  margin: 16px 0;
  padding: 0;
}
.account-credentials summary {
  padding: 7px 12px;
  background: var(--face);
  cursor: pointer;
}
.account-credentials form {
  max-width: 410px;
  padding: 14px;
}
.profile-entry {
  padding: 12px 0 7px;
  border-bottom: 1px solid #d1cfc5;
}
.public-profile .account-tabs { padding-inline: 0; }
.profile-entry .post-header { align-items: center; }
.profile-context {
  display: inline-block;
  margin: 0 0 5px 8px;
}
.profile-entry .reply {
  margin: 0;
}
@media (max-width: 520px) {
  .account-fields :is(input, textarea) {
    min-height: 36px;
    font-size: 16px;
  }
  .account-tabs a {
    padding: 9px 12px;
  }
  .account-panel {
    padding: 12px;
  }
  .profile-avatar {
    width: 48px;
    height: 48px;
  }
  .profile-identity {
    column-gap: 8px;
  }
  .profile-details {
    column-gap: 8px;
  }
}

.profile-name, .profile-bio { overflow-wrap: anywhere; }
.art-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
profile-frame {
  display: block;
  position: relative;
  overflow: hidden;
}
profile-frame > img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--frame-point, 50% 50%);
  transform-origin: var(--frame-point, 50% 50%);
  transform: scale(var(--frame-zoom, 1));
}
.frame-editor {
  padding: 5px 0;
}
.frame-editor summary {
  cursor: pointer;
  color: var(--link);
  width: fit-content;
}
.frame-sample { width: fit-content; max-width: 100%; margin: 8px 0; touch-action: none; user-select: none; cursor: grab; }
.frame-sample:has(.sample-wallpaper) { width: 100%; }
.frame-sample:active { cursor: grabbing; }
.sample-avatar { width: 96px; aspect-ratio: 1; }
.sample-wallpaper { width: 100%; aspect-ratio: 3 / 1; }
.frame-sample profile-frame {
  outline: 1px solid #8998ae;
  outline-offset: -1px;
  background: white;
}
.frame-slider {
  display: grid;
  grid-template-columns: 75px 1fr;
  gap: 6px;
  align-items: center;
}
.frame-slider input { padding: 0; cursor: pointer; }
.frame-editor button { margin-top: 6px; }

.profile-flag { vertical-align: middle; object-fit: contain; image-rendering: pixelated; }
#profile-flag { justify-self: start; gap: 6px; }
#profile-flag::after { content: "▾"; }
#profile-flag img { object-fit: contain; image-rendering: pixelated; }

.toolbar-icon {
  position: relative;
  flex: none;
  width: var(--control-height);
  height: var(--control-height);
  padding: 0;
  color: #234b7f;
  display: inline-grid;
  place-items: center;
}
.mail-badge { display: none; }
.inbox-link[data-unread] .mail-badge {
  position: absolute;
  top: -3px;
  right: -2px;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border: 1px solid #81250e;
  border-radius: 4px;
  background: linear-gradient(#c4471f, #a22913);
  box-shadow: inset 1px 1px #ee9977;
  color: white;
  font: bold 10px/1 Tahoma, sans-serif;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .inbox-link[data-unread] .mail-badge { animation: mail-bob 750ms ease-in-out 3; }
}
@keyframes mail-bob {
  50% { transform: translateY(-2px); }
}
.board-compose-tools { display: flex; align-items: center; gap: var(--action-gap); }
.profile-action { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.dm-panel { max-width: 680px; }
.dm-panel > header, .dm-panel header nav, .dm-search, .dm-setting {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.dm-panel > header { justify-content: space-between; border-bottom: 1px solid #a1b3ce; padding-bottom: 8px; }
.dm-panel > header h1, .dm-setting h2, .dm-setting p { margin: 0; overflow-wrap: anywhere; }
.dm-panel header nav, .dm-setting, .dm-search, #dm-send { font: 12px/1.5 var(--ui); }
.dm-search, #dm-send { background: #edf1f8; border: 1px solid #b6c3d6; padding: 10px; margin-block: 12px; }
.dm-search input { flex: 1 1 7em; min-width: 0; }
.dm-panel h2 { font: bold 15px var(--ui); margin-top: 18px; }
.dm-list, .dm-history { padding: 0; list-style: none; }
.dm-list li { border-bottom: 1px solid #d6dce6; }
.dm-list a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 10px 4px; }
.dm-panel time { margin-left: auto; font: 11px/1.5 var(--ui); color: #475468; }
.dm-list a span { width: 100%; color: #232b38; overflow-wrap: anywhere; }
.dm-unread { font: bold 11px var(--ui); color: #194586; }
.dm-history { display: grid; gap: 9px; max-height: 52dvh; overflow-y: auto; overscroll-behavior: contain; padding: 3px; }
.dm-history li { max-width: 90%; min-width: min(180px, 80%); width: fit-content; padding: 8px 12px; border: 1px solid #c7ccd1; background: #f7f6f0; }
.dm-history .outgoing { justify-self: end; border-color: #b9c9e1; background: #edf3fe; }
.dm-history li div { display: flex; gap: 3px 10px; align-items: baseline; flex-wrap: wrap; font: 12px var(--ui); }
.dm-history p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
#dm-send { display: grid; gap: 5px; }
#dm-send textarea { width: 100%; resize: vertical; }
#dm-send button { justify-self: end; }
.dm-feedback { font: 12px/1.5 var(--ui); }
.dm-setting { padding: 10px; margin-block: 12px; background: #edf1f8; border: 1px solid #b6c3d6; }
.dm-setting h2 { font-size: 14px; }
@media (max-width: 520px) {
  .feed-controls:has(.toolbar-icon) { flex-wrap: nowrap; }
  .feed-controls:has(.toolbar-icon) form { min-width: 0; flex: 0 1 auto; }
}

.toolbar-icon img { display: block; image-rendering: pixelated; }
.mod-sections, .directory-tools, .directory-pages {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font: 12px/1.5 var(--ui);
}
.mod-sections { padding: 6px; border: 1px solid #9daec6; background: #e5ecf8; }
.mod-sections [aria-pressed="true"] { background: #c4d9ff; box-shadow: inset 1px 1px 2px #87a0c6; }
.directory-tools label { display: inline-flex; align-items: center; gap: 5px; }
.directory-tools input { width: 15ch; }
.directory-status, .directory-table { font: 12px/1.5 var(--ui); }
.directory-table { width: 100%; border-collapse: collapse; }
.directory-table th, .directory-table td { padding: 6px; border-bottom: 1px solid #c5cfde; text-align: right; }
.directory-table th { background: #e9eef7; }
.directory-table :is(th,td):first-child { text-align: left; }
.directory-table small { color: #495569; white-space: nowrap; }
.directory-pages { margin-top: 8px; }
@media (max-width: 365px) {
  .feed-controls .toolbar-icon { width: 30px; }
  .directory-table th, .directory-table td { padding-inline: 3px; }
}

#mod-analytics { max-width: 36rem; }
.analytics-totals { display: flex; margin: 0 0 16px; border: 1px solid #9daec6; background: #edf1f8; }
.analytics-totals div { flex: 1; padding: 8px 12px; }
.analytics-totals div + div { border-left: 1px solid #bdcadd; }
.analytics-totals dt, .analytics-days { font: 12px/1.5 var(--ui); }
.analytics-totals dd { margin: 2px 0 0; color: #173d74; font: bold 22px var(--ui); }
.analytics-days { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.analytics-days caption { padding-bottom: 6px; text-align: left; font-weight: bold; }
.analytics-days th, .analytics-days td { padding: 3px 6px; border-bottom: 1px solid #dce2ec; }
.analytics-days th { width: 5em; text-align: left; font-weight: normal; }
.analytics-days td:last-child { width: 4em; text-align: right; }
.analytics-days meter { width: 100%; }
