:where(a:any-link) { color: #2f6582; }
.portal-identity { color: #646464; font: 11px/1.3 Verdana, Arial, sans-serif; white-space: nowrap; }
.portal-identity-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 23px; }
.portal-date-anchor { position: absolute; top: 50px; left: 535px; white-space: nowrap; }
.board-banner .portal-date-anchor { left: 540px; }
.portal-date-anchor > :is(.board-today, .portal-today, .retro-date) { position: static; display: block; }
.portal-identity--align, .portal-identity--legacy { position: absolute; top: calc(100% + 5px); right: 0; width: max-content; max-width: min(220px, 45vw); z-index: 5; }
.portal-identity--fallback { position: fixed; z-index: 5; right: 10px; top: 4px; padding: 2px 6px; background: #fffff1; }
.portal-legacy-anchor { display: inline-block; position: relative; }
:is(#portal-notify-open, #portal-mail-open) { box-sizing: border-box; position: relative; width: 23px; height: 23px; padding: 4px; color: #2f6582; background: none; border: 0; cursor: pointer; }
#chat-screen .people-cap { display: flex; align-items: center; justify-content: flex-end; padding-inline: 8px; }
.portal-identity--chat { max-width: 100%; min-width: 0; position: relative; z-index: 2; }
.portal-identity-actions #portal-profile-open { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.portal-identity-actions > :is(#portal-mail-open, #portal-notify-open, .portal-mobile-menu) { flex: none; }
#portal-notify-open span { display: block; width: 15px; height: 15px; background: currentColor; mask: url("/account/bell.png") center / contain no-repeat; }
#portal-mail-open span { display: block; width: 15px; height: 15px; background: #2f6582; mask: url("/account/envelope.png") center / contain no-repeat; }
:is(#portal-notify-open, #portal-mail-open) i { position: absolute; top: 2px; right: 1px; width: 6px; height: 6px; border-radius: 50%; background: #c61e25; box-shadow: 0 0 0 1px #fffff1; }
.portal-account-panel { box-sizing: border-box; width: min(520px, calc(100vw - 24px)); max-height: min(84dvh, 700px); padding: 16px 20px; overflow: auto; color: #606060; background: #fffff1; border: 2px solid #cfcfbc; font: 12px/1.45 Verdana, Arial, sans-serif; }
.portal-account-panel::backdrop { background: #2227; }
.portal-account-panel h2 { margin: 0 0 10px; font-size: 15px; }
.portal-account-panel fieldset { border: 1px solid #cfcfbc; margin: 0 0 10px; padding: 8px; }
.portal-account-panel label { display: grid; grid-template-columns: minmax(115px, 1fr) minmax(0, 1fr); gap: 4px; align-items: center; margin-bottom: 5px; }
#portal-person-card {
  position: fixed; inset: auto; margin: 0; width: min(280px, calc(100vw - 16px));
  padding: 11px 13px; border-width: 1px; box-shadow: 0 5px 17px #302f2b33; overflow-wrap: anywhere;
}
#portal-person-card [data-person-close] { float: right; border: 0; background: none; color: #2f6582; font-size: 18px; cursor: pointer; }
#portal-person-card dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 3px 9px; margin: 6px 0; }
#portal-person-card dd { margin: 0; }
#portal-person-card img { max-width: 100%; max-height: 114px; object-fit: contain; }
.portal-person-actions { display: grid; justify-items: start; gap: 5px; border-block-start: 1px solid #dedfd1; padding-block-start: 7px; margin-block-start: 8px; }
.portal-person-actions a:any-link { color: #2f6582; font-weight: bold; text-decoration: none; }
.portal-person-actions a:hover { text-decoration: underline; }
#portal-person-card [hidden] { display: none; }
#portal-person-card .is-error { color: #8b2525; }
.portal-account-panel :is(input,select,button) { color: inherit; font: inherit; min-width: 0; }
.portal-account-panel input[type=color] { width: 53px; }
.portal-account-panel .account-buttons button { color: #fff; }
#portal-profile-logout { margin-inline-start: auto; }
#portal-profile-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#portal-profile-title { overflow-wrap: anywhere; }
#portal-profile-form { display: flex; flex-direction: column; min-height: 0; }
#portal-profile-form [hidden] { display: none !important; }
.portal-settings-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 12px; border-bottom: 1px solid #cfcfbc; }
.portal-settings-nav button {
  padding: 4px 0 6px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: #2f6582; cursor: pointer;
}
.portal-settings-nav button[aria-pressed=true] { border-color: #2f6582; font-weight: bold; }
.portal-settings-panels { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 2px 3px; }
.portal-settings-panels fieldset { min-width: 0; padding: 8px 10px 10px; }
.portal-settings-panels legend { font-weight: bold; }
.portal-settings-panels :is(label:not(.portal-color-chip, .portal-setting-check), .portal-setting-row) {
  display: grid; grid-template-columns: minmax(0, 152px) minmax(0, 1fr);
  align-items: center; gap: 5px 10px; margin: 0 0 6px;
}
.portal-settings-panels :is(select, input[type=date], input:not([type])) {
  box-sizing: border-box; width: 100%; max-width: 100%; min-height: 29px;
}
.portal-settings-panels .portal-setting-row { margin-bottom: 0; overflow-wrap: anywhere; }
.portal-settings-panels .portal-setting-check { display: flex; gap: 7px; align-items: flex-start; }
.portal-setting-check input { flex: none; margin: .2em 0 0; }
.portal-settings-links { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.portal-settings-panels .account-link { color: #2f6582; }
#chat-profile-settings select { max-width: 230px; }
.portal-birthday-field { display: grid; gap: 2px; }
#portal-profile-form .portal-color-group { border: 0; padding: 2px 0 5px; margin: 0; }
#portal-profile-form .portal-color-palette { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); max-width: 330px; }
#portal-profile-form .portal-color-chip { width: auto; }
.portal-profile-picture { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#portal-profile-preview { padding: 2px; border: 1px solid #cfcfbc; background: #fff; cursor: pointer; }
#portal-profile-photo { display: block; object-fit: contain; }
.portal-profile-picture input { flex: 1 1 170px; max-width: 100%; }
.portal-profile-picture input::file-selector-button {
  border: 1px solid #2f6582; padding: 3px 7px; background: #2f6582; color: white; cursor: pointer;
}
#portal-profile-gallery:not([hidden]) { display: inline-block; width: fit-content; margin-top: 8px; color: #2f6582; }
#portal-profile-form > .account-buttons { margin-top: 8px; }
#portal-profile-status { margin: 4px 0; }
@media (max-width: 430px) {
  #portal-profile-dialog { padding-inline: 12px; }
  .portal-settings-panels :is(label:not(.portal-color-chip, .portal-setting-check), .portal-setting-row) { grid-template-columns: minmax(0, 1fr); }
  .portal-settings-panels :is(select, input[type=date], input:not([type])) { font-size: 16px; }
  #chat-profile-settings select { max-width: 100%; }
}
#portal-profile-status, #portal-notify-status { color: #8b2525; }
#portal-notify-dialog {
  position: fixed; inset: auto; margin: 0; width: min(330px, calc(100vw - 16px));
  max-height: min(65dvh, 400px); padding: 11px 13px; border-width: 1px;
  box-shadow: 0 5px 17px #302f2b33; overflow-wrap: anywhere;
}
#portal-notify-dialog::backdrop { background: transparent; pointer-events: none; }
#portal-notify-close { float: right; border: 0; padding: 0 3px; color: #2f6582; background: none; font-size: 18px; line-height: 1; cursor: pointer; }
#portal-notify-list { margin: 0 0 8px; padding-left: 18px; }
#portal-notify-list:empty { display: none; }
#portal-notify-list li { padding: 3px 0; }
#portal-notify-list li a { font-weight: bold; }
#portal-notify-list a { color: #2f6582; }
#portal-notify-list time { margin-left: 6px; font-size: .9em; color: #676767; }
.portal-mention-list { position: fixed; z-index: 12; box-sizing: border-box; margin: 0; max-height: 140px; overflow: auto; min-width: 140px; background: #fffff1; border: 1px solid #cfcfbc; box-shadow: 0 2px 8px #0002; padding: 2px; font: 12px Verdana, Arial, sans-serif; }
.portal-mention-list button { display: block; width: 100%; text-align: left; padding: 4px; border: 0; color: #2f6582; background: none; font: inherit; }
.portal-mention-list button[aria-selected="true"], .portal-mention-list button:hover { color: #fff; background: #2f6582; }
@media (max-width: 700px) {
  .portal-date-anchor, .board-banner .portal-date-anchor { left: auto; right: 8px; }
}

.portal-color-group {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0 0 10px;
}
.portal-account-panel .portal-color-group {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0 0 10px;
}
.portal-color-group legend { margin: 0 0 5px; padding: 0; font-weight: bold; }
.portal-color-group [data-color-picker] { width: 72px; height: 29px; }
.portal-color-palette { display: flex; flex-wrap: wrap; gap: 2px; }
.portal-color-palette[hidden] { display: none; }
.portal-color-palette .portal-color-chip {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  width: 25px;
  height: 27px;
  margin: 0;
  cursor: pointer;
}
.portal-color-palette .portal-color-chip input[type=radio] {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #067aff;
  cursor: pointer;
}
.portal-color-chip:has(:focus-visible) { outline: 2px solid #2f6582; outline-offset: 2px; z-index: 1; }

#portal-profile-dialog { font-size: 13px; }
#portal-profile-dialog :is(form, nav, section, fieldset, legend, div, p, label, input, select, button, output, small, span, a) {
  font-size: inherit;
}
#portal-profile-dialog #portal-profile-title { font-size: 1.2em; }
@media (max-width: 430px) { #portal-profile-dialog { font-size: 16px; } }

@media (prefers-reduced-motion: no-preference) {
  @supports (transition-behavior: allow-discrete) and (overlay: auto) {
    dialog {
      opacity: 0;
      translate: 0 9px;
      scale: .98;
      transition: opacity 135ms ease, translate 160ms ease, scale 160ms ease,
        display 160ms allow-discrete, overlay 160ms allow-discrete;
    }
    dialog:modal { opacity: 1; translate: 0 0; scale: 1; }
    dialog:not([open]) { pointer-events: none; }
    dialog::backdrop {
      opacity: 0;
      transition: opacity 150ms ease, display 160ms allow-discrete, overlay 160ms allow-discrete;
    }
    dialog:modal::backdrop { opacity: 1; }
    @starting-style {
      dialog:modal { opacity: 0; translate: 0 12px; scale: .98; }
      dialog:modal::backdrop { opacity: 0; }
    }
  }
  @supports not ((transition-behavior: allow-discrete) and (overlay: auto)) {
    dialog:modal { animation: portal-dialog-enter 160ms ease-out; }
    dialog[data-portal-exiting] { pointer-events: none; }
    dialog[data-portal-exiting]::backdrop { animation: portal-backdrop-exit 140ms ease-in both; }
    @keyframes portal-backdrop-exit { to { opacity: 0; } }
    @keyframes portal-dialog-enter {
      from { opacity: 0; transform: translateY(12px) scale(.98); }
    }
  }
}

html:has(.portal-photo-viewer[open]) { overflow: hidden; }
dialog.portal-photo-viewer {
  --photo-arrow-size: 44px;
  --photo-arrow-gap: 8px;
  --photo-gutter: 12px;
  position: fixed;
  inset: 0;
  width: fit-content;
  min-width: min(180px, calc(100vw - 2 * var(--photo-gutter)));
  max-width: min(1400px, calc(100vw - 2 * var(--photo-gutter)));
  height: fit-content;
  max-height: calc(100dvh - 12px);
  margin: auto;
  padding: 0;
  border: 0;
  overflow: visible;
  background: #171b1e;
  color: #fff;
}
.portal-photo-viewer:has(> :is(.portal-photo-prev, .portal-photo-next):not([hidden])) {
  --photo-gutter: calc(var(--photo-arrow-size) + var(--photo-arrow-gap) + 6px);
}
.portal-photo-viewer::backdrop { background: rgb(12 17 20 / 85%); }
.portal-photo-viewer [hidden], .portal-photo-viewer img:not([src]) { display: none; }
.portal-photo-tools {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 4px;
}
.portal-photo-viewer :is(button, .portal-photo-tools a:any-link):not([hidden]) {
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 32px;
  min-height: 36px;
  padding: 0 6px;
  border: 1px solid #fff6;
  border-radius: 4px;
  background: #22282b;
  color: #fff;
  font: 18px/1 Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.portal-photo-viewer .portal-photo-tools a:any-link { font-size: 14px; }
.portal-photo-viewer :is(button, .portal-photo-tools a):hover { background: #363f43; }
.portal-photo-viewer button:disabled { opacity: .45; cursor: default; }
.portal-photo-viewer :is(button, a):focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.portal-photo-viewport { overflow: hidden; margin-inline: auto; max-width: 100%; width: fit-content; }
.portal-photo-viewport img {
  display: block;
  max-width: min(1400px, calc(100vw - 2 * var(--photo-gutter)));
  max-height: calc(100dvh - 88px - var(--photo-caption-space, 0px) - var(--photo-album-space, 0px));
  object-fit: contain;
  touch-action: pan-y;
}
.portal-photo-viewport.is-zoomed { overflow: auto; }
.portal-photo-viewport.is-zoomed img { max-width: none; max-height: none; touch-action: auto; }
.portal-photo-viewer > :is(.portal-photo-prev, .portal-photo-next) {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--photo-arrow-size);
  height: var(--photo-arrow-size);
  border-radius: 50%;
  font-size: 27px;
}
.portal-photo-prev { right: calc(100% + var(--photo-arrow-gap)); }
.portal-photo-next { left: calc(100% + var(--photo-arrow-gap)); }
@media (max-width: 480px) {
  dialog.portal-photo-viewer { --photo-arrow-size: 40px; --photo-arrow-gap: 4px; }
}
