.chrome {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.topbar {
  --chrome-row: 2.25rem;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  height: var(--chrome-row);
}
.chrome .brand {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
  height: 100%;
  font-size: 1.35rem;
  line-height: 1.2;
  padding: 0.350rem 0 0;
}
.account-bar {
  margin-left: auto;
  min-width: 0;
  text-align: right;
  display: flex;
  align-items: stretch;
  height: 100%;
}
.account-status, .context-sentence { margin: 0; }
.account-status {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: stretch;
  gap: 0.35rem 0.7rem;
  height: 100%;
  width: 100%;
}
.account-status > button:not(.menu-toggle) {
  width: auto;
  display: inline-flex;
  align-items: flex-start;
  box-sizing: border-box;
  height: 100%;
  padding: 0.40rem 0 0;
}
.account-name {
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
  height: 100%;
  max-width: min(14rem, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
  padding: 0.5rem 0 0;
}
.account-links {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: stretch;
  gap: 0.35rem 0.7rem;
  height: 100%;
}
.account-links a,
.account-links button {
  display: inline-flex;
  align-items: flex-start;
  box-sizing: border-box;
  height: 100%;
  padding: 0.40rem 0 0;
}
.menu-toggle,
.account-status .menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--chrome-row);
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--brand);
  border-radius: 1px;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before,
.menu-toggle[aria-expanded="true"] .menu-icon::after { top: 0; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: rotate(-45deg); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.account-menu { list-style: none; margin: 0; padding: 0; }
.account-menu-identity {
  display: none;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}
.account-menu a, .account-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
@media (max-width: 550px) {
  .account-links { display: none; }
  .account-status:has(.account-links) { flex-wrap: nowrap; }
  .account-status:has(.account-links) .menu-toggle { display: inline-flex; }
}
@media (max-width: 419px) {
  .account-name { display: none; }
  .account-menu-identity { display: block; }
}
.context-bar {
  display: block;
  width: 100%;
  max-width: 48rem;
  margin: 0.85rem auto 0;
  padding: 0 1.25rem;
  text-align: center;
  background: none;
  border: 0;
}
.context-sentence { text-align: center; }
.context-sentence .sentence { display: inline-block; max-width: 100%; }
#context-bar[hidden], .needs-signin[hidden] { display: none !important; }
.account-status a, .account-status button:not(.menu-toggle),
.context-sentence a, .context-sentence button, button.linkish {
  color: var(--brand);
  font-weight: 600;
}
button.linkish, .portal-panel button.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.account-status button:not(.menu-toggle) {
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
body.portal-open {
  height: 100vh;
  height: 100dvh;
  height: 100svh;
  overflow: hidden;
}
body.portal-open #main,
body.portal-open #context-bar { display: none; }
body.portal-open #portal {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  width: 100%;
}
body.portal-open.location-open #context-bar,
body.portal-open.listing-open #context-bar { display: block; }
.portal-back-row {
  margin: 0 0 0.65rem;
  margin-left: calc(50% - 50vw + 20px);
  width: max-content;
  max-width: calc(100vw - 40px);
}
.device-place { margin: 0.35rem 0 0; }
.portal-panel a.linkish {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
}
.portal-panel a.portal-back {
  font-size: 0.8125rem;
}
#portal { max-width: 40rem; margin: 0 auto; padding: 1.25rem; }
#portal[hidden] { display: none !important; }
.portal-panel h2 { font-family: var(--display); margin-top: 0; }
.portal-reading { overflow: visible; }
.portal-reading h2, .portal-reading h3 { font-size: 1rem; margin: 0.85rem 0 calc(0.25rem - 5px); }
.portal-reading .tier-list { margin: 0.2rem 0 0.6rem; padding-left: 1.15rem; }
.portal-panel fieldset { border: 0; margin: 0.75rem 0; padding: 0; }
.portal-panel fieldset label.check { font-size: 0.95rem; }
.portal-panel label { display: block; margin: 0.75rem 0; }
.portal-panel [hidden] { display: none !important; }
.portal-panel label.check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.portal-panel label.check input {
  display: inline-block;
  width: auto;
  margin: 0.15rem 0 0;
  padding: 0;
  flex: 0 0 auto;
}
.portal-panel input:not([type="checkbox"]), .portal-panel select, .portal-panel textarea {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}
.place-list { list-style: none; padding: 0; margin: 0.75rem 0 0; }
.place-list button {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.4rem;
  font: inherit;
  cursor: pointer;
}
.place-list button:hover { border-color: var(--brand); }
.portal-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }
.portal-error { color: #8a2b12; }
.portal-ok { color: var(--trust-platform); }
