:root {
  --ink: #061c35;
  --ink-soft: #12395e;
  --blue: #00a7df;
  --blue-soft: #e5f7fd;
  --red: #e52942;
  --paper: #f4f8fb;
  --white: #ffffff;
  --line: #d9e5ed;
  --muted: #597086;
  --danger: #b4142a;
  --success: #007d5f;
  --shadow: 0 20px 55px rgba(3, 23, 44, .16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.public-page {
  min-height: 100vh;
  background:
    linear-gradient(110deg, #031426 0%, #082f4b 35%, #0a5e80 64%, #18a6ca 100%);
}
.public-shell { width: min(100%, 620px); min-height: 100vh; margin: 0 auto; padding: 24px 18px 42px; }
.brand-row { display: flex; align-items: center; justify-content: flex-end; min-height: 72px; color: white; letter-spacing: .12em; font-size: 11px; font-weight: 700; }
.brand-mark { display: inline-flex; gap: 7px; align-items: center; }
.brand-stripe { width: 24px; height: 4px; display: inline-block; background: var(--red); transform: skewX(-25deg); }
.brand-logo { display: block; width: 118px; height: 54px; object-fit: contain; object-position: center; filter: drop-shadow(0 2px 4px rgba(2,20,38,.24)); }
.brand-row a { opacity: .78; text-decoration: none; letter-spacing: .04em; }
.public-card { background: rgba(255,255,255,.98); box-shadow: var(--shadow); border-radius: 22px; overflow: hidden; margin-top: 32px; }
.event-hero { background: linear-gradient(140deg, #052743, #0b4d70); color: #fff; padding: 30px 24px 25px; position: relative; overflow: hidden; }
.event-hero::after { content: ""; position: absolute; inset: auto -100px -138px auto; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.eyebrow { color: var(--blue); font-weight: 750; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 12px; }
.event-hero .eyebrow { color: #70d8ff; }
.event-hero h1 { position: relative; margin: 0; max-width: 430px; font-size: clamp(28px, 7vw, 40px); line-height: 1.1; letter-spacing: -.045em; }
.event-meta { position: relative; display: grid; gap: 7px; color: #d5e9f5; margin: 23px 0 0; font-size: 14px; line-height: 1.45; }
.entry-body { padding: 26px 24px 30px; }
.entry-body h2 { font-size: 21px; letter-spacing: -.03em; margin: 0 0 8px; }
.entry-body p { color: var(--muted); line-height: 1.6; margin: 0; }
.language-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.language-choice { min-height: 112px; padding: 18px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 14px; text-align: left; display: grid; align-content: space-between; font-weight: 760; transition: .15s ease; }
.language-choice small { color: var(--muted); font-weight: 600; }
.language-choice:hover, .language-choice:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); transform: translateY(-2px); }
.minor-note { margin-top: 20px !important; font-size: 12px; }

.form-topbar { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 0; }
.form-topbar button { color: var(--ink-soft); border: 0; background: transparent; padding: 6px; font-size: 13px; font-weight: 750; }
.form-topbar button:focus-visible { outline: 3px solid var(--blue-soft); border-radius: 5px; }
.expo-form { padding: 12px 22px 28px; }
.expo-form h1 { font-size: 28px; letter-spacing: -.04em; margin: 4px 0 8px; }
.form-intro { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 22px; }
.field { display: grid; gap: 7px; margin: 0 0 18px; }
.field[hidden] { display: none; }
fieldset.field { min-inline-size: 0; padding: 0; border: 0; }
fieldset.field > legend { padding: 0; margin: 0; }
.field label, .field-label { font-size: 14px; font-weight: 760; line-height: 1.35; }
.required { color: var(--red); }
.field input, .field select, .field textarea { width: 100%; color: var(--ink); background: #fff; border: 1px solid #bfced9; border-radius: 10px; min-height: 48px; padding: 12px 13px; outline: none; transition: .15s ease; }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.45; }
.interest-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.interest-field { gap: 7px; }
.choice-check { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 52px; background: #fff; }
.choice-check input { margin: 3px 0 0; accent-color: var(--blue); width: 17px; height: 17px; flex: 0 0 auto; }
.interest-grid .choice-check { align-items: center; }
.interest-grid .choice-check input { margin: 0; }
.choice-check span { flex: 1; font-size: 14px; line-height: 1.35; }
.consent { background: var(--blue-soft); border-radius: 11px; padding: 12px; }
.form-error { color: var(--danger); background: #fff0f2; padding: 11px; border-radius: 9px; font-size: 13px; margin: 0 0 14px; }
.button-primary, .button-secondary, .button-danger { border: 0; border-radius: 10px; min-height: 48px; padding: 12px 16px; font-weight: 780; transition: .15s ease; }
.button-primary { background: var(--ink); color: white; width: 100%; }
.button-primary:hover { background: #0d426c; }
.button-secondary { background: #edf5fa; color: var(--ink); }
.button-danger { background: #fff0f2; color: var(--danger); }
.button-primary:disabled, .button-secondary:disabled { opacity: .55; cursor: not-allowed; }
.success-card { padding: 34px 25px; text-align: center; }
.success-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #dff8ef; color: var(--success); font-size: 27px; margin: 0 auto 16px; }
.success-card h1 { margin: 0 0 8px; font-size: 28px; }
.success-card p { color: var(--muted); line-height: 1.6; }
.success-card .button-secondary { margin-top: 16px; }

.admin-page { background: #eef4f8; min-height: 100vh; }
.admin-shell { min-height: 100vh; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: linear-gradient(135deg, #05192f, #0c476b); }
.login-card { width: min(100%, 430px); background: #fff; border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
.login-card h1 { margin: 22px 0 8px; font-size: 27px; letter-spacing: -.035em; }
.login-card p { color: var(--muted); margin: 0 0 24px; line-height: 1.55; }
.login-hint { margin-top: 18px !important; background: #f3f8fb; padding: 12px; border-radius: 9px; font-size: 12px; }
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.side { background: var(--ink); color: white; padding: 23px 18px; display: flex; flex-direction: column; gap: 24px; }
.side .brand-row { min-height: 30px; justify-content: flex-start; font-size: 10px; }
.side-event { color: #9cc4dc; font-size: 12px; line-height: 1.5; margin: 0; }
.side-nav { display: grid; gap: 6px; }
.side-nav button { color: #c9ddec; text-align: left; border: 0; background: transparent; padding: 11px 12px; border-radius: 8px; font-size: 14px; }
.side-nav button.active, .side-nav button:hover { color: white; background: rgba(255,255,255,.11); }
.side-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.15); padding-top: 18px; display: grid; gap: 4px; font-size: 13px; }
.side-user small { color: #a5c6da; }
.link-button { color: inherit; background: transparent; border: 0; padding: 0; text-align: left; font: inherit; opacity: .8; }
.workspace { padding: 32px; min-width: 0; }
.workspace-head { display: flex; gap: 15px; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.workspace-head h1 { margin: 0; font-size: 28px; letter-spacing: -.045em; }
.workspace-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.workspace-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric { background: #fff; border: 1px solid var(--line); padding: 17px; border-radius: 12px; }
.metric small { color: var(--muted); display: block; font-weight: 700; }
.metric strong { display: block; font-size: 29px; margin-top: 8px; letter-spacing: -.04em; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 20px; margin-bottom: 18px; }
.panel h2 { font-size: 17px; margin: 0 0 14px; }
.panel p { color: var(--muted); line-height: 1.55; }
.qr-panel { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px; align-items: center; }
.qr-panel img { width: 132px; height: 132px; background: #fff; border: 1px solid var(--line); padding: 5px; }
.qr-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f3f7fa; border-radius: 7px; padding: 9px; overflow-wrap: anywhere; font-size: 12px; }
.qr-status { font-size: 13px; font-weight: 750; color: var(--success); }
.qr-status.off { color: var(--danger); }
.lead-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.lead-tools input, .lead-tools select { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink); background: #fff; }
.lead-tools input { min-width: min(100%, 260px); flex: 1; }
.lead-recycle-list { display: grid; gap: 10px; }
.lead-recycle-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px; border: 1px dashed #bdccd7; border-radius: 10px; background: #fbfdff; }
.lead-recycle-item strong, .lead-recycle-item span, .lead-recycle-item small { display: block; }
.lead-recycle-item span { margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.lead-recycle-item small { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.lead-recycle-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }
.lead-recycle-actions .button-secondary, .lead-recycle-actions .button-danger { width: auto; min-height: 39px; padding: 8px 11px; font-size: 12px; white-space: nowrap; }
.lead-recycle-actions small { max-width: 170px; margin: 0; text-align: right; }
.lead-table-wrap { overflow-x: auto; }
.lead-table { min-width: 780px; width: 100%; border-collapse: collapse; font-size: 13px; }
.lead-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
.lead-table td { padding: 13px 10px; border-bottom: 1px solid #edf2f5; vertical-align: top; }
.lead-table tr { cursor: pointer; }
.lead-table tr:hover { background: #f8fcfe; }
.lead-table .company { font-weight: 760; }
.lead-card-list { display: none; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 11px; background: #edf4f8; color: #36536b; white-space: nowrap; }
.pill.new { background: #e7f8ff; color: #006f9d; }
.pill.contacted { background: #fff4d9; color: #805e00; }
.pill.qualified { background: #def9ed; color: #057151; }
.pill.closed { background: #f0f1f3; color: #5a636b; }
.empty { padding: 30px 8px; color: var(--muted); text-align: center; }
.modal-backdrop { position: fixed; z-index: 5; inset: 0; background: rgba(2, 18, 34, .5); display: grid; justify-items: end; }
.modal { background: white; width: min(100%, 560px); height: 100vh; overflow-y: auto; padding: 25px; box-shadow: -16px 0 50px rgba(0,0,0,.18); }
.modal-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.modal-head h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.icon-close { border: 0; background: #eff5f8; color: var(--ink); border-radius: 8px; width: 35px; height: 35px; font-size: 20px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.detail-grid div { background: #f5f8fa; border-radius: 8px; padding: 10px; font-size: 13px; }
.detail-grid small { display: block; color: var(--muted); margin-bottom: 5px; }
.modal .field { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.material-list { display: grid; gap: 7px; margin: 10px 0; }
.email-log { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.email-log li { color: var(--muted); font-size: 12px; margin: 0 0 7px; line-height: 1.45; }
.toggle-check { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 720; min-height: 38px; }
.toggle-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
.material-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.material-upload-actions { display: flex; align-items: center; gap: 13px; margin-top: 14px; }
.material-upload-actions .button-primary { width: auto; }
.upload-feedback, .material-feedback, .recipient-feedback { color: var(--muted); font-size: 12px; line-height: 1.4; }
.material-editor-list, .recipient-editor-list { display: grid; gap: 10px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.panel-heading h2 { margin-bottom: 0; }
.panel-heading .button-secondary { width: auto; min-height: 36px; padding: 8px 11px; font-size: 12px; white-space: nowrap; }
.material-list-intro { font-size: 12px; margin: 0 0 13px; }
.material-editor { display: grid; grid-template-columns: minmax(190px, 1.5fr) 110px 180px 85px auto auto auto; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; }
.material-editor input, .material-editor select, .recipient-editor input { min-width: 0; min-height: 39px; padding: 8px 9px; color: var(--ink); background: #fff; border: 1px solid #bfced9; border-radius: 8px; font: inherit; font-size: 13px; }
.material-editor-title { min-width: 0; }
.material-editor-title input { width: 100%; }
.material-editor-title small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.material-editor .button-primary, .material-editor .button-secondary, .recipient-editor .button-secondary, .recipient-editor .button-danger { width: auto; min-height: 39px; padding: 8px 11px; font-size: 12px; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.material-editor .material-feedback { grid-column: 1 / -1; }
.material-recycle-list { display: grid; gap: 10px; }
.material-recycle-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px; border: 1px dashed #bdccd7; border-radius: 10px; background: #fbfdff; }
.material-recycle-item strong, .material-recycle-item span, .material-recycle-item small { display: block; }
.material-recycle-item span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.material-recycle-item small { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.material-recycle-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }
.material-recycle-actions .button-secondary, .material-recycle-actions .button-danger { width: auto; min-height: 39px; padding: 8px 11px; font-size: 12px; white-space: nowrap; }
.material-recycle-actions small { max-width: 170px; margin: 0; text-align: right; }
.material-read-list { display: grid; gap: 9px; }
.material-read-list article { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 14px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.material-read-list strong { font-size: 14px; }
.material-read-list span { color: var(--muted); font-size: 12px; }
.material-read-list a { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.smtp-status { background: linear-gradient(110deg, #f7fbfd, #eef8fc); }
.smtp-status p { margin-bottom: 8px; }
.smtp-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.smtp-config-grid .field { margin: 0; }
.smtp-config-grid .smtp-password-field { grid-column: 1 / -1; }
.smtp-options { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; }
.smtp-test { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.smtp-test .field { flex: 1 1 280px; margin: 0; }
.smtp-test .button-secondary { min-height: 48px; }
.smtp-test-feedback, .smtp-feedback { color: var(--muted); font-size: 12px; line-height: 1.45; }
.recipient-add { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(210px, 1.4fr) auto auto; align-items: end; gap: 12px; }
.recipient-add .field { margin: 0; }
.recipient-add .button-primary { width: auto; }
.recipient-add .recipient-feedback { grid-column: 1 / -1; }
.recipient-editor { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(210px, 1.3fr) auto auto auto; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; }
.recipient-editor .recipient-feedback { grid-column: 1 / -1; }

@media (max-width: 820px) {
  .admin-layout { display: block; }
  .side { min-height: auto; padding: 15px 18px; display: block; }
  .side-event, .side-user { display: none; }
  .side-nav { display: flex; overflow-x: auto; margin-top: 13px; }
  .side-nav button { white-space: nowrap; }
  .workspace { padding: 22px 14px; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-table-wrap { display: none; }
  .lead-card-list { display: grid; gap: 11px; }
  .lead-card { width: 100%; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 15px; text-align: left; font: inherit; box-shadow: 0 4px 12px rgba(3, 23, 44, .035); }
  .lead-card:active { background: #f8fcfe; }
  .lead-card:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 2px; }
  .lead-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 11px; }
  .lead-card-head strong, .lead-card-head span { display: block; }
  .lead-card-head strong { font-size: 16px; line-height: 1.35; }
  .lead-card-head > div > span { color: var(--muted); font-size: 12px; margin-top: 3px; }
  .lead-card-head > .pill { flex: 0 0 auto; }
  .lead-card-contact { margin: 12px 0 11px; color: var(--ink); font-size: 13px; line-height: 1.48; overflow-wrap: anywhere; }
  .lead-card-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lead-card-meta div { min-width: 0; padding: 8px 9px; background: #f4f8fb; border-radius: 8px; }
  .lead-card-meta small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .03em; }
  .lead-card-meta span { display: block; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
  .lead-card-interests { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
  .lead-card-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf2f5; color: var(--muted); font-size: 11px; }
  .lead-card-foot span { color: var(--ink-soft); font-weight: 750; white-space: nowrap; }
  .lead-recycle-item { align-items: flex-start; flex-direction: column; }
  .lead-recycle-actions { justify-content: flex-start; width: 100%; }
  .lead-recycle-actions small { max-width: none; text-align: left; }
  .material-editor { grid-template-columns: 1fr 1fr; align-items: end; }
  .material-editor-title { grid-column: 1 / -1; }
  .material-editor .toggle-check { align-self: center; }
  .material-editor .material-feedback { grid-column: 1 / -1; }
  .material-recycle-item { align-items: flex-start; flex-direction: column; }
  .material-recycle-actions { justify-content: flex-start; width: 100%; }
  .material-recycle-actions small { max-width: none; text-align: left; }
  .recipient-add { grid-template-columns: 1fr 1fr; }
  .recipient-editor { grid-template-columns: 1fr 1fr; }
  .recipient-editor .toggle-check { align-self: center; }
  .smtp-config-grid { grid-template-columns: 1fr; }
  .smtp-config-grid .smtp-password-field { grid-column: auto; }
}
@media (max-width: 480px) {
  .public-shell { padding: 17px 12px 28px; }
  .public-card { margin-top: 20px; border-radius: 17px; }
  .event-hero { padding: 25px 20px; }
  .entry-body, .expo-form { padding-left: 18px; padding-right: 18px; }
  .language-grid { gap: 9px; }
  .language-choice { min-height: 100px; padding: 14px; }
  .workspace-head { display: block; }
  .workspace-actions { justify-content: flex-start; margin-top: 14px; }
  .overview-grid { gap: 9px; }
  .metric { padding: 13px; }
  .metric strong { font-size: 24px; }
  .panel { padding: 16px; }
  .qr-panel { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .material-upload-grid, .material-editor, .recipient-add, .recipient-editor, .smtp-config-grid { grid-template-columns: 1fr; }
  .material-upload-actions { align-items: flex-start; flex-direction: column; }
  .material-upload-actions .button-primary, .recipient-add .button-primary { width: 100%; }
  .material-editor-title { grid-column: auto; }
  .material-editor .button-primary, .material-editor .button-secondary, .material-editor .button-danger, .recipient-editor .button-secondary, .recipient-editor .button-danger, .material-recycle-actions .button-primary, .material-recycle-actions .button-secondary, .material-recycle-actions .button-danger { width: 100%; }
  .lead-recycle-actions .button-primary, .lead-recycle-actions .button-secondary, .lead-recycle-actions .button-danger { width: 100%; }
  .smtp-test { align-items: stretch; flex-direction: column; }
  .smtp-test .button-secondary { width: 100%; }
}
