:root {
  --ink: #17231d;
  --muted: #69756e;
  --line: #dce4df;
  --paper: #fffefb;
  --canvas: #f2f5f1;
  --green: #1e6947;
  --green-dark: #155137;
  --green-soft: #e1f1e8;
  --amber: #eead4f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 15% 0%, #fff 0, transparent 31rem), var(--canvas); }
button, input, textarea, select { font: inherit; }
.auth-dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 28px 90px rgba(23,35,29,.22); }
.auth-dialog::backdrop, .settings-dialog::backdrop { background: rgba(23,35,29,.42); backdrop-filter: blur(5px); }
.auth-dialog form { padding: 28px; }
.auth-dialog h2 { margin-bottom: 8px; }
.auth-copy { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.auth-error { min-height: 18px; margin: -3px 0 10px; color: #a34430; font-size: 12px; }
.shell { width: min(1400px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 48px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-actions button { min-height: 38px; white-space: nowrap; }
.eyebrow { margin: 0 0 6px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 4vw, 56px); font-weight: 500; line-height: 1; letter-spacing: -.035em; }
.subtitle { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.smtp-badge { display: flex; align-items: center; gap: 9px; border: 1px solid #cddbd2; border-radius: 999px; padding: 9px 14px; background: rgba(255,255,255,.7); color: #3f5147; font-size: 13px; font-weight: 650; white-space: nowrap; }
.smtp-badge span { width: 8px; height: 8px; border-radius: 50%; background: #43a76e; box-shadow: 0 0 0 4px #dff2e6; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(400px, .9fr); gap: 20px; align-items: stretch; }
.card { display: flex; flex-direction: column; min-width: 0; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 18px 50px rgba(38,58,47,.055); }
.section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.step { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field > span, legend { color: #415047; font-size: 12px; font-weight: 750; letter-spacing: .02em; }
.field b { color: #b46638; }
.recipient-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recipient-label > span { color: #415047; font-size: 12px; font-weight: 750; letter-spacing: .02em; }
.text-button, .add-recipient, .bulk-panel button { width: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 750; }
.text-button:hover, .add-recipient:hover, .bulk-panel button:hover { background: transparent; color: var(--green-dark); }
.recipient-table { overflow: hidden; border: 1px solid #d8dfda; border-radius: 10px; background: #fbfcfa; }
.recipient-table-head, .recipient-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr) minmax(0, .85fr) minmax(0, 1.45fr) minmax(0, .7fr) 30px; min-width: 0; }
.recipient-table-head { border-bottom: 1px solid #e1e7e2; background: #f1f5f2; color: #748078; font-size: 9px; font-weight: 750; }
.recipient-table-head span { padding: 7px 9px; }
.recipient-row + .recipient-row { border-top: 1px solid #e5eae6; }
.recipient-row input { height: 39px; min-width: 0; padding: 0 9px; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 12px; }
.recipient-row input + input { border-left: 1px solid #e5eae6; }
.recipient-row input:focus { position: relative; z-index: 1; box-shadow: inset 0 0 0 2px #6da586; }
.remove-recipient { display: grid; place-items: center; width: 30px; min-height: 39px; padding: 0; border: 0; border-left: 1px solid #e5eae6; border-radius: 0; background: transparent; color: #9aa39e; font-size: 18px; font-weight: 400; }
.remove-recipient:hover { background: #f8ebe7; color: #a34430; }
.add-recipient { align-self: flex-start; margin: 2px 0 1px; }
.bulk-panel { padding: 11px; border: 1px solid #d8dfda; border-radius: 10px; background: #f5f8f5; }
.bulk-panel[hidden] { display: none; }
.bulk-panel label { display: block; margin-bottom: 7px; color: #67736c; font-size: 10px; }
.bulk-panel textarea { margin-bottom: 7px; background: white; font-size: 12px; }
.bulk-panel div { display: flex; justify-content: flex-end; }
.bulk-actions { align-items: center; gap: 14px; }
.file-button { color: var(--green); cursor: pointer; font-size: 11px; font-weight: 750; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
input, textarea, select { width: 100%; border: 1px solid #d8dfda; border-radius: 10px; outline: none; background: #fbfcfa; color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; }
input, select { height: 43px; padding: 0 12px; }
textarea { padding: 11px 12px; line-height: 1.45; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #6da586; background: white; box-shadow: 0 0 0 3px rgba(54,126,87,.12); }
input[readonly] { background: #eef3ef; color: #536158; cursor: not-allowed; }
small { color: #89928d; font-size: 11px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grow { flex: 1; }
.grow textarea { flex: 1; min-height: 140px; }
.days-field { margin: 0 0 18px; padding: 0; border: 0; }
legend { margin-bottom: 8px; }
.day-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.day-picker input { position: absolute; opacity: 0; pointer-events: none; }
.day-picker span { display: grid; place-items: center; height: 39px; border: 1px solid #d8dfda; border-radius: 10px; background: #fbfcfa; color: #748078; cursor: pointer; font-size: 12px; font-weight: 750; transition: .15s; }
.day-picker input:checked + span { border-color: var(--green); background: var(--green); color: white; }
.day-picker input:focus-visible + span { box-shadow: 0 0 0 3px rgba(54,126,87,.18); }
.time-row { display: grid; grid-template-columns: 1fr 20px 1fr; gap: 8px; align-items: center; }
.dash { margin-top: 3px; color: #9aa39e; text-align: center; }
.interval-field { margin-bottom: 18px; }
.interval-label, .range-scale { display: flex; align-items: center; justify-content: space-between; }
.interval-label strong { color: var(--green); font-size: 12px; }
input[type="range"] { height: 26px; padding: 0; border: 0; background: transparent; box-shadow: none; accent-color: var(--green); cursor: pointer; }
.range-scale { margin-top: -5px; }
.calendar-preview, .next-slots { border: 1px solid var(--line); border-radius: 13px; background: #f8faf7; padding: 14px; margin: 1px 0 13px; }
.preview-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 11px; color: var(--muted); }
.preview-title strong { color: #445249; font-size: 11px; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-day { min-width: 0; text-align: center; }
.week-day span { display: block; margin-bottom: 6px; color: #8b958f; font-size: 10px; }
.day-track { position: relative; height: 36px; overflow: hidden; border-radius: 7px; background: #e9eeea; }
.day-track i { position: absolute; top: 6px; bottom: 6px; border-radius: 5px; background: linear-gradient(90deg, #76ad8d, var(--green)); }
.day-track.off i { display: none; }
.next-slots ol { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 15px; margin: 0; padding: 0; list-style: none; counter-reset: slots; }
.next-slots li { display: flex; align-items: center; gap: 7px; color: #435148; font-size: 12px; counter-increment: slots; }
.next-slots li::before { content: counter(slots); display: grid; place-items: center; flex: 0 0 20px; height: 20px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 800; }
.confirmation { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 12px; color: #4e5b54; font-size: 12px; line-height: 1.4; cursor: pointer; }
.confirmation input { width: 17px; height: 17px; margin: 0; accent-color: var(--green); }
.tracking-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tracking-option { margin-top: 2px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf7; }
.tracking-option span, .tracking-option strong, .tracking-option small { display: block; }
.tracking-option strong { margin-bottom: 3px; color: #415047; font-size: 12px; }
.tracking-option small { line-height: 1.35; }
.unsubscribe-note { margin: 0; color: #748078; font-size: 10px; line-height: 1.4; }
.personalization-help { margin: -5px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf7; color: #536158; font-size: 11px; line-height: 1.5; }
.personalization-help summary { color: var(--green); cursor: pointer; font-weight: 750; }
.personalization-help ol { margin: 8px 0 0; padding-left: 20px; }
.personalization-help code { padding: 1px 4px; border-radius: 4px; background: #e8efea; }
.status { display: none; margin-bottom: 10px; padding: 10px 12px; border-radius: 9px; font-size: 12px; line-height: 1.4; }
.status.show { display: block; }
.status.success { background: #e4f3e9; color: #23603f; }
.status.error { background: #f9e7e0; color: #8a3f2d; }
button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 50px; padding: 0 18px; border: 0; border-radius: 11px; background: var(--green); color: white; cursor: pointer; font-weight: 750; transition: background .15s, transform .15s; }
button:hover { background: var(--green-dark); }
button:active { transform: translateY(1px); }
button:disabled { cursor: wait; opacity: .65; }
button i { font-family: Georgia, serif; font-size: 24px; font-style: normal; font-weight: 400; }
.secondary-button { width: auto; min-height: 38px; padding: 0 13px; border: 1px solid #cbd9d0; background: white; color: var(--green); font-size: 11px; }
.secondary-button:hover { background: var(--green-soft); }
.icon-button { width: 38px; min-height: 38px; padding: 0; justify-content: center; border: 1px solid var(--line); background: white; color: #607068; font-size: 22px; }
.settings-dialog { width: min(980px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 28px 90px rgba(23,35,29,.22); }
.settings-shell { max-height: calc(100vh - 32px); padding: 26px; overflow-y: auto; }
.settings-heading, .settings-section-title, .settings-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.settings-heading { margin-bottom: 18px; }
.settings-heading p, .settings-section p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.settings-section { margin-top: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #f8faf7; }
.settings-section h3 { margin: 0; color: #34463c; font-size: 15px; }
.settings-grid { display: grid; grid-template-columns: 2fr .7fr 1.4fr 1.4fr; gap: 10px; margin-top: 14px; }
.settings-grid.three { grid-template-columns: repeat(3, 1fr); }
.settings-grid .field { margin-bottom: 0; }
.settings-accounts { display: grid; gap: 10px; margin-top: 14px; }
.settings-account { padding: 13px; border: 1px solid #d8dfda; border-radius: 11px; background: white; }
.settings-account-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.settings-account-head strong { font-size: 12px; }
.settings-account-fields { display: grid; grid-template-columns: .8fr 1.3fr 1.3fr 1.3fr 1.4fr; gap: 9px; }
.settings-account-fields .field { margin: 0; }
.toggle-setting { display: flex; align-items: center; gap: 7px; color: #536158; font-size: 11px; }
.toggle-setting input { width: 16px; height: 16px; accent-color: var(--green); }
.settings-actions { align-items: center; margin-top: 12px; }
.settings-actions button { width: auto; }
.settings-actions #settings-save { min-width: 200px; }
.admin-settings button { margin-top: 12px; }
.fineprint { margin: 9px 0 0; color: #929b96; font-size: 10px; text-align: center; }
.campaign-progress { margin-top: 18px; padding: 15px; border: 1px solid #cadbd0; border-radius: 13px; background: #f7faf7; }
.campaign-progress[hidden] { display: none; }
.campaign-history { display: grid; gap: 5px; margin-bottom: 12px; color: #536158; font-size: 10px; font-weight: 700; }
.campaign-history[hidden] { display: none; }
.campaign-history select { height: 36px; background: white; font-size: 11px; }
.progress-heading, .progress-heading > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.progress-heading strong { font-size: 13px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px #f8ead4; }
.live-dot.done { background: #43a76e; box-shadow: 0 0 0 4px #dff2e6; }
.live-dot.failed { background: #b7523b; box-shadow: 0 0 0 4px #f5dfda; }
.progress-state { border-radius: 999px; padding: 5px 8px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 750; }
.progress-subject { overflow: hidden; margin: 10px 0 8px; color: #4c5a52; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.progress-account { margin: -4px 0 8px; color: #7b8680; font-size: 10px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e2e9e4; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #65a47f, var(--green)); transition: width .35s ease; }
.progress-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 7px; margin: 13px 0 8px; }
.progress-metrics span { padding: 8px; border-radius: 9px; background: white; text-align: center; }
.progress-metrics b, .progress-metrics small { display: block; }
.progress-metrics b { color: #314239; font-size: 16px; }
.progress-metrics small { margin-top: 2px; font-size: 9px; }
.tracking-note { margin: 0 0 12px; color: #748078; font-size: 10px; line-height: 1.4; }
.progress-next { margin-bottom: 9px; color: #536158; font-size: 11px; }
.campaign-controls { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 9px; }
.campaign-controls button { width: auto; min-height: 30px; padding: 0 10px; border: 1px solid #cbd9d0; border-radius: 8px; background: white; color: var(--green); font-size: 10px; }
.campaign-controls button:hover { background: var(--green-soft); }
.campaign-controls button.danger { border-color: #ead0ca; color: #a34430; }
.campaign-controls button.danger:hover { background: #f8ebe7; }
.campaign-controls button[hidden] { display: none; }
.delivery-progress { display: grid; gap: 6px; max-height: 190px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.delivery-progress li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid #e1e7e2; border-radius: 9px; background: white; font-size: 11px; }
.delivery-progress .delivery-icon { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #edf1ee; color: #738078; font-size: 9px; font-weight: 800; }
.delivery-progress li.sent .delivery-icon { background: #dff1e6; color: var(--green); }
.delivery-progress li.failed .delivery-icon { background: #f6e1dc; color: #a34430; }
.delivery-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delivery-time { color: #7e8982; white-space: nowrap; }
.delivery-error { grid-column: 2 / 4; color: #a34430; font-size: 10px; }
.delivery-engagement { grid-column: 2 / 4; color: var(--green); font-size: 10px; line-height: 1.35; }

@media (max-width: 920px) {
  .workspace { grid-template-columns: 1fr; }
  .shell { width: min(680px, calc(100% - 28px)); padding-top: 24px; }
  .settings-grid, .settings-grid.three { grid-template-columns: 1fr 1fr; }
  .settings-account-fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { flex-wrap: wrap; }
  .card { padding: 20px; border-radius: 16px; }
  .two-fields { grid-template-columns: 1fr; gap: 0; }
  .day-picker { gap: 4px; }
  .day-picker span { height: 36px; font-size: 10px; }
  .next-slots ol { grid-template-columns: 1fr; }
  .tracking-options { grid-template-columns: 1fr; }
  .recipient-table { overflow: hidden; }
  .recipient-table-head { display: none; }
  .recipient-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-width: 0; }
  .recipient-row input { border-bottom: 1px solid #e5eae6; }
  .recipient-row input:nth-child(odd) { border-left: 0; }
  .recipient-row .remove-recipient { width: 100%; border-bottom: 0; }
  .progress-metrics { grid-template-columns: repeat(3, 1fr); }
  .settings-grid, .settings-grid.three, .settings-account-fields { grid-template-columns: 1fr; }
  .settings-actions, .settings-section-title { align-items: stretch; flex-direction: column; }
}
