/* TodPlayer upload portal ([todplayer_portal]).
   Uses the TodPlayer theme's tokens when present, with the same values as fallback. */

.todp-portal {
  --p-bg: var(--bg, #070A13); --p-raise: var(--bg-raise, #0B1020); --p-surface: var(--surface, #10162A);
  --p-high: var(--surface-high, #161E36); --p-line: var(--line, #222B45); --p-line-soft: var(--line-soft, #1A2238);
  --p-ink: var(--ink, #F3F5FB); --p-soft: var(--ink-soft, #BCC3D6); --p-muted: var(--muted, #7E88A5);
  --p-accent: var(--accent, #FF5A1F); --p-accent-2: var(--accent-light, #FF7B3A); --p-code: var(--code, #FFB547);
  --p-ok: var(--ok, #34D399); --p-bad: var(--bad, #F87171);
  --p-mono: var(--mono, ui-monospace, Consolas, monospace);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start;
  color: var(--p-soft); font-size: 16px; line-height: 1.6;
}
.todp-portal * { box-sizing: border-box; }
.todp-portal h2, .todp-portal h3 { color: var(--p-ink); margin: 0; letter-spacing: -0.02em; }
.todp-portal [hidden] { display: none !important; }

/* guide column */
.todp-guide { position: sticky; top: 96px; }
.todp-guide-title { font-size: 22px !important; font-weight: 680; margin: 0 0 18px !important; }
.todp-guide-steps { list-style: none; padding: 0; margin: 0; counter-reset: g; display: grid; gap: 16px; }
.todp-guide-steps li { counter-increment: g; position: relative; padding-left: 48px; font-size: 15.5px; line-height: 1.6; margin: 0 !important; }
.todp-guide-steps li::before { content: counter(g); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--p-high); border: 1px solid var(--p-line); font: 650 13px/1 var(--p-mono); color: var(--p-ink); }
.todp-guide-steps strong { color: var(--p-ink); font-weight: 600; }
.todp-figure { margin: 24px 0 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--p-line); }
.todp-figure img { display: block; width: 100%; height: auto; }
.todp-guide-note { margin: 20px 0 0 !important; font-size: 14px !important; color: var(--p-muted); line-height: 1.6; }

/* progress */
.todp-progress { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 16px !important; }
.todp-progress li { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--p-line-soft); font-size: 14px !important; font-weight: 600; color: var(--p-muted); margin: 0 !important; }
.todp-progress li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 650 12px/1 var(--p-mono); background: var(--p-high); color: var(--p-muted); }
.todp-progress li.is-current { border-color: var(--p-accent); color: var(--p-ink); }
.todp-progress li.is-current span { background: var(--p-accent); color: #fff; }
.todp-progress li.is-done span { background: var(--p-ok); color: #06231a; }

/* card */
.todp-card { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 20px; padding: 32px; box-shadow: 0 24px 60px -24px rgba(2, 4, 12, .85); }
.todp-card > h2 { font-size: 26px !important; font-weight: 700; margin: 0 !important; }
.todp-card > p { margin: 8px 0 22px !important; }
.todp-card h3 { font-size: 17px !important; font-weight: 650; margin: 28px 0 12px !important; }
.todp-muted { color: var(--p-muted); }
.todp-mono { font-family: var(--p-mono) !important; }

.todp-form { display: grid; gap: 14px; }
.todp-form label { display: grid; gap: 7px; font-size: 14px; font-weight: 600; color: var(--p-ink); }
.todp-form input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--p-line); background: var(--p-bg);
  color: var(--p-ink); font: 500 16px var(--sans, inherit); transition: border-color .15s, box-shadow .15s;
}
.todp-form input.todp-mono { font-size: 15px; letter-spacing: .02em; }
.todp-form input::placeholder { color: #55607E; }
.todp-form input:focus { outline: none; border-color: var(--p-accent); box-shadow: 0 0 0 3px rgba(255, 90, 31, .2); }
.todp-form details { border: 1px solid var(--p-line-soft); border-radius: 12px; padding: 12px 14px; }
.todp-form summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--p-soft); }
.todp-form details[open] summary { margin-bottom: 12px; }
.todp-form details label + label { margin-top: 12px; }
.todp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.todp-pass { position: relative; display: block; }
.todp-pass input { padding-right: 70px; }
.todp-reveal { position: absolute; right: 8px; top: 9px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--p-line); background: var(--p-high); color: var(--p-soft); font: 600 12px var(--sans, inherit); cursor: pointer; }

.todp-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 20px; border-radius: 12px;
  border: 1px solid var(--p-line); background: transparent; color: var(--p-ink); font: 600 15px var(--sans, inherit); cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.todp-btn:active { transform: translateY(1px); }
.todp-btn[disabled] { opacity: .55; cursor: progress; }
.todp-btn-primary { background: var(--p-accent); border-color: var(--p-accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 12px 28px -12px rgba(255,90,31,.7); }
.todp-btn-primary:hover { background: var(--p-accent-2); }
.todp-form > .todp-btn-primary { justify-self: start; min-width: 200px; }
.todp-btn-quiet { height: 38px; padding: 0 14px; font-size: 14px; }
.todp-btn-danger { height: 36px; padding: 0 12px; font-size: 13px; color: var(--p-bad); border-color: rgba(248,113,113,.3); }
.todp-btn-danger:hover { background: rgba(248,113,113,.08); }

.todp-device { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--p-line-soft); border-radius: 14px; background: var(--p-raise); }
.todp-device-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(52,211,153,.12); color: var(--p-ok); }
.todp-device-icon svg { width: 22px; height: 22px; }
.todp-device strong { display: block; color: var(--p-ink); font-size: 16px; }
.todp-device .todp-muted { font-size: 14px; }

.todp-list { list-style: none; padding: 0 !important; margin: 0 !important; display: grid; gap: 8px; }
.todp-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--p-line-soft); border-radius: 14px; background: var(--p-raise); margin: 0 !important; }
.todp-list li > div { min-width: 0; }
.todp-list strong { color: var(--p-ink); font-size: 16px; font-weight: 600; }
.todp-list .todp-mono { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.todp-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--p-line); font: 600 11px/1.6 var(--p-mono); color: var(--p-code); vertical-align: middle; }
.todp-empty { color: var(--p-muted); justify-content: center !important; border-style: dashed !important; }
.todp-small { font-size: 13px; }

.todp-tabs { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--p-bg); border: 1px solid var(--p-line); margin-bottom: 16px; }
.todp-tab { height: 38px; padding: 0 16px; border-radius: 9px; border: 0; background: none; color: var(--p-muted); font: 600 14px var(--sans, inherit); cursor: pointer; }
.todp-tab.is-active { background: var(--p-high); color: var(--p-ink); box-shadow: inset 0 0 0 1px var(--p-line); }

.todp-message { min-height: 24px; margin: 16px 0 0 !important; font-size: 15px; font-weight: 500; }
.todp-message.is-error { color: var(--p-bad); }
.todp-message.is-ok { color: var(--p-ok); }
.todp-legal { margin: 8px 0 0 !important; font-size: 13px !important; color: var(--p-muted); }

@media (max-width: 860px) {
  .todp-portal { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .todp-guide { position: static; order: 2; }
  .todp-card { padding: 22px; }
  .todp-grid { grid-template-columns: minmax(0, 1fr); }
  .todp-progress li { font-size: 13px !important; padding: 10px; }
}
