.ptools-app-page {
  margin: 0;
  background: #f8fafc;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ptools-app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #dbeafe;
  background: #fff;
  padding: 0 20px;
}

.ptools-app-brand {
  color: #1d4ed8;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.ptools-app-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ptools-header-report {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border-radius: 10px;
  background: #2563eb;
  padding: 9px 14px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.ptools-header-report:hover,
.ptools-header-report:focus-visible {
  background: #1d4ed8;
}

.ptools-account-menu {
  position: relative;
}

.ptools-account-menu summary {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.ptools-account-menu summary::-webkit-details-marker {
  display: none;
}

.ptools-app-nav {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  width: min(280px, calc(100vw - 24px));
  min-width: 0;
  box-sizing: border-box;
  align-items: center;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgb(15 23 42 / 16%);
  padding: 10px;
}

.ptools-profile-editor {
  width: 100%;
  margin-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
  padding: 4px 4px 12px;
}

.ptools-profile-editor > strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 13px;
}

.ptools-profile-editor .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.ptools-profile-editor form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.ptools-profile-editor input,
.ptools-profile-editor button {
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}

.ptools-profile-editor input {
  min-width: 0;
  padding: 8px 10px;
}

.ptools-profile-editor button {
  background: #eff6ff;
  padding: 8px 11px;
  color: #1d4ed8;
  font-weight: 800;
  cursor: pointer;
}

.ptools-profile-editor button:hover,
.ptools-profile-editor button:focus-visible {
  border-color: #2563eb;
  background: #dbeafe;
}

.ptools-profile-editor p {
  min-height: 1.4em;
  margin: 6px 0 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.ptools-profile-editor p.is-error {
  color: #b91c1c;
}

.ptools-app-nav a {
  width: 100%;
  border-radius: 8px;
  padding: 9px 10px;
  color: #374151;
  font-weight: 700;
  text-decoration: none;
}

.ptools-mobile-nav {
  display: none;
}

.ptools-app-nav a:hover,
.ptools-app-nav a:focus-visible,
.ptools-text-link:hover,
.ptools-text-link:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ptools-app-main {
  min-height: calc(100vh - 128px);
}

.ptools-app-footer {
  padding: 22px 16px;
  color: #6b7280;
  font-size: 12px;
  text-align: center;
}

.ptools-app-footer a {
  color: #475569;
  font-weight: 700;
  text-decoration: none;
}

.ptools-app-footer a:hover,
.ptools-app-footer a:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ptools-app-footer > * + * {
  margin-left: 18px;
}

.ptools-docs {
  width: min(100% - 32px, 880px);
  margin: 32px auto 64px;
}

.ptools-docs-heading {
  margin-bottom: 28px;
}

.ptools-docs-heading h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(30px, 6vw, 48px);
  line-height: 1.2;
}

.ptools-docs-content {
  overflow-wrap: anywhere;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 50px rgb(15 23 42 / 8%);
  padding: clamp(24px, 5vw, 52px);
  font-size: 16px;
  line-height: 1.8;
}

.ptools-docs-content > :first-child {
  margin-top: 0;
}

.ptools-docs-content h2 {
  margin: 2.4em 0 .8em;
  color: #0f172a;
  font-size: clamp(23px, 4vw, 30px);
  line-height: 1.35;
}

.ptools-docs-content h3 {
  margin: 1.8em 0 .65em;
  color: #1e3a8a;
  font-size: clamp(19px, 3vw, 23px);
  line-height: 1.45;
}

.ptools-docs-content p,
.ptools-docs-content ul,
.ptools-docs-content ol,
.ptools-docs-content figure,
.ptools-docs-content details {
  margin-top: 0;
  margin-bottom: 1.2em;
}

.ptools-docs-content li + li {
  margin-top: .55em;
}

.ptools-docs-content a {
  color: #1d4ed8;
  font-weight: 700;
  text-underline-offset: 3px;
}

.ptools-docs-content .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 36px;
}

.ptools-docs-content .wp-block-button__link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 2px solid #2563eb;
  border-radius: 10px;
  background: #2563eb;
  padding: 9px 16px;
  color: #fff;
  text-decoration: none;
}

.ptools-docs-content .is-style-outline .wp-block-button__link {
  background: #fff;
  color: #1d4ed8;
}

.ptools-docs-content .wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ptools-docs-content table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.ptools-docs-content th,
.ptools-docs-content td {
  border-bottom: 1px solid #e2e8f0;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.ptools-docs-content details {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0 16px;
}

.ptools-docs-content summary {
  min-height: 48px;
  padding: 12px 0;
  font-weight: 800;
  cursor: pointer;
}

.ptools-docs-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
}

.ptools-docs-footer > * + * {
  margin-left: 0;
}

.ptools-docs-footer a {
  color: #475569;
  font-weight: 700;
  text-decoration: none;
}

.ptools-docs-footer a:hover,
.ptools-docs-footer a:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ptools-dashboard,
.ptools-login-card,
.ptools-register-card,
.ptools-error-card {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 16px;
  color: #1f2937;
}

.ptools-dashboard *,
.ptools-login-card *,
.ptools-register-card *,
.ptools-error-card * {
  box-sizing: border-box;
}

.ptools-dashboard-head,
.ptools-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ptools-dashboard h1,
.ptools-login-card h1,
.ptools-register-card h1,
.ptools-error-card h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 42px);
}

.ptools-eyebrow {
  margin: 0 0 4px;
  color: #2563eb;
  font-weight: 800;
  letter-spacing: .08em;
}

.ptools-button,
.ptools-section-head button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  padding: 10px 16px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.ptools-button-secondary {
  background: #e5e7eb;
  color: #1f2937;
}

.ptools-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.ptools-summary > div,
.ptools-records-card,
.ptools-login-card,
.ptools-register-card,
.ptools-error-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 24px rgb(15 23 42 / 6%);
}

.ptools-summary > div {
  padding: 18px;
}

.ptools-summary span {
  display: block;
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 13px;
}

.ptools-summary strong {
  font-size: 24px;
}

.ptools-records-card,
.ptools-login-card,
.ptools-register-card,
.ptools-error-card {
  padding: 20px;
}

.ptools-balances-card {
  margin-bottom: 18px;
}

.ptools-section-head p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 13px;
}

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

.ptools-balance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
  padding: 14px;
}

.ptools-balance span {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
}

.ptools-balance-amount {
  color: #1d4ed8;
  font-size: 18px;
  white-space: nowrap;
}

.ptools-balance-link {
  grid-column: 1 / -1;
  min-height: 40px;
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  color: #1d4ed8;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.ptools-balance-link:focus-visible,
.ptools-balance-link:hover {
  background: #dbeafe;
}

.ptools-register-card {
  max-width: 560px;
  margin: 32px auto;
}

.ptools-register-card > p:not(.ptools-eyebrow) {
  color: #6b7280;
}

.ptools-register-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.ptools-register-form label > span {
  display: block;
  margin-bottom: 6px;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}

.ptools-required {
  display: inline-block;
  margin-left: 5px;
  border-radius: 4px;
  background: #fee2e2;
  padding: 2px 5px;
  color: #b91c1c;
  font-size: 11px;
  line-height: 1.2;
}

.ptools-register-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 16px;
}

.ptools-register-form input:focus {
  border-color: #2563eb;
  outline: 3px solid #dbeafe;
}

.ptools-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ptools-form-help,
.ptools-register-login {
  margin: 0;
  font-size: 13px;
}

.ptools-form-notice {
  border-radius: 9px;
  padding: 11px 13px;
  font-weight: 700;
}

.ptools-form-notice.is-success {
  background: #ecfdf3;
  color: #047857 !important;
}

.ptools-form-notice.is-error {
  background: #fef2f2;
  color: #b91c1c !important;
}

.ptools-welcome {
  margin: 8px 0 0;
  color: #6b7280;
}

.ptools-text-link {
  margin-left: 8px;
  color: #1d4ed8;
  font-weight: 700;
}

.ptools-error-card {
  max-width: 660px;
  margin-top: clamp(40px, 10vh, 100px);
  padding: clamp(24px, 5vw, 48px);
  text-align: center;
}

.ptools-error-card > p:not(.ptools-eyebrow) {
  color: #6b7280;
  font-size: 16px;
}

.ptools-error-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.ptools-section-head h2 {
  margin: 0;
  font-size: 20px;
}

.ptools-section-head button {
  min-height: 40px;
  background: #eff6ff;
  color: #1d4ed8;
}

.ptools-status {
  color: #6b7280;
}

.ptools-record {
  display: grid;
  grid-template-columns: minmax(90px, .7fr) minmax(140px, 1.5fr) repeat(4, minmax(95px, 1fr)) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #e5e7eb;
  padding: 14px 0;
}

.ptools-record:first-child {
  border-top: 0;
}

.ptools-record span {
  display: block;
  color: #6b7280;
  font-size: 12px;
}

.ptools-record strong {
  display: block;
  overflow-wrap: anywhere;
}

.ptools-delete {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #b91c1c;
  cursor: pointer;
}

@media (max-width: 720px) {
  .ptools-app-header {
    min-height: 52px;
    gap: 8px;
    padding: 0 10px;
  }

  .ptools-app-brand {
    font-size: 17px;
  }

  .ptools-app-actions {
    gap: 6px;
  }

  .ptools-docs {
    width: min(100% - 24px, 880px);
    margin-top: 24px;
  }

  .ptools-docs-content {
    border-radius: 16px;
    padding: 22px 18px;
  }

  .ptools-docs-content .wp-block-buttons,
  .ptools-docs-content .wp-block-button,
  .ptools-docs-content .wp-block-button__link {
    width: 100%;
  }

  .ptools-app-nav {
    font-size: 13px;
  }

  .ptools-header-report {
    min-height: 44px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .ptools-account-menu summary {
    width: 44px;
    min-height: 44px;
    overflow: hidden;
    padding: 0;
    color: transparent;
  }

  .ptools-account-menu summary::before {
    position: absolute;
    left: 11px;
    color: #334155;
    content: "☰";
    font-size: 20px;
    line-height: 1;
  }

  .ptools-app-page {
    padding-bottom: calc(66px + env(safe-area-inset-bottom));
  }

  .ptools-mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 60px;
    border-top: 1px solid #dbe3ee;
    background: rgb(255 255 255 / 96%);
    padding: 5px max(10px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    box-shadow: 0 -8px 24px rgb(15 23 42 / 8%);
    backdrop-filter: blur(12px);
  }

  .ptools-mobile-nav.is-dashboard {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ptools-mobile-nav a {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1px;
    border-radius: 10px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
  }

  .ptools-mobile-nav a span {
    font-size: 18px;
    line-height: 1;
  }

  .ptools-mobile-nav a.is-current {
    color: #1d4ed8;
  }

  .ptools-mobile-nav .ptools-mobile-nav-primary {
    background: #eff6ff;
    color: #1d4ed8;
  }

  .ptools-dashboard {
    margin-top: 12px;
  }

  .ptools-app-footer {
    padding: 14px 10px;
    font-size: 10px;
  }

  .ptools-dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ptools-dashboard-head .ptools-button {
    width: 100%;
  }

  .ptools-text-link {
    display: block;
    margin: 6px 0 0;
  }

  .ptools-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ptools-record {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-top: 12px;
    padding: 14px;
  }

  .ptools-balances {
    grid-template-columns: 1fr;
  }

  .ptools-record .ptools-record-store {
    grid-column: 1 / -1;
  }

  .ptools-record .ptools-delete {
    grid-column: 1 / -1;
    width: 100%;
  }

  .ptools-error-actions {
    display: grid;
  }
}

@media (max-width: 380px) {
  .ptools-summary {
    grid-template-columns: 1fr;
  }
}
