/* Sign-in screen ("secure access terminal") and the signed-in operator chip. */
html.auth-loading { background: #04111f; }
html.auth-loading .app-container { visibility: hidden; pointer-events: none; }
body.auth-locked { overflow: hidden; }
body.auth-locked .app-container { visibility: hidden; pointer-events: none; }

.auth-overlay {
  --a-navy: #061a2e;
  --a-ink: #0b2540;
  --a-amber: #f7b452;
  --a-amber-2: #d97706;
  --a-cyan: #00d9ff;
  --a-text: #e6f0f8;
  --a-muted: #9db4c8;
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: auto;
  background:
    radial-gradient(1100px 600px at 18% 12%, rgba(29, 79, 122, .55), transparent 60%),
    radial-gradient(900px 600px at 90% 95%, rgba(217, 119, 6, .16), transparent 60%),
    linear-gradient(160deg, #04111f 0%, #071d33 55%, #0a2a47 100%);
  color: var(--a-text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.auth-overlay[hidden] { display: none; }
.auth-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.auth-vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 45%, rgba(2, 10, 20, .65) 100%);
}
.auth-overlay > :not(canvas):not(.auth-vignette) { position: relative; z-index: 1; }

/* Top status bar */
.auth-topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px clamp(16px, 3vw, 36px); font-size: .74rem; color: var(--a-muted); }
.auth-topbar-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .04em; color: #cfe0ee; }
.auth-topbar-brand i { color: var(--a-amber); }
.auth-topbar-right { display: inline-flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.auth-restricted { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid rgba(247, 180, 82, .35); border-radius: 999px; background: rgba(247, 180, 82, .08); color: #ffd9a0; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: .64rem; }
.auth-clock { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #cfe0ee; font-size: .74rem; letter-spacing: .03em; }
.auth-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: auth-ping 2s infinite; flex: 0 0 auto; display: inline-block; }
@keyframes auth-ping { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

/* Shell */
/* No transform rests on the shell: text on a transformed (3D) layer is
   rasterised and looks blurry, so the entrance only fades and the shell ends
   with transform: none. */
.auth-shell {
  align-self: center; justify-self: center;
  width: min(1120px, calc(100% - 32px));
  margin: 8px auto 18px;
  display: grid; grid-template-columns: 1.08fr .92fr; gap: 22px;
  transition: opacity .45s ease;
  animation: auth-rise .6s ease-out both;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
@keyframes auth-rise { from { opacity: 0; } to { opacity: 1; } }

/* Left: mission panel */
.auth-intro { padding: clamp(22px, 3vw, 34px); border: 1px solid rgba(148, 197, 233, .16); border-radius: 18px; background: linear-gradient(160deg, rgba(10, 37, 64, .9), rgba(6, 22, 40, .82)); box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand-mark { position: relative; display: grid; place-items: center; width: 74px; height: 74px; flex: 0 0 auto; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(247,180,82,.25), 0 10px 26px rgba(0,0,0,.35); }
.auth-brand-mark img { width: 60px; height: 60px; object-fit: contain; border-radius: 50%; }
.auth-brand-ring { position: absolute; inset: -9px; border-radius: 50%; border: 1.5px dashed rgba(247, 180, 82, .55); animation: auth-spin 18s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-brand-copy strong { display: block; font-size: 1.05rem; letter-spacing: .01em; }
.auth-brand-copy small { display: block; margin-top: 4px; color: var(--a-amber); font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.auth-intro h1 { margin: 26px 0 10px; font-size: clamp(1.9rem, 3.4vw, 2.9rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; }
.auth-intro h1 span { background: linear-gradient(90deg, var(--a-amber), #ffd9a0 45%, var(--a-cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-intro > p { max-width: 470px; margin: 0; color: #c3d6e6; font-size: .9rem; line-height: 1.6; }

/* Console */
.auth-console { margin-top: 20px; border: 1px solid rgba(0, 217, 255, .22); border-radius: 12px; background: rgba(2, 12, 24, .78); box-shadow: inset 0 0 30px rgba(0, 217, 255, .06); overflow: hidden; }
.auth-console-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(0, 217, 255, .14); color: #7fa6c4; font-size: .66rem; font-family: ui-monospace, Consolas, monospace; }
.auth-console-bar i { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; }
.auth-console-bar i:nth-child(2) { background: #f59e0b; }
.auth-console-bar i:nth-child(3) { background: #22c55e; }
.auth-console-bar span { margin-left: 8px; }
.auth-console-body { height: 168px; padding: 10px 14px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .76rem; line-height: 1.7; overflow: hidden; }
.auth-console-line { display: flex; gap: 9px; white-space: nowrap; }
.auth-console-prefix { width: 10px; color: var(--a-amber); }
.auth-console-line.is-ok .auth-console-prefix { color: #22c55e; }
.auth-console-line.is-ok .auth-console-text { color: #86efac; }
.auth-console-line.is-cmd .auth-console-text { color: #d6e7f5; }
.auth-console-line.is-wait .auth-console-text { color: var(--a-cyan); }
.auth-console-line:not(.is-done) .auth-console-text::after,
.auth-console-line.is-wait .auth-console-text::after { content: '▋'; margin-left: 2px; color: var(--a-cyan); animation: auth-blink 1s steps(1) infinite; }
@keyframes auth-blink { 50% { opacity: 0; } }

/* Module tiles */
.auth-modules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.auth-modules span { display: grid; gap: 2px; padding: 10px; border: 1px solid rgba(148, 197, 233, .14); border-radius: 10px; background: rgba(255,255,255,.04); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.auth-modules span:hover { transform: translateY(-3px); border-color: rgba(247, 180, 82, .5); background: rgba(247, 180, 82, .07); }
.auth-modules i { color: var(--a-amber); font-size: .95rem; margin-bottom: 4px; }
.auth-modules b { font-size: .78rem; }
.auth-modules small { color: var(--a-muted); font-size: .64rem; }

/* Right: sign-in card */
.auth-form-panel { display: flex; align-items: center; padding: clamp(24px, 3.4vw, 40px); border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(244, 248, 252, .97)); color: #102a43; box-shadow: 0 30px 70px rgba(0, 0, 0, .45), 0 0 0 1px rgba(247, 180, 82, .25); position: relative; overflow: hidden; }
.auth-form-panel::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--a-amber-2), var(--a-amber), var(--a-cyan)); }
.auth-form-panel.is-shake { animation: auth-shake .42s ease; }
@keyframes auth-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.auth-form { width: 100%; max-width: 380px; margin: auto; }
.auth-form[data-mode="register"] { max-width: 470px; }
.auth-form-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.auth-form h2 { margin: 12px 0 0; font-size: 1.75rem; letter-spacing: -.03em; color: #0b2540; }
.auth-form-intro { margin: 6px 0 22px; color: #627d98; font-size: .86rem; line-height: 1.5; }
.auth-field { display: block; margin: 0 0 16px; color: #243b53; font-size: .74rem; font-weight: 800; letter-spacing: .02em; }
.auth-field input, .auth-field select, .auth-field textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 7px; padding: 12px 13px; border: 1.5px solid #cbd8e5; border-radius: 10px; background: #f8fafc; color: #102a43; font: inherit; font-size: .92rem; font-weight: 500; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.auth-field input:focus, .auth-field select:focus, .auth-field textarea:focus { outline: none; border-color: var(--a-amber-2); background: #fff; box-shadow: 0 0 0 4px rgba(217, 119, 6, .14); }
.auth-input-wrap { position: relative; display: block; }
.auth-input-wrap > i { position: absolute; left: 14px; top: calc(50% + 3.5px); transform: translateY(-50%); color: #829ab1; font-size: .85rem; pointer-events: none; transition: color .15s ease; }
.auth-input-wrap input { padding-left: 40px; padding-right: 44px; }
.auth-input-wrap:focus-within > i { color: var(--a-amber-2); }
.auth-input-wrap.is-valid input { border-color: #22c55e; }
.auth-input-wrap.is-invalid input { border-color: #f59e0b; }
.auth-field-state { position: absolute; right: 13px; top: calc(50% + 3.5px); transform: translateY(-50%); color: #16a34a; font-size: .95rem; }
.auth-field-state i { animation: auth-pop .25s ease; }
@keyframes auth-pop { from { transform: scale(.4); opacity: 0; } }
.auth-password-toggle { position: absolute; right: 6px; top: calc(50% + 3.5px); transform: translateY(-50%); width: 34px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #627d98; cursor: pointer; }
.auth-password-toggle:hover { background: #edf2f7; color: #102a43; }
.auth-caps { display: flex; align-items: center; gap: 6px; margin: -8px 0 12px; color: #b45309; font-size: .74rem; font-weight: 700; }
.auth-caps[hidden] { display: none; }
.auth-remember { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; color: #486581; font-size: .8rem; font-weight: 600; cursor: pointer; }
.auth-remember input { width: 16px; height: 16px; accent-color: var(--a-amber-2); }

/* Staged verification */
.auth-verify { list-style: none; margin: 14px 0 0; padding: 10px 12px; border: 1px solid #d9e2ec; border-radius: 10px; background: #f8fafc; display: grid; gap: 6px; }
.auth-verify[hidden] { display: none; }
.auth-verify li { display: flex; align-items: center; gap: 9px; color: #9fb3c8; font-size: .8rem; font-weight: 600; transition: color .2s ease; }
.auth-step-icon { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #cbd8e5; box-sizing: border-box; flex: 0 0 auto; }
.auth-verify li.is-active { color: #102a43; }
.auth-verify li.is-active .auth-step-icon { border-color: var(--a-amber-2) transparent var(--a-amber-2) var(--a-amber-2); animation: auth-spin .7s linear infinite; }
.auth-verify li.is-done { color: #15803d; }
.auth-verify li.is-done .auth-step-icon { border: 0; background: #22c55e; box-shadow: inset 0 0 0 4px #22c55e; position: relative; }
.auth-verify li.is-done .auth-step-icon::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.auth-verify li.is-failed { color: #b42318; }
.auth-verify li.is-failed .auth-step-icon { border-color: #ef4444; background: #fee2e2; }

.auth-submit { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 14px; border: 0; border-radius: 11px; background: linear-gradient(135deg, #0b2540, #1d4f7a); color: #fff; font: inherit; font-size: .95rem; font-weight: 800; letter-spacing: .01em; cursor: pointer; overflow: hidden; transition: transform .15s ease, box-shadow .2s ease; box-shadow: 0 10px 22px rgba(11, 37, 64, .3); }
.auth-submit::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent); transform: skewX(-20deg); transition: left .6s ease; }
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(11, 37, 64, .38); }
.auth-submit:hover::after { left: 120%; }
.auth-submit:disabled { cursor: progress; opacity: .92; transform: none; }
.auth-submit i { transition: transform .2s ease; }
.auth-submit:hover i { transform: translateX(4px); }
.auth-overlay.is-granted .auth-submit { background: linear-gradient(135deg, #15803d, #22c55e); }
.auth-error { min-height: 20px; margin: 10px 0 0; color: #b42318; font-size: .78rem; font-weight: 650; }
.auth-switch { margin: 8px 0 0; color: #63788b; font-size: .78rem; text-align: center; }
.auth-switch button { padding: 0; border: 0; background: transparent; color: #b45309; font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-support { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 14px 0 0; color: #829ab1; font-size: .7rem; }

/* Registration fields */
.auth-register-fields { margin: 0 0 2px; }
.auth-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-register-fields .auth-field { margin-bottom: 10px; }
.auth-register-fields .auth-field input, .auth-register-fields .auth-field select, .auth-register-fields .auth-field textarea { padding: 9px 10px; font-size: .82rem; }
.auth-register-fields .auth-field textarea { resize: vertical; min-height: 54px; line-height: 1.35; }
.auth-section-title { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 8px; padding-top: 10px; border-top: 1px solid #e3eaf1; color: #102a43; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.auth-register-fields .auth-section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.auth-optional { color: #829ab1; font-size: .66rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.auth-declaration { align-items: flex-start; margin: 4px 0 10px; font-size: .74rem; line-height: 1.4; }
.auth-declaration input { flex: none; margin-top: 1px; }
.auth-register-fields input[type="file"] { padding: 7px; font-size: .68rem; }
.auth-file-note { margin: -2px 0 10px; color: #6e8294; font-size: .66rem; line-height: 1.35; }

.auth-footer { padding: 0 16px 14px; text-align: center; color: #6f8aa3; font-size: .68rem; letter-spacing: .05em; }

/* Access granted: the terminal zooms away into the workspace */
.auth-overlay.is-granted .auth-shell { opacity: 0; transition-delay: .15s; }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; max-width: 560px; }
  .auth-console-body { height: 132px; }
  .auth-modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .auth-topbar { gap: 6px; }
  .auth-topbar-brand { font-size: .68rem; }
  .auth-restricted { display: none; }
  .auth-clock { font-size: .66rem; }
  /* Phones: sign-in first, a short intro after it. */
  .auth-form-panel { order: -1; }
  .auth-intro h1 { margin-top: 16px; font-size: 1.6rem; }
  .auth-console, .auth-modules { display: none; }
  .auth-field-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-shell, .auth-brand-ring, .auth-dot, .auth-console-line .auth-console-text::after { animation: none !important; }
}

/* Signed-in operator chip (app header) */
.auth-operator { display: flex; align-items: center; gap: 8px; margin-left: 4px; padding: 4px 4px 4px 8px; border: 1px solid rgba(255,255,255,.16); border-radius: 11px; background: rgba(4,20,36,.3); color: #fff; }
.auth-operator-avatar { display: grid; place-items: center; width: 28px; height: 28px; overflow: hidden; border-radius: 50%; background: #d97706; color: #fff; font-size: .62rem; font-weight: 800; }
.auth-operator-details { display: grid; gap: 1px; min-width: 92px; }
.auth-operator-details strong { font-size: .72rem; }
.auth-operator-details small { color: #bcd0e1; font-size: .6rem; }
.auth-profile-btn, .auth-logout-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 7px; background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: .68rem; font-weight: 700; cursor: pointer; }
.auth-profile-btn:hover, .auth-logout-btn:hover { background: rgba(217,119,6,.85); }
.auth-profile-btn svg, .auth-logout-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 760px) { .auth-operator-details { display: none; } }
@media (max-width: 480px) { .auth-operator { margin-left: 0; } .auth-logout-btn span, .auth-profile-btn span { display: none; } }

/* ---- Forgot password ---- */
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.auth-row .auth-remember { margin: 2px 0 6px; }
.auth-link { padding: 0; border: 0; background: none; color: var(--a-amber-2); font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-forgot-fields .auth-link { margin: 0 0 12px; }
.auth-forgot-sent { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #ecfdf5; color: #14532d; font-size: .78rem; line-height: 1.4; }
.auth-code-input { letter-spacing: .3em; font-family: ui-monospace, Consolas, monospace !important; font-size: 1.05rem !important; }

/* ---- My profile ---- */
.auth-operator.is-clickable .auth-operator-avatar, .auth-operator.is-clickable .auth-operator-details { cursor: pointer; }
.auth-operator.is-clickable:hover { border-color: rgba(245, 158, 11, .6); }
.profile-backdrop { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px; background: rgba(4, 17, 31, .62); }
.profile-modal { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 16px; background: #f8fafc; color: #102a43; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); font-size: .86rem; }
.profile-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: #0b2239; color: #fff; }
.profile-head h2 { margin: 0; font-size: 1.1rem; }
.profile-head p { margin: 2px 0 0; color: #bcd0e1; font-size: .78rem; word-break: break-all; }
.profile-avatar { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: #d97706; font-weight: 800; }
.profile-close { margin-left: auto; align-self: flex-start; border: 0; background: none; color: #bcd0e1; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.profile-close:hover { color: #fff; }
.profile-body { display: grid; gap: 14px; padding: 18px 20px 22px; }
.profile-sub { display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px; border-left: 4px solid #16a34a; background: #ecfdf5; }
.profile-sub.is-ending { border-left-color: #d97706; background: #fef3c7; }
.profile-sub span { color: #486581; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.profile-sub strong { font-size: 1.15rem; }
.profile-sub small { color: #486581; }
.profile-body section { padding: 14px 16px; border: 1px solid #e3eaf1; border-radius: 12px; background: #fff; }
.profile-body h3 { margin: 0 0 10px; color: #486581; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.profile-body dl, .pp dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; margin: 0; }
.profile-body dt, .pp dt { color: #829ab1; font-size: .7rem; font-weight: 700; }
.profile-body dd, .pp dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.profile-body dl > .is-wide { grid-column: 1 / -1; }
.profile-note { margin: 0; color: #627d98; font-size: .78rem; }
.profile-reset p { margin: 0 0 10px; }
.profile-reset form { display: grid; gap: 10px; }
.profile-reset label { display: grid; gap: 5px; color: #243b53; font-size: .74rem; font-weight: 800; }
.profile-reset input { padding: 9px 10px; border: 1.5px solid #cbd8e5; border-radius: 9px; background: #f8fafc; color: #102a43; font: inherit; font-size: .88rem; }
.profile-reset input:focus { outline: none; border-color: #d97706; background: #fff; box-shadow: 0 0 0 3px rgba(217, 119, 6, .14); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pp dt small { font-weight: 600; }
body.dark-mode .pp dd { color: #e6eef7; }
.profile-missing { color: #b91c1c; font-weight: 700; }
.profile-btn { padding: 9px 14px; border: 1px solid #cbd8e5; border-radius: 9px; background: #fff; color: #102a43; font: inherit; font-weight: 800; font-size: .8rem; cursor: pointer; }
.profile-btn.primary { border-color: #d97706; background: #d97706; color: #fff; }
.profile-btn:disabled { opacity: .6; cursor: wait; }
.profile-msg { margin: 10px 0 0 !important; color: #b91c1c; font-size: .8rem; font-weight: 700; }
.profile-msg:empty { display: none; }
.profile-msg.is-ok { color: #15803d; }
@media (max-width: 520px) { .profile-body dl { grid-template-columns: 1fr; } }

.auth-profile-btn { margin-right: 6px; }
.auth-operator-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- My Profile page (assets/auth.js, pages/profile.js) ---- */
.workspace-main.has-profile-page { position: relative; }
.profile-page { position: absolute; inset: 0; z-index: 1100; overflow-y: auto; background: var(--mp-canvas, #f3f6f9); }
.pp { max-width: 1180px; margin: 0 auto; padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 16px; color: #102a43; }
.pp [hidden] { display: none !important; }
.pp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border: 1px solid #e3eaf1; border-radius: 14px; background: #fff; }
.pp-title { display: flex; align-items: center; gap: 12px; }
.pp-title h1 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.pp-title-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #fff3df; color: #d97706; }
.pp-head-actions { display: flex; gap: 8px; }
.pp-head-actions .profile-btn i, .pp-edit .profile-btn i { margin-right: 6px; }
.pp-msg { margin: 0 !important; }
.pp-card { padding: 18px 20px; border: 1px solid #e3eaf1; border-radius: 14px; background: #fff; }
.pp-card > h3, .pp-cols h3 { margin: 0 0 8px; color: #627d98; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pp-id { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; margin-bottom: 14px; border-bottom: 1px solid #e3eaf1; }
.pp-photo { flex: none; display: grid; place-items: center; width: 64px; height: 64px; overflow: hidden; border: 3px solid #fff; border-radius: 50%; background: #d97706; color: #fff; font-size: 1.2rem; font-weight: 800; box-shadow: 0 0 0 2px #f3d3a3; }
.pp-photo img { width: 100%; height: 100%; object-fit: cover; }
.pp-id-text { flex: 1; min-width: 0; }
.pp-id-text h2 { margin: 0 0 4px; font-size: 1.15rem; font-weight: 800; }
.pp-id-text p { margin: 0; color: #486581; font-size: .86rem; }
.pp-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: #e7f8ee; color: #15803d; font-size: .7rem; font-weight: 800; letter-spacing: .06em; }
.pp-badge.is-ending { background: #fff4e2; color: #b45309; }
.pp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 36px; margin-top: 6px; }
.pp-cols + .pp-cols { margin-top: 18px; }
.pp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed #e3eaf1; font-size: .86rem; }
.pp-label { display: inline-flex; align-items: center; gap: 9px; color: #334e68; }
.pp-label i { width: 16px; color: #829ab1; text-align: center; }
.pp-value { color: #102a43; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.pp-value small { display: block; color: #627d98; font-weight: 500; font-size: .76rem; }
.pp-empty { color: #9fb3c8; font-weight: 500; font-style: italic; }
.pp-note { margin-top: 14px !important; }
.pp-note i { margin-right: 6px; color: #d97706; }
.pp-edit-photo { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.pp-edit-photo .profile-btn { margin: 0 6px 6px 0; }
.pp-edit-photo label.profile-btn { display: inline-flex; align-items: center; cursor: pointer; }
.pp-edit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.pp-edit-grid .is-wide { grid-column: 1 / -1; }
.pp-edit-grid label small { color: #627d98; font-weight: 600; }
.pp-edit-sub { margin: 4px 0 10px; padding-top: 12px; border-top: 1px solid #e3eaf1; color: #243b53; font-size: .8rem; font-weight: 800; }
.pp-edit-grid label { display: grid; gap: 5px; color: #243b53; font-size: .74rem; font-weight: 800; }
.pp-edit-grid input, .pp-edit-grid select, .pp-edit-grid textarea { padding: 9px 10px; border: 1.5px solid #cbd8e5; border-radius: 9px; background: #f8fafc; color: #102a43; font: inherit; font-size: .88rem; }
.pp-edit-grid input:focus, .pp-edit-grid select:focus, .pp-edit-grid textarea:focus { outline: none; border-color: #d97706; background: #fff; box-shadow: 0 0 0 3px rgba(217, 119, 6, .14); }
.pp .profile-reset input { width: 100%; box-sizing: border-box; }
@media (max-width: 860px) {
  .pp { padding: 14px; }
  .pp-cols { grid-template-columns: 1fr; }
  .pp-edit-grid { grid-template-columns: 1fr; }
  .pp-id { flex-wrap: wrap; }
}
body.dark-mode .profile-page { background: #0d1b2a; }
body.dark-mode .pp { color: #e6eef7; }
body.dark-mode .pp-head, body.dark-mode .pp-card { border-color: #29465f; background: #13263a; }
body.dark-mode .pp-id, body.dark-mode .pp-row { border-color: #29465f; }
body.dark-mode .pp-label { color: #aac0d3; }
body.dark-mode .pp-value, body.dark-mode .pp-id-text h2, body.dark-mode .pp-title h1 { color: #e6eef7; }
body.dark-mode .pp-id-text p, body.dark-mode .pp-card > h3, body.dark-mode .pp-cols h3 { color: #93abc2; }
body.dark-mode .pp-edit-grid label, body.dark-mode .pp-edit-sub { color: #c9d9e8; }
body.dark-mode .pp-edit-grid input, body.dark-mode .pp-edit-grid select, body.dark-mode .pp-edit-grid textarea { border-color: #29465f; background: #0f2236; color: #e6eef7; }
