@media (max-width: 600px) {
  html,
  body {
    min-width: 0;
    width: 100%;
    font-size: 14px;
  }
  .mobile-product-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 35;
    padding: calc(0.85rem + env(safe-area-inset-top)) 0.875rem 0.85rem;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-bottom: 1px solid var(--line);
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    backdrop-filter: blur(12px);
  }
  .mobile-product-header span {
    color: var(--accent);
  }
  .app-main {
    width: 100%;
    padding: 1rem 0.875rem calc(6.75rem + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  .page-header {
    margin-bottom: 1.1rem;
    gap: 0.75rem;
  }
  .page-header h1 {
    font-size: 1.75rem;
    line-height: 1.1;
    letter-spacing: -0.035em;
  }
  .page-header .eyebrow {
    margin-bottom: 0.35rem;
  }
  .header-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .header-actions .button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0.7rem 0.65rem;
    white-space: normal;
    text-align: center;
  }
  .panel {
    width: 100%;
    min-width: 0;
    padding: 0.875rem;
    border-radius: 6px;
  }
  .panel header {
    align-items: flex-start;
    margin-bottom: 0.75rem;
  }
  .panel h2 {
    font-size: 1.08rem;
  }
  .metrics {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 1rem;
  }
  .metrics article,
  .metrics article:nth-child(3) {
    display: flex;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.9rem 1rem;
    align-items: center;
  }
  .metrics article:last-child {
    border-bottom: 0;
  }
  .metrics strong {
    font-size: 1.5rem;
  }
  .product-metrics {
    display: grid;
    grid-template-columns: 1fr;
  }
  .product-metrics article,
  .product-metrics article:nth-child(3) {
    display: flex;
    min-height: 58px;
    padding: 0.7rem 0.85rem;
  }
  .product-metrics article span {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }
  .product-metrics article strong {
    margin-left: auto;
    font-size: 1.2rem;
  }
  .quick-actions {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.9rem;
  }
  .quick-actions > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .quick-actions .button {
    min-height: 44px;
    justify-content: center;
    padding: 0.65rem 0.5rem;
  }
  .list-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 0 1rem;
  }
  .list-actions .button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
  .minimalist-list-panel {
    padding: 0.1rem 0.8rem;
  }
  .minimalist-list > li > a {
    min-height: 60px;
  }
  .policy-minimal-list summary {
    min-height: 62px;
  }
  .policy-minimal-list summary > span:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
  .policy-detail-body dl {
    grid-template-columns: 1fr 1fr;
  }
  .renewal-list li {
    align-items: start;
  }
  .renewal-list time {
    font-size: 0.82rem;
  }
  .dashboard-grid,
  .detail-grid,
  .settings-grid,
  .split {
    gap: 0.875rem;
  }
  .dashboard-grid aside {
    gap: 0.875rem;
  }
  .toolbar,
  .toolbar.grow {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 0.65rem;
    margin-bottom: 1rem;
  }
  .toolbar .search,
  .toolbar select,
  .toolbar .button,
  .toolbar .check {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }
  .toolbar .check {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
  }
  .search {
    padding: 0.1rem 0.75rem;
  }
  .search input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
  }
  .form-panel {
    max-width: none;
    padding: 1rem;
  }
  .form-panel label:not(.policy-active-row) {
    line-height: 1.35;
  }
  .form-panel input:not([type="checkbox"]),
  .form-panel select,
  .send-now select {
    min-height: 44px;
    font-size: 16px;
  }
  .send-now form {
    display: grid;
    gap: 0.5rem;
  }
  .send-now .button {
    width: 100%;
    margin-top: 0.35rem;
    min-height: 44px;
  }
  .notice,
  .integration-ok {
    padding: 0.875rem;
  }
  .activity li {
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.65rem;
  }
  .activity li > span:first-child {
    grid-column: 1/-1;
  }
  .integration-card {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .integration-card > svg {
    margin-bottom: 0.25rem;
  }
  .table-scroll {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
  .panel.table-scroll {
    padding: 0.75rem;
  }
  .table-scroll > table:not(.responsive-table) {
    min-width: 680px;
  }
  .responsive-table td {
    grid-template-columns: minmax(6.5rem, 38%) 1fr;
    align-items: start;
    overflow-wrap: anywhere;
  }
  .responsive-table thead {
    display: none;
  }
  .responsive-table,
  .responsive-table tbody {
    display: block;
    width: 100%;
  }
  .responsive-table tr {
    display: block;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }
  .responsive-table tr:last-child {
    border-bottom: 0;
  }
  .responsive-table td {
    display: grid;
    border: 0;
    padding: 0.3rem 0;
  }
  .responsive-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .responsive-table td:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.65rem;
  }
  .responsive-table td .button {
    min-height: 44px;
  }
  .profile-editor {
    padding: 0.75rem;
  }
  .profile-editor > summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    list-style: none;
    cursor: pointer;
  }
  .profile-editor > summary::-webkit-details-marker {
    display: none;
  }
  .profile-editor[open] > summary {
    margin-bottom: 1rem;
  }
  .customer-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
  .customer-summary .preview-details {
    grid-template-columns: 1fr;
  }
  .customer-summary .preview-details div {
    padding: 0.55rem 0;
  }
  .profile-editor .form-panel {
    padding: 0;
    margin-top: 1rem;
    border: 0;
    box-shadow: none;
  }
  .policy-card-list {
    display: grid;
    gap: 0.75rem;
  }
  .policy-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 6px;
  }
  .policy-card > div:first-child {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
  }
  .policy-card span {
    overflow-wrap: anywhere;
    color: var(--muted);
  }
  .policy-actions {
    grid-column: 1/-1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .policy-actions .button,
  .policy-actions summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .empty {
    padding: 1.75rem 0.75rem;
  }
  .compact-empty {
    padding: 1.25rem 0.5rem;
  }
  .pagination {
    gap: 0.75rem;
    padding: 0.875rem 0 0;
    font-size: 0.85rem;
  }
  .pagination a {
    min-height: 40px;
    display: flex;
    align-items: center;
  }
  .row-menu[open] {
    min-width: 180px;
  }
  .session-list li,
  .result-list li {
    gap: 0.7rem;
    padding: 0.9rem 0;
  }
  .mobile-sheet nav a,
  .sheet-logout {
    min-height: 52px;
  }
  .flash,
  .mock-banner,
  .connection-banner {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.45;
  }
  .breadcrumb {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.2rem;
  }
  .install-chip {
    right: 0.75rem;
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
    max-width: calc(100% - 1.5rem);
  }
  .marketing-nav {
    height: 60px;
  }
  .marketing-nav .marketing-login-link {
    padding: 0.65rem 0.8rem;
  }
  .hero {
    padding: 3.25rem 1rem 2.5rem;
    gap: 2.25rem;
  }
  .hero h1 {
    font-size: clamp(2.75rem, 15vw, 3.5rem);
    line-height: 0.92;
  }
  .product-preview {
    width: 100%;
    overflow: hidden;
  }
  .preview-row {
    gap: 0.5rem;
    padding: 0.75rem 0.55rem;
    font-size: 0.78rem;
  }
  .workflow article {
    grid-template-columns: auto 1fr;
  }
  .workflow article > svg {
    display: none;
  }
  .pricing,
  .faq {
    padding: 3.25rem 1rem;
  }
  .pricing header h2,
  .faq header h2 {
    font-size: 2.25rem;
  }
  .price-grid {
    margin-top: 1.75rem;
  }
  .price-grid article {
    padding: 1.35rem;
  }
  .auth-page {
    min-height: 100dvh;
    padding: 4.5rem 1rem 2rem;
  }
  .auth-card {
    width: 100%;
    max-width: 100%;
  }
}

/* Shared mobile rhythm: Policy Details is the reference layout. */
@media (max-width: 600px) {
  .app-main > .page-header,
  .record-list-page > .page-header,
  .overview-page > .page-header {
    min-height: 44px;
    margin: 0 0 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .app-main > .page-header h1,
  .record-list-page > .page-header h1,
  .overview-page > .page-header h1 {
    font-size: 20px;
    line-height: 1.2;
    margin: 0;
    letter-spacing: -0.02em;
  }
  .app-main > .page-header .header-actions {
    width: auto;
    display: flex;
    gap: 8px;
    margin-left: auto;
  }
  .app-main > .page-header .header-actions .button {
    width: auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    white-space: nowrap;
  }
  .app-main > .page-header .header-actions .icon-button {
    width: 44px;
    height: 44px;
  }
  .panel {
    border-radius: 0;
    box-shadow: none;
  }
  .policy-facts,
  .detail-summary,
  .message-envelope {
    border-top: 0;
    margin-top: 0;
  }
  .policy-management details,
  .policy-danger details {
    min-height: 48px;
    padding: 0;
  }
  .policy-management summary,
  .policy-danger summary {
    min-height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
  }
  .record-list-page .list-search-row {
    margin: 0 0 8px;
  }
  .record-list-page .list-count {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--muted);
  }
  .name-list-panel,
  .customer-policies {
    padding: 0;
    border-radius: 0;
    background: transparent;
  }
  .name-list a {
    min-height: 48px;
    padding: 12px 0;
  }
  .overview-actions {
    gap: 8px;
    margin-bottom: 12px;
  }
  .overview-actions .button {
    min-height: 44px;
  }
  .settings-grid,
  .billing-page,
  .templates-page {
    display: block;
  }
  .settings-grid .panel,
  .schedule-settings,
  .template-preview,
  .table-scroll {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    margin: 0 0 16px;
  }
  .settings-grid .panel,
  .schedule-settings {
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
  }
  .settings-grid .panel h2,
  .schedule-settings h2 {
    font-size: 16px;
    line-height: 1.25;
  }
  .settings-grid .panel h3,
  .schedule-settings p {
    font-size: 13px;
    color: var(--muted);
  }
  .settings-grid .panel form,
  .schedule-settings form {
    gap: 12px;
  }
  .integration-card {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .integration-card > div {
    min-width: 0;
  }
  .integration-card header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
  }
  .integration-card header h2 {
    font-size: 15px;
    margin: 0;
    flex: 1;
  }
  .integration-card p {
    font-size: 13px;
    line-height: 1.45;
  }
  .template-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    margin: 0 0 12px;
  }
  .template-tabs a {
    text-align: center;
    padding: 12px 8px;
    border: 0;
  }
  .template-tabs a.active {
    background: var(--accent-soft);
    border: 0;
  }
  .schedule-settings > div {
    padding: 12px 0;
  }
  .schedule-settings form label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
  }
  .schedule-settings form label input {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 16px;
  }
  .schedule-settings form .button {
    width: 100%;
    min-height: 44px;
  }
  .responsive-table {
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 360px) {
  .app-main {
    padding-inline: 0.7rem;
  }
  .header-actions {
    grid-template-columns: 1fr;
  }
  .page-header h1 {
    font-size: 1.6rem;
  }
  .dialog footer {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .dialog footer .button,
  .dialog footer form,
  .dialog footer form .button {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    min-height: 100dvh;
  }
  .mobile-product-header {
    height: 52px;
    min-height: 52px;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 35;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }
  .mobile-product-header > a[aria-label="Back"] {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    text-decoration: none;
    border-radius: 6px;
  }
  .mobile-wordmark {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-decoration: none;
    white-space: nowrap;
  }
  .mobile-wordmark span {
    color: var(--accent);
  }
  .list-search-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px !important;
    gap: 0.55rem !important;
    align-items: center;
    margin-bottom: 0.65rem !important;
  }
  .list-search-row .search {
    min-width: 0;
    width: 100%;
    height: 44px;
  }
  .filter-icon {
    position: relative;
    border: 1px solid var(--line);
    background: var(--surface);
  }
  .filter-icon span {
    position: absolute;
    right: -4px;
    top: -5px;
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 20px;
    background: var(--accent);
    color: #fff;
    font-size: 0.67rem;
    font-weight: 700;
  }
  .compact-page-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }
  .compact-page-actions .compact-add {
    flex: 1;
  }
  .overview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
  }
  .overview-actions .button {
    min-height: 44px;
    padding: 0.65rem;
  }
}

/* Shared compact customer/policy indexes */
.record-list-page {
  width: min(100%, 860px);
}
.record-list-page .page-header {
  align-items: center;
  margin-bottom: 14px;
}
.record-list-page .page-header {
  min-height: 44px;
}
.record-list-page .page-header > div:first-child {
  min-width: 0;
}
.record-list-page .page-header h1 {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  line-height: 1.1;
}
.record-list-page .header-actions {
  display: flex;
  width: auto;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.record-list-page .compact-page-actions {
  display: flex;
  width: auto;
  flex: 0 0 auto;
  gap: 8px;
}
.record-list-page .icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  flex: 0 0 44px;
}
.record-list-page .primary-icon-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.record-list-page .primary-icon-button:hover {
  background: var(--accent-dark);
}
.record-list-page .list-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
}
.record-list-page .list-search-row .search {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
}
.record-list-page .list-search-row .search input {
  width: 100%;
  min-width: 0;
}
.record-list-page .list-count {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}
.record-list-page > .list-count {
  min-height: 44px;
  display: flex;
  align-items: center;
  margin: 0 0 8px;
}
.record-list-page .name-list-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.record-list-page .name-list {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.record-list-page .name-list li + li {
  border-top: 1px solid var(--line);
}
.record-list-page .name-list a {
  min-height: 48px;
  padding: 8px 4px;
  line-height: 1.35;
}
.record-list-page .name-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.record-list-page .name-list a > span {
  font-size: 1.1rem;
}
.record-list-page .name-list .policy-list-expiry {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.35;
}
.record-list-page .overflow-menu > a {
  top: calc(100% + 4px);
}

@media (max-width: 900px) {
  .record-list-page {
    width: 100%;
  }
  .record-list-page .page-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }
  .record-list-page .header-actions {
    display: flex;
    width: auto;
    grid-template-columns: none;
    gap: 8px;
  }
  .record-list-page .header-actions .button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    white-space: nowrap;
  }
  .record-list-page .compact-page-actions .primary-icon-button {
    flex: 0 0 44px;
  }
  .record-list-page .name-list-panel {
    padding: 0;
  }
}

@media (max-width: 600px) {
  .policy-detail-page {
    width: 100%;
  }
  .policy-detail-page .page-header > div:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
  }
  .policy-detail-page .page-header h1 {
    order: 1;
    font-size: 20px;
    line-height: 1.2;
  }
  .policy-detail-page .page-header .page-kicker {
    order: 2;
    flex-basis: 100%;
    margin: -0.2rem 0 0;
    font-size: 12px;
    color: var(--muted);
  }
  .policy-detail-page .page-header {
    margin-bottom: 14px;
  }
  .policy-facts {
    display: grid;
    gap: 0;
    margin: 0 0 0.75rem;
    border-bottom: 1px solid var(--line);
  }
  .policy-facts > div {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    align-items: baseline;
    gap: 0.75rem;
    padding: 8px 0;
  }
  .policy-facts dt,
  .policy-channels span {
    font-size: 13px;
    color: var(--muted);
  }
  .policy-facts dd {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    overflow-wrap: anywhere;
  }
  .policy-facts dd small {
    display: inline;
    margin-left: 0.25rem;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
  }
  .policy-facts .status {
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: 14px;
    font-weight: 500;
  }
  .policy-channels {
    display: grid;
    gap: 0;
    margin-bottom: 0.55rem;
    border-bottom: 1px solid var(--line);
  }
  .policy-channels > div {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    align-items: baseline;
    gap: 0.75rem;
    padding: 12px 0;
  }
  .policy-channels strong {
    font-size: 14px;
    font-weight: 500;
    overflow-wrap: anywhere;
  }
  .channel-good {
    color: var(--good);
  }
  .channel-warn {
    color: var(--warn);
  }
  .channel-bad {
    color: var(--bad);
  }
  .channel-neutral {
    color: var(--muted);
  }
  .send-blocked {
    margin: 0.35rem 0 0.65rem;
    padding: 0;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
    line-height: 1.4;
  }
  .policy-detail-page .detail-primary-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 0.8rem;
  }
  .policy-detail-page .detail-primary-actions .button {
    width: 100%;
    min-height: 44px;
  }
  .policy-management {
    border-top: 1px solid var(--line);
  }
  .policy-management details,
  .policy-danger details {
    border-bottom: 1px solid var(--line);
    padding: 0;
  }
  .policy-management summary,
  .policy-danger summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    list-style: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
  }
  .policy-management summary::-webkit-details-marker,
  .policy-danger summary::-webkit-details-marker {
    display: none;
  }
  .policy-management summary span,
  .policy-danger summary span {
    font-size: 1.35rem;
    color: var(--muted);
    font-weight: 400;
  }
  .policy-management .form-panel,
  .policy-danger .form-panel {
    padding: 0 0 0.9rem;
    max-width: none;
    font-size: 14px;
  }
  .policy-management .form-panel label,
  .policy-danger .form-panel label {
    gap: 0.35rem;
  }
  .policy-management .form-panel input,
  .policy-danger .form-panel input {
    min-height: 44px;
    font-size: 14px;
  }
  .policy-danger {
    margin-top: 0;
    border-top: 0;
  }
  .policy-danger summary {
    color: var(--bad);
  }
}
@media (max-width: 600px) {
  .templates-page,
  .settings-grid:has(.integration-card),
  .billing-page {
    width: 100%;
  }
  .templates-page .page-header {
    margin-bottom: 14px;
  }
  .templates-page .template-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
  }
  .templates-page .template-tabs {
    width: 100%;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-2);
  }
  .templates-page .template-tabs a {
    flex: 1;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.8rem;
    border: 0;
    border-radius: 4px;
    font-weight: 700;
  }
  .templates-page .template-tabs a.active {
    color: var(--accent);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }
  .templates-page .template-controls {
    display: grid;
    gap: 8px;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    margin-bottom: 8px;
  }
  .templates-page .template-controls label {
    display: grid;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 700;
  }
  .templates-page .template-controls select {
    min-height: 44px;
  }
  .templates-page .template-controls .button {
    min-height: 44px;
  }
  .templates-page .template-note {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0.5rem 0 8px;
  }
  .schedule-settings {
    display: grid;
    gap: 0.7rem;
    padding: 0.85rem 0;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }
  .schedule-settings h2 {
    font-size: 1rem;
    margin: 0;
  }
  .schedule-settings p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
  }
  .schedule-settings form {
    display: grid;
    gap: 0.5rem;
  }
  .schedule-settings label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 40px;
    font-size: 0.86rem;
  }
  .schedule-settings input {
    width: 18px;
    height: 18px;
  }
  .schedule-settings .button {
    min-height: 44px;
    margin-top: 0.2rem;
  }
  .templates-page .template-preview {
    padding: 0.85rem;
    margin-bottom: 0;
  }
  .templates-page .template-preview header {
    margin-bottom: 0.7rem;
  }
  .templates-page .message-envelope {
    display: grid;
    gap: 0;
    margin: 0;
    border-block: 1px solid var(--line);
  }
  .templates-page .message-envelope div {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 0.5rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--line);
  }
  .templates-page .message-envelope div:last-child {
    border-bottom: 0;
  }
  .templates-page .message-envelope dt {
    color: var(--muted);
    font-size: 0.78rem;
  }
  .templates-page .message-envelope dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 0.84rem;
  }
  .templates-page .message-body {
    padding-top: 0.75rem;
  }
  .templates-page .message-body h3 {
    font-size: 0.9rem;
    margin: 0 0 0.35rem;
  }
  .templates-page .message-body p {
    margin: 0;
    line-height: 1.5;
  }
  .settings-grid:has(.integration-card) {
    display: grid;
    gap: 8px;
  }
  .settings-grid:has(.integration-card) .integration-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    padding: 0.85rem;
  }
  .settings-grid:has(.integration-card) .integration-card > div {
    min-width: 0;
  }
  .settings-grid:has(.integration-card) .integration-card header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
  }
  .settings-grid:has(.integration-card) .integration-card h2 {
    font-size: 1rem;
    margin: 0;
    flex: 1;
  }
  .settings-grid:has(.integration-card) .integration-card p {
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0.35rem 0;
  }
  .settings-grid:has(.integration-card) .integration-card form {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.7rem;
  }
  .settings-grid:has(.integration-card) .integration-card input {
    min-height: 44px;
  }
  .settings-grid:has(.integration-card) .integration-card .button {
    min-height: 44px;
  }
}
@media (max-width: 600px) {
  .overview-main {
    padding-bottom: calc(6.75rem + env(safe-area-inset-bottom));
  }
  .overview-page {
    min-height: calc(100dvh - 52px - 64px - env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .overview-page > .page-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }
  .overview-page > .page-header h1 {
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    line-height: 1.1;
  }
  .overview-page .product-metrics {
    margin-bottom: 0.55rem;
  }
  .overview-page .product-metrics article,
  .overview-page .product-metrics article:nth-child(3) {
    min-height: 46px;
    padding: 0.45rem 0.7rem;
  }
  .overview-page .overview-actions {
    margin-bottom: 0.55rem;
  }
  .needs-attention {
    display: block;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
  }
  .needs-attention a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.82rem;
    text-decoration: none;
    min-height: 32px;
  }
  .needs-attention b {
    font-size: 20px;
    font-weight: 400;
    color: var(--muted);
  }
  .overview-page .upcoming-renewals {
    flex: none;
    min-height: 0;
    padding: 0.7rem 0.75rem;
    margin-bottom: calc(16px + env(safe-area-inset-bottom));
    display: block;
  }
  .overview-page .upcoming-renewals header {
    margin-bottom: 0.25rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--line);
  }
  .overview-page .upcoming-renewals .renewal-list {
    min-height: 0;
    max-height: 180px;
    overflow-y: auto;
  }
  .overview-page .renewal-list li {
    min-height: 48px;
    padding: 0.5rem 0;
  }
}

.overview-page > .page-header {
  align-items: center;
  margin-bottom: 14px;
}
.overview-page > .page-header {
  min-height: 44px;
}
.overview-page > .page-header h1 {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}
@media (max-width: 600px) and (max-height: 620px) {
  .overview-page .product-metrics article,
  .overview-page .product-metrics article:nth-child(3) {
    min-height: 40px;
    padding: 0.3rem 0.7rem;
  }
  .overview-page .product-metrics article strong {
    font-size: 1.1rem;
  }
}
@media (max-width: 600px) and (min-height: 621px) and (max-height: 720px) {
}
@media (max-width: 600px) and (min-height: 721px) {
}

@media (max-width: 600px) {
  .policy-purpose-options {
    grid-template-columns: 1fr;
  }
  .policy-reminder-fields {
    padding: 0.85rem;
  }
  .reminder-preview-dialog {
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    max-height: calc(100dvh - max(1rem, env(safe-area-inset-top)));
  }
  .settings-page {
    width: 100%;
    padding-bottom: 8px;
  }
  .settings-section > summary {
    min-height: 56px;
    padding: 12px 0;
    gap: 12px;
  }
  .settings-section h2 {
    font-size: 15px;
    margin-bottom: 8px;
  }
  .settings-summary > div {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
  }
  .settings-editor {
    padding: 4px 0 16px;
    max-width: none;
  }
  .settings-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .settings-form-actions .button {
    width: 100%;
    min-height: 44px;
  }
  .settings-reset {
    width: 100%;
  }
}

/* One divider separates policy facts from editing; keep preview content in its own scroll region. */
@media (max-width: 600px) {
  .policy-detail-page .policy-facts { border-bottom: 0; }
  .policy-detail-page .policy-editor { border-top: 0; }
  html:has(.reminder-preview-dialog), body:has(.reminder-preview-dialog) { overflow: hidden; }
  .reminder-preview-dialog { overflow: hidden; }
  .reminder-preview-dialog > h2 { flex: 0 0 auto; margin: 0 0 12px; }
  .reminder-preview-dialog .reminder-preview-body { min-height: 0; padding-bottom: 12px; }
  .reminder-preview-dialog > button { flex: 0 0 auto; }
}

/* Shareable centered monthly report. */
.report-card { text-align:center; padding:24px 18px 16px; background:linear-gradient(#e85224ed 0%,var(--surface) 62%); border:1px solid var(--line); border-radius:12px; }
.report-month { margin:0 0 6px; color:whitesmoke; font-size:12px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; }
.report-agent { margin:0 0 10px; font-size:18px; line-height:1.35; overflow-wrap:anywhere; }
.report-demo { display:inline-block; border:1px solid var(--line); border-radius:6px; padding:3px 8px; font-size:11px; color:var(--muted); }
.report-total { display:block; margin:14px 0 0; font-size:clamp(56px,16vw,80px); line-height:1.05; letter-spacing:-.055em; font-variant-numeric:tabular-nums; }
.report-label { font-size:19px; margin:6px 0; }
.report-caption { color:var(--muted); font-size:13px; margin:0; }
.report-chart { position:relative; margin:18px 0; color:var(--accent); }
.report-chart svg { display:block; width:100%; height:82px; fill:var(--accent); }
.report-chart figcaption { display:flex; justify-content:space-between; color:var(--muted); font-size:10px; margin-top:5px; }
.report-empty { position:absolute; inset:22px 0 auto; color:var(--muted); font-size:12px; margin:0; }
.report-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:18px 0; border-block:1px solid var(--line); }
.report-stats > :is(div,a) { min-width:0; display:flex; flex-direction:column; align-items:center; padding:0 5px; }
.report-stats > a { color:inherit; text-decoration:none; }
.report-stats > :is(div,a) + :is(div,a) { border-left:1px solid var(--line); }
.report-stats strong { font-size:27px; line-height:1.2; font-variant-numeric:tabular-nums; }
.report-stats span { font-size:11px; margin-top:5px; color:var(--muted); }
.report-stats small { font-size:9px; color:var(--muted); margin-top:2px; }
.report-issues { display:block; margin-top:14px; color:var(--accent-dark); font-size:13px; font-weight:600; text-decoration:none; }
.report-stamp { margin:12px 0 0; font-size:10px; color:var(--muted); }
.report-stamp > span { color:var(--ink); font-weight:700; }
.report-brand-accent { color:var(--accent); }
@media(max-width:600px){
  .report-card { padding:20px 14px 12px; }
  .report-chart { margin:14px 0; }
  .report-stats { grid-template-columns:repeat(2,minmax(0,1fr)); padding:8px 0; }
  .report-stats > :is(div,a) { padding:9px 5px; }
  .report-stats > :is(div,a):nth-child(3) { border-left:0; }
  .report-stats > :is(div,a):nth-child(n+3) { border-top:1px solid var(--line); }
}
@media(min-width:601px){ .report-card { max-width:680px; width:100%; margin:0 auto 20px; } }

@media(max-width:600px){
 .admin-page .page-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px}
 .admin-page .page-header h1{font-size:22px;line-height:1.15}
 .admin-page .header-actions{display:block;width:auto;flex:0 0 auto}
 .admin-page .header-actions .button{width:auto;min-height:38px;padding:9px 10px;font-size:11px;white-space:nowrap}
}

@media(max-width:600px){.admin-page .admin-settings{scroll-margin-top:88px}}

@media (min-width: 901px) {
  .overview-page .overview-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; width:100%; max-width:680px; margin:0 auto 16px; }
  .overview-page .overview-actions .button { width:100%; justify-content:center; }
}

.desktop-action-label, .desktop-reminder-meta { display:none; }
@media (min-width:901px) {
 .app-main > .record-list-page, .app-main > .billing-page, .app-main > .settings-page, .app-main > .integrations-page, .app-main > .overview-page { width:100%; max-width:1040px; margin-left:auto; margin-right:auto; }
 .app-main .page-header { min-height:48px; margin:0 0 24px; align-items:center; }
 .app-main .page-header h1 { font-size:30px; line-height:1.2; margin:0; letter-spacing:-.03em; }
 .app-main .page-header .page-kicker { display:none; }
 .desktop-action-label { display:inline; white-space:nowrap; }
 .record-list-page .primary-icon-button { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; width:auto; min-width:44px; padding:0 16px; gap:8px; font-size:14px; font-weight:600; }
 .record-list-page .list-search-row { display:flex; gap:10px; width:100%; margin-bottom:20px; }
 .record-list-page .search { flex:1; min-width:0; display:flex; align-items:center; gap:10px; }
 .record-list-page .search input { width:100%; flex:1; min-width:0; }
 .record-list-page .list-count { margin:0 0 20px; }
 .record-list-page .name-list-panel, .record-list-page .reminder-list-panel { padding:0 20px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
 .record-list-page .name-list, .record-list-page .reminder-list { border:0; margin:0; }
 .record-list-page .name-list li:last-child, .record-list-page .reminder-list li:last-child { border-bottom:0; }
 .record-list-page .name-list a, .record-list-page .reminder-row { min-height:64px; padding:16px 0; }
 .reminder-row-summary { display:grid; gap:6px; text-align:left; }
 .desktop-reminder-meta { display:block; font-size:12px; font-weight:400; color:var(--muted); }
 .overview-page > .panel, .overview-page > .onboarding-checklist { width:100%; max-width:680px; margin-left:auto; margin-right:auto; }
 .integrations-page .settings-grid { display:block; }
 .integrations-page .integration-card { width:100%; max-width:none; padding:24px; border-radius:12px; }
 .integration-card h2 { font-size:18px; }
 .billing-page .billing-current, .billing-page .panel { border-radius:12px; }
 .settings-page .settings-nav-list { padding:0 24px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
 .settings-page .settings-nav-list > a { padding:20px 0; }
 .settings-page .settings-nav-list > a:first-child { border-top:0; }
 .settings-page .settings-nav-list > a:last-child { border-bottom:0; }
 .settings-page .settings-desktop-logout { margin-top:20px; }
}

.session-activity { display:block; margin-top:5px; color:var(--muted); font-size:12px; }
.session-device-details { margin-top:8px; font-size:12px; color:var(--muted); }
.session-device-details p { overflow-wrap:anywhere; max-width:440px; }
@media(min-width:901px){
 .app-main > .policy-create-page, .app-main > .csv-import-page { width:100%; max-width:1040px; margin:0 auto; }
 .policy-create-page .narrow-form { width:100%; max-width:640px; margin:0 auto; }
 .csv-import-page > ol, .csv-import-page > .import-steps { max-width:820px; margin-left:auto; margin-right:auto; }
 .settings-subpage input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="date"]), .settings-subpage select { border:1px solid var(--line); border-radius:7px; min-height:44px; padding:10px 12px; background:var(--surface); font:inherit; }
 .settings-subpage .phone-field-controls input { border:0; border-radius:0; background:transparent; }
 .settings-subpage .settings-note { line-height:1.55; margin:10px 0 16px; }
 .settings-subpage .conditional-policy-fields label { display:grid; gap:8px; }
 .policy-detail-page .page-header .page-kicker { display:block; color:var(--muted); font-size:13px; margin-top:6px; }
 .settings-subpage .session-list > li { padding:18px 0; align-items:start; gap:20px; }
}

.desktop-record-meta { display:none; }
@media(min-width:901px){
 .record-row-summary { display:grid; gap:6px; min-width:0; }
 .desktop-record-meta { display:block; font-size:12px; font-weight:400; color:var(--muted); overflow-wrap:anywhere; }
}
@media (min-width:901px) {
 .record-list-page .name-list.policy-number-list > li > a,
 .record-list-page .name-list.customer-name-list > li > a,
 .record-list-page .reminder-row { min-height:48px; padding:10px 0; }
}

@media (max-width: 900px) {
  .marketing-refresh .hero { grid-template-columns: 1fr; min-height: 0; padding: 58px 4vw 72px; gap: 42px; }
  .marketing-refresh .hero h1 { max-width: 11ch; font-size: clamp(50px, 8vw, 76px); }
  .marketing-hero-model { min-height: 0; height: min(68vw, 560px); }
  .marketing-feature { gap: 36px; padding-bottom: 80px; }
  .marketing-visual { height: 330px; }
  .marketing-refresh .workflow { padding: 78px 4vw; }
  .marketing-trust { padding: 70px 4vw; }
}
@media (max-width: 600px) {
  .marketing-refresh .marketing-nav { padding: 0 18px; }
  .marketing-refresh .marketing-nav .marketing-login-link { padding: 8px 12px; }
  .marketing-refresh .hero { padding: 53px 18px 68px; gap: 40px; }
  .marketing-refresh .hero h1 { font-size: clamp(44px, 12vw, 58px); line-height: 1.02; }
  .marketing-refresh .hero .lede { margin-top: 20px; font-size: 17px; }
  .marketing-refresh .hero-actions { margin-top: 27px; }
  .marketing-hero-model { height: 370px; }
  .marketing-hero-model img { height: calc(100% - 40px); }
  .marketing-hero-model figcaption { margin-top: 8px; font-size: 11px; }
  .marketing-intro { padding: 56px 18px 45px; }
  .marketing-intro h2 { font-size: 36px; }
  .marketing-feature, .marketing-feature-dates { display: flex; flex-direction: column; direction: ltr; align-items: stretch; gap: 30px; padding: 34px 18px 74px; }
  .marketing-feature h2 { margin: 16px 0; font-size: clamp(35px, 9vw, 45px); }
  .marketing-feature p { font-size: 17px; }
  .marketing-visual { width: 100%; height: 270px; border-radius: 12px; }
  .marketing-visual-records { height: auto; }
  .marketing-visual-records img { flex: none; height: auto; }
  .marketing-visual-see-ahead { height: auto; aspect-ratio: auto; }
  .marketing-visual-see-ahead img { height: auto; }
  .see-ahead-mobile-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 10px; padding: 9px 12px 3px; color: #3e4a4c; font-size: 12px; }
  .see-ahead-mobile-note span { font-style: italic; }
  .see-ahead-mobile-note strong { color: #c84835; }
  .marketing-visual-see-ahead figcaption { position: static; display: block; padding: 3px 12px 9px; background: transparent; text-align: right; font-size: 10px; }
  .marketing-visual-reminders { height: auto; aspect-ratio: auto; }
  .marketing-visual-reminders img { height: auto; }
  .marketing-visual-reminders figcaption { position: static; display: block; padding: 5px 8px 7px; background: #fffdf9; text-align: right; font-size: 10px; }
  .marketing-refresh .workflow { padding: 66px 18px; }
  .marketing-refresh .workflow header h2 { font-size: 39px; }
  .marketing-refresh .workflow header > p:last-child { font-size: 17px; }
  .workflow-steps { grid-template-columns: 1fr; gap: 12px; margin-top: 38px; }
  .marketing-refresh .workflow article { min-height: 0; padding: 25px; }
  .marketing-refresh .workflow h3 { margin-top: 20px; }
  .marketing-extra { padding: 70px 18px; }
  .marketing-extra h2 { font-size: 38px; }
  .marketing-extra-grid { grid-template-columns: 1fr; }
  .marketing-extra-grid article { padding: 24px; }
  .marketing-trust { display: block; padding: 66px 18px; }
  .marketing-trust h2 { font-size: 38px; }
  .marketing-trust ul { margin-top: 35px; }
  .marketing-trust li { font-size: 16px; }
  .marketing-refresh .faq { padding: 70px 18px; display: block; }
  .marketing-refresh .faq > div { margin-top: 30px; }
  .marketing-final-cta { display: block; padding: 67px 18px; }
  .marketing-final-cta h2 { font-size: 38px; }
  .marketing-final-cta .button { margin-top: 30px; }
  .marketing-refresh footer { display: block; padding: 45px 18px; }
  .marketing-refresh footer .business-identity { min-width: 0; margin: 22px 0; }
  .marketing-refresh footer nav { flex-direction: column; align-items: flex-start; gap: 14px; }
}
