:root {
  --ink: #191722;
  --muted: #77727f;
  --line: #e5dfda;
  --paper: #fffefc;
  --surface: #f4f1ee;
  --surface-deep: #ece7e3;
  --night: #17131f;
  --night-soft: #241d30;
  --purple: #6d3be7;
  --purple-dark: #4d24c3;
  --purple-soft: #eee8ff;
  --gold: #d7b46a;
  --danger: #9a3044;
  --success: #2b8f65;
  --shadow: 0 18px 55px rgba(42, 31, 28, .11);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--surface); }
body { margin: 0; color: var(--ink); background: var(--surface); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .64; }
a { color: inherit; text-decoration: none; }

.boot-screen, .centered-state { min-height: 100svh; display: grid; place-content: center; justify-items: center; padding: 28px; text-align: center; background: var(--night); color: white; }
.boot-screen img, .centered-state img { width: 76px; height: 76px; display: block; border: 1px solid rgba(215, 180, 106, .34); border-radius: 22px; object-fit: cover; box-shadow: 0 20px 55px rgba(109, 59, 231, .22); }
.boot-screen p { margin: 16px 0 0; color: #c9c1d4; font-size: 13px; }
.spinner, .small-spinner { display: inline-block; border-radius: 999px; border: 2px solid rgba(255,255,255,.17); border-top-color: var(--gold); animation: spin .85s linear infinite; }
.spinner { width: 25px; height: 25px; margin-top: 22px; }
.small-spinner { width: 15px; height: 15px; margin-right: 8px; border-color: #d9d2e0; border-top-color: var(--purple); vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.centered-state .eyebrow { margin: 20px 0 7px; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.centered-state h1 { margin: 0; font-size: clamp(23px, 4vw, 32px); }
.centered-state > p:not(.eyebrow) { max-width: 480px; margin: 13px 0 24px; color: #c9c1d4; font-size: 14px; line-height: 1.8; }

.auth-shell { min-height: 100svh; display: grid; grid-template-columns: minmax(460px, 54%) 1fr; background: #fbfaf8; }
.auth-panel { width: min(100%, 590px); align-self: center; padding: clamp(34px, 7vw, 80px); }
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand img { width: 54px; height: 54px; border: 1px solid #dbc790; border-radius: 16px; object-fit: cover; box-shadow: 0 12px 26px rgba(65, 33, 124, .16); }
.auth-brand div { display: flex; flex-direction: column; }
.auth-brand span { color: #746d79; font-size: 10px; font-weight: 850; letter-spacing: .2em; }
.auth-brand strong { margin-top: 3px; color: var(--night); font-family: Georgia, "Times New Roman", serif; font-size: 21px; letter-spacing: .12em; }
.auth-copy { margin-top: clamp(45px, 8vh, 80px); }
.auth-kicker { margin: 0 0 11px; color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.auth-copy h1 { margin: 0; font-size: clamp(28px, 4vw, 41px); letter-spacing: -.03em; }
.auth-copy > p:last-child { max-width: 470px; margin: 15px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.login-form { display: grid; gap: 17px; margin-top: 34px; }
.login-form label, .account-form label { display: grid; gap: 8px; }
.login-form label > span:first-child, .account-form label > span:first-child { color: #59535f; font-size: 12px; font-weight: 750; }
.login-form input, .account-form input { width: 100%; height: 52px; padding: 0 15px; border: 1px solid #d8d1cc; border-radius: 12px; outline: 0; background: white; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.login-form input:focus, .account-form input:focus, .store-select select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(109, 59, 231, .12); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 76px; }
.reveal-button { position: absolute; top: 50%; right: 7px; translate: 0 -50%; height: 37px; padding: 0 11px; border: 0; border-radius: 8px; background: #f0ecf6; color: var(--purple-dark); font-size: 11px; font-weight: 800; }
.form-error { min-height: 19px; margin: -3px 0 0; color: var(--danger); font-size: 12px; line-height: 1.55; }
.primary-button, .secondary-button { min-height: 45px; padding: 0 18px; border-radius: 11px; font-weight: 800; }
.primary-button { border: 0; background: var(--purple); color: white; box-shadow: 0 10px 25px rgba(77, 36, 195, .22); }
.primary-button:hover { background: var(--purple-dark); }
.secondary-button { border: 1px solid #d7d0cb; background: white; color: #514b57; }
.secondary-button.small { min-height: 34px; padding: 0 12px; font-size: 11px; }
.login-button { height: 54px; font-size: 14px; }
.security-note { display: flex; align-items: center; gap: 8px; margin: 24px 0 0; color: #8a8490; font-size: 11px; }
.security-note span { color: var(--success); font-size: 8px; }
.auth-visual { position: relative; min-height: 100svh; display: grid; place-content: center; overflow: hidden; background: radial-gradient(circle at 65% 35%, #6f3ad5 0, #2d174b 32%, var(--night) 73%); color: white; }
.auth-visual::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, transparent, black 22%, black 78%, transparent); }
.auth-visual::after { content: "NE"; position: absolute; right: -4vw; bottom: -8vh; color: rgba(255,255,255,.035); font-family: Georgia, serif; font-size: clamp(250px, 36vw, 520px); font-weight: 700; line-height: .8; }
.auth-visual p { position: relative; z-index: 1; margin: 0; font-family: Georgia, "Yu Mincho", serif; font-size: clamp(28px, 3.4vw, 55px); line-height: 1.55; letter-spacing: .04em; text-shadow: 0 10px 28px rgba(0,0,0,.28); }
.auth-visual p::before { content: ""; width: 65px; height: 2px; display: block; margin-bottom: 28px; background: var(--gold); }
.visual-orbit { position: absolute; width: min(60vw, 690px); aspect-ratio: 1; border: 1px solid rgba(215, 180, 106, .15); border-radius: 50%; box-shadow: inset 0 0 95px rgba(112, 54, 204, .18); }

.app-shell { min-height: 100vh; }
.topbar { min-height: 78px; padding: 13px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--night); color: white; border-bottom: 1px solid #30283d; }
.topbar-brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.topbar-brand img { width: 46px; height: 46px; display: block; border: 1px solid rgba(215, 180, 106, .38); border-radius: 13px; object-fit: cover; box-shadow: 0 0 24px rgba(109, 59, 231, .23); }
.topbar-brand div { display: flex; flex-direction: column; }
.topbar-brand p { margin: 0; color: #b7a9d0; font-size: 8px; font-weight: 850; letter-spacing: .2em; }
.topbar-brand strong { margin-top: 2px; font-family: Georgia, serif; font-size: 17px; letter-spacing: .11em; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.topbar-button, .store-chip { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid #4c4359; border-radius: 10px; background: #292232; color: #eee9f3; font-size: 11px; font-weight: 750; white-space: nowrap; }
.topbar-button:hover { border-color: #76678e; background: #352a43; }
.topbar-button.quiet { background: transparent; color: #bdb5c7; }
.store-chip { border-color: rgba(215, 180, 106, .45); color: #f0d99f; }
.store-select { display: flex; align-items: center; gap: 8px; }
.store-select span { color: #aaa2b4; font-size: 10px; }
.store-select select { height: 36px; padding: 0 30px 0 11px; border: 1px solid rgba(215, 180, 106, .42); border-radius: 10px; outline: 0; background: #292232; color: #f0d99f; font-size: 11px; font-weight: 800; }
.workspace { min-height: calc(100vh - 78px); display: grid; grid-template-columns: minmax(310px, 390px) 1fr; }
.applicant-panel { height: calc(100vh - 78px); overflow: auto; padding: 20px; background: #f8f6f4; border-right: 1px solid var(--line); }
.panel-heading { position: sticky; top: -20px; z-index: 3; padding: 18px 0 14px; background: #f8f6f4; }
.panel-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.panel-title p { margin: 0 0 4px; color: var(--purple); font-size: 9px; font-weight: 850; letter-spacing: .13em; }
.panel-title h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.panel-title > span { padding: 6px 9px; border-radius: 999px; background: #ece7e2; color: #6d6671; font-size: 10px; font-weight: 800; }
.search-box { height: 44px; margin-top: 14px; display: flex; align-items: center; gap: 8px; padding: 0 13px; background: white; border: 1px solid #ddd7d2; border-radius: 12px; color: #8e8994; }
.search-box:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(109, 59, 231, .08); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.applicant-list { display: grid; gap: 10px; }
.applicant-card { width: 100%; padding: 15px; text-align: left; border: 1px solid #e3ded9; border-radius: 15px; background: white; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.applicant-card:hover { transform: translateY(-1px); border-color: #b9acee; box-shadow: 0 8px 22px rgba(42, 29, 89, .07); }
.applicant-card.active { border-color: var(--purple); box-shadow: 0 0 0 2px rgba(109, 59, 231, .1); }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.status-pill { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 9px; border-radius: 999px; background: var(--purple-soft); color: var(--purple-dark); font-size: 10px; font-weight: 800; }
.card-subline { display: block; margin: 7px 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #686370; font-size: 12px; }
.card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card-meta > span { min-width: 0; padding-top: 8px; border-top: 1px solid #eeeae7; }
.card-meta small { display: block; color: #9a949c; font-size: 9px; }
.card-meta b { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.resume-stage { min-width: 0; padding: 23px; overflow: auto; background: var(--surface-deep); }
.detail-actions { width: min(100%, 900px); margin: 0 auto 12px; display: flex; align-items: center; gap: 10px; }
.action-copy { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.action-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.action-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.back-button, .print-button, .copy-link-button { min-height: 42px; border-radius: 11px; font-weight: 750; white-space: nowrap; }
.back-button { display: none; padding: 0 12px; border: 1px solid #d5cfca; background: white; color: #4f4a55; }
.print-button { display: flex; align-items: center; gap: 8px; padding: 0 16px; border: 0; background: var(--purple); color: white; box-shadow: 0 9px 24px rgba(71, 38, 185, .2); }
.print-button:hover { background: var(--purple-dark); }
.copy-link-button { padding: 0 13px; border: 1px solid #d2cbc6; background: white; color: #5d5661; }
.privacy-alert { width: min(100%, 900px); margin: 0 auto 10px; color: #7a727d; font-size: 9px; text-align: right; }
.privacy-alert span { color: var(--gold); }
.empty-detail { min-height: 60vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-detail > span { font-size: 34px; color: #aca5af; }
.empty-detail h2 { margin: 12px 0 4px; color: #4c4751; font-size: 20px; }
.empty-detail p { margin: 0; font-size: 13px; }
.resume-sheet { width: min(100%, 900px); margin: 0 auto; padding: 28px 34px; background: var(--paper); border: 1px solid #ded8d2; border-radius: 7px; box-shadow: var(--shadow); }
.resume-header { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 3px solid var(--ink); }
.resume-title { min-width: 0; align-self: center; }
.resume-title p { margin: 0 0 5px; color: var(--purple); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.resume-title h2 { margin: 0; font-size: 25px; letter-spacing: .06em; }
.resume-header-meta { display: flex; align-items: flex-end; gap: 14px; }
.face-photo { width: 92px; height: 118px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; background: #f4f1ee; border: 1px solid #d9d2cc; color: #98909a; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.face-photo.has-photo { background: white; }
.face-photo img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 28%; }
.resume-id { min-width: 150px; text-align: right; }
.resume-id span { display: block; color: var(--muted); font-size: 9px; }
.resume-id strong { display: block; margin-top: 6px; font-family: ui-monospace, monospace; font-size: 12px; }
.identity-strip { display: grid; grid-template-columns: 1.2fr 1fr 1fr; margin: 17px 0 20px; border-radius: 8px; background: #f3f0ed; }
.identity-strip > div { min-width: 0; padding: 13px 15px; border-right: 1px solid #ded8d2; }
.identity-strip > div:last-child { border-right: 0; }
.identity-strip span { display: block; color: var(--muted); font-size: 9px; }
.identity-strip strong { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: 15px; }
.identity-strip small { display: block; margin-top: 3px; color: #716b75; font-size: 9px; }
.resume-section { margin-top: 18px; break-inside: avoid; }
.resume-section h3 { margin: 0 0 7px; padding-left: 9px; border-left: 4px solid var(--purple); font-size: 13px; }
.resume-section dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.resume-section dl > div { min-width: 0; display: grid; grid-template-columns: 125px 1fr; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.resume-section dl > div.wide-field { grid-column: 1 / -1; }
.resume-section dt { padding: 9px 10px; background: #f7f5f3; color: #746e78; font-size: 9px; font-weight: 700; }
.resume-section dd { min-height: 34px; margin: 0; padding: 9px 11px; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 10px; line-height: 1.55; }
.resume-footer { margin-top: 20px; padding-top: 10px; display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); color: #89838b; font-size: 8px; }
.state-card { padding: 22px 16px; text-align: center; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--muted); font-size: 13px; line-height: 1.65; }
.error-state { display: flex; flex-direction: column; gap: 6px; border-color: #efcbd1; background: #fff5f6; color: var(--danger); }
.error-state span { font-size: 11px; }
.error-state button { align-self: center; margin-top: 8px; padding: 8px 12px; border: 1px solid #b66a78; border-radius: 999px; background: white; color: #7a2535; font-weight: 700; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(18, 13, 25, .72); backdrop-filter: blur(8px); }
.modal-card { position: relative; width: min(100%, 760px); max-height: min(90vh, 850px); overflow: auto; padding: clamp(24px, 5vw, 42px); border: 1px solid #e2d9d2; border-radius: 20px; background: #fffdfb; box-shadow: 0 28px 90px rgba(0,0,0,.28); }
.modal-close { position: absolute; top: 15px; right: 15px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #eee9e5; color: #5a535e; font-size: 21px; }
.modal-kicker { margin: 0 0 6px; color: var(--purple); font-size: 9px; font-weight: 850; letter-spacing: .15em; }
.modal-card h2 { margin: 0; font-size: 25px; }
.modal-lead { margin: 10px 0 25px; color: var(--muted); font-size: 13px; }
.account-form { padding: 20px; border: 1px solid #e5ded8; border-radius: 15px; background: #f8f5f2; }
.account-form-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 13px; }
.account-form input { height: 46px; }
.account-form fieldset { margin: 16px 0 0; padding: 0; display: flex; gap: 18px; border: 0; }
.account-form legend { margin-bottom: 8px; color: #59535f; font-size: 11px; font-weight: 750; }
.account-form fieldset label { display: flex; align-items: center; gap: 7px; color: #5e5763; font-size: 12px; font-weight: 700; }
.account-form fieldset input { width: 16px; height: 16px; accent-color: var(--purple); }
.form-hint { margin: 14px 0 7px; color: #89828c; font-size: 10px; line-height: 1.6; }
.account-list-wrap { margin-top: 26px; }
.account-list-wrap h3 { margin: 0 0 11px; font-size: 14px; }
.account-list { display: grid; gap: 8px; }
.account-row { min-height: 58px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 10px 12px 10px 15px; border: 1px solid #e5dfda; border-radius: 12px; background: white; }
.account-row > div { min-width: 0; display: flex; flex-direction: column; }
.account-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; font-size: 13px; }
.account-row > div span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.account-status { padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.account-status.enabled { background: #e5f6ef; color: #247c59; }
.account-status.disabled { background: #eee9e7; color: #71696c; }
.empty-row { margin: 0; padding: 18px; border: 1px dashed #d7d0cb; border-radius: 12px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-panel { width: min(100%, 600px); justify-self: center; }
  .auth-visual { display: none; }
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; }
  .store-select span { display: none; }
}

@media (max-width: 780px) {
  .topbar { min-height: 68px; padding: 10px 12px; align-items: center; }
  .topbar-brand img { width: 42px; height: 42px; }
  .topbar-brand p { display: none; }
  .topbar-brand strong { font-size: 14px; }
  .topbar-button { min-height: 33px; padding: 0 9px; font-size: 10px; }
  .topbar-button#accounts-button { display: none; }
  .store-chip { min-height: 33px; padding: 0 9px; font-size: 10px; }
  .store-select select { height: 33px; padding-left: 8px; font-size: 10px; }
  .workspace { min-height: calc(100vh - 68px); display: block; }
  .applicant-panel { height: calc(100vh - 68px); padding: 14px; border-right: 0; }
  .applicant-panel.mobile-hidden { display: none; }
  .panel-heading { top: -14px; padding-top: 14px; }
  .resume-stage { display: none; min-height: calc(100vh - 68px); padding: 9px; }
  .resume-stage.mobile-open { display: block; }
  .detail-actions { position: sticky; top: 0; z-index: 5; margin-bottom: 8px; padding: 7px; border-radius: 12px; background: rgba(236, 231, 227, .94); backdrop-filter: blur(8px); }
  .action-copy { display: none; }
  .back-button { display: block; }
  .copy-link-button { display: none; }
  .print-button { margin-left: auto; min-height: 40px; padding: 0 12px; font-size: 11px; }
  .privacy-alert { padding: 0 5px; font-size: 8px; }
  .resume-sheet { padding: 20px 15px; border-radius: 4px; }
  .resume-header { align-items: flex-start; gap: 10px; }
  .resume-title h2 { font-size: 18px; letter-spacing: .02em; }
  .resume-header-meta { gap: 7px; }
  .face-photo { width: 65px; height: 84px; }
  .resume-id { min-width: 72px; max-width: 86px; }
  .resume-id strong { overflow-wrap: anywhere; font-size: 9px; }
  .identity-strip { grid-template-columns: 1fr; }
  .identity-strip > div { border-right: 0; border-bottom: 1px solid #ded8d2; }
  .identity-strip > div:last-child { border-bottom: 0; }
  .resume-section dl { grid-template-columns: 1fr; }
  .resume-section dl > div.wide-field { grid-column: auto; }
  .resume-section dl > div { grid-template-columns: 112px 1fr; }
  .resume-footer { flex-direction: column; gap: 4px; }
  .modal-backdrop { padding: 10px; }
  .modal-card { max-height: 94vh; padding: 25px 17px; border-radius: 15px; }
  .account-form-grid { grid-template-columns: 1fr; }
  .account-row { grid-template-columns: 1fr auto; }
  .account-row .secondary-button { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .auth-panel { padding: 28px 22px; }
  .auth-copy { margin-top: 48px; }
  .auth-copy h1 { font-size: 29px; }
  .topbar-brand div { display: none; }
  .topbar-actions { gap: 5px; }
  .topbar-button.quiet { padding: 0 7px; }
}

@media print {
  @page { size: A4 portrait; margin: 9mm; }
  html, body { width: 210mm; background: white !important; }
  .no-print, #modal-root { display: none !important; }
  .workspace, .resume-stage { display: block !important; min-height: 0; padding: 0; overflow: visible; background: white; }
  .resume-sheet { width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .resume-title h2 { font-size: 20px; }
  .face-photo { width: 28mm; height: 36mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .identity-strip { margin: 12px 0 14px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .resume-section { margin-top: 12px; }
  .resume-section dt { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .resume-section dd { font-size: 9px; }
  .resume-footer { margin-top: 12px; }
}
