:root {
  --postly-blue: #061f86;
  --postly-blue-dark: #041255;
  --postly-ink: #08364b;
  --postly-line: #dfe6f1;
  --postly-bg: #f7f9fc;
  --postly-error: #b42318;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--postly-ink);
  background: linear-gradient(135deg, var(--white) 0%, var(--postly-bg) 58%, #eef4f8 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.login-panel {
  width: min(100%, 416px);
  min-height: 548px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px;
  border: 1px solid rgba(6, 31, 134, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 60px rgba(8, 54, 75, 0.12);
}

.login-panel.compact {
  min-height: 420px;
  align-items: center;
  text-align: center;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 34px;
}

.brand-row span {
  flex: 0 0 auto;
  color: var(--postly-blue);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.wordmark {
  display: block;
  width: 158px;
  max-width: 62%;
  height: auto;
}

.signal-icon {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 0 22px;
}

.compact .signal-icon {
  margin-top: 28px;
}

.signal-icon.small {
  width: 72px;
  height: 72px;
  margin: 0;
}

h1 {
  margin: 0 0 28px;
  color: var(--postly-blue-dark);
  font-size: 2rem;
  line-height: 1.08;
  font-weight: 800;
}

form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  color: var(--postly-ink);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--postly-line);
  border-radius: 8px;
  color: var(--postly-blue-dark);
  background: var(--white);
  font: inherit;
  outline: none;
}

input {
  height: 50px;
  padding: 0 14px;
}

select {
  height: 50px;
  padding: 0 38px 0 14px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  padding: 13px 14px;
  line-height: 1.4;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--postly-blue);
  box-shadow: 0 0 0 4px rgba(6, 31, 134, 0.12);
}

.error {
  min-height: 20px;
  margin: -2px 0 0;
  color: var(--postly-error);
  font-size: 0.9rem;
  font-weight: 700;
}

.error[hidden] {
  display: block;
  visibility: hidden;
}

button {
  height: 52px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: var(--postly-blue);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--postly-blue-dark);
}

button:focus-visible {
  outline: 4px solid rgba(6, 31, 134, 0.22);
  outline-offset: 3px;
}

.workspace-body {
  overflow: hidden;
  min-height: 100vh;
  background: #f5f7fb;
}

.workspace-shell {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  overflow: hidden;
  color: #14394d;
  background: #f5f7fb;
}

.sidebar-backdrop,
.mobile-menu-button {
  display: none;
}

.campaign-sidebar {
  min-width: 0;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  padding: 16px 12px;
  border-right: 1px solid #dce5ee;
  background: #f7f8fa;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 0 8px;
}

.sidebar-wordmark {
  width: 124px;
  height: auto;
}

.sidebar-brand span,
.status-pill {
  color: #08746d;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ghost-button,
.tab-button {
  height: auto;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.campaign-import {
  padding: 12px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #ffffff;
}

.campaign-import h2 {
  margin: 0 0 10px;
  color: #102f45;
  font-size: 0.94rem;
  font-weight: 850;
}

.campaign-import-form {
  display: grid;
  gap: 10px;
}

.campaign-import-form label {
  display: grid;
  gap: 6px;
  color: #31495a;
  font-size: 0.82rem;
  font-weight: 800;
}

.campaign-import-form input {
  height: 40px;
  padding: 0 11px;
  border-color: #d8e1ea;
  color: #102f45;
  background: #f8fafc;
}

.campaign-import-actions {
  display: block;
}

.campaign-import-actions button {
  width: 100%;
  min-height: 40px;
  border: 1px solid #d8e1ea;
  border-radius: 8px;
  color: #ffffff;
  background: var(--postly-blue);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.campaign-import-actions button:hover {
  background: var(--postly-blue-dark);
}

.campaign-import-status {
  margin: 0;
  color: #08746d;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.campaign-import-status[data-tone="error"] {
  color: var(--postly-error);
}

.campaign-import-status[hidden] {
  display: none;
}

.campaign-import-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  margin: 2px 0 0;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.campaign-import-result[hidden] {
  display: none;
}

.campaign-import-result dt,
.campaign-import-result dd {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.campaign-import-result dt {
  color: #6a7b88;
  font-weight: 800;
}

.campaign-import-result dd {
  min-width: 0;
  color: #102f45;
  font-weight: 700;
}

.sidebar-search {
  position: relative;
  display: block;
  min-width: 0;
}

.sidebar-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.sidebar-search input {
  height: 42px;
  padding: 0 12px;
  border-color: #d8e1ea;
  background: #ffffff;
}

.sidebar-nav {
  display: grid;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.sidebar-nav a {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 8px;
  color: #263f52;
  font-size: 0.94rem;
  font-weight: 760;
  text-decoration: none;
}

.sidebar-nav a:hover {
  color: var(--postly-blue);
  background: #eef3fb;
}

.sidebar-section {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
}

.sidebar-section h2 {
  margin: 4px 8px 0;
  color: #6a7b88;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.campaign-list {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 6px;
  align-content: start;
  overflow-y: auto;
}

.campaign-item {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #14394d;
  text-decoration: none;
}

.campaign-item[hidden] {
  display: none;
}

.campaign-item:hover,
.campaign-item.active {
  border-color: #d9e4ef;
  background: #f1f5fb;
}

.campaign-item.imported {
  border-color: #c8dde7;
  background: #f4fbf8;
}

.campaign-item.attention {
  border-color: #08746d;
  box-shadow: 0 0 0 4px rgba(8, 116, 109, 0.14);
}

.campaign-title {
  color: #061f86;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

.campaign-meta {
  color: #617384;
  font-size: 0.84rem;
  line-height: 1.25;
}

.campaign-empty {
  margin: -8px 8px 0;
  color: #617384;
  font-size: 0.9rem;
  font-weight: 700;
}

.campaign-empty[hidden] {
  display: none;
}

.workspace-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.logout-form {
  display: block;
}

.sidebar-logout {
  padding-top: 2px;
}

.sidebar-logout .ghost-button {
  width: 100%;
  min-height: 40px;
}

.ghost-button {
  padding: 10px 12px;
  color: #375266;
  background: transparent;
  border-color: #d8e1ea;
  font-weight: 800;
}

.ghost-button:hover {
  color: var(--postly-blue);
  background: #f8fafc;
}

.campaign-workspace {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  padding: 22px 24px 24px;
}

.campaign-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.campaign-heading > div:first-child,
.listing-map-header > div,
.listing-overview-header > div:first-child,
.postgrid-header > div,
.audience-panel-header > div,
.postgrid-card-heading > div {
  min-width: 0;
}

.campaign-heading-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.campaign-heading p {
  margin: 0 0 6px;
  color: #08746d;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.campaign-heading h1 {
  margin: 0;
  color: var(--postly-blue-dark);
  font-size: 1.82rem;
  line-height: 1.08;
}

.status-pill {
  padding-top: 9px;
}

.workspace-tabs {
  width: min(100%, 690px);
  display: grid;
  grid-template-columns: repeat(5, minmax(104px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #ffffff;
}

.tab-button {
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  display: grid;
  place-items: center;
  color: #4b6273;
  background: transparent;
  font-weight: 800;
  text-decoration: none;
}

.tab-button:hover,
.tab-button.active {
  color: #ffffff;
  background: var(--postly-blue);
}

.tab-stack {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.tab-surface {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(20, 57, 77, 0.08);
}

.tab-surface[hidden] {
  display: none;
}

.overview-tab-surface {
  min-height: 0;
  display: block;
  place-items: unset;
  overflow: hidden;
}

.listing-overview {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
}

.listing-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.listing-overview-header p {
  margin: 0 0 5px;
  color: #08746d;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.listing-overview-header h2 {
  margin: 0;
  color: var(--postly-blue-dark);
  font-size: 1.5rem;
  line-height: 1.12;
}

.overview-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.listing-overview-header span {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px solid #d8e1ea;
  border-radius: 999px;
  color: #375266;
  background: #f8fafc;
  font-size: 0.78rem;
  font-weight: 850;
}

.overview-save-button {
  width: auto;
  min-width: 78px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--postly-blue);
  border-radius: 8px;
  color: #ffffff;
  background: var(--postly-blue);
  font-size: 0.84rem;
  font-weight: 850;
}

.overview-save-button:disabled {
  color: #7a8a98;
  background: #eef3f7;
  border-color: #d8e1ea;
  cursor: not-allowed;
}

.overview-empty {
  min-height: 420px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 48px 24px;
  text-align: center;
}

.overview-empty[hidden],
.overview-fields[hidden] {
  display: none;
}

.overview-empty h3 {
  margin: 0;
  color: var(--postly-blue-dark);
  font-size: 1.65rem;
  line-height: 1.15;
}

.overview-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  align-content: start;
  overflow: auto;
  padding: 20px 24px 24px;
}

.overview-field {
  display: grid;
  gap: 8px;
}

.overview-field-wide {
  grid-column: 1 / -1;
}

.overview-field span {
  color: #617384;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.overview-field input,
.overview-field textarea {
  border-color: #d8e1ea;
  color: #102f45;
  background: #f8fafc;
  font-weight: 750;
}

.map-tab-surface {
  min-height: 0;
  display: block;
  place-items: unset;
  overflow: hidden;
}

.map-workbench {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  overflow: hidden;
  background: #ffffff;
}

.listing-map-panel {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  border-right: 1px solid #e2e8f0;
  background: #ffffff;
}

.listing-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.listing-map-header p {
  margin: 0 0 5px;
  color: #08746d;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.listing-map-header h2 {
  margin: 0;
  color: var(--postly-blue-dark);
  font-size: 1.38rem;
  line-height: 1.12;
}

.listing-map-header span {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px solid #d8e1ea;
  border-radius: 999px;
  color: #375266;
  background: #f8fafc;
  font-size: 0.78rem;
  font-weight: 850;
}

.listing-map {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: #f5f6f2;
}

.listing-map.can-drag-pan .maplibregl-canvas {
  cursor: grab;
}

.listing-map.can-drag-pan .maplibregl-canvas:active {
  cursor: grabbing;
}

.listing-map .maplibregl-ctrl-attrib {
  display: none;
}

.listing-map .maplibregl-ctrl-top-right {
  top: 12px;
  right: 12px;
}

.listing-map .maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid rgba(32, 56, 71, 0.18);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(32, 56, 71, 0.12);
}

.listing-map .maplibregl-ctrl-group button,
.listing-map .maplibregl-ctrl-group button:hover {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 0;
  background-color: #ffffff;
  color: #203847;
}

.listing-map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px 16px;
  border-top: 1px solid #e2e8f0;
}

.listing-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  color: #617384;
  font-size: 0.86rem;
  font-weight: 850;
}

.listing-map-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 999px;
  vertical-align: -1px;
}

.listing-map-legend .target-dot {
  background: var(--postly-blue);
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(6, 31, 134, 0.22);
}

.listing-map-legend .radius-dot {
  background: rgba(32, 56, 71, 0.08);
  box-shadow: inset 0 0 0 2px rgba(6, 31, 134, 0.58);
}

.listing-map-legend .nearby-dot {
  background: #08746d;
}

.listing-map-legend .excluded-dot {
  background: #aebbc4;
}

.listing-map-footer p {
  margin: 0;
  color: #375266;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
}

.maplibregl-popup-content {
  border-radius: 8px;
  padding: 10px 12px;
  color: #102f45;
  box-shadow: 0 14px 36px rgba(20, 57, 77, 0.2);
}

.listing-map-popup {
  display: grid;
  gap: 3px;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.25;
}

.listing-map-popup span:first-child {
  color: var(--postly-blue-dark);
  font-weight: 850;
}

.audience-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
  background: #ffffff;
}

.audience-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.audience-panel-header p,
.audience-controls span {
  margin: 0 0 5px;
  color: #08746d;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.audience-panel-header h2 {
  margin: 0;
  color: var(--postly-blue-dark);
  font-size: 1.18rem;
  line-height: 1.12;
}

.audience-panel-header > span {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 7px 9px;
  border: 1px solid #d8e1ea;
  border-radius: 999px;
  color: #375266;
  background: #f8fafc;
  font-size: 0.74rem;
  font-weight: 850;
}

.audience-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid #e7edf3;
  background: #fbfcfd;
}

.audience-stats div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #ffffff;
}

.audience-stats span {
  color: #617384;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.audience-stats strong {
  min-width: 0;
  color: #102f45;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.audience-controls {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid #e7edf3;
}

.audience-controls label {
  display: grid;
  gap: 7px;
}

.audience-controls select {
  height: 40px;
  border-color: #d8e1ea;
  color: #102f45;
  background: #f8fafc;
  font-size: 0.86rem;
  font-weight: 800;
}

.audience-control-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.audience-control-buttons button {
  height: 38px;
  border: 1px solid #d8e1ea;
  border-radius: 8px;
  color: #375266;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 850;
}

.audience-control-buttons button:hover {
  color: var(--postly-blue);
  background: #eef3fb;
}

.audience-control-buttons button:disabled,
.audience-control-buttons button:disabled:hover {
  color: #7a8a98;
  background: #eef3f7;
  cursor: not-allowed;
}

.address-list {
  min-height: 0;
  overflow: auto;
  background: #ffffff;
}

.address-list-count {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 14px;
  border-bottom: 1px solid #e7edf3;
  color: #617384;
  background: rgba(255, 255, 255, 0.96);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.address-list-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #617384;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.address-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 14px;
  border-bottom: 1px solid #edf2f6;
  cursor: pointer;
}

.address-row:hover {
  background: #f8fafc;
}

.address-row[data-selected="false"] {
  color: #718292;
  background: #fbfcfd;
}

.address-row input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: #08746d;
}

.address-row-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.address-row strong {
  min-width: 0;
  overflow: hidden;
  color: #102f45;
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-row[data-selected="false"] strong {
  color: #536675;
}

.address-row-meta,
.address-row-metrics {
  min-width: 0;
  overflow: hidden;
  color: #617384;
  font-size: 0.76rem;
  font-weight: 760;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-row-metrics {
  color: #08746d;
  font-weight: 850;
}

.postgrid-tab-surface {
  min-height: 0;
  display: block;
  place-items: unset;
  overflow: hidden;
}

.postgrid-panel {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #ffffff;
}

.postgrid-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.postgrid-header p,
.postgrid-card-heading p {
  margin: 0 0 5px;
  color: #08746d;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.postgrid-header h2 {
  margin: 0;
  color: var(--postly-blue-dark);
  font-size: 1.38rem;
  line-height: 1.12;
}

.postgrid-header > span,
.postgrid-card-heading > span {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px solid #d8e1ea;
  border-radius: 999px;
  color: #375266;
  background: #f8fafc;
  font-size: 0.78rem;
  font-weight: 850;
}

.postgrid-body {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
}

.postgrid-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #ffffff;
}

.postgrid-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.postgrid-card-heading h3 {
  margin: 0;
  color: #102f45;
  font-size: 1.05rem;
  line-height: 1.16;
}

.postcard-preview-card {
  grid-column: 1 / -1;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.postcard-preview-grid {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: center;
}

.postcard-face {
  position: relative;
  aspect-ratio: 3 / 2;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfdbe6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(20, 57, 77, 0.12);
}

.postcard-face::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(8, 54, 75, 0.26);
  border-radius: 6px;
  pointer-events: none;
}

.postcard-front {
  background:
    linear-gradient(135deg, rgba(6, 31, 134, 0.96), rgba(4, 18, 85, 0.92)),
    radial-gradient(circle at 74% 24%, rgba(255, 255, 255, 0.16), transparent 32%);
  color: #ffffff;
}

.postcard-front-inner {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding: 24px;
}

.postcard-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.postcard-brand img,
.postcard-back-message img {
  display: block;
  width: 96px;
  height: auto;
}

.postcard-brand strong {
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 900;
}

.postcard-brand span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.postcard-front-copy {
  align-self: end;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.postcard-front-copy p {
  margin: 0;
  color: #78d8cf;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.postcard-front-copy h4 {
  max-width: 86%;
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.35rem, 2.2vw, 2.25rem);
  line-height: 1.02;
  font-weight: 900;
}

.postcard-front-copy dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.postcard-front-copy dl div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.postcard-front-copy dt,
.postcard-back-message dt {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.64rem;
  font-weight: 850;
  text-transform: uppercase;
}

.postcard-front-copy dd,
.postcard-back-message dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 0.85rem;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.postcard-back {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.72fr);
  gap: 16px;
  padding: 22px;
  color: #102f45;
}

.postcard-back::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 57%;
  width: 1px;
  background: #dce5ee;
}

.postcard-back-message {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 12px;
}

.postcard-back-message p {
  margin: 0;
  color: #263f52;
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.35;
}

.postcard-back-message dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.postcard-back-message dl div {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.postcard-back-message dt {
  color: #617384;
}

.postcard-address-zone {
  position: relative;
  z-index: 1;
  align-self: center;
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 14px;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  background: #f8fafc;
}

.postcard-address-zone span,
.postcard-address-zone small {
  color: #617384;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.postcard-address-zone strong {
  color: #102f45;
  font-size: 0.94rem;
  line-height: 1.15;
}

.postcard-indicia {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 64px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #cfdbe6;
  border-radius: 4px;
  color: #617384;
  background: #ffffff;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.postcard-barcode-zone {
  position: absolute;
  right: 22px;
  bottom: 18px;
  width: min(44%, 190px);
  height: 28px;
  overflow: hidden;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, #102f45 0 2px, transparent 2px 6px),
    #eef3f7;
  opacity: 0.72;
}

.workflow-tab-surface {
  display: grid;
  place-items: center;
  padding: 24px;
}

.workflow-placeholder {
  width: min(520px, 100%);
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 28px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #f8fafc;
}

.workflow-placeholder p {
  margin: 0;
  color: #08746d;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.workflow-placeholder h2 {
  margin: 0;
  color: var(--postly-blue-dark);
  font-size: 1.8rem;
  line-height: 1.08;
}

.workflow-placeholder span {
  color: #375266;
  font-size: 0.98rem;
  font-weight: 760;
  line-height: 1.4;
}

.postgrid-specs {
  display: grid;
  gap: 10px;
  margin: 0;
}

.postgrid-specs div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.postgrid-specs dt,
.postgrid-select span,
.postgrid-lookup-form span {
  color: #617384;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.postgrid-specs dd {
  min-width: 0;
  margin: 0;
  color: #102f45;
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.3;
}

.postgrid-select {
  display: grid;
  gap: 8px;
}

.postgrid-select select,
.postgrid-lookup-form input {
  height: 42px;
  border-color: #d8e1ea;
  color: #102f45;
  background-color: #ffffff;
  font-size: 0.9rem;
  font-weight: 750;
}

.postgrid-note,
.postgrid-status {
  margin: 0;
  color: #375266;
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1.42;
}

.postgrid-status[data-tone="success"] {
  color: #08746d;
}

.postgrid-status[data-tone="error"] {
  color: var(--postly-error);
}

.postgrid-lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.postgrid-lookup-form label {
  display: grid;
  gap: 8px;
}

.postgrid-lookup-form button {
  align-self: end;
  min-height: 42px;
  height: 42px;
  border: 1px solid var(--postly-blue);
  border-radius: 8px;
  color: #ffffff;
  background: var(--postly-blue);
  font-size: 0.88rem;
  font-weight: 850;
}

.postgrid-payload,
.postgrid-result {
  min-height: 180px;
  max-height: 280px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  color: #102f45;
  background: #f8fafc;
  font: 700 0.82rem/1.5 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.postgrid-result {
  min-height: 122px;
  max-height: 220px;
}

.postgrid-result[hidden] {
  display: none;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  color: var(--postly-blue-dark);
  font-size: 2.6rem;
  line-height: 1;
}

.desktop-only-message {
  display: none;
}

.duplicate-dialog {
  width: min(420px, calc(100vw - 40px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.duplicate-dialog::backdrop {
  background: rgba(4, 18, 85, 0.28);
}

.duplicate-dialog-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(20, 57, 77, 0.24);
}

.duplicate-kicker {
  margin: 0 0 6px;
  color: #08746d;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.duplicate-dialog h2 {
  margin: 0;
  color: var(--postly-blue-dark);
  font-size: 1.45rem;
  line-height: 1.12;
}

.duplicate-copy,
.duplicate-meta,
.duplicate-rule {
  margin: 0;
  color: #375266;
  font-size: 0.95rem;
  line-height: 1.45;
}

.duplicate-rule {
  padding: 10px 12px;
  border: 1px solid #d8e1ea;
  border-radius: 8px;
  color: #31495a;
  background: #f8fafc;
  font-size: 0.86rem;
  font-weight: 800;
}

.duplicate-copy strong {
  color: #102f45;
}

.duplicate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.duplicate-actions button {
  min-height: 42px;
  border: 1px solid #d8e1ea;
  border-radius: 8px;
  background: #ffffff;
  color: #375266;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.duplicate-actions button:last-child {
  color: #ffffff;
  background: var(--postly-blue);
  border-color: var(--postly-blue);
}

.duplicate-actions button:disabled,
.duplicate-actions button:disabled:hover {
  color: #7a8a98;
  background: #eef3f7;
  border-color: #d8e1ea;
  cursor: not-allowed;
}

.duplicate-actions button:hover {
  color: var(--postly-blue);
  background: #eef3fb;
}

.duplicate-actions button:last-child:hover {
  color: #ffffff;
  background: var(--postly-blue-dark);
}

@media (max-width: 520px) {
  .shell {
    align-items: stretch;
    padding: 0;
  }

  .login-panel {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    padding: 34px 24px;
    box-shadow: none;
  }

  .brand-row {
    margin-bottom: 28px;
  }

  .wordmark {
    width: 144px;
  }
}

@media (max-width: 880px) {
  html,
  body {
    min-height: 100%;
  }

  .workspace-body {
    overflow: auto;
    background: #f5f7fb;
  }

  .desktop-only-message {
    display: none;
  }

  .workspace-shell {
    max-width: 100vw;
    min-height: 100svh;
    height: auto;
    display: block;
    overflow-x: hidden;
    overflow-y: visible;
    background: #f5f7fb;
  }

  .workspace-body.sidebar-open {
    overflow: hidden;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: rgba(4, 18, 85, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
  }

  .workspace-shell.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .campaign-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(86vw, 340px);
    height: 100dvh;
    max-height: 100dvh;
    padding: 16px 12px;
    border-right: 1px solid #dce5ee;
    box-shadow: 18px 0 46px rgba(20, 57, 77, 0.18);
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }

  .workspace-shell.sidebar-open .campaign-sidebar {
    transform: translateX(0);
  }

  .workspace-main {
    max-width: 100vw;
    min-height: 100svh;
    display: block;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .campaign-workspace {
    max-width: 100vw;
    min-height: 100svh;
    height: auto;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 12px;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 14px 12px 18px;
  }

  .campaign-heading {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    margin: -14px -12px 0;
    padding: 12px;
    border-bottom: 1px solid #dce5ee;
    background: rgba(245, 247, 251, 0.94);
    backdrop-filter: blur(12px);
  }

  .campaign-heading p {
    margin-bottom: 3px;
    font-size: 0.68rem;
  }

  .campaign-heading h1 {
    max-width: calc(100vw - 116px);
    overflow: hidden;
    font-size: 1.22rem;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .campaign-heading-actions {
    gap: 8px;
  }

  .status-pill {
    display: none;
  }

  .mobile-menu-button {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: auto;
    min-width: 68px;
    height: 38px;
    padding: 0 13px;
    border: 1px solid #d8e1ea;
    border-radius: 8px;
    color: #102f45;
    background: #ffffff;
    font-size: 0.84rem;
    font-weight: 850;
    box-shadow: 0 8px 18px rgba(20, 57, 77, 0.08);
  }

  .mobile-menu-button:hover {
    color: #ffffff;
    background: var(--postly-blue);
  }

  .workspace-tabs {
    width: auto;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 5px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .workspace-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-button {
    flex: 0 0 auto;
    min-width: 92px;
    min-height: 40px;
    padding: 0 14px;
    scroll-snap-align: start;
    font-size: 0.86rem;
  }

  .tab-stack {
    overflow: visible;
  }

  .tab-surface {
    max-width: 100%;
    min-height: calc(100svh - 124px);
    height: auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(20, 57, 77, 0.08);
  }

  .overview-tab-surface,
  .map-tab-surface,
  .postgrid-tab-surface {
    overflow: hidden;
  }

  .listing-overview {
    height: auto;
  }

  .listing-overview-header,
  .listing-map-header,
  .postgrid-header {
    align-items: center;
    padding: 16px;
  }

  .listing-map-header,
  .audience-panel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .listing-overview-header h2,
  .listing-map-header h2,
  .postgrid-header h2 {
    font-size: 1.14rem;
  }

  .listing-overview-header span,
  .listing-map-header span,
  .postgrid-header > span {
    flex: 0 1 auto;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .audience-panel-header > span {
    flex: 0 1 auto;
    justify-self: start;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .listing-map-header span {
    justify-self: start;
    max-width: 100%;
  }

  .overview-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .overview-save-button {
    min-width: 72px;
    height: 34px;
  }

  .overview-empty {
    min-height: 320px;
    padding: 34px 18px;
  }

  .overview-empty h3 {
    font-size: 1.28rem;
  }

  .overview-fields {
    max-height: none;
    grid-template-columns: 1fr;
    overflow: visible;
    padding: 16px;
  }

  .overview-field-wide {
    grid-column: auto;
  }

  .map-workbench {
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .listing-map-panel {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .listing-map {
    height: min(54svh, 420px);
    min-height: 300px;
  }

  .listing-map-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px 14px;
  }

  .listing-map-footer p {
    text-align: left;
  }

  .listing-map-legend {
    gap: 9px 13px;
    font-size: 0.78rem;
  }

  .audience-panel {
    height: auto;
    max-height: none;
    display: grid;
    grid-template-rows: auto auto auto auto;
  }

  .audience-panel-header {
    padding: 16px;
  }

  .audience-stats {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .audience-stats div {
    padding: 9px;
  }

  .audience-controls {
    padding: 12px;
  }

  .address-list {
    max-height: min(48svh, 440px);
    overflow: auto;
  }

  .address-row {
    grid-template-columns: 22px minmax(0, 1fr);
    min-height: 58px;
    padding: 12px;
  }

  .address-row input {
    width: 18px;
    height: 18px;
  }

  .postgrid-panel {
    height: auto;
  }

  .postgrid-body {
    height: auto;
    padding: 12px;
  }

  .postgrid-card {
    padding: 14px;
  }

  .postcard-preview-card {
    height: auto;
  }

  .postcard-preview-grid {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .postcard-face {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
  }

  .postcard-front-inner {
    gap: 14px;
    padding: 18px;
  }

  .postcard-front-copy h4 {
    max-width: 100%;
    font-size: 1.45rem;
  }

  .postcard-front-copy dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .postcard-back {
    grid-template-columns: minmax(0, 1fr) minmax(118px, 0.72fr);
    gap: 10px;
    padding: 16px;
  }

  .postcard-back-message {
    gap: 8px;
    padding-right: 8px;
  }

  .postcard-back-message p {
    font-size: 0.78rem;
    line-height: 1.28;
  }

  .postcard-back-message dl {
    gap: 5px;
  }

  .postcard-back-message dl div {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 6px;
  }

  .postcard-address-zone {
    min-height: 72px;
    padding: 11px;
  }

  .workflow-tab-surface {
    min-height: 360px;
    padding: 16px;
  }

  .workflow-placeholder {
    padding: 22px;
  }
}

@media (min-width: 881px) and (max-width: 1120px) {
  .map-workbench {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .postgrid-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  input,
  textarea,
  select {
    font-size: 16px;
  }

  .campaign-workspace {
    padding-inline: 10px;
  }

  .campaign-heading {
    margin-inline: -10px;
    padding: 12px 10px;
  }

  .campaign-heading h1 {
    max-width: calc(100vw - 110px);
    font-size: 1.08rem;
  }

  .mobile-menu-button {
    min-width: 62px;
    height: 36px;
    padding-inline: 10px;
  }

  .workspace-tabs {
    margin-inline: -2px;
  }

  .tab-button {
    min-width: 86px;
    font-size: 0.82rem;
  }

  .listing-map {
    height: 330px;
    min-height: 280px;
  }

  .audience-stats strong {
    font-size: 0.84rem;
  }

  .address-row-meta,
  .address-row-metrics {
    white-space: normal;
  }

  .postcard-front-inner {
    padding: 14px;
  }

  .postcard-brand strong {
    font-size: 1.05rem;
  }

  .postcard-brand span {
    font-size: 0.58rem;
  }

  .postcard-front-copy {
    gap: 8px;
  }

  .postcard-front-copy p {
    font-size: 0.64rem;
  }

  .postcard-front-copy h4 {
    font-size: 1.1rem;
  }

  .postcard-front-copy dd,
  .postcard-back-message dd {
    font-size: 0.72rem;
  }

  .postcard-back {
    grid-template-columns: minmax(0, 1fr) minmax(92px, 0.66fr);
    padding: 13px;
  }

  .postcard-back::before {
    left: 59%;
  }

  .postcard-back-message img {
    width: 74px;
  }

  .postcard-back-message p {
    font-size: 0.68rem;
  }

  .postcard-back-message dl {
    display: none;
  }

  .postcard-address-zone {
    min-height: 64px;
    padding: 9px;
  }

  .postcard-address-zone strong {
    font-size: 0.74rem;
  }

  .postcard-indicia {
    top: 12px;
    right: 12px;
    padding: 5px 7px;
    font-size: 0.48rem;
  }

  .postcard-barcode-zone {
    right: 14px;
    bottom: 12px;
    height: 20px;
  }

  .duplicate-actions {
    grid-template-columns: 1fr;
  }
}
