.account-open { max-width: min(240px, 32vw); min-width: 0; min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); padding: 8px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-size: 13px; }
.account-open:hover { background: var(--hover); }
.account-open.account-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 2px 8px -5px rgba(31, 29, 26, 0.3);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.account-open.account-icon:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
}
.account-open.account-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.account-open.account-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account-dot {
  display: none;
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--panel);
}
.account-icon.is-unverified .account-dot { display: block; }
.account-dialog { color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; width: min(460px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; overflow: auto; box-shadow: 0 24px 80px #0003; }
.account-dialog::backdrop { background: #0007; }
.account-card { padding: 26px; overflow-wrap: anywhere; }
.account-card header { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.account-card h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0; flex: 1; }
.account-card button { cursor: pointer; }
.account-close { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-size: 25px; }
.account-close:hover { background: var(--hover); }
.account-intro { color: var(--ink-2); font-size: 14px; margin: 0 0 20px; }
.account-form { display: grid; gap: 16px; }
.account-field { display: grid; gap: 7px; font-size: 14px; }
.account-field input { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); color: var(--ink); }
.account-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-password-hint { color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.account-primary { width: 100%; min-height: 46px; padding: 10px 16px; border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent); }
.account-card button:disabled { opacity: .6; cursor: wait; }
.account-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 14px; }
.account-links button, .account-content > button, .history-claim { min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: var(--accent); text-align: left; }
.account-content > a { display: block; width: fit-content; min-height: 44px; padding: 8px 0; color: var(--accent); }
.account-content > .account-primary { color: var(--on-accent); background: var(--accent); padding: 10px 16px; text-align: center; margin-top: 12px; }
.account-notice, .account-error { font-size: 14px; margin: 12px 0 0; }
.account-notice:empty, .account-error:empty { display: none; }
.account-notice { color: var(--ink-2); }
.account-error { color: #a32323; }
body[data-presence="asleep"] .account-error { color: #ffb3a8; }
.account-claim-preview { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 14px; background: var(--side); border: 1px solid var(--line); border-radius: 9px; }
.account-claim-preview > div { display: grid; gap: 4px; min-width: 0; }
.account-claim-preview dt { color: var(--ink-2); font-size: 12px; }
.account-claim-preview dd { min-width: 0; margin: 0; overflow-wrap: anywhere; word-break: normal; }
.account-gate-actions { display: grid; gap: 10px; margin-top: 18px; }
.account-gate-actions button, .account-gate-actions a { display: block; width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); color: var(--ink); text-decoration: none; text-align: center; }
.account-gate-actions .account-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.account-gate-note { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.history-claim { font-size: 12px; min-height: 36px; padding: 4px 8px; }
.history-claim-one {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  margin: 2px 0 4px 10px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 4%, var(--panel));
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.history-claim-one:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}
.history-claim-one:disabled { opacity: 0.55; cursor: wait; }
.history-claim-more {
  display: block;
  width: 100%;
  min-height: 32px;
  color: var(--accent);
  font-size: 11.5px;
}
.hist .thread { min-width: 0; }
.account-label { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.account-logout-warning { font-size: 13px; color: var(--ink-2); padding-top: 14px; border-top: 1px solid var(--line); margin-top: 14px; }
.account-logout-banner { position: fixed; z-index: 120; bottom: 14px; left: 14px; right: 14px; margin: 0 auto; max-width: 740px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 14px 18px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--ink); box-shadow: 0 8px 32px #0002; font-size: 13px; }
.account-logout-banner span { flex: 1 1 320px; }
.account-logout-banner button { min-height: 44px; background: transparent; color: var(--accent); border: 0; cursor: pointer; }
@media (max-width: 640px) {
  .account-card { padding: 20px; }
  .account-open { max-width: 124px; font-size: 12px; padding-inline: 6px; }
  .account-open.account-icon {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
  }
  .account-open.account-icon svg { width: 16px; height: 16px; }
  .top .title { min-width: 0; }
  .account-dialog { max-height: calc(100dvh - 20px); }
  .account-field input { font-size: 16px; }
}
/* Account dossier: warm paper, one editorial accent, quiet rows. */
.account-dialog {
  width: min(478px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 30px 90px -24px rgba(31, 29, 26, 0.45), 0 4px 18px -10px rgba(31, 29, 26, 0.2);
}
.account-dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 24%, transparent);
  backdrop-filter: blur(3px);
}
.account-card { padding: 24px 28px 26px; }
.account-card::before {
  content: "";
  display: block;
  width: 30px;
  height: 3px;
  margin: 0 0 17px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.82;
}
.account-card header { align-items: flex-start; gap: 13px; margin-bottom: 16px; }
.account-card h2 {
  margin: 2px 0 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.02em;
}
.account-seal {
  display: grid;
  flex: none;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 7%, var(--side));
  color: var(--accent);
}
.account-seal svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
  stroke: none;
}
.account-profile-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account-close {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  margin-left: auto;
  padding: 0;
  border-radius: 50%;
  color: var(--faint);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}
.account-close:hover { color: var(--ink); background: var(--hover); }
.account-intro {
  max-width: 39ch;
  margin: 0 0 20px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.75;
  text-wrap: pretty;
  white-space: pre-line;
}
.account-intro[hidden] { display: none; }

.account-form { gap: 15px; }
.account-field { gap: 7px; }
.account-field > span {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.account-field input {
  min-height: 45px;
  padding: 10px 12px;
  border-color: var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--side) 48%, var(--panel));
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.account-field input:hover { border-color: var(--line-2); }
.account-field input:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line-2));
  background: var(--panel);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 9%, transparent);
}
.account-primary {
  min-height: 45px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 22px -14px color-mix(in srgb, var(--accent) 80%, transparent);
}
.account-primary:hover { filter: brightness(1.04); }
.account-links {
  gap: 4px 16px;
  margin-top: 16px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.account-links:empty { display: none; }
.account-links button {
  min-height: 38px;
  padding: 6px 0;
  color: var(--accent);
  font-size: 12.5px;
}
.account-notice, .account-error { font-size: 13px; line-height: 1.65; }

.account-profile {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 5%, var(--side)), var(--panel) 70%);
}
.account-profile-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 41px;
  height: 41px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink-2);
}
.account-profile-body { display: grid; min-width: 0; gap: 2px; }
.account-profile-label {
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.account-profile-email {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.account-profile-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.5;
}
.account-profile-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
}
.account-profile-status.is-verified::before { background: #65916a; }
.account-profile-status.is-pending {
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
  color: var(--accent);
}
.account-profile-status.is-pending::before { background: var(--accent); }

.account-action-list {
  display: grid;
  margin: 0 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.account-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-action:last-child { border-bottom: 0; }
.account-action-main { display: grid; min-width: 0; gap: 2px; }
.account-action strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
}
.account-action small {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.account-action-arrow {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--faint);
  transition: color 0.15s, transform 0.15s;
}
.account-action-arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account-action:hover .account-action-main strong { color: var(--accent); }
.account-action:hover .account-action-arrow { color: var(--accent); transform: translateX(2px); }
.account-action:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}
.account-action.is-primary strong { color: var(--accent); }
.account-action.is-primary .account-action-arrow { color: var(--accent); }
.account-action-shell { position: relative; }
.account-action-shell .account-action-main { padding-right: 28px; }
.account-action-info {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 28px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: var(--hover);
  color: var(--ink-2);
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.account-action-info svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account-action-info:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--hover));
  color: var(--accent);
}
.account-action-info:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}
.account-help-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(84dvh, 760px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 30px 90px -24px rgba(31, 29, 26, 0.45), 0 4px 18px -10px rgba(31, 29, 26, 0.2);
}
.account-help-dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 28%, transparent);
  backdrop-filter: blur(3px);
}
.account-help-card {
  display: flex;
  flex-direction: column;
  max-height: min(84dvh, 760px);
  padding: 24px 26px 22px;
}
.account-help-card header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.account-help-card header > div { flex: 1; min-width: 0; }
.account-help-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.account-help-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
}
.account-help-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.account-help-close:hover { background: var(--hover); color: var(--ink); }
.account-help-body {
  min-height: 0;
  padding-right: 4px;
  overflow: auto;
}
.account-help-lead {
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 5%, var(--side));
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.75;
}
.account-help-section { margin: 0 0 17px; }
.account-help-section h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.account-help-section ol,
.account-help-section ul {
  margin: 0;
  padding-left: 19px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.8;
}
.account-help-section li { margin: 3px 0; padding-left: 2px; }
.account-help-section li::marker { color: var(--accent); }
.account-help-note {
  margin: 2px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.7;
}
@media (max-width: 560px) {
  .account-help-card { padding: 20px 18px 18px; }
  .account-help-card h2 { font-size: 21px; }
  .account-help-dialog { max-height: calc(100dvh - 20px); }
  .account-help-card { max-height: calc(100dvh - 20px); }
}
.account-action.is-busy { cursor: wait; }
.account-action.is-busy:disabled { opacity: 1; cursor: wait; }
.account-action.is-busy strong,
.account-action.is-busy small { color: var(--accent); }
.account-action.is-busy .account-action-arrow svg,
.account-action.is-done .account-action-arrow svg { display: none; }
.account-action.is-busy .account-action-arrow::after {
  width: 14px;
  height: 14px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-top-color: var(--accent);
  border-radius: 50%;
  content: "";
  animation: account-action-spin 0.8s linear infinite;
}
.account-action.is-busy .account-action-arrow:hover,
.account-action.is-busy:hover .account-action-arrow,
.account-action.is-done:hover .account-action-arrow { transform: none; }
.account-action.is-done { cursor: default; }
.account-action.is-done strong { color: var(--accent); }
.account-action.is-done .account-action-arrow { color: var(--accent); }
.account-action.is-done .account-action-arrow::after {
  content: "✓";
  font-size: 16px;
  font-weight: 600;
}
@keyframes account-action-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .account-action.is-busy .account-action-arrow::after { animation-duration: 1.6s; }
}

.account-danger { margin-top: 2px; }
.account-danger-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--side) 48%, var(--panel));
  color: #9b3d2e;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.account-danger-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account-danger-action:hover {
  border-color: color-mix(in srgb, #9b3d2e 28%, var(--line));
  background: color-mix(in srgb, #9b3d2e 4%, var(--panel));
  color: #7c2b1f;
}
.account-danger-action.is-confirm {
  border-color: color-mix(in srgb, #9b3d2e 34%, var(--line));
  background: color-mix(in srgb, #9b3d2e 7%, var(--panel));
}
.account-confirm-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 8px;
  margin-top: 20px;
}
.account-confirm-actions .account-danger-action { margin: 0; }
.account-secondary {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.account-secondary:hover {
  border-color: var(--line-2);
  background: var(--hover);
  color: var(--ink);
}
.account-secondary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 2px;
}
.account-danger-action:focus-visible {
  outline: 2px solid color-mix(in srgb, #9b3d2e 35%, transparent);
  outline-offset: 2px;
}
body[data-presence="asleep"] .account-danger-action {
  border-color: color-mix(in srgb, #e6a090 24%, var(--line));
  background: transparent;
  color: #e6a090;
}
body[data-presence="asleep"] .account-danger-action:hover {
  border-color: color-mix(in srgb, #e6a090 40%, var(--line));
  background: color-mix(in srgb, #e6a090 8%, var(--panel));
  color: #f2b7a8;
}
body[data-presence="asleep"] .account-danger-action.is-confirm {
  border-color: color-mix(in srgb, #e6a090 28%, var(--line));
  background: color-mix(in srgb, #e6a090 7%, var(--panel));
}

@media (max-width: 640px) {
  .account-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }
  .account-card { padding: 20px 19px 22px; }
  .account-card::before { margin-bottom: 14px; }
  .account-card header { gap: 11px; margin-bottom: 14px; }
  .account-card h2 { font-size: 23px; }
  .account-seal { width: 38px; height: 38px; }
  .account-seal svg { width: 19px; height: 19px; }
  .account-profile { padding: 13px; }
  .account-action { min-height: 57px; }
  .account-action small { font-size: 11px; }
  .account-intro { margin-bottom: 17px; }
}

@media (prefers-reduced-motion: reduce) { .account-dialog, .account-dialog * { transition: none !important; animation: none !important; } }
