:root {
    --primary: #4f6ef7; --primary-light: #eef2ff;
    --success: #10b981; --success-light: #d1fae5;
    --warning: #f59e0b; --warning-light: #fef3c7;
    --danger: #ef4444; --danger-light: #fee2e2;
    --bg: #eef2fa; --text: #1f2937; --text-light: #6b7280; --radius: 12px; --border: #d5dae5;
  }
  * { margin:0; padding:0; box-sizing:border-box; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg); color: var(--text); min-height: 100vh;
    display: flex; flex-direction: column; padding-top: 65px;
    overflow-anchor: none;
  }
  .topbar {
    background: #fff; padding: 0; text-align: center;
    font-size: 26px; font-weight: 900;
    position: fixed; top: 0; left: 0; right: 0; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    gap: 4px; border-bottom: 1px solid #e5e7eb; height: 65px; line-height: 65px;
    -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0);
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
  }
  .topbar-inner {
    width: min(1080px, 100%); height: 100%; margin: 0 auto; padding: 0 18px;
    position: relative; display: flex; align-items: center; justify-content: center;
  }
  .topbar .back-btn {
    position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-weight: 700;
    color: var(--text); cursor: pointer; display: none;
    border: 1px solid #e5e7eb; border-radius: 12px; padding: 9px 15px; font-size: 14px;
    min-width: 64px; min-height: 38px; line-height: 18px;
    background: #fff; z-index: 2; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  }
  .topbar .back-btn:hover { background: #f8f9fa; }
  .container { width: min(1080px, 100%); margin: 0 auto; padding: 20px 18px 50px; overflow-anchor: none; }
  .container.centered { min-height: calc(100vh - 120px); display: flex; flex-direction: column; justify-content: center; }
  @media (min-width: 768px) {
    .info-item .val { font-size: 20px; }
    .info-item .val.sm { font-size: 16px; }
    .ring-center .big { font-size: 26px; }
  }
  @media (max-width: 480px) {
    .info-item { padding: 8px 10px; }
    .info-item .lbl { font-size: 10px; }
    .info-item .val { font-size: 13px; }
    .info-item .val.sm { font-size: 11px; }
  }
  .page { display: none; }
  .page.active { display: block; }
  .page > .card:last-child { margin-bottom: 0; }
  #topbarTitle { display: block; line-height: 1.2; position: relative; z-index: 1; pointer-events: none; }
  html.has-session #mainContainer.centered { min-height: auto; display: block; }
  html.has-session #refreshBtn { display: flex !important; }
  html.has-session #buySimBackBtn,
  html.view-pageBuySim #buySimBackBtn,
  html.initial-pageBuySim #buySimBackBtn { display: none !important; }
  html.initial-pagePlans #backBtn,
  html.initial-pageSmsLog #backBtn,
  html.initial-pageSettings #backBtn,
  html.initial-pageBuySim #backBtn,
  html.view-pagePlans #backBtn,
  html.view-pageSmsLog #backBtn,
  html.view-pageSettings #backBtn,
  html.view-pageBuySim #backBtn { display: inline; }
  html.initial-pageHome #pageLogin.page.active,
  html.initial-pagePlans #pageLogin.page.active,
  html.initial-pageSmsLog #pageLogin.page.active,
  html.initial-pageSettings #pageLogin.page.active,
  html.initial-pageBuySim #pageLogin.page.active { display: none; }
  html.initial-pageHome #pageHome,
  html.initial-pagePlans #pagePlans,
  html.initial-pageSmsLog #pageSmsLog,
  html.initial-pageSettings #pageSettings,
  html.initial-pageBuySim #pageBuySim { display: block; }
  .card {
    background: #fff; border-radius: var(--radius); padding: 20px 24px;
    margin-bottom: 16px; border: 1px solid #e5e7eb;
  }
  .card-label {
    font-size: 12px; color: var(--primary); font-weight: 600;
    letter-spacing: 1px; margin-bottom: 10px;
  }
  .card-heading {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 10px;
  }
  .card-heading .card-label { margin-bottom: 0; }
  .text-action {
    border: none; background: transparent; color: var(--primary);
    font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
    padding: 4px 0; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  }
  .query-result {
    margin-top: 10px; font-size: 13px; line-height: 1.5;
    color: var(--text-light); text-align: center;
  }
  .query-result.ok,
  .query-result.err { font-weight: 800; }
  .query-status { text-align: center; margin-bottom: 8px; }
  .query-status-box {
    background: #f8f9fa; border: 1px solid #eef0f4; border-radius: 10px;
    padding: 10px 12px; margin-bottom: 8px; text-align: center;
    color: #065f46; font-size: 13px; font-weight: 800; line-height: 1.5;
  }
  .query-status-box.err { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
  .query-info-box {
    background: #f8f9fa; border-radius: 12px; padding: 8px 12px;
    text-align: left; color: var(--text);
  }
  .query-info-box > div {
    min-width: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr);
    gap: 4px; align-items: center; padding: 5px 0;
  }
  .query-info-box > div { border-bottom: 1px solid #e5e7eb; }
  .query-info-box > div:last-child { border-bottom: none; }
  .query-info-box span { color: var(--text-light); font-size: 12px; font-weight: 900; }
  .query-info-box strong {
    min-width: 0; color: var(--text); font-size: 13px; font-weight: 900;
    line-height: 1.35; word-break: break-all;
  }
  .query-order-block {
    padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #e5e7eb;
  }
  .query-order-block:last-child {
    padding-bottom: 0; margin-bottom: 0; border-bottom: none;
  }
  .query-contact {
    display: block; width: 100%;
    margin-top: 8px; background: #f8f9fa; border: 1px solid #eef0f4;
    border-radius: 10px; padding: 10px 12px; text-align: center;
    color: var(--text-light); font: inherit; font-size: 13px; font-weight: 800;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .input-box {
    width: 100%; padding: 14px 16px; border: 1px solid #e5e7eb;
    border-radius: 12px; font-size: 17px; outline: none;
    transition: border 0.2s; letter-spacing: 1px;
  }
  .input-box:focus { border-color: var(--primary); }
  .input-box::placeholder { color: #c4c4c4; letter-spacing: 0; font-size: 17px; }
  .input-box.readonly-input { background: #f8f9fa; color: var(--text-light); }
  .field-wrap { position: relative; }
  .field-wrap.input-spaced { margin-top: 8px; }
  .field-wrap .input-box { padding-right: 46px; }
  .code-row .field-wrap { flex: 1; min-width: 0; }
  .modal .field-wrap { margin-top: 8px; }
  .modal .field-wrap .input-box { margin-top: 0; }
  .input-clear {
    position: absolute; right: 8px; top: 8px;
    width: 30px; height: 30px; border: none; border-radius: 50%;
    background: transparent; color: var(--text-light); cursor: pointer;
    font-size: 24px; line-height: 26px; display: none;
  }
  .input-clear:hover { background: #f3f4f6; color: var(--danger); }
  .is-hidden { display: none; }
  .input-spaced { margin-top: 8px; }
  .form-section { padding: 12px; border: 1px solid #eef0f3; border-radius: 12px; background: #fafafa; }
  .form-section + .form-section { margin-top: 12px; }
  .form-section-label { font-size: 13px; font-weight: 800; color: #6b7280; margin-bottom: 8px; }
  .label-with-action {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
  }
  .label-action-btn {
    border: none; background: transparent; color: var(--primary);
    font: inherit; font-size: 12px; font-weight: 800; padding: 0;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .buy-sim-product-tabs {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  }
  .buy-sim-product-chip {
    border: 1px solid #e1e5ef; background: #fff; border-radius: 10px;
    min-height: 50px; padding: 10px 12px; display: flex; align-items: center;
    justify-content: space-between; gap: 8px; color: var(--text);
    font: inherit; font-size: 13px; font-weight: 900; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .buy-sim-product-chip strong { color: var(--primary); font-size: 13px; font-weight: 900; }
  .buy-sim-product-chip.active {
    border-color: var(--primary); background: var(--primary-light); color: var(--primary);
  }
  .buy-sim-product-desc {
    margin-top: 8px; background: #f8f9fa; border-radius: 10px;
    padding: 10px 12px; color: var(--text-light); font-size: 12px;
    font-weight: 700; line-height: 1.55;
  }
  .buy-sim-product-desc div + div { margin-top: 4px; }
  .buy-sim-desc { color: var(--text); }
  .buy-sim-price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .buy-sim-price-grid div {
    background: #fff; border: 1px solid #eef0f4; border-radius: 10px;
    padding: 10px 12px;
  }
  .buy-sim-price-grid span {
    display: block; color: var(--text-light); font-size: 12px; font-weight: 800; margin-bottom: 4px;
  }
  .buy-sim-price-grid strong { display: block; font-size: 15px; font-weight: 900; }
  .buy-sim-note {
    margin-top: 8px; background: #f8f9fa; border-radius: 10px;
    padding: 10px 12px; color: var(--text-light); font-size: 12px; font-weight: 700; line-height: 1.55;
  }
  .contact-note {
    margin-top: 8px; background: #f8f9fa; border: 1px solid #eef0f4;
    border-radius: 10px; padding: 10px 12px; text-align: center;
    color: var(--text-light); font-size: 13px; font-weight: 800;
  }
  .method-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .method-chip {
    border: 1px solid #e1e5ef; background: #fff; border-radius: 10px;
    padding: 11px 10px; font: inherit; font-size: 14px; font-weight: 800;
    color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .method-chip.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
  #regCodeRow { margin-top: 8px; }
  .code-row { display: flex; gap: 8px; align-items: stretch; }
  .code-row .input-box { flex: 1; min-width: 0; }
  .code-buy-btn {
    width: 72px; flex: 0 0 72px; border: 1px solid #dbe3ff;
    border-radius: 12px; background: #fff; color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; text-decoration: none;
    cursor: pointer;
  }
  .code-buy-btn:disabled { opacity: .55; cursor: not-allowed; }
  .account-section { background: #fff; border-color: #e5e7eb; }
  .form-section + .btn { margin-top: 14px; }
  .modal .form-section { padding: 10px; }
  .mt-8 { margin-top: 8px; }
  .mt-12 { margin-top: 12px; }
  .button-row { display: flex; gap: 8px; }
  .buy-service {
    margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef0f4;
  }
  .buy-service-home { margin-top: 8px; padding-top: 0; border-top: none; }
  .buy-service-main {
    width: 100%; border: 1px solid #dbe3ff; background: var(--primary-light); color: var(--primary);
    border-radius: 12px; padding: 12px; font: inherit; font-size: 13px; font-weight: 800;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .login-secondary-actions {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px;
  }
  .home-secondary-actions { grid-template-columns: repeat(2, 1fr); }
  .login-secondary-actions button {
    border: 1px solid #e5e7eb; background: #fff; color: var(--text-light);
    border-radius: 10px; font: inherit; font-size: 12px; font-weight: 800;
    min-height: 34px; padding: 7px 4px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .login-secondary-actions button:hover {
    border-color: var(--primary); color: var(--primary);
  }
  .buy-service-actions {
    display: flex; justify-content: center; gap: 18px; margin-top: 8px;
  }
  .buy-service-actions button {
    border: none; background: transparent; color: var(--text-light);
    font: inherit; font-size: 12px; font-weight: 800; padding: 2px 0;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .btn {
    width: 100%; padding: 14px; border: none; border-radius: 12px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
  }
  .btn-sm { font-size: 14px; padding: 13px; }
  .btn-primary { background: var(--primary); color: #fff; margin-top: 12px; }
  .btn-primary:disabled { background: #a5b4fc; cursor: not-allowed; }
  .btn-pay { background: var(--primary); color: #fff; }
  .btn-pay:disabled { background: #a5b4fc; cursor: not-allowed; }
  .btn-outline { background: #fff; color: var(--text); border: 1px solid #e5e7eb; }
  .btn-outline:hover { border-color: var(--primary); color: var(--primary); }
  .btn-outline-danger { color: var(--danger); border-color: #fecaca; }
  .btn-outline-danger:hover { color: var(--danger); border-color: var(--danger); background: #fef2f2; }
  .btn-danger { background: var(--danger); color: #fff; }
  .btn-danger:hover { opacity: 0.9; }
  .btn-success { background: var(--success); color: #fff; border-color: var(--success); }
  .btn-success:hover { background: #0ea371; color: #fff; border-color: #0ea371; }
  .iccid-history {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
    border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
    max-height: 160px; overflow-y: auto; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-top: 2px;
  }
  .iccid-history-item {
    padding: 10px 14px; cursor: pointer; font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
  }
  .iccid-history-item:last-child { border-bottom: none; }
  .iccid-history-remove {
    width: 30px; height: 30px; border: none; border-radius: 50%;
    background: transparent; color: var(--text-light); cursor: pointer;
    font-size: 24px; line-height: 26px; flex: 0 0 auto;
  }
  .iccid-history-remove:hover { background: #f3f4f6; color: var(--danger); }
  .section-title { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
  .site-footer {
    text-align: center; font-size: 11px; color: var(--text-light);
    padding: 16px; margin-top: auto;
    display: none;
  }
  html:not(.has-session) .site-footer { display: block; }

  .usage-hero { text-align: center; min-height: 438px; }
  @media (max-width: 480px) { .usage-hero { min-height: 408px; } }
  .usage-card-heading {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: -4px;
  }
  .usage-card-title { font-size: 14px; font-weight: 800; text-align: left; }
  .ring-wrap { position: relative; width: 200px; height: 200px; margin: 0 auto 18px; }
  .ring-wrap svg { transform: rotate(-90deg); display: block; }
  .ring-wrap .bg { fill: none; stroke: #f3f4f6; stroke-width: 20; }
  .ring-wrap .fg { fill: none; stroke: var(--primary); stroke-width: 20; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
  .ring-wrap .fg.warn { stroke: var(--warning); }
  .ring-wrap .fg.danger { stroke: var(--danger); }
  .ring-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
  .ring-center .big { font-size: 25px; font-weight: 900; line-height: 1.05; white-space: nowrap; }
  .ring-label { font-size: 11px; color: var(--text-light); font-weight: 800; margin-bottom: 6px; }
  .ring-sub { font-size: 9px; color: var(--text-light); font-weight: 700; margin-top: 5px; white-space: nowrap; }

  .info-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
  .info-row-3 { grid-template-columns: 1fr 1fr; }
  @media (min-width: 600px) { .info-row-3 { grid-template-columns: 1fr 1fr 1fr; } }
  .status-info-row { margin-top: 10px; }
  .info-item { background: #f8f9fa; border-radius: 12px; padding: 12px 14px; }
  .info-item .lbl { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
  .info-item .val { font-size: 15px; font-weight: 700; }
  .info-item .val.sm { font-size: 15px; font-weight: 700; }
  .tag-ok,
  .tag-warn,
  .tag-info,
  .tag-err {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 24px; padding: 3px 10px; border-radius: 8px;
    font-size: 13px; font-weight: 800;
  }
  .tag-ok { background: var(--success-light); color: #065f46; }
  .tag-warn { background: var(--warning-light); color: #92400e; }
  .tag-info { background: var(--primary-light); color: #3730a3; }
  .tag-err { background: var(--danger-light); color: #991b1b; }

  .settings-section { padding: 0; margin-top: 12px; }
  .settings-warning + .settings-section { margin-top: 16px; }
  .settings-section:last-child { padding-bottom: 0; border-bottom: none; }
  .settings-logout { margin-top: 18px; border-bottom: none; }
  .settings-actions { display: grid; gap: 8px; }
  .settings-actions-2 { grid-template-columns: 1fr 1fr; }
  .settings-actions .btn { margin-top: 0; font-size: 14px; padding: 13px; }
  .settings-toggle {
    margin-top: 0; padding: 13px; font-size: 14px;
    justify-content: space-between; text-align: left; gap: 12px;
  }
  .settings-toggle span { min-width: 0; }
  .settings-toggle .toggle-switch {
    position: relative; flex: 0 0 auto; width: 42px; height: 24px;
    border-radius: 999px; background: #e5e7eb; transition: background 0.18s ease;
    box-shadow: inset 0 0 0 1px rgba(31, 41, 55, 0.05);
  }
  .settings-toggle .toggle-knob {
    position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
    transition: transform 0.18s ease;
  }
  .settings-toggle.active {
    border-color: #c7d2fe; background: #f8faff; color: var(--text);
  }
  .settings-toggle.active .toggle-switch { background: var(--primary); }
  .settings-toggle.active .toggle-knob { transform: translateX(18px); }
  .plan-card .section-title { margin-bottom: 14px; }
  .plan-card > .key-inline { margin: 0 0 14px; }
  .plan-card-sub { font-size: 12px; color: var(--text-light); line-height: 1.5; margin: 0 0 10px; }
  .plan-method-switch { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 0 0 12px; }
  .plan-method-tab {
    border: 1px solid #e1e5ef; background: #fff; border-radius: 10px;
    min-height: 42px; padding: 9px 10px; font: inherit; font-size: 14px; font-weight: 900;
    color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .plan-method-tab.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
  .plan-info-switch { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .plan-info-tab {
    border: 1px solid #e1e5ef; background: #fff; border-radius: 10px;
    min-height: 40px; padding: 8px 8px; font: inherit; font-size: 13px; font-weight: 900;
    color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .plan-info-tab.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
  .plan-info-panel { margin-top: 12px; }
  .renewal-method-title { font-size: 13px; font-weight: 800; color: var(--text); margin: 0 0 8px; }
  .renewal-code-panel { margin-top: 0; }
  .renewal-code-row { margin-top: 0; }
  .plan-card #renewalCode { letter-spacing: 0; font-size: 17px; }
  .plan-card #renewalCodeBtn { margin-top: 8px; }
  .plan-card #dataTopupPayBtn { margin-top: 8px; }
  .renewal-month-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 0;
    min-height: 92px;
  }
  .renewal-month-chip {
    border: 1px solid #e1e5ef; background: #fff; border-radius: 10px;
    padding: 10px 12px; text-align: left; color: var(--text);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-family: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
    -webkit-tap-highlight-color: transparent; min-height: 42px;
  }
  .renewal-month-chip strong { color: var(--primary); font-size: 13px; }
  .renewal-month-chip.active { border-color: var(--primary); background: var(--primary-light); }
  .renewal-month-chip:disabled { opacity: .55; cursor: not-allowed; }
  .renewal-total, .data-topup-total {
    margin-top: 8px; background: #f8f9fa; border-radius: 10px;
    padding: 10px 12px; display: flex; justify-content: space-between; align-items: center;
  }
  .plan-card #renewalPayBtn { margin-top: 8px; }
  .danger-note {
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px;
    padding: 11px 12px; color: #991b1b;
    font-size: 13px; font-weight: 700; line-height: 1.55; text-align: center;
  }
  .settings-warning { margin-bottom: 0; }
  .empty-state {
    text-align: center; padding: 28px 18px; color: var(--text-light);
  }
  .empty-title { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
  .empty-subtitle { font-size: 12px; line-height: 1.5; }
  .empty-state.error .empty-title { color: var(--danger); }

  .bar-chart { margin-top: 14px; background: #f8f9fa; border-radius: 12px; padding: 12px 14px; }
  .bar-chart .chart-title { font-size: 11px; color: var(--text-light); margin-bottom: 6px; }
  .bar-row { display: flex; align-items: flex-end; gap: 6px; height: 130px; }
  .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
  .bar-val { font-size: 10px; color: var(--text-light); margin-bottom: 4px; }
  .bar-fill { width: 100%; max-width: 24px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 3px; transition: height 0.5s ease; }
	  .bar-label { font-size: 11px; color: var(--text-light); margin-top: 6px; text-align: center; }

  .log-row { gap: 10px; }
  .record-main { min-width: 0; }
  .record-main .record-title,
  .record-main .record-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .log-side { flex-shrink: 0; min-width: 120px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
  .log-gap { font-size: 12px; font-weight: 600; }
  .log-gap.ok { color: var(--success); }
  .log-gap.err { color: var(--danger); }
  .log-badge {
    display: inline-block; font-weight: 700; font-size: 14px; padding: 4px 14px; border-radius: 10px;
  }
  .log-badge.ok { background: var(--success-light); color: #065f46; }
  .log-badge.err { background: var(--danger-light); color: #991b1b; }

  .record-row {
    display: flex; justify-content: space-between; align-items: center;
    background: #f8f9fa; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  }
  .record-row:last-child { margin-bottom: 0; }
  .record-title { font-weight: 700; font-size: 14px; color: var(--text); }
  .record-sub { font-size: 12px; color: var(--text-light); margin-top: 3px; }
  .record-side { text-align: right; }
  .record-price { font-weight: 700; font-size: 15px; }

  .plan-summary-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: #f8f9fa; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  }
  .plan-summary-row:last-child { margin-bottom: 0; }
  .plan-summary-main { min-width: 0; text-align: left; }
  .plan-summary-title { font-weight: 700; font-size: 14px; color: var(--text); }
  .plan-summary-date { font-size: 12px; color: var(--text-light); margin-top: 3px; }
  .plan-summary-badge {
    flex: 0 0 auto; font-weight: 700; font-size: 14px;
    padding: 4px 14px; border-radius: 10px;
  }
  .plan-summary-badge.active { background: var(--success-light); color: #065f46; }
  .plan-summary-badge.pending { background: #f3f4f6; color: var(--text-light); }

  .total-bar .l { font-size: 14px; font-weight: 700; }
  .total-bar .r { font-size: 22px; font-weight: 900; }

	  .toast {
	    position: fixed; top: 75px; left: 50%; transform: translateX(-50%);
	    padding: 12px 22px; border-radius: 10px; color: #fff;
	    font-weight: 600; font-size: 14px; line-height: 1.45; z-index: 1200;
	    display: none; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
	    animation: slideIn 0.3s ease; text-align: center;
	  }
  .toast-ok { background: var(--success); }
  .toast-err { background: var(--danger); }
  @keyframes slideIn { from { opacity: 0; transform: translateX(-50%) translateY(-12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
	  .refresh-fab {
	    position: fixed; right: 40px; bottom: 40px; width: 50px; height: 50px;
	    border-radius: 50%; background: #fff; border: 1px solid #e5e7eb;
	    box-shadow: 0 2px 8px rgba(0,0,0,0.1); font-size: 24px;
	    cursor: pointer; z-index: 50; display: none; align-items: center; justify-content: center;
	    color: var(--text); line-height: 1; padding: 0; outline: none;
	    appearance: none; -webkit-appearance: none; user-select: none; -webkit-tap-highlight-color: transparent;
	  }
  .refresh-fab:focus,
  .refresh-fab:active { outline: none; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
	  .refresh-fab svg {
	    width: 22px; height: 22px; fill: none; stroke: currentColor;
	    stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
	  }
	  .modal-overlay {
	    position: fixed; inset: 0; z-index: 100; display: none;
	    align-items: center; justify-content: center; padding: 20px;
	    background: rgba(0,0,0,0.38);
	  }
	  .modal-overlay.active { display: flex; }
	  .modal {
	    width: 100%; max-width: 360px; background: #fff; border-radius: 14px;
	    border: 1px solid #e5e7eb; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.16);
	    max-height: calc(100vh - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch;
	  }
	  .query-modal {
	    display: flex; flex-direction: column; overflow: hidden;
	  }
	  .query-modal .query-result {
	    min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
	  }
	  .confirm-overlay {
	    position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 999;
	    display: flex; align-items: center; justify-content: center; padding: 20px;
	  }
	  .confirm-box {
	    background: #fff; border-radius: 14px; padding: 28px 24px 20px;
	    max-width: 340px; width: 100%; text-align: center;
	    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
	  }
	  .confirm-icon {
	    width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 50%;
	    background: #fee2e2; display: flex; align-items: center; justify-content: center;
	    font-size: 24px; font-weight: 800; color: #991b1b;
	  }
	  .confirm-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
	  .confirm-warning { margin: 0 -12px 20px; }
	  .modal-title { font-size: 17px; font-weight: 800; margin-bottom: 12px; text-align: center; }
	  .modal-warning { margin-bottom: 10px; }
	  .key-inline {
	    margin: 10px 0 2px; padding: 10px 12px; border-radius: 10px;
	    background: #f8f9fa; border: 1px solid #eef0f4; text-align: center;
	  }
	  .key-inline-label {
	    font-size: 12px; color: var(--text-light); font-weight: 700; margin-bottom: 6px;
	  }
	  .key-inline-value {
	    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	    font-size: 12px; line-height: 1.45; color: var(--text);
	    word-break: break-all;
	  }
	  .modal .input-box { margin-top: 8px; }
	  .modal-actions { display: flex; gap: 10px; margin-top: 14px; }
	  .modal-actions .btn { margin-top: 0; }
	  .referral-actions {
	    display: grid;
	    grid-template-columns: 1fr 1fr;
	  }
	  .referral-actions .btn-wide { grid-column: 1 / -1; }
	  .image-modal { max-width: 420px; padding: 18px; }
	  .price-example-image {
	    display: block; width: 100%; height: auto; border-radius: 12px;
	    border: 1px solid #eef0f4; background: #f8f9fa;
	  }
	  @keyframes spin { to { transform: rotate(360deg); } }
