/* /my - ported from the approved docs/design/my-page.html mock (brief §G). */
:root {
  color-scheme: dark;
  --ink:#0B1120; --surface: #111720; --surface-2: #171e29; --raise: #1c2430;
  --line: #212a37; --line-2: #2c3645;
  --fg: #e8edf4; --fg-2: #a3aebf; --fg-3: #6c788b;
  --blue: #3a86f0; --blue-2: #5b9cf5; --blue-soft: rgba(58, 134, 240, .12);
  --tp: #2fbf7f; --tp-soft: rgba(47, 191, 127, .12);
  --sl: #ef5b5b; --sl-soft: rgba(239, 91, 91, .1);
  --gold: #e2b23c; --gold-soft: rgba(226, 178, 60, .1);
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-num: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --f-latin: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --r: 14px;
}
html[lang="fa"] { --f-body: "Vazirmatn", Tahoma, "Segoe UI", sans-serif; --f-num: "Vazirmatn", Tahoma, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--ink); color: var(--fg); }
body { margin: 0; font: 400 15.5px/1.75 var(--f-body); -webkit-font-smoothing: antialiased; padding-inline: 16px; }
html[lang="fa"] body { line-height: 1.9; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-weight: 700; text-wrap: balance; }
html[lang="fa"] h1, html[lang="fa"] h2 { font-weight: 800; }
button, input { font: inherit; color: inherit; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
html[lang="fa"] .num { font-weight: 700; }
.ltr { direction: ltr; unicode-bidi: isolate; font-family: var(--f-latin); }
.mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: isolate; }
.col { max-width: 600px; margin-inline: auto; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* top bar */
.top { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 9px; font: 700 1.02rem/1 var(--f-latin); direction: ltr; color: var(--fg); text-decoration: none; }
.brand-mark { width: 24px; height: 24px; border-radius: 6px; flex: none; display: block; }
.top .sp { flex: 1; }
.ghost { background: none; border: 1px solid var(--line-2); color: var(--fg-2); border-radius: 8px; padding: 6px 11px; font-size: .82rem; cursor: pointer; line-height: 1.4; }
.ghost:hover { color: var(--fg); border-color: var(--fg-3); }
html[lang="en"] #langBtn { font-family: "Vazirmatn", Tahoma, sans-serif; }
html[lang="fa"] #langBtn { font-family: var(--f-latin); }

main { padding-block: 8px 40px; display: grid; gap: 18px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 11px 18px; font-weight: 600; cursor: pointer; border: 1px solid transparent; line-height: 1.3; text-decoration: none; font-size: .95rem; }
html[lang="fa"] .btn { font-weight: 700; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-2); }
.btn-line { background: transparent; border-color: var(--line-2); color: var(--fg); }
.btn-line:hover { border-color: var(--fg-3); background: var(--surface-2); }
.btn-danger { background: transparent; border-color: rgba(239, 91, 91, .45); color: #ff9b9b; }
.btn-danger:hover { background: var(--sl-soft); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 8px; }
.link { background: none; border: 0; padding: 0; color: var(--blue-2); cursor: pointer; font-size: inherit; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* sign-in */
.auth { padding-block: clamp(24px, 8vh, 72px) 24px; display: grid; gap: 22px; max-width: 420px; margin-inline: auto; width: 100%; }
.auth h1 { font-size: 1.65rem; line-height: 1.35; }
.auth .lead { color: var(--fg-2); }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .88rem; color: var(--fg-2); font-weight: 500; }
.input { width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; outline: none; transition: border-color .15s; }
.input:focus { border-color: var(--blue); }
.input.ltr-in { direction: ltr; text-align: left; font-family: var(--f-latin); }
.input.key { font-family: "JetBrains Mono", ui-monospace, monospace; letter-spacing: .04em; text-transform: uppercase; }
.input[aria-invalid="true"] { border-color: var(--sl); }
.err { color: #ff9b9b; font-size: .84rem; }
.auth .alt { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .9rem; color: var(--fg-3); }
.note-ok { border: 1px solid rgba(47, 191, 127, .35); background: var(--tp-soft); color: #9fe6c3; border-radius: 10px; padding: 12px 14px; font-size: .92rem; }

/* summary panel */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(18px, 4vw, 26px); display: grid; gap: 20px; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; color: var(--fg-2); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 999px; font-weight: 600; font-size: .84rem; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--tp-soft); color: var(--tp); }
.pill-warn { background: var(--gold-soft); color: var(--gold); }
.pill-bad { background: var(--sl-soft); color: var(--sl); }
.dot-sep { color: var(--line-2); }
.days { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.days b { font-size: clamp(2.4rem, 2rem + 2vw, 3rem); line-height: 1; font-weight: 700; letter-spacing: -.01em; }
html[lang="fa"] .days b { font-weight: 800; letter-spacing: 0; }
.days span { color: var(--fg-2); }
.bar { height: 5px; border-radius: 99px; background: var(--raise); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--tp); }
.bar.warn i { background: var(--gold); }
.until { font-size: .86rem; color: var(--fg-3); }

.keybox { display: flex; align-items: center; gap: 8px; background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 14px; }
html[dir="rtl"] .keybox { padding: 8px 14px 8px 8px; }
.keybox .lbl { font-size: .8rem; color: var(--fg-3); white-space: nowrap; }
.keybox .mono { flex: 1; min-width: 0; font-size: .95rem; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.icon-btn { background: none; border: 0; color: var(--fg-3); width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--fg); background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }

.actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
@media (max-width: 420px) { .actions { grid-template-columns: 1fr; } }
.dl-meta { font-size: .84rem; color: var(--fg-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: -8px; }
.changes { margin: 0; padding-inline-start: 18px; color: var(--fg-2); font-size: .88rem; display: grid; gap: 2px; }

/* list */
.list { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.row + .row { border-top: 1px solid var(--line); }
.row-head { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 18px; align-items: center; gap: 14px; padding: 16px 18px; background: none; border: 0; text-align: start; cursor: pointer; }
.row-head:hover { background: var(--surface-2); }
.row-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--raise); display: grid; place-items: center; color: var(--fg-2); }
.row-ic svg { width: 17px; height: 17px; }
.row-t { display: grid; min-width: 0; }
.row-t strong { font-weight: 600; font-size: .98rem; }
html[lang="fa"] .row-t strong { font-weight: 700; }
.row-t span { color: var(--fg-3); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-hint { font-size: .8rem; color: var(--fg-3); white-space: nowrap; }
.row-hint.q { color: var(--gold); }
.chev { width: 18px; height: 18px; color: var(--fg-3); transition: transform .2s; }
html[dir="rtl"] .chev { transform: scaleX(-1); }
.row.open .chev { transform: rotate(90deg); }
html[dir="rtl"] .row.open .chev { transform: scaleX(-1) rotate(90deg); }
.row-body { padding: 0 18px 20px; padding-inline-start: 66px; display: grid; gap: 16px; }
@media (max-width: 480px) { .row-body { padding-inline-start: 18px; } .row-hint { display: none; } .row-head { grid-template-columns: 34px minmax(0, 1fr) 18px; } }
.muted { color: var(--fg-2); font-size: .92rem; }
.small { font-size: .84rem; color: var(--fg-3); }

.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 520px) { .rules { grid-template-columns: 1fr; } }
.rule { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.rule span:first-child { color: var(--fg-2); }
.rule span:last-child { font-weight: 600; text-align: end; }
.rule .off { color: var(--fg-3); font-weight: 500; }
.ver { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .84rem; color: var(--fg-3); }
.tag { border: 1px solid var(--line-2); border-radius: 6px; padding: 0 7px; font-size: .78rem; color: var(--fg-2); }

.policy { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: .88rem; color: var(--fg-2); background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.policy i { width: 8px; height: 8px; border-radius: 50%; margin-top: .62em; }
.policy .g { background: var(--tp); } .policy .y { background: var(--gold); }

.pending { border: 1px solid rgba(226, 178, 60, .4); background: var(--gold-soft); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: .9rem; color: #f3d58a; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { flex: 1 1 200px; }
.confirm { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; font-size: .92rem; }
.confirm .btns { display: flex; gap: 8px; flex-wrap: wrap; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; counter-increment: s; font-size: .92rem; color: var(--fg-2); }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: .8rem; color: var(--fg); font-family: var(--f-num); }
html[lang="fa"] .steps li::before { content: counter(s, persian); }
.copyline { display: inline-flex; align-items: center; gap: 4px; background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 2px 4px 2px 10px; margin-top: 6px; }
.copyline .mono { font-size: .86rem; color: var(--fg); }
.copyline .icon-btn { width: 28px; height: 28px; }
kbd { font-family: var(--f-latin); font-size: .82rem; background: var(--raise); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; color: var(--fg); direction: ltr; unicode-bidi: isolate; }

.site-footer { padding-block: 10px 36px; display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: center; font-size: .84rem; color: var(--fg-3); }
.site-footer a { color: var(--fg-3); text-decoration: none; } .site-footer a:hover { color: var(--fg); }

.toast { position: fixed; inset-inline: 0; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; pointer-events: none; z-index: 50; padding-inline: 16px; }
.toast div { background: var(--raise); border: 1px solid var(--line-2); color: var(--fg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.show div { opacity: 1; transform: none; }
