:root {
  --navy: #0d1b3d;
  --navy-2: #081225;
  --navy-3: #11254d;
  --teal: #17b2a6;
  --teal-2: #0f8f86;
  --teal-soft: #d9f5f1;
  --amber: #f5a623;
  --light: #f2f4f7;
  --white: #ffffff;
  --text: #0d1b3d;
  --muted: #63708a;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #dce3ee;
  --success: #159b69;
  --success-soft: #dcf8eb;
  --danger: #d84b4b;
  --danger-soft: #ffe8e8;
  --warning: #c98008;
  --warning-soft: #fff0cf;
  --shadow: 0 24px 70px rgba(13, 27, 61, .13);
  --shadow-soft: 0 12px 34px rgba(13, 27, 61, .08);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

html[data-theme="dark"] {
  --light: #071022;
  --text: #f4f7fb;
  --muted: #a6b1c8;
  --surface: #0d1a31;
  --surface-2: #101f39;
  --border: #263958;
  --teal-soft: #0e3d3a;
  --success-soft: #103b2d;
  --danger-soft: #452126;
  --warning-soft: #473514;
  --shadow: 0 28px 80px rgba(0, 0, 0, .34);
  --shadow-soft: 0 14px 38px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--light);
  color: var(--text);
  font-family: Arial, "Segoe UI", Tahoma, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
button, input { font: inherit; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  inset-inline-start: 16px;
  top: -70px;
  z-index: 9999;
  padding: 10px 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--teal);
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 14px; }

.portal-shell { width: min(1180px, calc(100% - 36px)); margin-inline: auto; }
.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 7px 24px rgba(13, 27, 61, .04);
}
.portal-nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.portal-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.portal-brand img { width: 45px; height: 45px; border-radius: 12px; }
.portal-brand span { display: grid; line-height: 1.12; }
.portal-brand b { font-size: 1rem; }
.portal-brand small { margin-top: 5px; color: var(--muted); font-size: .73rem; }
.portal-nav-actions { display: flex; align-items: center; gap: 9px; }
.back-site, .icon-btn, .lang-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  min-height: 42px;
  border-radius: 13px;
}
.back-site { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; text-decoration: none; font-weight: 700; font-size: .82rem; }
.back-site svg { width: 18px; height: 18px; }
html[dir="rtl"] .back-site svg { transform: scaleX(-1); }
.icon-btn { width: 42px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
html[data-theme="dark"] .sun-icon, html:not([data-theme="dark"]) .moon-icon { display: none; }
.language { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; cursor: pointer; font-weight: 700; font-size: .8rem; }
.lang-btn img, .lang-menu img { width: 22px; height: 15px; object-fit: cover; border-radius: 2px; }
.lang-btn svg { width: 16px; height: 16px; }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 165px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.lang-menu button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 9px; padding: 10px; background: transparent; color: var(--text); cursor: pointer; text-align: start; }
.lang-menu button:hover { background: var(--surface-2); }

.auth-view { position: relative; min-height: calc(100vh - 76px); padding: 72px 0 86px; overflow: hidden; }
.auth-pattern { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 14% 15%, rgba(23,178,166,.12), transparent 28%), radial-gradient(circle at 86% 80%, rgba(245,166,35,.1), transparent 24%), linear-gradient(rgba(13,27,61,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(13,27,61,.025) 1px, transparent 1px); background-size: auto, auto, 44px 44px, 44px 44px; }
html[data-theme="dark"] .auth-pattern { background: radial-gradient(circle at 14% 15%, rgba(23,178,166,.18), transparent 28%), radial-gradient(circle at 86% 80%, rgba(245,166,35,.1), transparent 24%), linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: auto, auto, 44px 44px, 44px 44px; }
.auth-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(350px, 470px); align-items: center; gap: 72px; }
.auth-intro { max-width: 650px; }
.portal-kicker { display: inline-flex; align-items: center; min-height: 32px; padding: 0 13px; border: 1px solid color-mix(in srgb, var(--teal) 38%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--teal-soft) 65%, transparent); color: var(--teal-2); font-size: .78rem; font-weight: 800; }
html[data-theme="dark"] .portal-kicker { color: #62dfd6; }
.auth-intro h1 { margin: 20px 0 18px; font-size: clamp(2.55rem, 5vw, 5.2rem); line-height: .98; letter-spacing: -.05em; }
.auth-intro h1 span, .auth-intro h1 em { display: block; font-style: normal; }
.auth-intro h1 em { color: var(--teal); margin-top: 12px; }
.auth-intro > p { max-width: 600px; margin: 0; color: var(--muted); font-size: 1.02rem; }
.auth-trust { display: grid; gap: 12px; margin-top: 34px; }
.auth-trust article { display: flex; align-items: center; gap: 13px; max-width: 570px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 15px; background: color-mix(in srgb, var(--surface) 80%, transparent); }
.auth-trust article > span { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--teal-soft); color: var(--teal-2); }
.auth-trust svg { width: 21px; height: 21px; }
.auth-trust div { display: grid; }
.auth-trust b { font-size: .9rem; }
.auth-trust small { color: var(--muted); font-size: .76rem; margin-top: 2px; }

.login-card { position: relative; padding: 32px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.login-card::before { content: ""; position: absolute; inset: 0 26px auto; height: 4px; border-radius: 0 0 999px 999px; background: linear-gradient(90deg, var(--teal), var(--amber)); }
.login-heading { display: flex; align-items: center; gap: 14px; }
.login-heading img { width: 55px; height: 55px; border-radius: 15px; }
.login-heading div { display: grid; }
.login-heading span { color: var(--teal-2); font-size: .75rem; font-weight: 800; }
html[data-theme="dark"] .login-heading span { color: #61d9d0; }
.login-heading h2 { margin: 2px 0 0; font-size: 1.6rem; }
.login-help { color: var(--muted); font-size: .85rem; margin: 19px 0 25px; }
#loginForm { display: grid; gap: 10px; }
#loginForm label { margin-top: 6px; font-size: .8rem; font-weight: 800; }
.field-wrap { position: relative; }
.field-wrap > svg { position: absolute; top: 50%; inset-inline-start: 14px; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.field-wrap input { width: 100%; height: 52px; padding: 0 45px; border: 1px solid var(--border); border-radius: 14px; outline: none; background: var(--surface-2); color: var(--text); direction: ltr; text-align: start; transition: border-color .2s, box-shadow .2s, background .2s; }
.field-wrap input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 15%, transparent); background: var(--surface); }
.field-wrap input::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.password-field input { padding-inline-end: 48px; }
.password-toggle { position: absolute; top: 50%; inset-inline-end: 10px; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.password-toggle:hover { background: var(--surface); color: var(--teal-2); }
.password-toggle svg { width: 19px; height: 19px; }
.password-toggle .eye-off { display: none; }
.password-toggle.visible .eye-open { display: none; }
.password-toggle.visible .eye-off { display: block; }
.form-message { margin-top: 5px; padding: 11px 13px; border-radius: 12px; font-size: .8rem; font-weight: 700; }
.form-message.error { color: var(--danger); background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.form-message.success { color: var(--success); background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 25%, transparent); }
.login-btn { position: relative; width: 100%; height: 54px; margin-top: 10px; border: 0; border-radius: 15px; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--teal); color: #fff; font-weight: 900; cursor: pointer; box-shadow: 0 12px 26px rgba(23,178,166,.2); transition: transform .2s, background .2s; }
.login-btn:hover { background: var(--teal-2); transform: translateY(-2px); }
.login-btn:disabled { cursor: wait; opacity: .74; transform: none; }
.login-btn > svg { width: 20px; height: 20px; }
html[dir="rtl"] .login-btn > svg { transform: scaleX(-1); }
.button-spinner { display: none; width: 19px; height: 19px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
.login-btn.loading span, .login-btn.loading > svg { display: none; }
.login-btn.loading .button-spinner { display: block; }
.login-footer { display: flex; justify-content: center; gap: 6px; margin-top: 18px; font-size: .8rem; color: var(--muted); }
.login-footer a { color: var(--teal-2); font-weight: 800; text-decoration: none; }
.security-note { display: flex; align-items: flex-start; gap: 8px; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: .72rem; }
.security-note svg { flex: 0 0 auto; width: 17px; height: 17px; color: var(--amber); }

.dashboard-view { min-height: calc(100vh - 76px); padding: 48px 0 80px; background: linear-gradient(180deg, color-mix(in srgb, var(--teal-soft) 25%, transparent), transparent 320px); }
.dashboard-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.dashboard-topbar h1 { margin: 12px 0 0; font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.12; }
.dashboard-topbar h1 b { color: var(--teal-2); }
html[data-theme="dark"] .dashboard-topbar h1 b { color: #59d8cf; }
.dashboard-topbar p { margin: 8px 0 0; color: var(--muted); direction: ltr; text-align: start; }
.logout-btn { height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--text); cursor: pointer; font-weight: 800; }
.logout-btn svg { width: 18px; height: 18px; color: var(--danger); }

.loading-state { min-height: 390px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; box-shadow: var(--shadow-soft); }
.loader { width: 44px; height: 44px; margin-bottom: 20px; border: 4px solid color-mix(in srgb, var(--teal) 22%, transparent); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-state b { font-size: 1rem; }
.loading-state small { margin-top: 5px; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

.subscription-hero { display: grid; grid-template-columns: minmax(0, 1fr) 315px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-soft); }
.subscription-main { position: relative; padding: 34px; }
.subscription-main::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; inset-inline-end: -110px; top: -140px; background: radial-gradient(circle, color-mix(in srgb, var(--teal) 22%, transparent), transparent 65%); pointer-events: none; }
.subscription-title-row { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.subscription-title-row div { display: grid; }
.subscription-title-row span:not(.status-pill) { color: var(--muted); font-size: .8rem; font-weight: 700; }
.subscription-title-row h2 { margin: 4px 0 0; font-size: 2.45rem; letter-spacing: -.04em; }
.status-pill { flex: 0 0 auto; min-height: 34px; padding: 0 13px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: .76rem; font-weight: 900; border: 1px solid transparent; }
.status-active { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.status-trial { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.status-expired, .status-rejected { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.status-pending, .status-neutral { color: var(--muted); background: var(--surface-2); border-color: var(--border); }
.subscription-main > p { position: relative; z-index: 1; max-width: 670px; margin: 17px 0 26px; color: var(--muted); }
.subscription-dates { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.subscription-dates div { min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-2); display: grid; }
.subscription-dates span { color: var(--muted); font-size: .7rem; }
.subscription-dates b { margin-top: 5px; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subscription-action { padding: 29px; display: flex; flex-direction: column; justify-content: center; color: #fff; background: linear-gradient(150deg, var(--navy), var(--navy-3)); }
.action-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: #64ddd4; background: rgba(23,178,166,.16); }
.action-icon svg { width: 22px; height: 22px; }
.subscription-action b { margin-top: 16px; font-size: 1rem; }
.subscription-action p { margin: 8px 0 18px; color: #b7c4da; font-size: .8rem; }
.subscription-action button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: var(--teal); color: #fff; font: inherit; font-size: .8rem; font-weight: 900; cursor: pointer; transition: transform .18s ease, background .18s ease, opacity .18s ease; }
.subscription-action button:hover { background: var(--teal-2); transform: translateY(-1px); }
.subscription-action button:disabled { cursor: not-allowed; opacity: .55; transform: none; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin: 18px 0; }
.stats-grid article { min-width: 0; display: flex; align-items: center; gap: 14px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: 0 8px 24px rgba(13,27,61,.035); }
.stat-icon { flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; }
.stat-icon svg { width: 23px; height: 23px; }
.stat-icon.teal { color: var(--teal-2); background: var(--teal-soft); }
.stat-icon.amber { color: var(--warning); background: var(--warning-soft); }
.stat-icon.navy { color: #5e78ab; background: color-mix(in srgb, #6781b8 14%, transparent); }
.stats-grid article > div { min-width: 0; display: grid; }
.stats-grid span { color: var(--muted); font-size: .72rem; }
.stats-grid b { margin-top: 2px; font-size: 1.35rem; overflow: hidden; text-overflow: ellipsis; }
.stats-grid small { margin-top: 2px; color: var(--muted); font-size: .67rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { padding: 25px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: 0 8px 24px rgba(13,27,61,.035); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.panel-heading div { display: grid; }
.panel-heading span { color: var(--teal-2); font-size: .72rem; font-weight: 900; }
html[data-theme="dark"] .panel-heading span { color: #62d8d0; }
.panel-heading h3 { margin: 3px 0 0; font-size: 1.12rem; }
.panel-heading > svg { width: 27px; height: 27px; color: var(--muted); }
.account-panel dl { margin: 0; }
.account-panel dl > div { display: grid; grid-template-columns: minmax(120px, .75fr) minmax(0, 1.25fr); align-items: center; gap: 18px; min-height: 57px; border-bottom: 1px solid var(--border); }
.account-panel dl > div:last-child { border-bottom: 0; }
.account-panel dt { color: var(--muted); font-size: .76rem; }
.account-panel dd { margin: 0; font-size: .82rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#profileEmail { direction: ltr; text-align: start; }
.access-list { display: grid; gap: 12px; margin: 20px 0; padding: 0; list-style: none; }
.access-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: .8rem; }
.access-list svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--success); margin-top: 2px; }
.portal-warning { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border-radius: 13px; background: var(--warning-soft); color: var(--warning); }
.portal-warning svg { flex: 0 0 auto; width: 19px; height: 19px; margin-top: 1px; }
.portal-warning p { margin: 0; font-size: .74rem; font-weight: 700; }
.data-notice { margin-top: 18px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .77rem; }


/* Payment renewal requests */
.payment-panel { margin: 18px 0; }
.payment-panel-heading { align-items: center; }
.new-request-btn { min-height: 40px; padding: 0 15px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--border)); border-radius: 12px; background: var(--teal-soft); color: var(--teal-2); font: inherit; font-size: .76rem; font-weight: 900; cursor: pointer; }
.new-request-btn svg { width: 17px; height: 17px; }
.new-request-btn:hover { border-color: var(--teal); }
.new-request-btn:disabled { opacity: .5; cursor: not-allowed; }
.payment-history-list { display: grid; gap: 10px; margin-top: 17px; }
.payment-request-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 15px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.payment-request-main { min-width: 0; display: grid; gap: 5px; }
.payment-request-main b { font-size: .86rem; }
.payment-request-main small { color: var(--muted); font-size: .7rem; overflow-wrap: anywhere; }
.payment-request-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-align: end; }
.payment-request-meta strong { display: grid; font-size: .86rem; }
.payment-request-meta strong small { color: var(--muted); font-size: .65rem; font-weight: 600; }
.request-status { min-height: 30px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; font-size: .68rem; font-weight: 900; border: 1px solid transparent; }
.request-status-pending { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.request-status-approved { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.request-status-rejected { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.payment-history-state { min-height: 100px; margin-top: 17px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); text-align: center; }
.payment-history-state[hidden] { display: none; }
.payment-history-state svg { width: 30px; height: 30px; color: var(--muted); }
.payment-history-state > div { display: grid; }
.payment-history-state b { color: var(--text); font-size: .86rem; }
.payment-history-state small { font-size: .72rem; }
.mini-loader { width: 20px; height: 20px; border: 2px solid color-mix(in srgb, var(--teal) 20%, transparent); border-top-color: var(--teal); border-radius: 50%; animation: spin .75s linear infinite; }
.payment-feature-notice { margin-top: 15px; padding: 12px 14px; border-radius: 12px; background: var(--warning-soft); color: var(--warning); font-size: .73rem; font-weight: 700; }

/* Renewal modal */
.renewal-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; }
.renewal-modal[hidden] { display: none; }
.renewal-backdrop { position: absolute; inset: 0; background: rgba(3, 10, 24, .78); }
.renewal-dialog { position: relative; z-index: 1; width: min(620px, 100%); max-height: min(88vh, 820px); overflow: auto; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.renewal-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 25px 25px 20px; border-bottom: 1px solid var(--border); }
.renewal-dialog-header > div { min-width: 0; }
.renewal-dialog-header span { color: var(--teal-2); font-size: .72rem; font-weight: 900; }
.renewal-dialog-header h2 { margin: 4px 0 6px; font-size: 1.45rem; }
.renewal-dialog-header p { margin: 0; color: var(--muted); font-size: .78rem; }
.dialog-close { flex: 0 0 auto; width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.dialog-close svg { width: 19px; height: 19px; }
#renewalForm { display: grid; gap: 10px; padding: 22px 25px 25px; }
#renewalForm > label, .payment-method-fieldset legend { color: var(--text); font-size: .76rem; font-weight: 800; }
.renewal-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 3px; }
.renewal-summary div { padding: 13px 15px; display: grid; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.renewal-summary span { color: var(--muted); font-size: .68rem; }
.renewal-summary b { margin-top: 2px; font-size: .92rem; }
.renewal-select, .renewal-input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .8rem; outline: none; }
.renewal-select:focus, .renewal-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.renewal-textarea { min-height: 84px; padding-top: 11px; resize: vertical; }
.field-help { margin-top: -5px; color: var(--muted); font-size: .66rem; }
.payment-method-fieldset { min-width: 0; margin: 3px 0 0; padding: 0; border: 0; }
.payment-method-fieldset legend { margin-bottom: 8px; }
.payment-method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.payment-method-option { min-width: 0; min-height: 72px; padding: 10px 12px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); color: var(--text); text-align: start; cursor: pointer; }
.payment-method-option:hover { border-color: color-mix(in srgb, var(--teal) 55%, var(--border)); }
.payment-method-option.selected { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 14%, transparent); }
.payment-method-logo { flex: 0 0 auto; width: 54px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #fff; border: 1px solid rgba(13,27,61,.08); }
.payment-method-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.payment-method-logo svg { width: 22px; height: 22px; color: var(--teal-2); }
.payment-method-option > span:last-child { min-width: 0; display: grid; }
.payment-method-option b { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payment-method-option small { color: var(--muted); font-size: .65rem; }
.payment-instructions { padding: 12px 13px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--teal) 25%, var(--border)); background: var(--teal-soft); color: var(--text); font-size: .72rem; white-space: pre-line; }
.renewal-message { padding: 12px 13px; border-radius: 12px; font-size: .73rem; font-weight: 700; }
.renewal-message.error { background: var(--danger-soft); color: var(--danger); }
.renewal-message.success { background: var(--success-soft); color: var(--success); }
.renewal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.cancel-request-btn, .submit-request-btn { min-height: 44px; padding: 0 18px; border-radius: 12px; font: inherit; font-size: .78rem; font-weight: 900; cursor: pointer; }
.cancel-request-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.submit-request-btn { min-width: 130px; position: relative; border: 0; background: var(--teal); color: #fff; }
.submit-request-btn .button-spinner { display: none; }
.submit-request-btn.loading span { visibility: hidden; }
.submit-request-btn.loading .button-spinner { display: block; position: absolute; inset: 50% auto auto 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
.submit-request-btn:disabled, .cancel-request-btn:disabled { opacity: .55; cursor: not-allowed; }
body.modal-open { overflow: hidden; }

.portal-footer { border-top: 1px solid var(--border); background: var(--surface); }
.portal-footer .portal-shell { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: .75rem; }
.portal-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.portal-footer a { color: var(--muted); text-decoration: none; }
.portal-footer a:hover { color: var(--teal-2); }

@media (max-width: 980px) {
  .auth-grid { grid-template-columns: 1fr; gap: 38px; }
  .auth-intro { max-width: 760px; text-align: center; margin-inline: auto; }
  .auth-intro > p { margin-inline: auto; }
  .auth-trust { max-width: 680px; margin-inline: auto; margin-top: 30px; }
  .auth-trust article { max-width: none; text-align: start; }
  .login-card { width: min(520px, 100%); margin-inline: auto; }
  .subscription-hero { grid-template-columns: 1fr; }
  .subscription-action { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; }
  .subscription-action b { margin: 0; }
  .subscription-action p { margin: 4px 0 0; }
  .subscription-action button { min-width: 140px; }
  .subscription-action .action-icon { grid-row: 1 / 3; }
  .subscription-action b, .subscription-action p { grid-column: 2; }
  .subscription-action button { grid-column: 3; grid-row: 1 / 3; }
}

@media (max-width: 760px) {
  .portal-shell { width: min(100% - 24px, 1180px); }
  .portal-nav { min-height: 68px; }
  .portal-brand img { width: 39px; height: 39px; }
  .portal-brand small { display: none; }
  .back-site span { display: none; }
  .back-site { width: 42px; padding: 0; justify-content: center; }
  .lang-btn span { display: none; }
  .auth-view { padding: 45px 0 60px; }
  .auth-intro h1 { font-size: clamp(2.25rem, 13vw, 3.6rem); }
  .auth-intro > p { font-size: .91rem; }
  .auth-trust { grid-template-columns: 1fr; }
  .auth-trust article { padding: 11px; }
  .login-card { padding: 25px 18px; border-radius: 23px; }
  .dashboard-view { padding: 30px 0 58px; }
  .dashboard-topbar { align-items: flex-start; }
  .dashboard-topbar h1 { font-size: 1.65rem; }
  .logout-btn span { display: none; }
  .logout-btn { width: 43px; padding: 0; justify-content: center; }
  .subscription-main { padding: 23px 18px; }
  .subscription-title-row h2 { font-size: 2rem; }
  .subscription-dates { grid-template-columns: 1fr; }
  .subscription-action { display: flex; align-items: stretch; }
  .subscription-action button { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .account-panel dl > div { grid-template-columns: 1fr; gap: 3px; padding: 12px 0; }

  .payment-request-item { grid-template-columns: 1fr; gap: 10px; }
  .payment-request-meta { justify-content: space-between; text-align: start; }
  .payment-panel-heading { align-items: flex-start; }
  .new-request-btn span { display: none; }
  .new-request-btn { width: 40px; padding: 0; justify-content: center; }
  .renewal-dialog { max-height: 94vh; border-radius: 20px; }
  .renewal-dialog-header, #renewalForm { padding-inline: 18px; }
  .payment-method-grid { grid-template-columns: 1fr; }
  .portal-footer .portal-shell { padding: 18px 0; flex-direction: column; justify-content: center; text-align: center; }
  .portal-footer nav { justify-content: center; }
}

@media (max-width: 420px) {
  .portal-nav-actions { gap: 6px; }
  .icon-btn, .back-site { width: 39px; min-height: 39px; }
  .lang-btn { min-height: 39px; padding: 0 9px; }
  .portal-brand b { font-size: .88rem; }
  .login-heading img { width: 48px; height: 48px; }
  .login-heading h2 { font-size: 1.35rem; }
  .subscription-title-row { flex-direction: column; }
  .status-pill { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* V15 — Payment Protocol V2 ready UI */
.renewal-dialog-v2 { width: min(820px, 100%); max-height: min(94vh, 980px); }
#renewalForm { gap: 16px; }
.renewal-step { display: grid; gap: 11px; padding: 16px; border: 1px solid var(--border); border-radius: 17px; background: color-mix(in srgb, var(--surface-2) 74%, transparent); }
.step-heading { display: flex; align-items: center; gap: 11px; }
.step-heading > span { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--teal-soft); color: var(--teal-2); font-weight: 900; }
.step-heading > div { display: grid; }
.step-heading b { font-size: .84rem; }
.step-heading small { color: var(--muted); font-size: .68rem; }
.plan-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.plan-choice { min-width: 0; padding: 13px; display: grid; gap: 7px; text-align: start; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer; }
.plan-choice:hover { border-color: color-mix(in srgb, var(--teal) 50%, var(--border)); }
.plan-choice.selected { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.plan-choice:disabled { opacity: .5; cursor: not-allowed; }
.plan-choice-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-choice-head b { font-size: .9rem; }
.plan-choice-head small { padding: 3px 7px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: .58rem; font-weight: 900; }
.plan-choice strong { color: var(--teal-2); font-size: 1rem; }
.plan-choice > small { color: var(--muted); font-size: .66rem; }
.payment-method-grid-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.payment-method-option { min-height: 88px; }
.payment-method-logo { width: 72px; height: 60px; padding: 7px; border-radius: 12px; background: #fff; }
.payment-method-logo img { width: 100%; height: 100%; object-fit: contain; }
.payment-destination { display: grid; gap: 13px; padding: 16px; border: 1px solid color-mix(in srgb, var(--teal) 30%, var(--border)); border-radius: 17px; background: var(--teal-soft); }
.payment-destination[hidden] { display: none; }
.destination-brand { display: flex; align-items: center; gap: 12px; }
.destination-logo { width: 86px; height: 62px; padding: 8px; display: grid; place-items: center; border-radius: 13px; background: #fff; border: 1px solid rgba(13,27,61,.1); }
.destination-logo img { width: 100%; height: 100%; object-fit: contain; }
.destination-brand > div:last-child { display: grid; }
.destination-brand b { font-size: .95rem; }
.destination-brand small { color: var(--muted); font-size: .68rem; }
.destination-data { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.destination-data > div { position: relative; min-width: 0; padding: 12px 13px; display: grid; gap: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.destination-data span { color: var(--muted); font-size: .64rem; }
.destination-data b { padding-inline-end: 48px; font-size: .78rem; overflow-wrap: anywhere; direction: ltr; text-align: start; }
.copy-value-btn { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); min-height: 30px; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .62rem; font-weight: 800; cursor: pointer; }
.destination-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.payment-link-btn, .qr-toggle-btn { min-height: 38px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--teal) 34%, var(--border)); border-radius: 11px; background: var(--surface); color: var(--teal-2); font: inherit; font-size: .7rem; font-weight: 900; text-decoration: none; cursor: pointer; }
.payment-qr-wrap { padding: 12px; display: grid; place-items: center; border-radius: 14px; background: #fff; }
.payment-qr-wrap[hidden] { display: none; }
.payment-qr-wrap img { max-width: min(100%, 380px); max-height: 420px; object-fit: contain; }
.proof-dropzone { min-height: 126px; padding: 20px; display: grid; place-items: center; gap: 5px; text-align: center; border: 1.5px dashed color-mix(in srgb, var(--teal) 55%, var(--border)); border-radius: 15px; background: var(--teal-soft); cursor: pointer; }
.proof-dropzone:hover, .proof-dropzone.dragover { border-color: var(--teal); }
.proof-dropzone svg { width: 30px; height: 30px; color: var(--teal-2); }
.proof-dropzone b { font-size: .8rem; }
.proof-dropzone small { color: var(--muted); font-size: .65rem; }
.proof-preview { padding: 10px; display: grid; grid-template-columns: 62px minmax(0,1fr) auto; align-items: center; gap: 11px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.proof-preview[hidden] { display: none; }
.proof-preview img { width: 62px; height: 56px; object-fit: cover; border-radius: 9px; background: var(--surface-2); }
.proof-preview > div { min-width: 0; display: grid; }
.proof-preview b { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proof-preview small { color: var(--muted); font-size: .64rem; }
.proof-preview button { min-height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--danger); font: inherit; font-size: .66rem; font-weight: 800; cursor: pointer; }
.payment-protocol-notice { padding: 12px 14px; border-radius: 12px; background: var(--warning-soft); color: var(--warning); font-size: .72rem; font-weight: 800; }
.payment-protocol-notice[hidden] { display: none; }
.support-fallback-btn { min-height: 43px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); text-decoration: none; font-size: .74rem; font-weight: 900; }
body.modal-open { overflow: hidden; }
@media (max-width: 720px) {
  .renewal-modal { padding: 0; place-items: end center; }
  .renewal-dialog-v2 { width: 100%; max-height: 94dvh; border-radius: 24px 24px 0 0; }
  .renewal-dialog-header, #renewalForm { padding-inline: 16px; }
  .plan-choice-grid { grid-template-columns: 1fr; }
  .payment-method-grid-v2, .destination-data { grid-template-columns: 1fr; }
  .payment-method-logo { width: 66px; }
  .renewal-summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 440px) {
  .renewal-summary { grid-template-columns: 1fr; }
  .proof-preview { grid-template-columns: 52px minmax(0,1fr); }
  .proof-preview img { width: 52px; height: 50px; }
  .proof-preview button { grid-column: 1 / -1; }
}


/* V15.1 — payment asset containment and long identifiers */
.payment-method-option { overflow: hidden; }
.payment-method-logo { width: 62px; height: 52px; min-width: 62px; padding: 6px; }
.payment-method-logo img,
.destination-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.destination-brand { min-width: 0; overflow: hidden; }
.destination-logo { flex: 0 0 76px; width: 76px; height: 62px; overflow: hidden; }
.destination-brand > div:last-child { min-width: 0; }
.destination-brand b, .destination-brand small { overflow-wrap: anywhere; }
.destination-data b { unicode-bidi: plaintext; }
@media (max-width: 520px) {
  .payment-method-logo { width: 56px; min-width: 56px; height: 48px; }
  .destination-logo { flex-basis: 68px; width: 68px; height: 56px; }
}

/* V16 — feature entitlements, inventory portal and payment modal refinement */
.entitlements-panel,
.portal-inventory-panel { margin-top: 16px; }
.feature-plan-badge,
.locked-feature-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-2);
  font-size: .72rem;
  font-weight: 900;
}
.entitlements-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.entitlement-item { min-width: 0; padding: 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-2); }
.entitlement-item > span { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--surface); }
.entitlement-item.enabled > span { color: var(--success); background: var(--success-soft); }
.entitlement-item.locked > span { color: var(--warning); background: var(--warning-soft); }
.entitlement-item div { min-width: 0; display: grid; }
.entitlement-item b { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entitlement-item small { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.feature-upgrade-link { display: inline-flex; margin-top: 15px; color: var(--teal-2); font-size: .75rem; font-weight: 900; text-decoration: none; }

.inventory-panel-heading { align-items: center; }
.inventory-state { min-height: 110px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; }
.inventory-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.inventory-metrics article { min-width: 0; padding: 16px; display: grid; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-2); }
.inventory-metrics span { color: var(--muted); font-size: .7rem; }
.inventory-metrics b { margin-top: 5px; font-size: 1.25rem; overflow-wrap: anywhere; }
.inventory-full-block,
.inventory-advanced-block { margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); }
.inventory-subheading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.inventory-records { display: grid; gap: 8px; }
.inventory-records article { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.inventory-record-type { padding: 5px 7px; border-radius: 8px; background: var(--teal-soft); color: var(--teal-2); font-size: .62rem; font-weight: 900; }
.inventory-records article div { min-width: 0; display: grid; }
.inventory-records article b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .77rem; }
.inventory-records article small { color: var(--muted); font-size: .64rem; }
.inventory-records article strong { font-size: .72rem; white-space: nowrap; }
.inventory-empty,
.feature-lock-callout { padding: 18px; border: 1px dashed var(--border); border-radius: 13px; color: var(--muted); text-align: center; }
.feature-lock-callout { display: grid; gap: 4px; }
.feature-lock-callout b { color: var(--text); }
.feature-lock-callout small { font-size: .7rem; }
.inventory-advanced-block { display: flex; align-items: center; gap: 12px; }
.inventory-advanced-block > div { display: grid; }
.inventory-advanced-block small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.inventory-advanced-block.locked { opacity: .72; }

.renewal-dialog-v2 { overflow: hidden; }
.renewal-dialog-header { position: relative; z-index: 3; background: var(--surface); }
#renewalForm {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#renewalForm::-webkit-scrollbar { width: 0; height: 0; display: none; }
.payment-method-option { min-height: 82px; align-items: center; }
.payment-method-logo,
.destination-logo { display: grid; place-items: center; overflow: hidden; }
.payment-method-logo img,
.destination-logo img { width: 100%; height: 100%; object-fit: contain; object-position: center; margin: auto; }
.destination-brand { align-items: center; }
.destination-data > div { position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; }
.destination-data > div > span { grid-column: 1 / -1; }
.destination-data > div > b { min-width: 0; direction: ltr; unicode-bidi: plaintext; text-align: start; overflow-wrap: anywhere; word-break: break-word; }
.destination-data .copy-value-btn { position: static; align-self: center; }
.destination-actions { justify-content: flex-start; flex-wrap: wrap; }
.renewal-actions { grid-template-columns: auto auto minmax(180px, 1fr); align-items: center; }
.support-fallback-btn { order: 2; }
.submit-request-btn { order: 3; }
.cancel-request-btn { order: 1; }
.submit-request-btn:disabled { opacity: .48; cursor: not-allowed; }
.request-result { margin-top: 2px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--success) 28%, var(--border)); border-radius: 12px; background: var(--success-soft); color: var(--success); font-size: .76rem; font-weight: 900; }

@media (max-width: 900px) {
  .entitlements-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .renewal-dialog-v2 { max-height: 96dvh; }
  .renewal-dialog-header { padding-block: 16px; }
  #renewalForm { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .entitlements-grid,
  .inventory-metrics { grid-template-columns: 1fr 1fr; }
  .inventory-records article { grid-template-columns: 1fr auto; }
  .inventory-record-type { grid-column: 1 / -1; justify-self: start; }
  .renewal-actions { grid-template-columns: 1fr 1fr; }
  .submit-request-btn { grid-column: 1 / -1; order: 1; }
  .cancel-request-btn { order: 2; }
  .support-fallback-btn { order: 3; }
}

@media (max-width: 420px) {
  .entitlements-grid,
  .inventory-metrics { grid-template-columns: 1fr; }
}


/* V16.1 — modal scrolling, plan preview and shop-name polish */
.renewal-dialog-v2 {
  display: flex;
  flex-direction: column;
  height: min(94dvh, 980px);
  max-height: min(94dvh, 980px);
  overflow: hidden;
}
.renewal-dialog-v2 .renewal-dialog-header { flex: 0 0 auto; }
.renewal-dialog-v2 #renewalForm {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scroll-padding-block: 18px 96px;
}
.plan-choice.server-pending:not(:disabled) { border-style: dashed; }
.plan-choice.server-pending:not(:disabled) .plan-choice-head small {
  background: var(--warning-soft);
  color: var(--warning);
}
@media (max-width: 720px) {
  .renewal-dialog-v2 { height: 96dvh; max-height: 96dvh; }
}

/* V16.2 portal action simplification */
.subscription-action button{width:100%}
.subscription-support{min-height:41px;margin-top:9px;padding:0 12px;border:1px solid rgba(255,255,255,.18);border-radius:12px;display:flex;align-items:center;justify-content:center;color:#dbe6f4;background:rgba(255,255,255,.06);font-size:.74rem;font-weight:850;text-decoration:none;transition:background .18s ease,border-color .18s ease}
.subscription-support:hover{background:rgba(255,255,255,.11);border-color:rgba(98,221,212,.42)}
.subscription-support[data-unavailable="true"],.portal-footer [data-contact][data-unavailable="true"]{display:none}

/* V28: renewal actions stay clickable and explain why submission is unavailable. */
.new-request-btn.is-unavailable {
  opacity:.76;
  border-style:dashed;
}
.new-request-btn.is-unavailable:hover {
  opacity:1;
  border-color:var(--orange);
  color:var(--orange);
}
.payment-feature-notice.action-feedback {
  border:1px solid color-mix(in srgb,var(--warning) 38%,transparent);
  box-shadow:0 10px 26px rgba(177,107,0,.08);
}

/* V31.4 — portal checkout restore and visual polish */
html { scroll-padding-top: 96px; }
.dashboard-view { padding-top: 64px; }
.subscription-hero, .payment-history-card, .portal-card { scroll-margin-top: 96px; }
.new-request-btn { min-width: 112px; justify-content: center; }
.new-request-btn.is-unavailable { opacity: 1; color: var(--warning); background: var(--warning-soft); }
#deviceSafeNote { display:block; margin-top:4px; line-height:1.45; }
@media (max-width: 720px) {
  .dashboard-view { padding-top: 38px; }
  .new-request-btn { min-width: 42px; }
}

/* V31.5 — compact checkout and reliable payment-data presentation */
.renewal-dialog-v2{
  width:min(900px,calc(100vw - 28px));
  height:min(92dvh,900px);
  max-height:min(92dvh,900px);
}
.renewal-dialog-v2 .renewal-dialog-header{
  position:sticky;
  top:0;
  z-index:8;
  padding-block:17px;
  border-bottom:1px solid var(--border);
  box-shadow:0 8px 24px rgba(8,18,37,.08);
}
.renewal-dialog-v2 #renewalForm{
  gap:12px;
  padding-top:14px;
  padding-bottom:0;
}
.renewal-step{
  gap:9px;
  padding:13px 14px;
  border-radius:15px;
}
.plan-choice-grid{gap:8px}
.plan-choice{padding:11px 12px;gap:5px}
.plan-choice:not(:disabled){opacity:1}
.plan-choice.server-pending{border-style:solid}
.payment-method-option{
  min-height:70px;
  padding:8px 10px;
}
.payment-method-logo{
  width:54px;
  min-width:54px;
  height:46px;
  padding:5px;
}
.payment-destination{
  gap:10px;
  padding:13px 14px;
  border-radius:15px;
}
.destination-logo{
  flex-basis:62px;
  width:62px;
  height:50px;
  padding:6px;
}
.payment-instructions{font-size:.7rem;line-height:1.75}
.destination-data[hidden]{display:none}
.destination-data>div{padding:10px 11px}
.proof-dropzone{min-height:96px;padding:14px}
.proof-dropzone svg{width:25px;height:25px}
.renewal-textarea{min-height:72px}
.renewal-actions{
  position:sticky;
  bottom:0;
  z-index:9;
  margin-inline:-1px;
  padding:12px 0 calc(12px + env(safe-area-inset-bottom));
  border-top:1px solid var(--border);
  background:linear-gradient(to top,var(--surface) 82%,color-mix(in srgb,var(--surface) 92%,transparent));
  box-shadow:0 -10px 26px rgba(8,18,37,.08);
}
@media(max-width:720px){
  .renewal-dialog-v2{width:100%;height:96dvh;max-height:96dvh}
  .renewal-step{padding:12px}
  .plan-choice-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .plan-choice{padding:10px 8px}
  .plan-choice-head{align-items:flex-start}
  .plan-choice-head b{font-size:.78rem}
  .plan-choice strong{font-size:.84rem}
  .payment-method-grid-v2{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:520px){
  .plan-choice-grid,.payment-method-grid-v2{grid-template-columns:1fr}
}


/* V31.9 — close successful payment modal and show a 10-second green toast */
.portal-toast-region {
  position: fixed;
  z-index: 1200;
  inset-block-start: max(18px, env(safe-area-inset-top));
  inset-inline: 18px;
  display: grid;
  justify-items: center;
  pointer-events: none;
}
.portal-toast {
  --toast-duration: 10000ms;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: min(560px, 100%);
  min-height: 58px;
  padding: 13px 16px 16px;
  border: 1px solid color-mix(in srgb, var(--success) 42%, var(--border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--success-soft) 94%, var(--surface));
  color: var(--success);
  box-shadow: 0 18px 46px rgba(3, 25, 18, .22);
  opacity: 0;
  transform: translateY(-18px) scale(.98);
  transition: opacity .22s ease, transform .22s ease;
  overflow: hidden;
  pointer-events: auto;
}
.portal-toast.show { opacity: 1; transform: translateY(0) scale(1); }
.portal-toast-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  font-size: 1rem;
  font-weight: 1000;
}
.portal-toast-text {
  min-width: 0;
  font-size: .84rem;
  font-weight: 900;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.portal-toast-progress {
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: 0;
  width: 100%;
  height: 4px;
  background: var(--success);
  transform-origin: inline-start;
  animation: portal-toast-countdown var(--toast-duration) linear forwards;
}
@keyframes portal-toast-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .portal-toast { transition: none; transform: none; }
  .portal-toast-progress { animation: none; }
}
@media (max-width: 620px) {
  .portal-toast-region { inset-inline: 10px; inset-block-start: max(10px, env(safe-area-inset-top)); }
  .portal-toast { border-radius: 14px; padding-inline: 13px; }
}
