.c-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.c-panel-heading {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}
.c-panel-title {
    font-size: 1.0625rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
}
h1.c-panel-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
}
.c-page-head { min-height: 2.4375rem; }
.c-panel-count {
    padding: 0.0625rem 0.4375rem;
    border-radius: 100px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}
.c-panel-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.c-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
    margin-bottom: 0.875rem;
}
.c-field > i {
    position: absolute;
    left: 0.75rem;
    display: block;
    font-size: 0.8125rem;
    line-height: 1;
    color: var(--text-muted);
    pointer-events: none;
}
.c-field > i::before { display: block; vertical-align: 0; }
/* `input.c-input` is needed to outrank base.css's `input[type="search"]`,
   which would otherwise paint console fields with the page background. */
.c-input,
input.c-input {
    width: 100%;
    padding: 0.4375rem 0.75rem;
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.c-input::placeholder { color: var(--text-muted); }
.c-input:focus,
input.c-input:focus {
    outline: none;
    background: var(--bg-primary);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.c-field > i + .c-input { padding-left: 2.125rem; }
.c-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.c-surface {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.c-table-wrap { overflow-x: auto; }
.c-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
}
.c-table thead th {
    padding: 0.5rem 0.875rem;
    text-align: left;
    white-space: nowrap;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: none;
}
.c-table thead th.c-sortable { cursor: pointer; user-select: none; transition: color 0.15s; }
.c-table thead th.c-sortable:hover { color: var(--text-primary); }
.c-table thead th .c-arrow { opacity: 0.5; font-weight: 400; }
.c-table td {
    padding: 0.5rem 0.875rem;
    color: var(--text-primary);
    vertical-align: middle;
    white-space: nowrap;
    border: none;
    border-top: 1px solid var(--bg-tertiary);
    transition: background 0.12s;
}
.c-table tbody tr:first-child td { border-top: none; }
.c-table tbody tr:hover td { background: var(--bg-tertiary); }
.c-strong { font-weight: 600; }
.c-muted { color: var(--text-secondary); }
.c-mono { font-variant-numeric: tabular-nums; }
.c-shrink { width: 1%; }

.c-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.125rem 0.4375rem;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 650;
    white-space: nowrap;
}
.c-pill::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.c-pill-on { background: var(--accent-light); color: var(--accent-color); }
.c-pill-off { background: var(--bg-primary); color: var(--text-muted); }

.c-action {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.625rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.c-action:hover { background: var(--accent-light); color: var(--accent-color); }
.c-action-soft { background: var(--bg-secondary); color: var(--text-primary); }
.c-action-soft:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* Soft actions read as transparent on a surface -- both use --bg-secondary.
   Lift them to --bg-tertiary wherever they sit inside one. */
.c-surface .c-action-soft,
.c-card .c-action-soft,
.c-fact .c-action-soft,
.c-stat .c-action-soft { background: var(--bg-tertiary); }
.c-surface .c-action-soft:hover,
.c-card .c-action-soft:hover,
.c-fact .c-action-soft:hover,
.c-stat .c-action-soft:hover { background: var(--accent-light); color: var(--accent-color); }
.c-action:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.c-action:disabled { opacity: 0.55; cursor: default; }

/* ============================================
   ICON ALIGNMENT
   The global `.bi` rule in base.html forces a 1em
   box and `vertical-align: -.125em` on the glyph,
   which drops icons below centre inside the console's
   flex rows (actions, pills, labels, nudges).
   ============================================ */

.c-action > i,
.c-pill > i,
.c-kv-label > i,
.c-nudge button > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    line-height: 1;
    vertical-align: 0;
    flex-shrink: 0;
}
.c-action > i::before,
.c-pill > i::before,
.c-kv-label > i::before,
.c-nudge button > i::before {
    display: block;
    line-height: 1;
    vertical-align: 0;
}
.c-action > i { font-size: 0.8125rem; }

.c-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.c-empty > p { margin: 0; }
.c-empty-icon {
    display: block;
    width: auto;
    height: auto;
    margin-bottom: 0.625rem;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--text-muted);
    opacity: 0.7;
}
.c-empty-icon::before { display: block; line-height: 1; vertical-align: 0; }
.c-empty > p.c-empty-title {
    margin-bottom: 0.1875rem;
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--text-primary);
}
.c-empty-action { margin-top: 1rem; }

@media (max-width: 640px) {
    .c-field { max-width: none; }
    .c-table td, .c-table thead th { padding: 0.5rem 0.625rem; }
}

.c-pill-warn { background: var(--bg-primary); color: var(--warning); }
.c-pill-danger { background: var(--bg-primary); color: var(--danger); }

.c-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-top: 1px solid var(--bg-tertiary);
    transition: background 0.12s;
}
.c-list-item:first-child { border-top: none; }
.c-list-item:hover { background: var(--bg-tertiary); }
.c-list-body { flex: 1; min-width: 0; }
.c-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.c-item-sub {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.c-item-meta { font-size: 0.75rem; color: var(--text-muted); }
.c-item-actions { display: flex; align-items: center; gap: 0.375rem; flex-shrink: 0; }

.c-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.c-modal-org {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}
.c-modal-org-body { flex: 1; min-width: 0; }
.c-modal-org-name {
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.c-modal-org-meta { font-size: 0.75rem; color: var(--text-muted); }

.c-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--bg-primary);
    flex-shrink: 0;
}
.c-logo-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    user-select: none;
}

.c-section-flush { margin-top: 0; }

.c-avatar-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    user-select: none;
}

.c-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.125rem;
}

.c-action-icon { padding: 0.3125rem 0.4375rem; }

.c-sub-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
}
.c-sub-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.c-sub-item > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    font-size: 0.75rem;
    line-height: 1;
    vertical-align: 0;
    color: var(--text-muted);
    flex-shrink: 0;
}
.c-sub-item > i::before { display: block; line-height: 1; vertical-align: 0; }

.c-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.c-cell-right { text-align: right; }
.c-cell-center { text-align: center; }
.c-cell-link { color: var(--text-primary); }
.c-cell-link:hover { color: var(--accent-color); }
.c-check-cell { cursor: pointer; }
.c-action.is-active { background: var(--accent-light); color: var(--accent-color); }
.c-filter-row .c-seg { margin-bottom: 0; }

.c-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.875rem;
}

.c-tcard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.875rem 1rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.c-tcard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.c-tcard-name {
    margin: 0;
    min-width: 0;
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.c-tcard-price {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.c-tcard-desc {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-secondary);
}
.c-tcard-meta { font-size: 0.75rem; color: var(--text-muted); }
.c-tcard-stock { margin-top: auto; }
.c-tcard-foot {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding-top: 0.625rem;
    border-top: 1px solid var(--bg-tertiary);
}

.c-stock-count {
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.c-stock-note { font-size: 0.75rem; color: var(--text-muted); }
.c-tcard-stock .c-progress-track { margin-top: 0.375rem; }

.c-buy-row {
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}
.c-buy-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.c-buy-field > span {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.c-input-promo { width: 5.5rem; }


@media (max-width: 720px) {
    .c-card-grid { grid-template-columns: minmax(0, 1fr); }
}
.c-time {
    flex-shrink: 0;
    width: 4.75rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}
.c-time-start { font-size: 0.8125rem; font-weight: 650; color: var(--text-primary); }
.c-time-end { font-size: 0.75rem; color: var(--text-muted); }

.c-nudge {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    flex-shrink: 0;
}
.c-nudge button {
    display: block;
    padding: 0;
    line-height: 1;
    font-size: 0.6875rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
}
.c-nudge button:hover { color: var(--text-primary); }

.c-action-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.c-action-danger:hover { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.c-form-foot {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.c-section { margin-top: 1.75rem; }
.c-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.c-section-title {
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--text-primary);
    margin: 0;
}

.c-group { margin-bottom: 1.25rem; }
.c-group:last-child { margin-bottom: 0; }
.c-group-label {
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
}

.c-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.4375rem;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 650;
    white-space: nowrap;
}

.c-price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.c-code {
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.c-note { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

.c-input-xs {
    width: 3.25rem;
    padding: 0.25rem 0.375rem;
    text-align: center;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}
.c-input-xs:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.c-notice {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
}

.c-action-primary { background: var(--accent-color); color: var(--bg-primary); }
.c-action-primary:hover { background: var(--accent-hover); color: var(--bg-primary); }

.c-select {
    padding: 0.4375rem 0.75rem;
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.c-select:hover { background: var(--bg-tertiary); }
.c-select:focus {
    outline: none;
    background: var(--bg-primary);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.c-input-auto { width: auto; }

.c-inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}
.c-inline-form .c-select { flex: 1; min-width: 160px; }

.c-check {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
}

.c-form-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.c-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 650;
    color: var(--text-primary);
}
.c-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    resize: vertical;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.c-textarea:focus {
    outline: none;
    background: var(--bg-primary);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.c-modal {
    width: 100%;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-height: 90vh;
    overflow-y: auto;
}
.c-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.c-modal-title { margin: 0; font-size: 1rem; font-weight: 650; color: var(--text-primary); }
.c-modal-close {
    padding: 0;
    font-size: 1.375rem;
    line-height: 1;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
}
.c-modal-close:hover { color: var(--text-primary); }
.c-modal-foot { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.25rem; }

.c-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
    cursor: pointer;
}
.c-toggle-row input { margin-top: 0.1875rem; flex-shrink: 0; }
.c-toggle-label { font-weight: 650; color: var(--text-primary); }
.c-toggle-hint { color: var(--text-secondary); }

.c-actions-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.75rem 0.875rem;
}

.c-setting {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 0.875rem;
    border-top: 1px solid var(--bg-tertiary);
}
.c-setting:first-child { border-top: none; }
.c-setting-clickable { cursor: pointer; }
.c-setting-clickable:hover { background: var(--bg-tertiary); }
.c-setting-body { flex: 1 1 18rem; min-width: 0; }
.c-setting-title {
    font-size: 0.875rem;
    font-weight: 650;
    color: var(--text-primary);
}
.c-setting-desc {
    margin-top: 0.1875rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-secondary);
}
.c-setting-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding-top: 0.125rem;
}

.c-danger-title { color: var(--danger); }
.c-danger-zone .c-setting-title { color: var(--danger); }
.c-danger-text { color: var(--danger); }
.c-record-note {
    margin: 0;
    white-space: normal;
    line-height: 1.6;
}
.c-record-note .c-code { font-size: 0.6875rem; }

.c-select-xs {
    padding: 0.125rem 0.3125rem;
    font-family: inherit;
    font-size: 0.6875rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.c-select-xs:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.c-error { margin-bottom: 0.75rem; font-size: 0.875rem; color: var(--danger); }
.c-hint { margin-bottom: 0.75rem; font-size: 0.875rem; color: var(--text-secondary); }
.c-ok { color: var(--success); }

.c-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.875rem;
}
.c-filter-row .c-input, .c-filter-row .c-select { flex: 1; min-width: 8rem; max-width: none; }
.c-filter-row .c-field { margin-bottom: 0; }

.c-card {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.c-card-title {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 650;
    color: var(--text-primary);
}

.c-grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}
.c-card-wide { grid-column: span 2; }
@media (max-width: 900px) {
    .c-card-wide { grid-column: auto; }
}

.c-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}
.c-stat {
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.c-stat-label {
    margin-bottom: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.c-stat-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.c-stat-sub {
    margin-top: 0.1875rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.c-chart { position: relative; height: 200px; }

.c-alert {
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.c-alert-title {
    margin: 0 0 0.375rem;
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--danger);
}

.c-dropzone {
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.c-dropzone:hover { border-color: var(--accent-color); }
.c-dropzone-over { border-color: var(--accent-color); background: var(--accent-light); }
.c-dropzone i {
    display: block;
    width: auto;
    height: auto;
    margin-bottom: 0.75rem;
    font-size: 2.25rem;
    line-height: 1;
    color: var(--text-muted);
}
.c-dropzone i::before { display: block; line-height: 1; vertical-align: 0; }
.c-dropzone-title { margin-bottom: 0.25rem; font-weight: 650; color: var(--text-primary); }

.c-domain-add-stack { padding: 0.875rem; }
.c-domain-add-stack .c-hint,
.c-domain-add-stack .c-error { text-align: center; }
.c-page-frame {
    height: 26rem;
    max-height: 60vh;
}
.c-page-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
}

.c-frame {
    width: 100%;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
}

.c-banner {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
}

.c-meta { font-size: 0.875rem; color: var(--text-secondary); }
.c-prose { line-height: 1.75; white-space: pre-wrap; color: var(--text-primary); }

.c-linkish {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}
.c-linkish:hover { color: var(--accent-color); }
.c-linkish-danger:hover { color: var(--danger); }

.c-kv { padding: 0.75rem 0.875rem; }
.c-kv-label {
    margin-bottom: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.c-kv-label:has(> i) { display: flex; align-items: center; gap: 0.3125rem; }
.c-kv-label > i { font-size: 0.75rem; }

.c-lede {
    max-width: 68ch;
    margin: 0 0 1.25rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.c-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1px;
    margin-bottom: 1.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.c-fact {
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
}
.c-fact-value {
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}
.c-fact-sub {
    margin-top: 0.1875rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.c-fact-empty { color: var(--text-muted); font-weight: 500; }
.c-fact-link { color: var(--accent-color); text-decoration: none; }
.c-fact-link:hover { text-decoration: underline; }
.c-progress-inline { margin-top: 0.5rem; }

.c-stat-link {
    display: block;
    text-decoration: none;
    transition: background 0.15s;
}
.c-stat-link:hover { background: var(--bg-tertiary); }

.c-prose-sm { font-size: 0.8125rem; }

.c-progress-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.875rem;
    margin-bottom: 0.875rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.c-progress-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.c-progress-track {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    overflow: hidden;
}
.c-progress-bar {
    height: 100%;
    background: var(--accent-color);
    border-radius: 100px;
    transition: width 0.3s;
}

.c-block { margin-bottom: 1.25rem; }

.c-table tfoot td {
    padding: 0.5rem 0.875rem;
    white-space: nowrap;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--bg-tertiary);
    color: var(--text-primary);
}
.c-bar-cell { width: 9rem; }
.c-bar-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.c-bar-wrap .c-progress-track { min-width: 3.5rem; }
.c-bar-pct {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 2.25rem;
    text-align: right;
}

.c-checkin-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-wrap: wrap;
    margin-bottom: 0.875rem;
}
.c-checkin-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 1 auto;
}
.c-checkin-meter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    flex: 1 1 15rem;
    min-width: 12rem;
}
.c-checkin-meter .c-progress-value { white-space: nowrap; }
.c-checkin-input {
    flex: 0 1 17rem;
    min-width: 11rem;
    margin-bottom: 0;
    max-width: none;
}
.c-checkin-scan {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.c-checkin-controls .c-seg {
    margin-bottom: 0;
    flex-shrink: 0;
}

.c-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    margin-bottom: 0.875rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}
.c-seg button {
    padding: 0.3125rem 0.75rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.c-seg button:hover { color: var(--text-primary); }
.c-seg button.is-active { background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-sm); }

.c-flash {
    padding: 0.75rem;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 650;
    font-size: 0.875rem;
}
.c-flash-ok { background: var(--accent-light); color: var(--accent-color); }
.c-flash-bad { background: var(--bg-secondary); color: var(--danger); }

#tab-panel .form-input,
#tab-panel select.form-input,
#tab-panel textarea.form-input {
    background: var(--bg-primary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
#tab-panel .form-input:focus {
    outline: none;
    background: var(--bg-primary);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
#tab-panel .form-label { color: var(--text-primary); }

.c-callout {
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.c-callout .c-code,
.c-details-body .c-code { background: var(--bg-tertiary); }

.c-domain { margin-bottom: 0.875rem; }
.c-domain-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
}
.c-domain-id { min-width: 0; }
.c-domain-name {
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}
.c-domain-meta {
    margin-top: 0.1875rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.c-domain-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.c-domain-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.875rem;
    border-top: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
}
.c-domain-live {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.c-modal-narrow { max-width: 460px; }
.c-domain-hint { margin-bottom: 0; margin-top: 0.375rem; font-size: 0.75rem; }

.c-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.c-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-color);
    font-size: 0.6875rem;
    font-weight: 700;
}
.c-step-body { flex: 1; min-width: 0; }
.c-step-title {
    font-size: 0.8125rem;
    font-weight: 650;
    color: var(--text-primary);
}
.c-step-text {
    margin-top: 0.1875rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.c-step-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.c-step-note { margin-top: 0.375rem; white-space: normal; }
.c-step-body .c-table-wrap {
    margin-top: 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}
.c-dns-table td { border-top-color: var(--bg-secondary); }
.c-dns-table thead th { background: var(--bg-tertiary); }
.c-dns-table tbody tr:hover td { background: transparent; }
.c-dns-value {
    max-width: 22rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.c-details { font-size: 0.8125rem; }
.c-details-summary {
    cursor: pointer;
    padding: 0.25rem 0;
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--text-secondary);
}
.c-details-summary:hover { color: var(--text-primary); }
.c-details-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.375rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

#tab-panel input[type="checkbox"],
#tab-panel input[type="radio"] {
    accent-color: var(--accent-color);
    cursor: pointer;
}
#tab-panel input[type="color"] {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    background: none;
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
#tab-panel input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
#tab-panel input[type="color"]::-webkit-color-swatch { border: none; border-radius: 3px; }

.lp-card > .form-group:last-child,
.lp-card > div:last-child { margin-bottom: 0; }

#tab-panel .c-modal .form-input,
#tab-panel .c-modal .c-input,
#tab-panel .c-modal select,
#tab-panel .c-modal textarea {
    width: 100%;
    padding: 0.5rem 0.6875rem;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}
#tab-panel .c-modal .form-input:focus,
#tab-panel .c-modal .c-input:focus,
#tab-panel .c-modal select:focus,
#tab-panel .c-modal textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
#tab-panel .c-modal textarea { resize: vertical; }
.c-modal input[type="range"] { width: 100%; accent-color: var(--accent-color); }

.c-modal input[type="file"] {
    width: 100%;
    padding: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}
.c-modal input[type="file"]::file-selector-button {
    margin-right: 0.625rem;
    padding: 0.25rem 0.625rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.c-modal input[type="file"]::file-selector-button:hover {
    background: var(--accent-light);
    color: var(--accent-color);
}

.c-modal .c-modal-foot .c-action { padding: 0.4375rem 0.9375rem; font-size: 0.8125rem; }
.c-modal-hint { margin: -0.25rem 0 0.75rem; font-size: 0.8125rem; color: var(--text-secondary); }
.c-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.c-field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.625rem; }

#tab-panel .lp-edit .form-input,
#tab-panel .lp-edit select,
#tab-panel .lp-edit textarea,
#tab-panel .lp-edit input[type="file"] {
    background: var(--bg-secondary);
}
#tab-panel .lp-edit .form-input:focus,
#tab-panel .lp-edit select:focus,
#tab-panel .lp-edit textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
