.site-header .account-trigger {
  display: grid;
  flex: none;
  padding: 0;
  border: 0;
}

.screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.workspace-actions, .account-buttons, .account-tabs, .checklist-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.workspace-actions { justify-content: center; margin: -4px 0 12px; }

.workspace-button {
  display: inline-grid;
  min-height: 34px;
  align-content: center;
  padding: 5px 13px;
  border: 1px solid var(--moss);
  border-radius: 99px;
  background: var(--analysis-paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.workspace-button:hover { background: var(--wash); }
.workspace-button[aria-current="true"], .workspace-button[aria-expanded="true"] {
  border-color: var(--button);
  background: var(--button);
  color: var(--on-button);
}

.checklist {
  margin-bottom: 14px;
  padding: 9px 13px 10px;
  border: 1px solid color-mix(in srgb, var(--moss), transparent 50%);
  border-radius: 13px;
  background: var(--analysis-paper);
  text-align: left;
}

.checklist-table, .history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.checklist-table :is(th, td), .history-table :is(th, td) {
  padding: 6px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--moss), transparent 62%);
  text-align: center;
  overflow-wrap: anywhere;
}

.checklist-table :is(th, td):first-child, .history-table :is(th, td):first-child { width: 33%; text-align: left; }
.checklist-table [data-delta="below"], .history-table [data-delta="below"] { color: var(--error); }
.checklist-table [data-delta="exact"], .history-table [data-delta="exact"] { font-weight: 700; }

.checklist input, .account-form input {
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--moss);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}

.checklist input[type="number"] { width: 67px; text-align: center; }
.checklist-controls { margin-top: 9px; }
.checklist-controls input { flex: 1 1 140px; }
.checklist-controls .text-action { margin-top: 0; }

.workspace-message { margin: 7px 0 0; font-size: 13px; }
.workspace-message:empty { display: none; }
.workspace-message[data-error] { color: var(--error); }
.results .workspace-message { font-size: 13px; }
.save-result { min-height: 38px; margin-top: 12px; font-size: 13px; }

.account-dialog {
  width: min(660px, calc(100% - 24px));
  max-height: min(86svh, 840px);
  padding: clamp(14px, 3vw, 25px);
  border: 1px solid var(--moss);
  border-radius: 22px;
  background: var(--analysis-paper);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 14px;
}

.account-dialog::backdrop { background: #152313a8; }
.account-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.account-header h2 { font: 400 32px/1.1 var(--heading-font); text-transform: uppercase; }
.account-header form { margin: 0; }
.account-header .workspace-button { font-size: 22px; line-height: 1; }
.account-name { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.account-tabs { margin: 14px 0; }
.account-buttons .action { min-height: 36px; }
.account-dialog #account-message:not(:empty) { margin: 0 0 11px; }
.account-dialog #account-secure-link { margin-top: 10px; }

.account-form {
  display: grid;
  max-width: 430px;
  gap: 7px;
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 13px;
  background: var(--card);
}

.account-form label { font-weight: 700; }
.account-form .account-buttons { margin-top: 5px; }
.form-hint { font-size: 12px; line-height: 1.4; }
.sharing-options { display: flex; flex-wrap: wrap; gap: 7px 15px; margin: 4px 0 8px; }
.sharing-options legend { margin-bottom: 8px; font-weight: 700; }
.sharing-options label { display: flex; align-items: center; min-height: 34px; gap: 5px; }
.sharing-options input { accent-color: var(--button); }
.password-settings { margin: 15px 0; }
.password-settings summary { width: fit-content; padding: 4px 3px; cursor: pointer; font-weight: 700; }
.history-actions { margin-bottom: 11px; }
.history-list { display: grid; gap: 10px; }
.history-entry { padding: 10px; border-radius: 13px; background: var(--card); }
.history-entry summary { display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; }
.history-entry summary::-webkit-details-marker { display: none; }
.history-entry summary::after { margin-left: auto; content: "+"; font-size: 18px; }
.history-entry[open] summary::after { content: "−"; }
.history-entry img { width: 68px; height: 52px; border-radius: 7px; object-fit: cover; background: var(--analysis-paper); }
.history-entry strong, .history-entry time { display: block; overflow-wrap: anywhere; }
.history-entry time { margin-top: 4px; font-size: 12px; }
.history-entry .history-table { margin: 8px 0; }
.history-entry .account-buttons { margin-top: 10px; }
.history-entry button[data-delete] { color: var(--error); }

@media (max-width: 720px) {
  .workspace-button, .account-buttons .action, .save-result { min-height: 42px; }
  .account-dialog input { font-size: 16px; }
  .account-dialog { max-height: 90svh; }
}

@media (max-width: 380px) {
  .site-header .account-trigger { display: grid; }
  .site-header .main-link { gap: 4px; padding-inline: 5px; }
  .site-header .main-link .home-icon { display: none; }
  .checklist { padding-inline: 8px; }
}
