/* Shared dimensions of the public masthead, account shells and legal footer. */
:root {
  --shell-max: 1680px;
  --edge: clamp(20px, 4.5vw, 76px);
  --mast-height: 86px;
  --button-height: 44px;
  --mast-control-height: var(--button-height);
  --mast-rule-width: 1px;
  --mast-row-start: calc((var(--mast-height) - var(--mast-control-height) - var(--mast-rule-width)) / 2);
}
@media (max-width: 1080px) { :root { --edge: clamp(18px, 4.2vw, 46px); } }
@media (max-width: 679px) { :root { --edge: clamp(16px, 4.2vw, 28px); } }
@media (max-width: 380px) { :root { --edge: 14px; } }
.auditor-frame {
  box-sizing: border-box;
  width: min(100%, var(--shell-max));
  padding-inline: var(--edge);
  margin-inline: auto;
}

.masthead {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 22px);
  min-height: var(--mast-height);
  border-bottom: var(--mast-rule-width) solid var(--rule);
}

.masthead .brand, .auditor-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: var(--mast-control-height);
  font: 700 20px/1 Manrope, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .09em;
  white-space: nowrap;
}

.masthead .brand-mark, .auditor-brand img {
  display: block;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: transparent;
}

.header-projects { display: contents; }

.header-divider {
  flex: 0 0 auto;
  margin-left: clamp(8px, 2.5vw, 40px);
  color: var(--strong-rule);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.project-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 0;
  font-size: .875rem;
}

.project-nav-label {
  color: var(--muted);
  white-space: nowrap;
}


.project-menu-item img {
  display: block;
  flex: 0 0 auto;
  height: auto;
  border-radius: 6px;
}


.project-menu-toggle {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: transparent;
  color: var(--body);
  cursor: pointer;
}

.project-menu-toggle svg,
.account-button svg {
  display: block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.project-menu-toggle:hover,
.project-menu-toggle[aria-expanded="true"] {
  border-color: var(--strong-rule);
  background: #ffffff66;
  color: var(--ink);
}


.project-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 16px 44px #1316191c;
}

.project-menu-heading {
  margin: 4px 10px 6px;
  color: var(--muted);
  font-size: .875rem;
}

.project-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 66px;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.project-menu-item:hover,
.project-menu-item:focus-visible { background: #ffffffa6; }

.project-menu-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  line-height: 1.35;
}

.project-menu-copy strong {
  color: var(--ink);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .035em;
}

.project-menu-copy > span {
  margin: 0;
  color: var(--muted, var(--body-quiet-color, currentColor));
  font-size: .8125rem;
}

.project-menu-current {
  align-self: flex-start;
  margin-top: 2px;
  color: var(--muted);
  font-size: .75rem;
}

.masthead .account-button {
  display: inline-flex;
  flex: 0 0 auto;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: var(--button-height);
  padding: 1px 15px;
  border: 1px solid var(--strong-rule);
  border-radius: 6px;
  background: #ffffff40;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
}

.masthead .account-button:hover {
  border-color: var(--ink);
  background: #ffffff8c;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 28px;
  padding-block: 17px 20px;
  border-top: 1px solid var(--rule, var(--hairline-color));
}

.site-footer.site-footer--quiet {
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 761px) {
  .site-footer--quiet { min-height: 82px; }
}

.footer-info {
  font: 400 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px clamp(16px, 2.3vw, 32px);
}

.footer-copyright {
  flex: 0 0 auto;
  color: var(--body, var(--body-fg, currentColor));
  font-size: .875rem;
}

.footer-description {
  margin: 0;
  color: var(--muted, var(--body-quiet-color, currentColor));
  font-size: .8125rem;
  line-height: 1.5;
}

.site-footer :is(.footer-consultation, .account-help) {
  display: inline-flex;
  inline-size: min(224px, 100%);
  justify-self: start;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--button-height);
  padding: 1px 15px;
  border: 1px solid #bcc2c6;
  border-radius: 6px;
  background: #dce0e2;
  color: #3c4246;
  font: 600 .875rem/1.3 var(--text);
  white-space: nowrap;
  opacity: 1;
}

.site-footer .footer-label-short { display: none; }

.site-footer :is(.footer-consultation, .account-help):hover:not(:disabled) {
  border-color: var(--strong-rule);
  background: #eef0f1;
  color: var(--ink);
}

/* Keep the action aligned with the copyright when the description wraps. */
.site-footer:has(> :is(.footer-consultation, .account-help):not([hidden])) {
  grid-template-columns: max-content minmax(0, 1fr) 224px;
  grid-template-areas: "copyright description action";
}
.site-footer:has(> :is(.footer-consultation, .account-help):not([hidden])) .footer-info { display: contents; }
.site-footer:has(> :is(.footer-consultation, .account-help):not([hidden])) .footer-copyright { grid-area: copyright; }
.site-footer:has(> :is(.footer-consultation, .account-help):not([hidden])) .footer-description { grid-area: description; }
.site-footer > :is(.footer-consultation, .account-help) { grid-area: action; justify-self: end; }

@media (max-width: 1000px) {
  .project-nav { gap: 9px; }
  .masthead { gap: 16px; }
}

@media (max-width: 760px) {
  :root { --mast-height: 76px; }
  .masthead { gap: 12px; }
  .masthead .account-button { width: var(--button-height); padding-inline: 11px; }
  .account-button-name { display: none; }
  .footer-info { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  :root { --mast-height: 70px; }
  .masthead { gap: 10px; }
  .masthead .brand, .auditor-brand { gap: 7px; font-size: 16px; letter-spacing: .045em; }
  .masthead .brand-mark, .auditor-brand img { width: 30px; height: 30px; }
  .project-nav { position: static; gap: 6px; }
  .project-menu { left: 0; max-width: min(320px, calc(100vw - 48px)); }
  .site-footer { grid-template-columns: minmax(0, 1fr); padding-block: 16px 18px; gap: 12px; }
}

@media (max-width: 760px) {
  .site-footer:has(> :is(.footer-consultation, .account-help):not([hidden])) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "copyright action" "description description";
    column-gap: 12px;
  }
  .site-footer > :is(.footer-consultation, .account-help) { inline-size: min(140px, 46vw); }
  .site-footer .footer-label-full { display: none; }
  .site-footer .footer-label-short { display: inline; }
}

@media (max-width: 420px) {
  .masthead .brand, .auditor-brand { gap: 6px; font-size: 14px; }
  .masthead .brand-mark, .auditor-brand img { width: 28px; height: 28px; }
  .masthead { gap: 6px; }
  .project-nav { gap: 4px; }
  .header-divider { font-size: 18px; }
}

@media (max-width: 380px) {
  .project-nav-label { display: none; }
}

.help-files { display: grid; gap: 6px; min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.help-files-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.help-file-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--strong-rule);
  border-radius: 5px;
  color: var(--link, var(--steel));
  font-size: 14px;
  font-weight: 600;
}
.help-file-picker:not(:has(input:disabled)):hover { background: var(--tint, #e4ebef); }
.help-file-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.help-file-picker:focus-within { outline: 2px solid var(--focus, var(--steel)); outline-offset: 3px; }
.help-files [data-help-files-clear] { min-height: 44px; padding: 4px 0; color: var(--link, var(--steel)); border: 0; background: transparent; font: inherit; font-size: 14px; cursor: pointer; }
.help-files [data-help-files-clear]:hover { text-decoration: underline; text-underline-offset: 3px; }
.help-files .help-files-hint { margin: 0; color: var(--muted); font-size: 13px; }
.help-files [data-help-files-error] { margin: 0; color: var(--brand, #a43c26); font-size: 14px; }
.help-files [hidden] { display: none !important; }
.help-files .help-files-summary { margin: 2px 0 0; color: var(--body, var(--ink)); font-size: 13px; font-weight: 600; }
.help-file-list { display: grid; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.help-file-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 44px;
  align-items: center;
  column-gap: 8px;
  padding-inline-start: 2px;
  border-top: 1px solid var(--rule);
}
.help-file-name { overflow-wrap: anywhere; }
.help-file-size { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.help-file-issue { grid-column: 1 / 3; padding-bottom: 6px; font-size: 13px; }
.help-file-list li[data-invalid] :is(.help-file-size, .help-file-issue) { color: var(--brand, #a43c26); }
.help-file-remove {
  position: relative;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--link, var(--steel));
  cursor: pointer;
}
.help-file-remove:not(:disabled):hover { background: var(--tint, #e4ebef); }
.help-file-remove::before, .help-file-remove::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}
.help-file-remove::after { transform: translate(-50%, -50%) rotate(-45deg); }
form:has([data-help-files][data-invalid]) button[type="submit"]:disabled {
  border-color: #c4cbcf;
  background: #dce1e3;
  color: #525e66;
  opacity: 1;
}
.help-attachment-list { display: grid; gap: 6px; padding-inline-start: 20px; margin-block: 8px 0; font-size: 14px; overflow-wrap: anywhere; }
.help-attachment-list a { color: var(--link, var(--steel)); text-decoration: underline; text-underline-offset: 3px; }
.help-attachment-list small { color: var(--muted); margin-inline-start: 8px; }

@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  button:is(.package-pay-action, #selection-pay):enabled:not([aria-disabled="true"], [aria-busy="true"]) {
    background-image: linear-gradient(105deg, transparent 42%, #2f5d7c21 50%, transparent 58%);
    background-repeat: no-repeat;
    background-size: 300% 100%;
    animation: action-sheen 8s linear infinite;
  }
}

@keyframes action-sheen {
  0%, 78% { background-position: 100% 50%; }
  94%, 100% { background-position: 0% 50%; }
}

.upload-progress:not([hidden]) {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  width: 100%;
  margin-block: 8px;
  color: var(--body, #394349);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.upload-progress progress {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 8px;
  accent-color: var(--steel, #2f5d7c);
}

.auditor-beta-label {
  flex: none;
  padding: 3px 7px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--muted);
  font: 600 12px/1.35 var(--text);
  white-space: nowrap;
}

.masthead:has(> .auditor-beta-label:not([hidden])) { column-gap: 16px; }

/* Other projects: preserve the shared shell and keep the request isolated. */
.project-menu-future { cursor: default; }
.project-menu-future .project-menu-copy { margin-left: 45px; }
.project-menu-future .project-menu-copy strong { color: var(--muted); }
.project-menu-future:hover { background: transparent; }
.project-beta-dialog {
  width: min(540px, calc(100% - 32px));
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px;
  background: #f4f6f7;
}
.project-beta-dialog h2 { font-size: clamp(25px, 3vw, 30px); }
.project-beta-dialog .project-beta-intro { margin: 18px 0 22px; }
.project-beta-form { display: grid; gap: 9px; }
.project-beta-form label { color: var(--ink); font-weight: 600; }
.project-beta-form label:not(:first-child) { margin-top: 9px; }
.project-beta-form input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 12px 13px;
  border: 1px solid #9cabb5;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: 400 16px/1.4 var(--text);
}
.project-beta-form input:focus-visible { border-color: var(--steel); outline-color: var(--steel); }
.project-beta-form .project-beta-feedback {
  margin: 3px 0;
  color: #9a2e27;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.project-beta-form .project-beta-feedback:empty { margin: 0; }
.project-beta-form .button { width: 100%; margin-top: 8px; }
.project-beta-dialog .project-beta-success { margin-bottom: 0; }
@media (max-width: 900px) {
  .header-projects .header-divider, .project-nav-label { display: none; }
  .project-nav { position: static; }
  .project-menu { left: auto; right: 0; max-width: calc(100vw - 2 * var(--edge)); }
  .masthead:has(.header-projects) { column-gap: 8px; }
}
@media (max-width: 560px) {
  .project-beta-dialog { width: calc(100% - 20px); max-height: calc(100svh - 20px); padding: 22px; }
}
@media (max-width: 380px) {
  .masthead:has(.header-projects) .brand-name { display: none; }
}

/* Anchor every project menu to its own trigger, including compact headers. */
.header-divider { margin-left: 0; }
.project-nav { position: relative; flex: none; }
.project-menu { top: calc(100% + 8px); right: auto; left: 0; max-width: calc(100vw - 28px); }
.account-header .project-nav-label { display: none; }
.account-header .project-menu { z-index: 45; }
@media (max-width: 560px) {
  .account-header-main:has(.project-nav) { column-gap: 4px; }
}
/* Preserve one-row client controls when the projects launcher is present. */
@media (max-width: 560px) {
  .account-view .account-header:has(.project-nav)[data-wallet-tight] .account-header-main { column-gap: 2px; }
  .account-view .account-header:has(.project-nav)[data-wallet-tight] .account-header-brand { gap: 2px; }
  .account-view .account-header:has(.project-nav)[data-wallet-tight] .account-wallet-toggle {
    width: 44px; min-width: 44px; padding: 0; font-size: 0; gap: 0;
  }
  .account-view .account-header:has(.project-nav)[data-wallet-tight] .account-wallet-toggle::after { display: none; }
  .account-view .account-header:has(.project-nav)[data-wallet-tight] .account-wallet-toggle::before {
    content: ""; width: 20px; height: 20px; background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M4 6h15v14H4zM4 6V3h13v3M15 11h6v5h-6z'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}

/* The beta request belongs to MEMO, even inside the AUDITOR shell. */
.project-beta-dialog[data-project="memo"] {
  --accent: #2f5d7c;
  --accent-dark: color-mix(in srgb, #2f5d7c 80%, #131619);
  --accent-soft: #e2eaf0;
  --brand-accent: #2f5d7c;
  --focus: #2f5d7c;
}

.project-beta-dialog[data-project="memo"] .button--accent:hover:not(:disabled) {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
}

/* Field profiles are local to the MEMO beta form. */
.project-beta-form .project-beta-field-hint,
.project-beta-form .project-beta-field-error { margin: 0; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.project-beta-form .project-beta-field-hint { color: var(--muted); }
.project-beta-form .project-beta-field-error { color: #9a2e27; }
.project-beta-form input[aria-invalid="true"] { border-color: #9a2e27; }
