.renewal-mobile-home-surface,
.renewal-mobile-commandbar,
.renewal-mobile-savebar,
.renewal-mobile-saving,
.renewal-mobile-success,
.renewal-mobile-filter-head,
.renewal-mobile-filter-footer,
.renewal-mobile-detail-actions,
.renewal-mobile-detail-extra,
.renewal-mobile-sheet,
.renewal-mobile-create-wizard,
.renewal-mobile-review,
.renewal-mobile-card-summary {
  display: none;
}

@media (max-width: 680px) {
  body.renewal-mobile-saving-open,
  body.renewal-mobile-success-open {
    overflow: hidden;
  }

  #tab-renewal-home .payment-home-sidebar,
  #tab-renewal-home .payment-home-topbar,
  #tab-renewal-home .payment-home-heading-row,
  #tab-renewal-home .payment-home-side-grid,
  #tab-renewal-home > .payment-home-dashboard > .payment-home-main > .renewal-mobile-nav,
  #tab-renewals > .renewal-command-shell > .renewal-mobile-nav,
  #tab-renewals .renewal-command-hero,
  #tab-renewals .renewal-command-kpis,
  #tab-renewals .renewal-command-create-head,
  #tab-renewals .renewal-form-side,
  #tab-renewals .renewal-form-actions,
  #tab-renewals .renewal-command-table-head {
    display: none !important;
  }

  #tab-renewal-home,
  #tab-renewals {
    background: #f4f7fb;
  }

  #tab-renewal-home .payment-home-dashboard,
  #tab-renewal-home .payment-home-main,
  #tab-renewal-home .payment-home-body,
  #tab-renewals .renewal-command-shell {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
  }

  #tab-renewal-home .payment-home-body,
  #tab-renewals .renewal-command-shell {
    padding: 0 !important;
  }

  #tab-renewals .renewal-command-shell {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .renewal-mobile-home-surface,
  .renewal-mobile-commandbar,
  .renewal-mobile-savebar,
  .renewal-mobile-saving:not([hidden]),
  .renewal-mobile-success:not([hidden]) {
    display: flex;
  }

  .renewal-mobile-home-surface {
    flex-direction: column;
  }

  .renewal-mobile-appbar,
  .renewal-mobile-commandbar {
    align-items: center;
    gap: 10px;
    min-height: 68px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    color: #fff;
    background: linear-gradient(135deg, #5b21b6, #3730a3);
    box-shadow: 0 9px 24px rgba(67, 56, 202, 0.24);
  }

  .renewal-mobile-appbar > button,
  .renewal-mobile-commandbar > button {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
  }

  .renewal-mobile-commandbar > button[hidden] {
    display: none;
  }

  .renewal-mobile-appbar > div,
  .renewal-mobile-commandbar > div {
    display: grid;
    flex: 1;
    gap: 1px;
    min-width: 0;
  }

  .renewal-mobile-appbar small,
  .renewal-mobile-commandbar small {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.69rem;
  }

  .renewal-mobile-appbar strong,
  .renewal-mobile-commandbar strong {
    overflow: hidden;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .renewal-mobile-home-hero {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 15px;
    padding: 17px;
    border-radius: 19px;
    color: #fff;
    background: linear-gradient(145deg, #0f766e, #0d9488);
    box-shadow: 0 12px 28px rgba(13, 148, 136, 0.2);
  }

  .renewal-mobile-home-hero > span {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.35rem;
  }

  .renewal-mobile-home-hero h2,
  .renewal-mobile-home-hero p {
    margin: 0;
  }

  .renewal-mobile-home-hero h2 {
    font-size: 1rem;
  }

  .renewal-mobile-home-hero p {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.76rem;
    line-height: 1.4;
  }

  .renewal-mobile-home-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 0 15px 15px;
  }

  .renewal-mobile-home-actions > button {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 82px;
    padding: 11px;
    border: 1px solid #dbe4f0;
    border-radius: 15px;
    color: #172033;
    text-align: left;
    background: #fff;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.045);
  }

  .renewal-mobile-home-actions > button:last-child {
    grid-column: 1 / -1;
    min-height: 68px;
  }

  .renewal-mobile-home-actions > button > i {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    color: #4f46e5;
    background: #eef2ff;
    font-size: 1.05rem;
  }

  .renewal-mobile-home-actions > button > span {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .renewal-mobile-home-actions small {
    color: #64748b;
    font-size: 0.68rem;
    line-height: 1.3;
  }

  #tab-renewal-home .renewal-category-filter-cards,
  #tab-renewal-home .renewal-home-stat-grid,
  #tab-renewal-home .payment-home-content-grid {
    display: none !important;
  }

  #tab-renewals .renewal-command-create,
  #tab-renewals .renewal-command-view,
  #tab-renewals .renewal-form-v2 {
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  #tab-renewals .renewal-command-create,
  #tab-renewals .renewal-form-v2 {
    padding: 10px 9px calc(112px + env(safe-area-inset-bottom));
  }

  #tab-renewals .renewal-form-v2-grid,
  #tab-renewals .renewal-command-form,
  #tab-renewals .renewal-form-card {
    width: 100%;
    min-width: 0;
  }

  #tab-renewals .renewal-form-card {
    padding: 12px 10px;
    border: 1px solid #dbe4f0;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.04);
  }

  #tab-renewals .renewal-form-step,
  #tab-renewals .renewal-schedule-panel,
  #tab-renewals .renewal-progressive-details {
    margin-top: 11px;
    padding: 11px;
    border-radius: 13px;
  }

  #tab-renewals .renewal-form-step > div:first-child,
  #tab-renewals .renewal-section-heading {
    gap: 8px;
  }

  #tab-renewals .renewal-form-v2 .form-grid,
  #tab-renewals .renewal-form-v2 .renewal-details-grid,
  #tab-renewals .renewal-form-v2 .renewal-schedule-grid,
  #tab-renewals .renewal-form-v2 .inline-field-group,
  #tab-renewals .renewal-form-v2 .inline-field-group-validity {
    grid-template-columns: 1fr !important;
  }

  #tab-renewals .renewal-form-v2 input,
  #tab-renewals .renewal-form-v2 select,
  #tab-renewals .renewal-form-v2 textarea {
    min-height: 44px;
    font-size: 16px;
  }

  #tab-renewals .renewal-progressive-details summary {
    min-height: 48px;
  }

  .renewal-mobile-savebar {
    position: fixed;
    z-index: 1020;
    right: 0;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 0;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    padding: 9px 11px;
    border-top: 1px solid #dbe4f0;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(12px);
  }

  .renewal-mobile-savebar > div {
    display: grid;
    flex: 1;
    gap: 2px;
    min-width: 0;
    text-align: center;
  }

  .renewal-mobile-savebar small {
    color: #64748b;
    font-size: 0.66rem;
  }

  .renewal-mobile-savebar strong {
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .renewal-mobile-savebar > button {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    color: #334155;
    background: #fff;
    font-weight: 700;
  }

  .renewal-mobile-savebar > button.is-primary {
    border-color: #4f46e5;
    color: #fff;
    background: #4f46e5;
  }

  #tab-renewals #renewalViewPanel {
    padding: 10px 10px calc(92px + env(safe-area-inset-bottom));
  }

  #tab-renewals .renewal-list-view-tabs {
    display: flex;
    gap: 7px;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  #tab-renewals .renewal-list-view-tabs::-webkit-scrollbar {
    display: none;
  }

  #tab-renewals .renewal-list-view-tab {
    flex: 0 0 auto;
    width: auto !important;
    min-height: 42px;
    padding: 8px 9px;
    white-space: nowrap;
    font-size: 0.72rem;
  }

  #tab-renewals #renewalListViewHint {
    display: none;
  }

  #tab-renewals .renewal-command-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin: 8px 0 10px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  #tab-renewals .renewal-command-search {
    grid-column: 1 / -1;
    min-height: 44px;
    border-radius: 12px;
    background: #fff;
  }

  #tab-renewals .renewal-command-filter,
  #tab-renewals .renewal-toolbar-expiry-range {
    display: none;
  }

  #tab-renewals .renewal-mobile-filters-open .renewal-command-filter,
  #tab-renewals .renewal-mobile-filters-open .renewal-toolbar-expiry-range {
    display: grid;
    grid-column: 1 / -1;
    width: 100%;
  }

  #tab-renewals .renewal-toolbar-quick-dates {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  #tab-renewals .renewal-toolbar-quick-dates > span {
    display: none;
  }

  #tab-renewals .renewal-toolbar-quick-dates button {
    flex: 0 0 auto;
  }

  #tab-renewals .renewal-toolbar-clear-compact {
    grid-column: 1 / -1;
    min-height: 38px;
  }

  #tab-renewals .renewal-bulk-action-bar {
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 8px 0;
  }

  #tab-renewals .renewal-mobile-has-selection .renewal-bulk-action-bar {
    display: grid;
  }

  #tab-renewals .renewal-command-workspace,
  #tab-renewals .renewal-command-main,
  #tab-renewals .renewal-command-list {
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  #tab-renewals .renewal-command-card {
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px 11px;
    border-radius: 15px;
  }

  #tab-renewals .renewal-command-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #tab-renewals .renewal-command-pagination {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  #tab-renewals .renewal-command-pagination > select {
    grid-column: 1 / -1;
  }

  .renewal-mobile-saving,
  .renewal-mobile-success {
    position: fixed;
    z-index: 17040;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }

  .renewal-mobile-saving {
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(5px);
  }

  .renewal-mobile-saving > div {
    display: grid;
    justify-items: center;
    width: min(100%, 320px);
    padding: 28px 22px;
    border-radius: 22px;
    text-align: center;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  }

  .renewal-mobile-saving-ring {
    display: grid;
    width: 84px;
    height: 84px;
    place-items: center;
    border: 6px solid #ede9fe;
    border-top-color: #4f46e5;
    border-radius: 50%;
    color: #4338ca;
    animation: renewal-mobile-spin 1.2s linear infinite;
  }

  .renewal-mobile-saving-ring i {
    font-size: 1.2rem;
  }

  .renewal-mobile-saving-ring strong {
    font-size: 0.72rem;
  }

  .renewal-mobile-saving h2 {
    margin: 17px 0 5px;
  }

  .renewal-mobile-saving p {
    margin: 0;
    color: #64748b;
    font-size: 0.8rem;
  }

  @keyframes renewal-mobile-spin {
    to { transform: rotate(360deg); }
  }

  .renewal-mobile-success {
    z-index: 17035;
    flex-direction: column;
    justify-content: flex-start;
    padding: calc(62px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
    overflow: auto;
    text-align: center;
    background: linear-gradient(180deg, #f5f3ff, #fff 45%);
  }

  .renewal-mobile-success-icon {
    display: grid;
    width: 86px;
    height: 86px;
    place-items: center;
    border: 7px solid #dcfce7;
    border-radius: 50%;
    color: #fff;
    background: #16a34a;
    box-shadow: 0 14px 28px rgba(22, 163, 74, 0.2);
    font-size: 2.2rem;
  }

  .renewal-mobile-success h1 {
    margin: 22px 0 6px;
    font-size: 1.43rem;
  }

  .renewal-mobile-success > p {
    margin: 0;
    color: #64748b;
  }

  .renewal-mobile-success > section {
    display: grid;
    gap: 8px;
    width: 100%;
    margin: 26px 0;
  }

  .renewal-mobile-success > section > div {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    text-align: left;
    background: #fff;
  }

  .renewal-mobile-success > section small {
    color: #64748b;
  }

  .renewal-mobile-success > section strong {
    overflow-wrap: anywhere;
  }

  .renewal-mobile-success > footer {
    display: grid;
    gap: 9px;
    width: 100%;
    margin-top: auto;
  }

  .renewal-mobile-success > footer button {
    min-height: 47px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #334155;
    background: #fff;
    font-weight: 700;
  }

  .renewal-mobile-success > footer button.is-primary {
    border-color: #4f46e5;
    color: #fff;
    background: #4f46e5;
  }

  body.renewal-mobile-focused-flow #toastStack .app-toast-success {
    border-color: #15803d;
    color: #fff;
    background: #166534;
    box-shadow: 0 14px 30px rgba(20, 83, 45, 0.35);
  }
}

@media (max-width: 680px) {
  body.renewal-mobile-modal-open {
    overflow: hidden;
  }

  .renewal-mobile-appbar,
  .renewal-mobile-commandbar {
    position: sticky;
    z-index: 90;
    top: 0;
    color: #172033;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 1px 0 #e2e8f0;
    backdrop-filter: blur(14px);
  }

  .renewal-mobile-appbar > button,
  .renewal-mobile-commandbar > button {
    border-color: transparent;
    color: #172033;
    background: transparent;
  }

  .renewal-mobile-appbar > div,
  .renewal-mobile-commandbar > div {
    gap: 2px;
  }

  .renewal-mobile-appbar small,
  .renewal-mobile-commandbar small {
    color: #64748b;
  }

  .renewal-mobile-home-hero {
    color: #172033;
    background: linear-gradient(135deg, #f2f5ff, #f8f6ff);
    box-shadow: none;
  }

  .renewal-mobile-home-hero > span {
    color: #4f46e5;
    background: #fff;
  }

  .renewal-mobile-home-hero p {
    color: #64748b;
  }

  .renewal-mobile-home-actions {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .renewal-mobile-home-actions > button,
  .renewal-mobile-home-actions > button:last-child {
    grid-column: auto;
    grid-template-columns: 46px minmax(0, 1fr) 24px;
    min-height: 78px;
    padding: 14px;
    border-radius: 16px;
  }

  .renewal-mobile-home-actions > button > i:first-child {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .renewal-mobile-home-actions > button:nth-child(2) > i:first-child {
    color: #059669;
    background: #ecfdf5;
  }

  .renewal-mobile-home-actions > button:nth-child(3) > i:first-child {
    color: #ea580c;
    background: #fff7ed;
  }

  .renewal-mobile-home-actions > button > i:last-child {
    color: #64748b;
    background: transparent;
  }

  .renewal-mobile-detail-actions,
  .renewal-mobile-detail-extra,
  .renewal-mobile-sheet:not([hidden]) {
    display: flex;
  }

  #tab-renewals .renewal-mobile-filters-open .renewal-mobile-filter-head,
  #tab-renewals .renewal-mobile-filters-open .renewal-mobile-filter-footer {
    display: flex;
  }

  #tab-renewals .renewal-mobile-filters-open .renewal-command-toolbar {
    position: fixed;
    z-index: 17020;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin: 0;
    padding: 0 15px calc(82px + env(safe-area-inset-bottom));
    overflow-y: auto;
    background: #f8fafc;
  }

  #tab-renewals .renewal-mobile-filter-head {
    position: sticky;
    z-index: 2;
    top: 0;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    margin: 0 -15px;
    padding: calc(9px + env(safe-area-inset-top)) 14px 9px;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.98);
  }

  .renewal-mobile-filter-head > strong {
    flex: 1;
    font-size: 1.05rem;
  }

  .renewal-mobile-filter-head > button {
    min-height: 40px;
    padding: 0 9px;
    border: 0;
    color: #4f46e5;
    background: transparent;
    font-weight: 700;
  }

  .renewal-mobile-filter-head > button:first-child {
    width: 40px;
    color: #172033;
    font-size: 1.15rem;
  }

  #tab-renewals .renewal-mobile-filters-open .renewal-command-search {
    order: 1;
  }

  #tab-renewals .renewal-mobile-filters-open .renewal-command-filter,
  #tab-renewals .renewal-mobile-filters-open .renewal-toolbar-expiry-range,
  #tab-renewals .renewal-mobile-filters-open .renewal-toolbar-quick-dates {
    order: 2;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #fff;
  }

  #tab-renewals .renewal-mobile-filters-open .renewal-command-filter select,
  #tab-renewals .renewal-mobile-filters-open .renewal-toolbar-expiry-range input {
    min-height: 46px;
    font-size: 16px;
  }

  #tab-renewals .renewal-mobile-filters-open .renewal-toolbar-quick-dates {
    flex-wrap: wrap;
    overflow: visible;
  }

  #tab-renewals .renewal-mobile-filters-open .renewal-toolbar-quick-dates > span {
    display: block;
    flex: 0 0 100%;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 700;
  }

  #tab-renewals .renewal-mobile-filters-open .renewal-toolbar-clear-compact {
    display: none;
  }

  #tab-renewals .renewal-mobile-filter-footer {
    position: fixed;
    z-index: 3;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.98);
  }

  .renewal-mobile-filter-footer button {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    font-weight: 800;
  }

  #tab-renewals .renewal-command-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px !important;
    gap: 9px 10px;
    padding: 13px 11px 11px 14px;
    overflow: hidden;
    border-left: 3px solid #4f46e5;
    background: #fff;
  }

  #tab-renewals .renewal-command-card.is-overdue { border-left-color: #ef4444; }
  #tab-renewals .renewal-command-card.is-due { border-left-color: #f59e0b; }
  #tab-renewals .renewal-command-card.is-upcoming { border-left-color: #16a34a; }
  #tab-renewals .renewal-command-card.is-renewed { border-left-color: #0ea5e9; }

  #tab-renewals .renewal-card-selection {
    position: absolute;
    z-index: 2;
    top: 8px;
    right: 8px;
  }

  #tab-renewals .renewal-command-identity {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0;
  }

  #tab-renewals .renewal-command-avatar {
    display: none;
  }

  #tab-renewals .renewal-customer-title {
    padding-right: 28px;
  }

  #tab-renewals .renewal-customer-title > strong {
    font-size: 0.94rem;
  }

  #tab-renewals .renewal-command-identity > div > small {
    display: block;
    margin-top: 4px;
    color: #475569;
    font-size: 0.73rem;
  }

  #tab-renewals .renewal-customer-contact {
    display: none;
  }

  #tab-renewals .renewal-command-day-tile {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: start;
    justify-self: end;
    width: 84px !important;
    min-width: 0;
    max-width: 84px;
    padding: 5px 7px;
    border-radius: 999px;
  }

  #tab-renewals .renewal-command-day-tile > strong,
  #tab-renewals .renewal-command-day-tile > span,
  #tab-renewals .renewal-command-day-tile > small {
    font-size: 0.64rem;
  }

  #tab-renewals .renewal-expiry-cell,
  #tab-renewals .renewal-users-cell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 2px 5px;
    min-width: 0;
    padding: 7px 0 0;
    border-top: 1px solid #eef2f7;
  }

  #tab-renewals .renewal-expiry-cell {
    grid-column: 1;
  }

  #tab-renewals .renewal-users-cell {
    grid-column: 2;
  }

  #tab-renewals .renewal-expiry-cell small,
  #tab-renewals .renewal-users-cell span {
    grid-column: 1 / -1;
    color: #64748b;
    font-size: 0.62rem;
  }

  #tab-renewals .renewal-expiry-cell strong,
  #tab-renewals .renewal-users-cell strong {
    font-size: 0.72rem;
  }

  #tab-renewals .renewal-command-key,
  #tab-renewals .renewal-next-reminder-cell {
    grid-column: 1 / -1;
  }

  #tab-renewals .renewal-command-key {
    display: none;
  }

  #tab-renewals .renewal-next-reminder-cell {
    padding: 0;
    border: 0;
  }

  #tab-renewals .renewal-reminder-timeline {
    display: none;
  }

  #tab-renewals .renewal-next-reminder-cell > span {
    display: block;
    color: #475569;
    font-size: 0.68rem;
  }

  #tab-renewals .renewal-command-action-zone {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #eef2f7;
  }

  #tab-renewals .renewal-command-contact-links {
    display: flex;
    gap: 4px;
  }

  #tab-renewals .renewal-command-contact-links > * {
    width: 38px;
    height: 38px;
  }

  #tab-renewals .renewal-command-action-row {
    display: grid;
    grid-template-columns: minmax(92px, 1fr) minmax(62px, auto) 42px;
    gap: 6px;
  }

  #tab-renewals .renewal-command-main-action,
  #tab-renewals .renewal-mobile-view-action {
    min-height: 40px;
    padding: 0 9px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 800;
  }

  #tab-renewals .renewal-command-main-action {
    color: #fff;
    background: #4f46e5;
  }

  #tab-renewals .renewal-command-main-action.is-overdue { background: #dc2626; }
  #tab-renewals .renewal-command-main-action.is-due { background: #ea580c; }
  #tab-renewals .renewal-command-main-action.is-upcoming { background: #16a34a; }

  #tab-renewals .renewal-mobile-view-action {
    border: 1px solid #c7d2fe;
    color: #4338ca;
    background: #eef2ff;
  }

  #tab-renewals .renewal-command-duplicate-action {
    display: none;
  }

  .renewal-mobile-sheet {
    position: fixed;
    z-index: 18020;
    inset: 0;
    align-items: flex-end;
  }

  .renewal-mobile-sheet-scrim {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(15, 23, 42, 0.58);
  }

  .renewal-mobile-sheet > div {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 7px;
    width: 100%;
    max-height: min(82vh, 720px);
    padding: 9px 14px calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -18px 50px rgba(15, 23, 42, 0.2);
  }

  .renewal-mobile-sheet > div > span:first-child {
    width: 42px;
    height: 4px;
    margin: 0 auto 4px;
    border-radius: 99px;
    background: #cbd5e1;
  }

  .renewal-mobile-sheet h3 {
    margin: 3px 0 8px;
    font-size: 1rem;
  }

  .renewal-mobile-sheet > div > button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    color: #334155;
    text-align: left;
    background: #fff;
    font-weight: 700;
  }

  .renewal-mobile-sheet > div > button.is-primary {
    border-color: #4f46e5;
    color: #fff;
    background: #4f46e5;
  }

  .renewal-mobile-sheet > div > button.is-danger {
    color: #b91c1c;
  }

  #renewalDetailsOverlay,
  #renewalSettingsOverlay,
  #renewalCompletionOverlay,
  #renewalFollowUpOverlay,
  #renewalHistoryOverlay {
    align-items: stretch;
    padding: 0;
    background: #f8fafc;
  }

  #renewalDetailsOverlay .renewal-details-dialog,
  #renewalSettingsOverlay .renewal-settings-dialog,
  #renewalCompletionOverlay .renewal-completion-dialog,
  #renewalFollowUpOverlay .dialog-card,
  #renewalHistoryOverlay .dialog-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    max-height: none;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #renewalDetailsOverlay .dialog-heading,
  #renewalSettingsOverlay .dialog-heading,
  #renewalCompletionOverlay .dialog-heading,
  #renewalFollowUpOverlay .dialog-heading,
  #renewalHistoryOverlay .dialog-heading {
    position: sticky;
    z-index: 3;
    top: 0;
    padding-top: calc(12px + env(safe-area-inset-top));
    background: rgba(255, 255, 255, 0.98);
  }

  #renewalDetailsOverlay .renewal-details-content {
    flex: 1;
    padding: 12px 12px calc(92px + env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  #renewalDetailsOverlay .renewal-details-grid {
    grid-template-columns: 1fr !important;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
  }

  #renewalDetailsOverlay .renewal-details-grid > div {
    display: grid;
    grid-template-columns: 42% minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
  }

  #renewalDetailsOverlay .renewal-details-grid > div:last-child {
    border-bottom: 0;
  }

  #renewalDetailsOverlay .renewal-details-actions {
    display: none;
  }

  .renewal-mobile-detail-extra {
    flex-direction: column;
  }

  .renewal-mobile-detail-actions {
    position: fixed;
    z-index: 5;
    right: 0;
    bottom: 0;
    left: 0;
    align-items: stretch;
    justify-content: space-around;
    gap: 4px;
    padding: 8px 7px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.98);
  }

  .renewal-mobile-detail-actions > * {
    display: grid;
    flex: 1;
    min-width: 0;
    min-height: 48px;
    place-items: center;
    gap: 2px;
    padding: 4px;
    border: 0;
    border-radius: 10px;
    color: #334155;
    text-decoration: none;
    background: transparent;
    font-size: 0.62rem;
    font-weight: 700;
  }

  .renewal-mobile-detail-actions > * i {
    color: #4f46e5;
    font-size: 1rem;
  }

  .renewal-mobile-detail-actions [data-renewal-detail="renew"] {
    color: #fff;
    background: #16a34a;
  }

  .renewal-mobile-detail-actions [data-renewal-detail="renew"] i {
    color: #fff;
  }

  .renewal-mobile-detail-actions .is-disabled,
  .renewal-mobile-detail-actions :disabled {
    opacity: 0.38;
    pointer-events: none;
  }

  #renewalSettingsOverlay .renewal-settings-dialog form,
  #renewalCompletionOverlay .renewal-completion-dialog form,
  #renewalFollowUpOverlay .dialog-card form {
    min-width: 0;
  }

  #renewalSettingsOverlay .form-grid,
  #renewalCompletionOverlay .form-grid,
  #renewalFollowUpOverlay .form-grid {
    grid-template-columns: 1fr !important;
  }

  #renewalSettingsOverlay input,
  #renewalSettingsOverlay select,
  #renewalCompletionOverlay input,
  #renewalCompletionOverlay select,
  #renewalFollowUpOverlay input,
  #renewalFollowUpOverlay select,
  #renewalFollowUpOverlay textarea {
    min-height: 44px;
    font-size: 16px;
  }
}

@media (max-width: 680px) and (prefers-reduced-motion: reduce) {
  .renewal-mobile-saving-ring { animation: none; }
}

/* Compact mobile renewal list and sectioned create flow. */
@media (max-width: 680px) {
  body.renewal-mobile-native-overlay-open {
    overflow: hidden;
  }

  .renewal-mobile-validation-note:not([hidden]) {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0 0;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 11px;
    color: #991b1b;
    background: #fff1f2;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.4;
  }

  .renewal-mobile-validation-note i {
    flex: 0 0 auto;
    margin-top: 1px;
    font-size: 0.9rem;
  }

  #tab-renewals .renewal-command-form .renewal-mobile-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.11) !important;
  }

  #tab-renewals .renewal-command-card {
    z-index: 1;
    overflow: visible;
  }

  #tab-renewals .renewal-command-card:has(.renewal-command-action-menu[open]) {
    z-index: 240;
  }

  #tab-renewals .renewal-command-action-menu[open],
  #tab-renewals .renewal-command-action-menu[open] .action-menu-list {
    z-index: 260;
  }

  #renewalDetailsOverlay,
  #renewalCompletionOverlay {
    z-index: 18010;
    inset: 0;
    height: 100dvh;
    overflow: hidden;
    background: #f4f7fb;
  }

  #renewalDetailsOverlay .renewal-mobile-native-screen,
  #renewalCompletionOverlay .renewal-mobile-native-screen {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    color: #17213a;
    background: #f4f7fb;
  }

  #renewalDetailsOverlay .dialog-heading,
  #renewalCompletionOverlay .dialog-heading {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 0 10px;
    min-height: calc(64px + env(safe-area-inset-top));
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    border-bottom: 1px solid #e5eaf2;
    box-shadow: 0 2px 12px rgba(35, 51, 83, 0.05);
  }

  #renewalDetailsOverlay .dialog-heading > div,
  #renewalCompletionOverlay .dialog-heading > div {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  #renewalDetailsOverlay .dialog-heading .eyebrow,
  #renewalCompletionOverlay .dialog-heading .eyebrow {
    margin: 0 0 2px;
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 850;
    letter-spacing: 0.08em;
  }

  #renewalDetailsOverlay .dialog-heading h3,
  #renewalCompletionOverlay .dialog-heading h3 {
    overflow: hidden;
    margin: 0;
    color: #101a33;
    font-size: 0.98rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #renewalCompletionOverlay .dialog-heading .helper-text {
    display: none;
  }

  #renewalDetailsOverlay .renewal-mobile-native-back,
  #renewalCompletionOverlay .renewal-mobile-native-back {
    grid-column: 1;
    grid-row: 1;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #17213a;
    background: #eef2f7;
  }

  #renewalDetailsOverlay .renewal-mobile-native-back i,
  #renewalCompletionOverlay .renewal-mobile-native-back i {
    font-size: 1.05rem;
  }

  #renewalDetailsOverlay .renewal-mobile-native-back span,
  #renewalCompletionOverlay .renewal-mobile-native-back span {
    display: none;
  }

  #renewalDetailsOverlay .renewal-details-content {
    display: block;
    min-height: 0;
    padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    background: #f4f7fb;
  }

  #renewalDetailsOverlay .renewal-details-content > .renewal-details-grid:first-child {
    border-top: 5px solid #16a34a;
    box-shadow: 0 8px 24px rgba(31, 52, 89, 0.07);
  }

  #renewalDetailsOverlay .renewal-details-content section {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
  }

  #renewalDetailsOverlay .renewal-details-content section h4 {
    margin: 0 0 10px;
    color: #17213a;
    font-size: 0.82rem;
    font-weight: 900;
  }

  #renewalDetailsOverlay .renewal-details-grid dt {
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 750;
  }

  #renewalDetailsOverlay .renewal-details-grid dd {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #17213a;
    font-size: 0.73rem;
    font-weight: 850;
  }

  #renewalCompletionOverlay .renewal-completion-dialog > form {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f4f7fb;
  }

  #renewalCompletionOverlay .renewal-completion-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 12px 0;
    padding: 12px;
    border: 1px solid #dbe5f2;
    border-top: 5px solid #16a34a;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(31, 52, 89, 0.07);
  }

  #renewalCompletionOverlay .renewal-completion-summary > div {
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid #edf1f6;
    border-radius: 10px;
    background: #f8fafc;
  }

  #renewalCompletionOverlay .renewal-completion-summary strong {
    overflow: hidden;
    margin-top: 3px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #renewalCompletionOverlay .renewal-completion-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 11px;
    margin: 12px;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
  }

  #renewalCompletionOverlay .renewal-completion-grid label {
    gap: 6px;
    color: #334155;
    font-size: 0.7rem;
    font-weight: 800;
  }

  #renewalCompletionOverlay .renewal-completion-grid input,
  #renewalCompletionOverlay .renewal-completion-grid select,
  #renewalCompletionOverlay .renewal-completion-grid textarea {
    min-height: 46px;
    border-radius: 11px;
    font-size: 16px;
    background: #fff;
  }

  #renewalCompletionOverlay .renewal-completion-warning,
  #renewalCompletionOverlay .renewal-completion-preview,
  #renewalCompletionOverlay .renewal-completion-toggle {
    margin-right: 12px;
    margin-left: 12px;
  }

  #renewalCompletionOverlay .renewal-completion-toggle {
    padding: 12px;
    border: 1px solid #bbf7d0;
    border-radius: 13px;
    background: #f0fdf4;
  }

  #renewalCompletionOverlay .renewal-completion-actions {
    position: sticky;
    z-index: 4;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
    gap: 8px;
    margin-top: auto;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid #dfe6ef;
    background: rgba(255, 255, 255, 0.98);
  }

  #renewalCompletionOverlay .renewal-completion-actions button {
    min-height: 48px;
    border-radius: 12px;
    font-size: 0.74rem;
    font-weight: 850;
  }

  #tab-renewals .renewal-mobile-create-wizard {
    display: block;
    margin-bottom: 10px;
  }

  #tab-renewals .renewal-mobile-create-progress {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    padding: 12px 5px 10px;
    border: 1px solid #dfe7f2;
    border-radius: 15px 15px 0 0;
    background: #fff;
  }

  #tab-renewals .renewal-mobile-create-progress::before {
    content: "";
    position: absolute;
    top: 27px;
    right: 13%;
    left: 13%;
    height: 2px;
    background: #dce4ef;
  }

  #tab-renewals .renewal-mobile-create-progress button {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 5px;
    min-width: 0;
    padding: 0;
    border: 0;
    color: #7a879c;
    background: transparent;
  }

  #tab-renewals .renewal-mobile-create-progress button > span {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border: 2px solid #dce4ef;
    border-radius: 50%;
    background: #fff;
    font-size: 0.73rem;
    font-weight: 900;
  }

  #tab-renewals .renewal-mobile-create-progress button > small {
    overflow: hidden;
    max-width: 100%;
    font-size: 0.62rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #tab-renewals .renewal-mobile-create-progress button.is-active,
  #tab-renewals .renewal-mobile-create-progress button.is-complete {
    color: #4338ca;
  }

  #tab-renewals .renewal-mobile-create-progress button.is-active > span {
    border-color: #4f46e5;
    color: #fff;
    background: #4f46e5;
    box-shadow: 0 0 0 4px #eef2ff;
  }

  #tab-renewals .renewal-mobile-create-progress button.is-complete > span {
    border-color: #a5b4fc;
    color: #4338ca;
    background: #eef2ff;
  }

  #tab-renewals .renewal-mobile-page-heading {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border: 1px solid #dfe7f2;
    border-top: 0;
    border-radius: 0 0 15px 15px;
    background: linear-gradient(135deg, #f7f8ff, #fff);
  }

  #tab-renewals .renewal-mobile-page-heading > span {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    color: #4338ca;
    background: #e9edff;
    font-size: 1.05rem;
  }

  #tab-renewals .renewal-mobile-page-heading > div {
    min-width: 0;
  }

  #tab-renewals .renewal-mobile-page-heading small {
    color: #6366f1;
    font-size: 0.59rem;
    font-weight: 900;
    letter-spacing: 0.07em;
  }

  #tab-renewals .renewal-mobile-page-heading h3,
  #tab-renewals .renewal-mobile-page-heading p {
    margin: 0;
  }

  #tab-renewals .renewal-mobile-page-heading h3 {
    margin-top: 2px;
    color: #172033;
    font-size: 0.95rem;
  }

  #tab-renewals .renewal-mobile-page-heading p {
    margin-top: 3px;
    color: #64748b;
    font-size: 0.68rem;
    line-height: 1.35;
  }

  #tab-renewals .renewal-form-card-title,
  #tab-renewals .renewal-command-form > .renewal-form-card > .renewal-section-heading {
    display: none !important;
  }

  #tab-renewals .renewal-command-form[data-renewal-mobile-page="1"] [data-renewal-mobile-page]:not([data-renewal-mobile-page="1"]),
  #tab-renewals .renewal-command-form[data-renewal-mobile-page="2"] [data-renewal-mobile-page]:not([data-renewal-mobile-page="2"]),
  #tab-renewals .renewal-command-form[data-renewal-mobile-page="3"] [data-renewal-mobile-page]:not([data-renewal-mobile-page="3"]),
  #tab-renewals .renewal-command-form[data-renewal-mobile-page="4"] [data-renewal-mobile-page]:not([data-renewal-mobile-page="4"]) {
    display: none !important;
  }

  #tab-renewals .renewal-command-form[data-renewal-mobile-page="1"] .renewal-essential-grid > label:not([data-renewal-mobile-page="1"]),
  #tab-renewals .renewal-command-form[data-renewal-mobile-page="2"] .renewal-essential-grid > label:not([data-renewal-mobile-page="2"]),
  #tab-renewals .renewal-command-form[data-renewal-mobile-page="3"] .renewal-essential-grid,
  #tab-renewals .renewal-command-form[data-renewal-mobile-page="4"] .renewal-essential-grid {
    display: none !important;
  }

  #tab-renewals .renewal-form-card {
    padding: 11px;
  }

  #tab-renewals .renewal-form-step,
  #tab-renewals .renewal-schedule-panel,
  #tab-renewals .renewal-progressive-details,
  #tab-renewals .renewal-type-fields {
    margin-top: 0;
  }

  #tab-renewals .renewal-essential-grid {
    gap: 12px;
    margin-top: 0;
  }

  #tab-renewals .renewal-mobile-review {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
    padding: 13px;
    border: 1px solid #c7d2fe;
    border-radius: 14px;
    background: #f8f9ff;
  }

  #tab-renewals .renewal-mobile-review-title {
    display: flex;
    align-items: center;
    gap: 9px;
  }

  #tab-renewals .renewal-mobile-review-title > span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: #4f46e5;
  }

  #tab-renewals .renewal-mobile-review-title > div {
    display: grid;
    gap: 2px;
  }

  #tab-renewals .renewal-mobile-review-title small {
    color: #64748b;
    font-size: 0.68rem;
  }

  #tab-renewals .renewal-mobile-review dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
  }

  #tab-renewals .renewal-mobile-review dl > div {
    min-width: 0;
    padding: 9px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
  }

  #tab-renewals .renewal-mobile-review dt {
    color: #64748b;
    font-size: 0.62rem;
  }

  #tab-renewals .renewal-mobile-review dd {
    overflow: hidden;
    margin: 3px 0 0;
    color: #172033;
    font-size: 0.75rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #tab-renewals .renewal-mobile-savebar {
    display: grid;
    grid-template-columns: 42px 58px minmax(0, 1fr) 76px;
  }

  #tab-renewals .renewal-mobile-savebar > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    padding: 0 8px;
  }

  #tab-renewals .renewal-mobile-savebar > button:first-child {
    padding: 0;
  }

  #tab-renewals .renewal-mobile-savebar > button:disabled {
    opacity: 0.38;
  }

  #tab-renewals .renewal-mobile-savebar > div {
    text-align: left;
  }

  #tab-renewals .renewal-command-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: min-content;
    align-items: start;
    align-content: start;
    gap: 10px;
    min-height: 0 !important;
    padding: 12px !important;
    border-radius: 15px;
    background: #fff !important;
  }

  #tab-renewals .renewal-command-card > .renewal-command-identity,
  #tab-renewals .renewal-command-card > .renewal-command-day-tile,
  #tab-renewals .renewal-command-card > .renewal-expiry-cell,
  #tab-renewals .renewal-command-card > .renewal-users-cell,
  #tab-renewals .renewal-command-card > .renewal-command-key,
  #tab-renewals .renewal-command-card > .renewal-next-reminder-cell {
    display: none !important;
  }

  #tab-renewals .renewal-command-card > .renewal-card-selection {
    position: absolute;
    top: 11px;
    right: 11px;
  }

  #tab-renewals .renewal-mobile-card-summary {
    display: grid;
    grid-column: 1 !important;
    gap: 10px;
    min-width: 0;
  }

  #tab-renewals .renewal-mobile-card-summary > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 9px;
    padding-right: 28px;
  }

  #tab-renewals .renewal-mobile-card-summary > header > div {
    min-width: 0;
  }

  #tab-renewals .renewal-mobile-card-customer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
  }

  #tab-renewals .renewal-mobile-card-customer > strong {
    overflow: hidden;
    max-width: 100%;
    color: #14203a;
    font-size: 0.91rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #tab-renewals .renewal-mobile-card-summary header p {
    overflow: hidden;
    margin: 5px 0 0;
    color: #52617a;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #tab-renewals .renewal-mobile-status {
    display: grid;
    flex: 0 0 auto;
    min-width: 72px;
    justify-items: center;
    gap: 0;
    padding: 6px 8px;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: #3730a3;
    background: #eef2ff;
    line-height: 1.05;
  }

  #tab-renewals .renewal-mobile-status.is-overdue { border-color: #fecdd3; color: #be123c; background: #fff1f2; }
  #tab-renewals .renewal-mobile-status.is-due { border-color: #fed7aa; color: #c2410c; background: #fff7ed; }
  #tab-renewals .renewal-mobile-status.is-upcoming { border-color: #bbf7d0; color: #15803d; background: #f0fdf4; }
  #tab-renewals .renewal-mobile-status.is-renewed { border-color: #bae6fd; color: #0369a1; background: #f0f9ff; }

  #tab-renewals .renewal-mobile-status b {
    font-size: 0.72rem;
  }

  #tab-renewals .renewal-mobile-status small {
    margin-top: 2px;
    font-size: 0.52rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  #tab-renewals .renewal-mobile-card-summary dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
  }

  #tab-renewals .renewal-mobile-card-summary dl > div {
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid #e8edf4;
    border-radius: 10px;
    background: #f8fafc;
  }

  #tab-renewals .renewal-mobile-card-summary dt {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #718096;
    font-size: 0.58rem;
  }

  #tab-renewals .renewal-mobile-card-summary dd {
    overflow: hidden;
    margin: 3px 0 0;
    color: #1f2a44;
    font-size: 0.7rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #tab-renewals .renewal-mobile-card-contact {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: #52617a;
    font-size: 0.67rem;
  }

  #tab-renewals .renewal-command-card > .renewal-command-action-zone {
    grid-column: 1 !important;
    grid-row: auto !important;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px;
    width: 100%;
    min-width: 0;
    padding-top: 10px;
  }

  #tab-renewals .renewal-command-action-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr) 40px;
    min-width: 0;
  }

  #tab-renewals .renewal-command-action-row .action-menu,
  #tab-renewals .renewal-command-action-row .renewal-command-action-menu {
    min-width: 0;
  }

  #tab-renewals .renewal-command-action-row .action-menu > summary,
  #tab-renewals .renewal-command-action-row .renewal-command-action-menu > summary {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 340px) {
  #tab-renewals .renewal-mobile-savebar {
    grid-template-columns: 44px minmax(0, 1fr) 66px;
  }

  #tab-renewals .renewal-mobile-step-back span {
    display: none;
  }

  #tab-renewals .renewal-mobile-card-summary > header {
    grid-template-columns: minmax(0, 1fr);
  }

  #tab-renewals .renewal-mobile-status {
    justify-self: start;
  }

  #tab-renewals .renewal-command-card > .renewal-command-action-zone {
    grid-template-columns: minmax(0, 1fr);
  }

  #tab-renewals .renewal-command-contact-links > * {
    flex: 1;
    width: auto;
  }
}

/* Renewal home and settings parity with the established Sales/Quotation phone experience. */
@media (max-width: 680px) {
  #tab-renewal-home .renewal-mobile-home-surface {
    display: grid;
    gap: 16px;
    padding: 14px 14px calc(96px + env(safe-area-inset-bottom));
    background: #f7f9fd;
  }

  #tab-renewal-home .renewal-mobile-home-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px;
    align-items: center;
    gap: 12px;
    min-height: 176px;
    margin: 0;
    padding: 24px 22px;
    overflow: hidden;
    border: 1px solid #d7e3f6;
    border-radius: 24px;
    color: #101d38;
    background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
    box-shadow: 0 12px 30px rgba(31, 74, 143, 0.08);
  }

  #tab-renewal-home .renewal-mobile-home-hero::after {
    content: "";
    position: absolute;
    right: -44px;
    bottom: -54px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(45, 112, 228, 0.08);
  }

  #tab-renewal-home .renewal-mobile-home-hero > div {
    position: relative;
    z-index: 1;
    min-width: 0;
  }

  #tab-renewal-home .renewal-mobile-home-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    color: #1760dc;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.12em;
  }

  #tab-renewal-home .renewal-mobile-home-hero h1 {
    margin: 0;
    color: #101d38;
    font-size: clamp(1.72rem, 8vw, 2.12rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
  }

  #tab-renewal-home .renewal-mobile-home-hero p {
    max-width: 240px;
    margin: 12px 0 0;
    color: #63718b;
    font-size: 0.86rem;
    line-height: 1.55;
  }

  #tab-renewal-home .renewal-mobile-home-hero-icon {
    position: relative;
    z-index: 1;
    display: grid;
    width: 76px;
    height: 88px;
    place-items: center;
    border: 1px solid #c8daf9;
    border-radius: 18px;
    color: #1760dc;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 22px rgba(31, 91, 190, 0.12);
    font-size: 2rem;
  }

  #tab-renewal-home .renewal-mobile-home-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 0;
  }

  #tab-renewal-home .renewal-mobile-home-actions > button,
  #tab-renewal-home .renewal-mobile-home-actions > button:last-child {
    grid-column: auto;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 14px;
    min-height: 112px;
    padding: 16px;
    border: 1px solid #dbe4f2;
    border-radius: 20px;
    color: #14213d;
    text-align: left;
    background: #fff;
    box-shadow: 0 8px 22px rgba(31, 54, 94, 0.055);
  }

  #tab-renewal-home .renewal-mobile-home-actions > button.is-primary {
    min-height: 124px;
    border-color: #a9dec2;
    background: linear-gradient(135deg, #f7fffa 0%, #eaf9f1 100%);
    box-shadow: 0 12px 26px rgba(20, 142, 81, 0.1);
  }

  #tab-renewal-home .renewal-mobile-home-actions > button.is-view {
    border-color: #c8daf8;
    background: linear-gradient(135deg, #ffffff 0%, #f1f6ff 100%);
  }

  #tab-renewal-home .renewal-mobile-home-actions > button.is-settings {
    border-color: #dcd3fa;
    background: linear-gradient(135deg, #ffffff 0%, #f7f4ff 100%);
  }

  #tab-renewal-home .renewal-mobile-home-actions > button > i:first-child {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    border-radius: 17px;
    color: #1760dc;
    background: #edf4ff;
    font-size: 1.55rem;
  }

  #tab-renewal-home .renewal-mobile-home-actions > button.is-primary > i:first-child {
    color: #07934b;
    background: #ddf6e8;
  }

  #tab-renewal-home .renewal-mobile-home-actions > button.is-settings > i:first-child {
    color: #6346d8;
    background: #eee9ff;
  }

  #tab-renewal-home .renewal-mobile-home-actions > button > span {
    gap: 5px;
  }

  #tab-renewal-home .renewal-mobile-home-actions strong {
    color: #12203d;
    font-size: 1rem;
    line-height: 1.25;
  }

  #tab-renewal-home .renewal-mobile-home-actions small {
    color: #6c7890;
    font-size: 0.75rem;
    line-height: 1.45;
  }

  #tab-renewal-home .renewal-mobile-home-actions > button > i:last-child {
    width: auto;
    height: auto;
    justify-self: end;
    color: #1760dc;
    background: transparent;
    font-size: 1.15rem;
  }

  #tab-renewal-home .renewal-mobile-home-actions > button.is-primary > i:last-child { color: #07934b; }
  #tab-renewal-home .renewal-mobile-home-actions > button.is-settings > i:last-child { color: #6346d8; }

  #tab-renewals .renewal-mobile-savebar {
    grid-template-columns: 64px minmax(0, 1fr) 84px;
  }

  #tab-renewals .renewal-mobile-savebar > button:first-child {
    padding: 0 8px;
  }

  #renewalSettingsOverlay {
    z-index: 18010;
    inset: 0;
    height: 100dvh;
    overflow: hidden;
    background: #f4f7fb;
  }

  #renewalSettingsOverlay .renewal-settings-dialog {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    color: #17213a;
    background: #f4f7fb;
  }

  #renewalSettingsOverlay .renewal-settings-dialog > form {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f4f7fb;
  }

  #renewalSettingsOverlay .dialog-heading {
    position: sticky;
    z-index: 4;
    top: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 0 10px;
    min-height: calc(64px + env(safe-area-inset-top));
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    border-bottom: 1px solid #e5eaf2;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 12px rgba(35, 51, 83, 0.05);
  }

  #renewalSettingsOverlay .dialog-heading > div {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  #renewalSettingsOverlay .dialog-heading .eyebrow {
    margin: 0 0 2px;
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 850;
    letter-spacing: 0.08em;
  }

  #renewalSettingsOverlay .dialog-heading h3 {
    margin: 0;
    color: #101a33;
    font-size: 0.98rem;
    font-weight: 900;
  }

  #renewalSettingsOverlay .renewal-mobile-native-back {
    grid-column: 1;
    grid-row: 1;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #17213a;
    background: #eef2f7;
  }

  #renewalSettingsOverlay .renewal-mobile-native-back span {
    display: none;
  }

  #renewalSettingsOverlay .renewal-settings-dialog > form > .helper-text {
    margin: 12px 12px 0;
    padding: 11px 12px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    color: #475569;
    background: #eff6ff;
    font-size: 0.7rem;
    line-height: 1.45;
  }

  #renewalSettingsOverlay .renewal-settings-grid {
    display: grid;
    gap: 12px;
    margin: 12px;
  }

  #renewalSettingsOverlay .renewal-settings-card {
    padding: 14px;
    border: 1px solid #dfe6ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(31, 54, 94, 0.055);
  }

  #renewalSettingsOverlay .renewal-settings-card-head {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 14px;
  }

  #renewalSettingsOverlay .renewal-settings-card-head .service-wallet-switch {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }

  #renewalSettingsOverlay .renewal-settings-icon {
    width: 44px;
    height: 44px;
  }

  #renewalSettingsOverlay .renewal-settings-card-head strong {
    color: #17213a;
    font-size: 0.82rem;
  }

  #renewalSettingsOverlay .renewal-settings-card-head small {
    color: #64748b;
    font-size: 0.66rem;
  }

  #renewalSettingsOverlay .renewal-settings-card > label,
  #renewalSettingsOverlay .renewal-settings-fields > label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 0.7rem;
    font-weight: 800;
  }

  #renewalSettingsOverlay input,
  #renewalSettingsOverlay select {
    min-height: 46px;
    border-radius: 11px;
    font-size: 16px;
    background: #fff;
  }

  #renewalSettingsOverlay .service-wallet-switch input {
    min-height: 0;
  }

  #renewalSettingsOverlay .renewal-settings-days {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  #renewalSettingsOverlay .renewal-settings-days input {
    width: 100%;
  }

  #renewalSettingsOverlay .renewal-settings-status {
    margin: 0 12px 8px;
  }

  #renewalSettingsOverlay .renewal-settings-actions {
    position: sticky;
    z-index: 4;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 8px;
    margin-top: auto;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid #dfe6ef;
    background: rgba(255, 255, 255, 0.98);
  }

  #renewalSettingsOverlay #cancelRenewalSettingsBtn {
    display: none;
  }

  #renewalSettingsOverlay .renewal-settings-actions button {
    min-height: 48px;
    margin: 0;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 850;
  }
}
