:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --line: #d9dee8;
    --text: #162033;
    --muted: #647084;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #f59e0b;
    --danger: #b91c1c;
    --ok: #15803d;
    --warn: #b45309;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px 1fr;
    min-width: 0;
}

.sidebar {
    background: #111827;
    color: #f9fafb;
    padding: 20px 16px;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.brand {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 22px;
}

.nav {
    display: grid;
    gap: 4px;
}

.nav a,
.nav button {
    width: auto;
    display: block;
    border: 0;
    border-radius: 6px;
    padding: 10px 12px;
    background: transparent;
    color: #d1d5db;
    text-align: left;
    font: inherit;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.nav a.active,
.nav a:hover,
.nav button:hover {
    background: #1f2937;
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
}

.settings-cog {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    color: #d1d5db;
}

.settings-cog:hover,
.settings-cog.active {
    background: #1f2937;
    color: #ffffff;
}

.settings-cog svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.main {
    padding: 24px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.topbar h1 {
    margin: 0;
    font-size: 26px;
}

.muted {
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    min-width: 0;
}

.panel h2,
.panel h3 {
    margin-top: 0;
}

.metric {
    display: grid;
    gap: 4px;
}

.metric strong {
    font-size: 28px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.inline-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.posts-filter {
    margin-bottom: 16px;
}

.posts-filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto;
    gap: 12px;
    align-items: end;
}

.posts-filter-form-single {
    grid-template-columns: minmax(220px, 1fr) auto;
}

.posts-filter-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.posts-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.business-form-panel {
    display: grid;
    gap: 16px;
}

.form-tabs {
    display: grid;
    gap: 16px;
}

.tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.tab-button {
    border-color: var(--line);
    background: #f8fafc;
    color: var(--text);
    min-height: 38px;
}

.tab-button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.tab-button:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.25);
    outline-offset: 2px;
}

.tab-panel {
    display: grid;
    gap: 14px;
}

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

.tab-panel-title {
    margin: 0;
    font-size: 18px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.item-list-field {
    display: grid;
    gap: 10px;
}

.item-list-heading,
.item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.item-list-heading label {
    display: block;
}

.item-list {
    display: grid;
    gap: 8px;
}

.item-add,
.item-remove {
    min-height: 38px;
}

.item-remove {
    color: var(--danger);
}

.connection-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.connection-actions,
.connection-picker {
    display: grid;
    gap: 8px;
}

.inline-code {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 3px 5px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #334155;
}

.inner-panel {
    background: #f8fafc;
}

.danger-zone {
    border-color: #fecaca;
    background: #fff7f7;
}

.button,
button {
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 9px 12px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

.button.secondary,
button.secondary {
    background: #ffffff;
    color: var(--primary-dark);
}

.button.danger,
button.danger {
    border-color: var(--danger);
    background: var(--danger);
}

.button.success,
button.success {
    border-color: #166534;
    background: #166534;
}

button:disabled {
    border-color: #cbd5e1;
    background: #e5e7eb;
    color: #64748b;
    cursor: not-allowed;
}

.button.linkish,
button.linkish {
    border-color: transparent;
    background: transparent;
    color: var(--primary-dark);
    padding-left: 0;
}

.table-wrap {
    overflow-x: auto;
}

.post-row-preview {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    min-width: 420px;
}

.post-row-copy {
    min-width: 0;
    padding-top: 1px;
}

.post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.post-actions-stacked {
    display: grid;
    align-items: stretch;
}

.post-actions-stacked .button,
.post-actions-stacked button {
    width: 100%;
    text-align: center;
}

.business-list-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}

.businesses-table {
    table-layout: fixed;
    min-width: 820px;
}

.businesses-col-name {
    width: 43%;
}

.businesses-col-frequency {
    width: 26%;
}

.businesses-col-connections {
    width: 21%;
}

.businesses-col-actions {
    width: 10%;
}

.businesses-table tbody tr {
    height: 74px;
}

.businesses-table th,
.businesses-table td {
    vertical-align: middle;
}

.businesses-table td {
    height: 74px;
}

.businesses-table .business-list-name {
    min-width: 0;
}

.business-list-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.business-list-title,
.business-list-url,
.business-table-line {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.business-table-actions {
    text-align: right;
}

.business-table-actions .button {
    white-space: nowrap;
}

.business-logo-thumb,
.business-logo-preview {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--primary-dark);
    font-weight: 800;
    overflow: hidden;
}

.business-logo-thumb {
    width: 42px;
    height: 42px;
    border-radius: 7px;
    font-size: 13px;
}

.business-logo-preview {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    font-size: 18px;
}

.business-logo-thumb img,
.business-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.logo-preview-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 10px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid .wide {
    grid-column: 1 / -1;
}

.colour-swatch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 34px;
    align-items: center;
}

.colour-swatch {
    display: inline-flex;
    align-items: center;
    min-width: 94px;
    height: 34px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.colour-swatch span {
    display: inline-grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.82);
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.colour-swatch-empty {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.category-manager {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.ecommerce-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

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

.section-heading h3 {
    margin: 0;
}

.category-manager h3,
.product-manager h3,
.product-add-panel h4 {
    margin: 0;
}

.category-add-row {
    margin: 0;
}

.product-manager {
    display: grid;
    gap: 14px;
}

.product-list {
    display: grid;
    gap: 12px;
}

.product-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.product-image-preview {
    display: grid;
    place-items: center;
    width: 112px;
    min-height: 112px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.product-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.product-card-fields {
    min-width: 0;
}

.product-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.product-add-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
}

.checkbox-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.checkbox-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
}

.checkbox-row input {
    width: auto;
}

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

.field-label {
    color: var(--text);
    font-weight: 700;
}

.day-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.day-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
    font-weight: 700;
}

.day-checkbox input {
    width: auto;
}

.inline-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-weight: 400;
}

.inline-checkbox input {
    width: auto;
}

.status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 700;
    background: #e5e7eb;
    color: #374151;
}

.status.Published,
.status.Approved,
.status.Connected {
    background: #dcfce7;
    color: var(--ok);
}

.status.Scheduled {
    background: #dbeafe;
    color: #1d4ed8;
}

.status.AwaitingApproval {
    background: #ffedd5;
    color: var(--warn);
}

.status.Failed,
.status.Rejected,
.status.Error {
    background: #fee2e2;
    color: var(--danger);
}

.status.Needs {
    background: #ffedd5;
    color: var(--warn);
}

.flash {
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #dcfce7;
    color: var(--ok);
    border: 1px solid #86efac;
}

.flash.error {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fecaca;
}

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(420px, 100%);
}

.public-page {
    min-height: 100vh;
    padding: 32px 18px;
}

.public-policy {
    width: min(860px, 100%);
    margin: 0 auto;
}

.public-policy h1 {
    margin: 0 0 18px;
    font-size: 32px;
}

.public-policy h2 {
    margin: 28px 0 8px;
    font-size: 20px;
}

.public-policy p {
    max-width: 74ch;
}

.post-preview {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 14px;
}

.post-preview img {
    border: 1px solid var(--line);
    border-radius: 6px;
}

.preview-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.preview-heading h2 {
    margin-bottom: 4px;
}

.social-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 440px));
    gap: 18px;
    align-items: start;
    justify-content: start;
}

.social-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    max-width: 440px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}

.social-card-label {
    padding: 9px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.social-card-topbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
}

.social-profile {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.social-profile strong,
.social-profile span {
    display: block;
    overflow-wrap: anywhere;
}

.social-profile span {
    color: var(--muted);
    font-size: 12px;
}

.social-avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    overflow: hidden;
}

.social-avatar.has-logo {
    border: 1px solid var(--line);
    background: #ffffff;
}

.social-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
    background: #ffffff;
}

.social-dots {
    color: var(--muted);
    font-weight: 800;
}

.social-caption {
    padding: 12px;
    white-space: normal;
    line-height: 1.42;
    overflow-wrap: anywhere;
}

.social-caption p {
    margin: 0;
}

.social-caption p + p {
    margin-top: 8px;
}

.social-caption a {
    color: #1877f2;
    font-weight: 700;
    text-decoration: none;
    word-break: break-word;
}

.social-caption a:hover {
    text-decoration: underline;
}

.social-image-frame {
    aspect-ratio: 1 / 1;
    background: #f3f4f6;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.social-image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-image-placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 22px;
    color: var(--muted);
    text-align: center;
}

.social-image-placeholder strong {
    color: var(--text);
}

.social-image-placeholder small {
    max-width: 100%;
    color: var(--danger);
    overflow-wrap: anywhere;
}

.social-actions,
.social-metrics {
    display: flex;
    gap: 18px;
    padding: 11px 12px;
    color: #374151;
    border-top: 1px solid var(--line);
    font-weight: 700;
}

.social-actions {
    font-size: 21px;
    border-top: 0;
}

.social-actions span:last-child {
    margin-left: auto;
}

.social-card-instagram .social-caption {
    padding-top: 0;
}

.social-card-facebook .social-caption {
    padding-top: 12px;
}

.calendar {
    table-layout: fixed;
}

.calendar-filter {
    margin-bottom: 16px;
}

.calendar-filter label {
    display: grid;
    max-width: 520px;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.calendar td {
    height: 120px;
    background: #ffffff;
}

.calendar .day {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.calendar .item {
    border-left: 4px solid var(--primary);
    display: block;
    padding: 5px 6px;
    margin-bottom: 5px;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 12px;
}

.calendar .item[hidden] {
    display: none;
}

.calendar-post-business,
.calendar-post-detail {
    min-width: 0;
}

.calendar-post-business,
.calendar-post-idea {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-post-detail {
    display: none;
    gap: 3px;
}

.calendar-filtered .calendar-post-business {
    display: none;
}

.calendar-filtered .calendar-post-detail {
    display: grid;
}

.calendar-post-status,
.calendar-post-time {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.calendar-post-idea {
    color: var(--text);
    font-weight: 700;
}

.calendar .item.Published,
.calendar .item.Approved {
    border-left-color: var(--ok);
}

.calendar .item.AwaitingApproval {
    border-left-color: var(--warn);
}

.calendar .item.Failed,
.calendar .item.Rejected {
    border-left-color: var(--danger);
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 3px 8px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
}

.image-thumb {
    width: 96px;
    height: 96px;
    min-height: 96px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--line);
    object-fit: cover;
}

.log-details {
    min-width: 190px;
}

.log-details summary {
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 700;
}

.log-details pre {
    width: min(760px, 72vw);
    max-height: 320px;
    overflow: auto;
    margin: 10px 0 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0f172a;
    color: #e5e7eb;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.45;
}

.flash.warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fcd34d;
}

.client-shell .sidebar .flash {
    margin: 0 0 16px;
    font-size: 13px;
}

.client-preview-banner {
    display: grid;
    gap: 10px;
}

.client-preview-banner .button {
    justify-content: center;
    width: 100%;
}

.client-users-grid {
    display: grid;
    grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.6fr);
    gap: 16px;
    align-items: start;
}

.client-user-list {
    display: grid;
    gap: 12px;
}

.client-user-card {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.client-user-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.client-user-card-header div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.client-user-meta,
.client-detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.client-user-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-user-meta div,
.client-detail-list div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.client-user-meta dt,
.client-detail-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.client-user-meta dd,
.client-detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.client-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 16px;
}

.client-post-card {
    display: grid;
    gap: 14px;
    align-content: space-between;
    min-width: 0;
    overflow: hidden;
}

.client-post-card .post-row-preview {
    min-width: 0;
}

.client-post-card .post-row-preview > div {
    min-width: 0;
}

.client-summary-grid {
    margin-bottom: 16px;
}

.client-dashboard-grid {
    align-items: start;
}

.client-post-card h2 {
    margin: 8px 0 6px;
    font-size: 18px;
    line-height: 1.32;
    overflow-wrap: anywhere;
}

.client-post-card p {
    margin: 4px 0;
    overflow-wrap: anywhere;
}

.bulk-select {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.bulk-select input {
    width: auto;
}

.empty-panel {
    grid-column: 1 / -1;
    text-align: center;
}

.post-preview-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
    gap: 16px;
    align-items: start;
}

.post-preview-panel > div,
.post-preview-panel aside {
    min-width: 0;
}

.client-detail-list textarea.readonly-note {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    opacity: 1;
}

.approval-history-item {
    display: grid;
    gap: 4px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.approval-history-item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.approval-history-item p {
    margin: 0;
}

.client-decision-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.client-preference-form {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.client-history-list {
    display: grid;
    gap: 12px;
}

.management-mode-grid {
    display: grid;
    gap: 12px;
}

.mode-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 10px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fafc;
    cursor: pointer;
}

.mode-card input {
    width: auto;
    margin-top: 2px;
    grid-row: span 2;
}

.mode-card span {
    color: var(--muted);
}

@media (max-width: 920px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        min-height: auto;
    }

    .nav {
        grid-template-columns: 1fr;
    }

    .sidebar-footer {
        margin-top: 14px;
    }

    .main,
    .sidebar {
        padding: 16px;
    }

    .grid.cols-2,
    .grid.cols-3,
    .grid.cols-4,
    .form-grid,
    .tab-list,
    .item-list-heading,
    .item-row,
    .post-preview,
    .post-preview-panel,
    .client-users-grid,
    .preview-heading,
    .inline-action,
    .posts-filter-form,
    .connection-status-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        grid-template-columns: 1fr;
    }

    .product-image-preview {
        width: 100%;
    }

    .day-checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preview-heading {
        display: grid;
    }

    .tab-list {
        display: grid;
    }

    .tab-button {
        width: 100%;
    }

    .item-add,
    .item-remove {
        width: 100%;
    }

    .client-post-grid,
    .client-user-meta {
        grid-template-columns: 1fr;
    }

    .client-post-card .post-row-preview {
        min-width: 0;
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .client-post-card .image-thumb {
        width: 76px;
        height: 76px;
        min-height: 76px;
    }
}
