.account-layout {
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  min-height: var(--vvh, 100dvh);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.account-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}
.account-who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-name { font-weight: 600; max-width: min(280px, 50vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  align-items: start;
}
.account-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px 24px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 72px;
  max-height: calc(var(--vvh, 100dvh) - 72px);
  overflow-y: auto;
}
.account-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}
.account-nav-link:hover { color: var(--text); background: var(--surface-hi); }
.account-nav-link.active {
  color: var(--text);
  background: rgba(31, 163, 122, .14);
  border-color: rgba(31, 163, 122, .35);
}
.account-nav-muted { margin-top: 8px; font-size: 13px; opacity: .85; }
.account-main {
  padding: 24px 28px 48px;
  max-width: 1100px;
  width: 100%;
  min-width: 0;
}
.page-head { margin-bottom: 22px; }
.page-head h1 { margin-bottom: 4px; }
.page-sub { margin: 0; font-size: 15px; }
.page-loading { padding: 8px 0; }

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  border: 1px solid var(--line);
}
.dash-hero-due {
  background: linear-gradient(135deg, rgba(242, 177, 52, .18) 0%, var(--surface) 55%);
  border-color: rgba(242, 177, 52, .45);
}
.dash-hero-ok {
  background: linear-gradient(135deg, rgba(31, 163, 122, .16) 0%, var(--surface) 55%);
  border-color: rgba(31, 163, 122, .35);
}
.dash-hero-amount {
  font: 700 36px/1.1 Montserrat, system-ui, sans-serif;
  margin: 4px 0 8px;
  color: var(--accent);
}
.dash-hero-lead { font-size: 18px; font-weight: 600; margin: 4px 0 6px; }
.dash-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dash-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .85fr);
  gap: 24px;
  align-items: start;
}
.dash-section { margin-bottom: 22px; }
.dash-section h2 { font-size: 17px; margin-bottom: 12px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h2 { margin: 0; }
.section-card { margin-bottom: 16px; }
.section-card h2 { font-size: 16px; margin-bottom: 12px; }
.card-flush { padding: 12px 14px; }
.card-inner { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-top: 12px; }

.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.service-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.service-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.service-card-head h3 { font-size: 15px; margin: 0; flex: 1; }
.service-kv { margin: 0; display: grid; gap: 8px; font-size: 13px; }
.service-kv div { display: flex; justify-content: space-between; gap: 12px; }
.service-kv dt { margin: 0; color: var(--dim); font-weight: 500; }
.service-kv dd { margin: 0; text-align: right; }

.message-list { padding: 0; overflow: hidden; }
.message-list-full { padding: 0; }
.message-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.message-row:last-child { border-bottom: 0; }
.message-row:hover, .message-row:focus-visible { background: var(--surface-hi); }
.message-subj { font-weight: 600; font-size: 14px; line-height: 1.35; }
.message-date { font-size: 12px; }
.mail-read-subj { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.mail-read-body {
  margin: 16px 0;
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
  margin-bottom: 8px;
}
.profile-form-grid .span-2 { grid-column: 1 / -1; }
.profile-form label { color: var(--text); font-size: 13px; }
.profile-form input.phone-input,
.profile-form input[type="tel"] { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.profile-email-hint {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(31, 163, 122, .35);
  background: rgba(31, 163, 122, .1);
  font-size: 14px;
  line-height: 1.5;
}
.profile-email-hint strong { color: var(--brand-hi); }
.profile-meta { margin-top: 16px; font-size: 13px; }
@media (max-width: 640px) {
  .profile-form-grid { grid-template-columns: 1fr; }
  .profile-form-grid .span-2 { grid-column: 1; }
}

.account-shortcuts .account-greeting { margin: 0 0 14px; font-size: 14px; }
.shortcut-row { display: flex; flex-wrap: wrap; gap: 10px; }
.account-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid var(--line);
}
.account-alert.warn {
  background: rgba(242, 177, 52, .12);
  border-color: rgba(242, 177, 52, .4);
}
.empty-hint { margin: 8px 0; padding: 8px 0; }
.foot-note { font-size: 13px; max-width: 52em; margin-top: 16px; }

.pay-stub { opacity: .85; cursor: not-allowed; }
.pay-lead { margin: 0 0 16px; max-width: 52em; }
.pay-page-card { max-width: 520px; }
.pay-memo-warn {
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 3px solid var(--accent);
  background: rgba(242, 177, 52, .22);
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}
.pay-select-label { display: block; font-weight: 600; margin: 8px 0 12px; color: var(--text); font-size: 14px; }
.pay-select-label select {
  display: block; width: min(420px, 100%); margin-top: 6px;
  font: inherit; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.pay-detail { margin-top: 8px; }
.pay-qr-box {
  position: relative;
  width: min(240px, 100%);
  aspect-ratio: 1 / 1;
  margin: 12px 0;
  background: #fff;
  border-radius: 8px;
}
.pay-qr {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  object-position: center;
}
.pay-num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }

@media (max-width: 860px) {
  .account-body { grid-template-columns: 1fr; }
  .account-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 56px;
    max-height: none;
    padding: 10px 12px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .account-nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 12px;
  }
  .account-nav-muted { margin-top: 0; }
  .dash-columns { grid-template-columns: 1fr; }
  .account-main { padding: 16px 14px max(40px, env(safe-area-inset-bottom)); }
  .dash-hero-amount { font-size: 30px; }
}

@media (max-width: 640px) {
  .account-bar { padding: 12px 14px; }
  .pay-select-label select { font-size: 16px; min-height: 44px; }
}
