:root {
  --account-ink: #173f3a;
  --account-surface: #e6f4ef;
  --account-accent: #a6443b;
  --account-border: rgba(23, 63, 58, 0.24);
}

.home-account-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  margin: 0 0 28px;
  border-radius: 8px;
  background: var(--account-ink);
  color: #fffdf8;
  padding: 16px clamp(14px, 3vw, 22px);
  box-shadow: 0 12px 28px rgba(23, 63, 58, 0.18);
}

.home-account-brief__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.home-account-brief__eyebrow,
.home-account-brief h3,
.home-account-brief p {
  margin: 0;
}

.home-account-brief__eyebrow {
  color: #b8dfd2;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}

.home-account-brief h3 {
  font-size: 1.06rem;
}

.home-account-brief__copy > p:last-child {
  color: rgba(255, 253, 248, 0.76);
  font-size: 0.86rem;
  line-height: 1.5;
}

.home-account-brief__quota {
  display: grid;
  gap: 1px;
  min-width: 112px;
  border-left: 1px solid rgba(255, 255, 255, 0.34);
  padding-left: 16px;
}

.home-account-brief__quota[hidden] {
  display: none;
}

.home-account-brief__quota span {
  color: rgba(255, 253, 248, 0.72);
  font-size: 0.74rem;
}

.home-account-brief__quota strong {
  font-size: 1.04rem;
}

.home-account-brief .button {
  border-color: rgba(255, 255, 255, 0.7);
  background: #fffdf8;
  color: var(--account-ink);
  white-space: nowrap;
}

#panel-settings > .account-section {
  scroll-margin-top: 96px;
  border: 0;
  border-top: 8px solid var(--account-ink);
  border-radius: 8px;
  background: var(--account-surface);
  box-shadow: 0 12px 30px rgba(23, 63, 58, 0.1);
  padding: clamp(18px, 4vw, 28px);
}

#panel-settings > .account-section:focus-visible {
  outline: 3px solid var(--account-accent);
  outline-offset: 3px;
}

.account-section__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.account-section__heading > div {
  display: grid;
  gap: 5px;
}

.account-section__eyebrow,
.account-section__heading h3,
.account-section__heading p {
  margin: 0;
}

.account-section .account-section__eyebrow {
  color: var(--account-ink);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}

.account-section__heading h3 {
  color: var(--account-ink);
  font-size: clamp(1.25rem, 4vw, 1.65rem);
}

.account-section__plan-badge {
  flex: 0 0 auto;
  border: 1px solid var(--account-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--account-ink);
  padding: 6px 11px;
  font-size: 0.78rem;
  font-weight: 900;
}

.account-section .account-api-state {
  margin: 16px 0 0;
  border-left: 4px solid var(--account-ink);
  background: rgba(255, 255, 255, 0.68);
  color: var(--account-ink);
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 750;
}

.account-section .account-api-state[data-tone="success"] {
  border-left-color: #24704f;
}

.account-section .account-api-state[data-tone="warning"] {
  border-left-color: #9b6724;
}

.account-section .account-api-state[data-tone="error"] {
  border-left-color: var(--account-accent);
  color: #7d2c25;
}

.account-signed-out,
.account-signed-in {
  margin-top: 18px;
}

.account-signed-out[hidden],
.account-signed-in[hidden],
.account-form[hidden],
.account-welcome[hidden],
.account-auth-switch[hidden],
.account-plans[hidden] {
  display: none;
}

.account-welcome {
  display: grid;
  gap: 7px;
  border-bottom: 1px solid var(--account-border);
  padding-bottom: 16px;
}

.account-welcome p {
  margin: 0;
}

.account-welcome .account-welcome__lead {
  color: var(--account-ink);
  font-size: 1.16rem;
  font-weight: 900;
}

.account-welcome .account-welcome__aside {
  color: var(--account-accent);
  font-weight: 800;
}

.account-auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 440px;
  margin-top: 18px;
  border: 1px solid var(--account-border);
  border-radius: 8px;
  overflow: hidden;
}

.account-auth-switch__button {
  min-height: 44px;
  border: 0;
  background: rgba(255, 255, 255, 0.65);
  color: var(--account-ink);
  padding: 9px 14px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.account-auth-switch__button + .account-auth-switch__button {
  border-left: 1px solid var(--account-border);
}

.account-auth-switch__button.is-active {
  background: var(--account-ink);
  color: #fff;
}

.account-auth-switch__button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--account-accent);
  outline-offset: -3px;
}

.account-form {
  margin-top: 18px;
}

.account-form--standalone {
  border: 1px solid var(--account-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.54);
  padding: 18px;
}

.account-form__intro {
  margin-bottom: 16px;
}

.account-form__intro p,
.account-form__intro h4 {
  margin: 0;
}

.account-form__intro h4 {
  margin-top: 4px;
  color: var(--account-ink);
  font-size: 1.18rem;
}

.account-form__intro h4 + p {
  margin-top: 7px;
  color: var(--color-muted);
}

.account-form__eyebrow {
  color: var(--account-accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.account-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.account-form label {
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--account-ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.account-form__wide {
  grid-column: 1 / -1;
}

.account-form input {
  width: 100%;
  height: 46px;
  min-height: 46px;
  border: 1px solid var(--account-border);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  padding: 10px 12px;
  font: inherit;
}

.account-form input:focus-visible {
  outline: 3px solid var(--account-accent);
  outline-offset: 2px;
}

.account-form small {
  color: var(--color-muted);
  font-weight: 600;
}

.account-form .button {
  margin-top: 16px;
  background: var(--account-ink);
  border-color: var(--account-ink);
}

.account-link-button {
  display: block;
  min-height: 44px;
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--account-ink);
  padding: 8px 2px;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.account-link-button:focus-visible {
  outline: 3px solid var(--account-accent);
  outline-offset: 2px;
}

.account-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.account-form__actions .button {
  margin-top: 0;
}

.account-form__actions .button--ghost {
  background: transparent;
  color: var(--account-ink);
}

.account-profile {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1.2fr);
  gap: 22px;
  border-block: 1px solid var(--account-border);
  padding-block: 18px;
}

.account-profile__label,
.account-profile__name,
.account-profile__email {
  margin: 0;
}

.account-profile__label {
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.account-profile__name {
  margin-top: 4px;
  color: var(--account-ink);
  font-size: 1.28rem;
  font-weight: 900;
}

.account-profile__email {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--color-muted);
  font-size: 0.84rem;
}

.account-profile__verify {
  display: inline-flex;
  width: fit-content;
  margin: 8px 0 0;
  border: 1px solid var(--account-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--account-ink);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 850;
}

.account-profile__verify[data-state="pending"] {
  border-color: rgba(166, 68, 59, 0.38);
  color: var(--account-accent);
}

.account-profile__usage {
  display: grid;
  gap: 8px;
  margin: 0;
}

.account-profile__usage > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(23, 63, 58, 0.14);
  padding-bottom: 7px;
}

.account-profile__usage > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.account-profile__usage dt {
  color: var(--color-muted);
  font-size: 0.82rem;
}

.account-profile__usage dd {
  margin: 0;
  color: var(--account-ink);
  font-weight: 900;
  text-align: right;
}

.account-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.account-plans {
  margin-top: 26px;
  border-top: 3px solid var(--account-ink);
  padding-top: 18px;
}

.account-plans__heading h4,
.account-plans__heading p {
  margin: 0;
}

.account-plans__heading h4 {
  color: var(--account-ink);
  font-size: 1.1rem;
}

.account-plans__heading p {
  margin-top: 4px;
}

.account-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.account-plan {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--account-border);
  border-top: 6px solid #6b746f;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 15px;
}

.account-plan[data-plan="plus"] {
  border-top-color: var(--account-accent);
}

.account-plan[data-plan="pro"] {
  border-top-color: #8c3127;
}

.account-plan[data-plan="business"] {
  border-top-color: #2f6472;
}

.account-plan.is-current {
  box-shadow: 0 0 0 3px rgba(23, 63, 58, 0.18);
}

.account-plan__label,
.account-plan__price,
.account-plan__note {
  margin: 0;
}

.account-plan__label {
  color: var(--account-ink);
  font-size: 1.02rem;
  font-weight: 900;
}

.account-plan__price {
  margin-top: 7px;
  color: var(--account-ink);
  font-size: 1.28rem;
  font-weight: 900;
}

.account-plan__price span {
  font-size: 0.76rem;
  font-weight: 700;
}

.account-plan__features {
  display: grid;
  gap: 7px;
  margin: 13px 0 16px;
  padding: 0;
  list-style: none;
}

.account-plan__features li {
  position: relative;
  padding-left: 17px;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.account-plan__features li::before {
  position: absolute;
  left: 0;
  content: "・";
  color: var(--account-ink);
  font-weight: 900;
}

.account-plan__note {
  margin-top: auto;
  color: var(--color-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.account-plan .button {
  width: 100%;
  margin-top: 12px;
  border-color: var(--account-ink);
  color: var(--account-ink);
}

.account-plan[data-plan="plus"] .button:not(:disabled),
.account-plan[data-plan="pro"] .button:not(:disabled),
.account-plan[data-plan="business"] .button:not(:disabled) {
  background: var(--account-ink);
  color: #fff;
}

.account-plan .button:disabled,
.account-actions .button:disabled,
.account-form .button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 860px) {
  .home-account-brief {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .home-account-brief .button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .account-plan-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .account-section__heading,
  .account-profile {
    grid-template-columns: 1fr;
  }

  .account-section__heading {
    display: grid;
  }

  .account-section__plan-badge {
    justify-self: start;
  }

  .account-form__grid {
    grid-template-columns: 1fr;
  }

  .account-form__wide {
    grid-column: auto;
  }

  .account-profile__usage {
    border-top: 1px solid var(--account-border);
    padding-top: 14px;
  }
}

@media (max-width: 520px) {
  .home-account-brief {
    grid-template-columns: 1fr;
  }

  .home-account-brief__quota {
    border-top: 1px solid rgba(255, 255, 255, 0.34);
    border-left: 0;
    padding-top: 10px;
    padding-left: 0;
  }

  .home-account-brief .button {
    grid-column: auto;
  }

  .account-auth-switch {
    max-width: none;
  }

  .account-actions .button {
    width: 100%;
  }

  .account-form__actions .button {
    width: 100%;
  }
}
