.account-main {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 64px 0 112px;
}

.account-intro {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  padding: 18px 0 54px;
  border-bottom: 1px solid var(--line);
}

.account-intro .eyebrow {
  margin: 0 0 9px;
}

.account-intro h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(42px, 5vw, 62px);
  line-height: 1;
  letter-spacing: -.055em;
}

.account-intro div > p {
  margin: 18px 0 3px;
  color: var(--muted);
  font-size: 16px;
}

.login-section {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 72px;
  margin-top: 36px;
  padding: 46px;
  background: var(--warm);
  border: 1px solid var(--line);
}

.login-copy,
.login-form,
.login-row,
.login-row input,
.account-dashboard,
.dashboard-layout > *,
.sub-url-content {
  min-width: 0;
}

.login-copy .eyebrow {
  margin: 0 0 18px;
}

.login-copy h2 {
  max-width: 390px;
  margin: 0 0 16px;
  font-size: clamp(29px, 3vw, 39px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.login-copy > p:last-child {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.login-form {
  align-self: center;
}

.login-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
}

.login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.sub-input,
.promo-input {
  width: 100%;
  min-height: 54px;
  padding: 0 17px;
  border: 1px solid rgba(17, 19, 17, .28);
  border-radius: 3px;
  background: rgba(255, 255, 255, .42);
  color: var(--ink);
  font: 12px "PT Mono", monospace;
  outline: none;
}

.sub-input:focus,
.promo-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.login-button {
  min-height: 54px;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

.login-button:disabled,
.plan-btn:disabled,
.promo-btn:disabled,
.danger-btn:disabled {
  cursor: wait;
  opacity: .55;
}

.field-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.hidden,
[hidden] {
  display: none !important;
}

.account-dashboard {
  padding-top: 36px;
}

.account-overview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 8px 0 28px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.profile-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--acid);
  font-size: 21px;
  font-weight: 800;
}

.profile-caption,
.panel-index {
  margin: 0 0 7px;
  color: var(--muted);
  font: 10px "PT Mono", monospace;
  letter-spacing: .11em;
}

.profile-name {
  margin: 0;
  overflow: hidden;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -.045em;
  text-overflow: ellipsis;
}

.profile-uname {
  margin: 7px 0 0;
  color: var(--muted);
  font: 10px "PT Mono", monospace;
}

.overview-actions {
  display: flex;
  align-items: center;
  gap: 17px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid currentColor;
  border-radius: 99px;
  font: 10px "PT Mono", monospace;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.badge-active {
  border-color: rgba(48, 111, 61, .28);
  background: #e5f2df;
  color: #275d32;
}

.badge-expired {
  border-color: rgba(145, 55, 39, .25);
  background: #f4dfd8;
  color: #8d392a;
}

.badge-none {
  border-color: var(--line);
  color: var(--muted);
}

.logout {
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 700 12px Manrope, sans-serif;
  cursor: pointer;
}

.sub-stats {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  border: 1px solid var(--line);
}

.sub-stat {
  min-width: 0;
  padding: 25px 27px;
  border-right: 1px solid var(--line);
}

.sub-stat:last-child {
  border-right: 0;
}

.sub-stat-label {
  color: var(--muted);
  font: 10px "PT Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sub-stat-val {
  margin-top: 10px;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -.035em;
}

.no-sub {
  padding: 26px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.sub-url-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-top: 12px;
  padding: 24px 27px;
  background: var(--dark);
  color: var(--white);
}

.sub-url-label {
  display: block;
  margin-bottom: 8px;
  color: #9ba49c;
  font: 9px "PT Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sub-url-text {
  display: block;
  overflow: hidden;
  color: #dce1dc;
  font: 11px "PT Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-url-copy {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, .3);
  background: transparent;
  color: #fff;
  font: 700 11px Manrope, sans-serif;
  cursor: pointer;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: 14px;
  margin-top: 14px;
}

.account-panel {
  min-width: 0;
  padding: 30px;
  border: 1px solid var(--line);
  background: rgba(243, 241, 233, .68);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  min-height: 75px;
  margin-bottom: 24px;
}

.panel-head h2,
.account-promo h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -.04em;
}

.panel-head > p {
  max-width: 210px;
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px;
}

.plan-tile {
  display: flex;
  min-height: 218px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.plan-tile.featured {
  background: var(--dark);
  color: var(--white);
}

.plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.plan-name {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.plan-badge {
  padding: 4px 6px;
  background: var(--acid);
  color: var(--ink);
  font: 8px "PT Mono", monospace;
  text-transform: uppercase;
}

.plan-price {
  margin: auto 0 20px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.055em;
}

.plan-btn {
  width: 100%;
  min-height: 41px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font: 700 12px Manrope, sans-serif;
  cursor: pointer;
}

.featured .plan-btn {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--ink);
}

.device-summary {
  padding-bottom: 22px;
}

.device-summary-top,
.device-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.device-summary-top {
  align-items: flex-end;
}

.device-limit-label,
.device-meta,
.device-last-seen {
  color: var(--muted);
  font-size: 10px;
}

.device-count {
  display: block;
  height: auto;
  margin-top: 3px;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.device-count small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.device-bar {
  height: 4px;
  margin-top: 13px;
  overflow: hidden;
  background: #d8d7d0;
}

.device-bar-fill {
  height: 100%;
  background: var(--ink);
}

.devices-list {
  border-top: 1px solid var(--line);
}

.device-row {
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.device-name {
  font-size: 13px;
  font-weight: 700;
}

.device-meta {
  margin-top: 3px;
  font-family: "PT Mono", monospace;
}

.device-last-seen {
  flex: 0 0 auto;
  text-align: right;
}

.device-empty {
  padding: 19px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.danger-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(149, 54, 37, .3);
}

.danger-zone strong {
  color: #843124;
  font-size: 12px;
}

.danger-zone p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.danger-btn {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #9d4939;
  background: transparent;
  color: #843124;
  font: 700 10px Manrope, sans-serif;
  cursor: pointer;
}

.account-promo {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(210px, .7fr) minmax(0, 1.3fr);
  gap: 40px;
  align-items: center;
}

.promo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.promo-input {
  min-width: 0;
  min-height: 48px;
}

.promo-btn {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  background: var(--ink);
  color: #fff;
  font: 700 12px Manrope, sans-serif;
  cursor: pointer;
}

.payment-status {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  font-size: 12px;
}

.payment-status.visible {
  display: flex;
}

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: account-spin .8s linear infinite;
}

.payment-msg.success {
  color: #275d32;
}

.payment-msg.error {
  color: #8d392a;
}

.msg {
  margin: 12px 0 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
}

.msg-ok {
  border-color: rgba(49, 115, 62, .25);
  background: #e8f2e3;
  color: #275d32;
}

.msg-err {
  border-color: rgba(145, 55, 39, .25);
  background: #f5e5df;
  color: #8d392a;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes account-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .account-main {
    padding-top: 46px;
  }

  .account-intro {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .login-section {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .account-main {
    width: min(100% - 32px, 1180px);
    padding: 36px 0 78px;
  }

  .account-intro {
    padding: 8px 0 36px;
  }

  .account-intro div > p {
    font-size: 14px;
  }

  .login-section {
    margin-top: 22px;
    padding: 27px 22px;
  }

  .login-row,
  .sub-stats,
  .sub-url-box,
  .account-promo,
  .promo-row,
  .danger-zone {
    grid-template-columns: 1fr;
  }

  .login-button,
  .sub-url-copy,
  .promo-btn,
  .danger-btn {
    width: 100%;
  }

  .account-overview {
    align-items: flex-start;
  }

  .profile-avatar {
    width: 42px;
    height: 42px;
    font-size: 17px;
  }

  .overview-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .sub-stat {
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sub-stat:last-child {
    border-bottom: 0;
  }

  .sub-url-box {
    gap: 17px;
    padding: 22px;
  }

  .sub-url-text {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .account-panel {
    padding: 23px 20px;
  }

  .panel-head {
    display: block;
    min-height: 0;
  }

  .panel-head > p {
    margin-top: 10px;
  }

  .plans {
    grid-template-columns: 1fr;
  }

  .plan-tile {
    min-height: 185px;
  }

  .account-promo {
    gap: 23px;
  }

  .danger-zone {
    gap: 14px;
  }
}
