* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --apple-blue: #0071e3;
    --apple-blue-hover: #0077ed;
    --apple-blue-light: rgba(0, 113, 227, 0.12);
    --primary: #0071e3;
    --primary-dark: #0077ed;
    --secondary: #86868b;
    --success: #30d158;
    --danger: #ff453a;
    --warning: #ffd60a;
    --info: #0a84ff;
    --bg: #f5f5f7;
    --bg-dark: #1d1d1f;
    --card-bg: #ffffff;
    --text: #1d1d1f;
    --text-light: #86868b;
    --border: #d2d2d7;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --radius: 18px;
    --radius-sm: 12px;
    --hover: #f5f5f7;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.47059;
    font-size: 17px;
    font-weight: 400;
}

body.has-sidebar {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

body.is-login .main-content {
    padding: 0;
}

.hidden {
    display: none !important;
}

.copy-ghost {
    position: fixed;
    left: -9999px;
    top: 0;
}

.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: #1d1d1f;
    color: #f5f5f7;
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    padding: 20px 14px 32px;
    z-index: 1000;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -0.03em;
    padding: 8px 12px 22px;
    color: #f5f5f7;
    text-decoration: none;
}

.sidebar-brand img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    flex-shrink: 0;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #f5f5f7;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 2px;
}

.nav-section {
    margin: 18px 12px 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.36);
}

.nav-menu a,
.nav-link {
    display: block;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-menu a:hover,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-link.active {
    background: var(--apple-blue);
    color: #fff;
}

.nav-link-logout {
    color: rgba(255, 255, 255, 0.5);
}

.nav-user {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px 4px;
}

.nav-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #f5f5f7;
}

.nav-user-role {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.main-content {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    padding: 36px 32px 80px;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
}

.container.analytics {
    max-width: 1280px;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-card {
    background: var(--card-bg);
    padding: 48px 40px;
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    display: block;
    height: 36px;
    width: auto;
    max-width: 180px;
    margin: 0 auto 10px;
}

.login-title {
    text-align: center;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 6px;
}

.login-subtitle {
    text-align: center;
    font-size: 17px;
    color: var(--text-light);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 17px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px var(--apple-blue-light);
}

.form-group .form-hint,
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-light);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 980px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
    line-height: 1.3;
}

.btn-primary {
    background: var(--apple-blue);
    color: #fff;
}

.btn-primary:hover,
.btn-primary.is-copied {
    background: var(--apple-blue-hover);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: default;
}

.btn-secondary {
    background: #e8e8ed;
    color: var(--text);
}

.btn-secondary:hover {
    background: #dedee3;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 15px;
}

.alert-error {
    background: rgba(255, 69, 58, 0.1);
    color: #c41e3a;
    border: 1px solid rgba(255, 69, 58, 0.18);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 34px;
    font-weight: 650;
    letter-spacing: -0.03em;
}

.page-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--text-light);
    width: 100%;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    background: #e8e8ed;
    border-radius: 980px;
}

.segmented-btn {
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 980px;
    cursor: pointer;
}

.segmented-btn:hover {
    color: #000;
}

.segmented-btn.active {
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.metric-card {
    background: var(--card-bg);
    border: 0;
    border-radius: var(--radius);
    padding: 18px 20px 16px;
    text-align: left;
    box-shadow: var(--shadow);
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.metric-card.static {
    cursor: default;
}

.metric-card.dimmed {
    opacity: 0.42;
}

.metric-card.active {
    box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.22), var(--shadow);
}

.metric-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    letter-spacing: 0.01em;
    margin-bottom: 6px;
}

.metric-value {
    display: block;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.metric-value-sm {
    font-size: 22px;
}

.status-pending .metric-value { color: #c9a000; }
.status-paid .metric-value { color: #248a3d; }
.status-hold .metric-value { color: #0a84ff; }
.status-decline .metric-value { color: #c41e3a; }

.section-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 8px 0 14px;
}

.chart-card,
.stats-results,
.filters-panel,
.table-container,
.campaign-card,
.postback-url-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.chart-card {
    padding: 22px 24px 12px;
    margin-bottom: 28px;
}

.chart-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.chart-card-title {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.chart-card-hint {
    font-size: 13px;
    color: var(--text-light);
}

.chart-wrap {
    position: relative;
}

.chart-wrap-lg {
    height: 340px;
}

.filters-panel {
    padding: 22px 24px;
    margin-bottom: 24px;
}

.stats-header-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.stats-dates {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8e8ed;
    border-radius: 980px;
    padding: 3px 8px 3px 10px;
}

.stats-dates input[type="date"] {
    width: 132px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    padding: 6px 0;
}

.stats-dates input[type="date"]:focus {
    outline: none;
}

.stats-dates-sep {
    color: var(--text-light);
    font-size: 13px;
}

.stats-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.stats-toolbar select {
    min-width: 148px;
    max-width: 220px;
    padding: 8px 12px;
    border: 0;
    border-radius: 980px;
    background: #fff;
    box-shadow: var(--shadow);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.stats-toolbar select:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--apple-blue-light), var(--shadow);
}

.stats-day-pill {
    background: #fff;
    box-shadow: var(--shadow);
    padding: 8px 12px;
}

.stats-toolbar .btn.is-active {
    background: #d2d2d7;
}

.stats-more {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -8px 0 20px;
    padding: 12px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stats-more input[type="text"] {
    width: 132px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 980px;
    font: inherit;
    font-size: 13px;
    background: var(--bg);
}

.players-filters .stats-toolbar input[type="text"],
.players-filters .stats-toolbar input[type="date"] {
    min-width: 120px;
    max-width: 180px;
    padding: 8px 12px;
    border: 0;
    border-radius: 980px;
    background: #fff;
    box-shadow: var(--shadow);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.players-filters .stats-toolbar input[type="text"]:focus,
.players-filters .stats-toolbar input[type="date"]:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--apple-blue-light), var(--shadow);
}

.players-filters .stats-toolbar input[type="date"] {
    min-width: 132px;
    max-width: 148px;
}

.players-bulk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin: -8px 0 20px;
    padding: 12px 14px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.players-bulk .check-pill {
    background: var(--bg);
}

.players-bulk select {
    min-width: 132px;
    padding: 8px 12px;
    border: 0;
    border-radius: 980px;
    background: var(--bg);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.players-bulk select:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--apple-blue-light);
}

.players-bulk-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.players-bulk-hint {
    font-size: 12px;
    color: var(--text-light);
}

.players-check-col {
    width: 36px;
    text-align: center;
}

.players-check-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    vertical-align: middle;
    accent-color: var(--primary);
    cursor: pointer;
}

.players-check-na {
    color: var(--text-light);
}

.data-table tbody tr.players-selectable.is-selected {
    background: var(--apple-blue-light);
}

.stats-more input[type="text"]:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px var(--apple-blue-light);
}

.metric-row-compact {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    margin-bottom: 28px;
}

.metric-row-compact .metric-card {
    padding: 14px 16px 12px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-period.filter-row {
    align-items: end;
}

.filter-period .period-dates {
    max-width: 160px;
}

.stats-results {
    padding: 22px 24px 28px;
}

.grouped-stats:not(:empty) {
    margin-top: 8px;
    margin-bottom: 20px;
    padding: 18px 8px 8px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.grouped-stats .chart-card-head {
    padding: 0 16px;
}

.grouped-stats .table-container {
    box-shadow: none;
    background: transparent;
    border-radius: 0;
}

.grouped-stats h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: transparent;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-light);
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.7);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--hover);
}

.data-table a {
    color: var(--primary);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

.url-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
}

.money-orig {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-light);
}

.badge-success {
    background: rgba(48, 209, 88, 0.14);
    color: #248a3d;
}

.badge-danger {
    background: rgba(255, 69, 58, 0.12);
    color: #c41e3a;
}

.badge-info {
    background: var(--apple-blue-light);
    color: var(--apple-blue);
}

.badge-warning {
    background: rgba(255, 214, 10, 0.22);
    color: #9a7b00;
}

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

.campaign-search {
    width: 260px;
    max-width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 980px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
}

.campaign-search:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px var(--apple-blue-light);
}

.campaign-name-link {
    font-size: 16px;
    font-weight: 600;
    color: var(--text) !important;
    letter-spacing: -0.02em;
}

.campaign-name-link:hover {
    color: var(--apple-blue) !important;
    text-decoration: none !important;
}

.campaign-row-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.page-back {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--apple-blue);
    text-decoration: none;
}

.page-back:hover {
    text-decoration: underline;
}

.campaign-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -12px 0 20px;
}

.view-campaign .campaign-card {
    padding: 22px 24px;
}

.view-campaign .page-subtitle {
    width: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.campaign-card {
    padding: 22px 24px;
}

.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.campaign-header h3 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.campaign-slug {
    color: var(--text-light);
    font-family: ui-monospace, monospace;
    font-size: 13px;
    background: var(--bg);
    padding: 6px 12px;
    border-radius: 980px;
}

.campaign-link-section {
    margin: 12px 0 16px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.campaign-link-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.campaign-link-params {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.check-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    border-radius: 980px;
    padding: 6px 10px;
}

.link-preview {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    word-break: break-all;
    color: var(--text-light);
}

.flows-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flow-item {
    padding: 14px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.flow-offers {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.offer-badge,
.landing-badge,
.landing-offer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 980px;
    font-size: 13px;
}

.offer-badge {
    background: var(--apple-blue);
    color: #fff;
}

.landing-badge {
    background: #dbeafe;
    color: #1e40af;
}

.landing-offer-badge {
    background: #e8e8ed;
    color: #3730a3;
}

.flow-filters {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.filter-badge,
.sticky-badge {
    display: inline-block;
    background: #fff;
    padding: 3px 8px;
    border-radius: 8px;
    margin-left: 6px;
}

.sticky-badge {
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
}

.sticky-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin: 6px 0 4px;
}

.sticky-flags label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text);
}

.flow-editor {
    margin-bottom: 18px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.flow-editor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.flow-editor-head h3 {
    font-size: 16px;
    font-weight: 600;
}

.flow-landings {
    margin-top: 10px;
}

.editor-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 12px;
    margin-bottom: 8px;
    align-items: end;
}

.editor-row .form-group {
    margin: 0;
}

.editor-row-compact {
    grid-template-columns: 2fr 1fr auto;
}

.editor-row-filter {
    grid-template-columns: 1fr 1fr 2fr auto;
}

.landing-row {
    margin-bottom: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 10px;
}

.landing-offers-wrap {
    margin-top: 8px;
}

.offer-select-flags {
    margin-left: 6px;
    vertical-align: middle;
}

.modal-top.active {
    align-items: flex-start;
    padding-top: 28px;
}

.modal-campaign {
    max-width: 980px;
}

.campaign-editor {
    padding-top: 18px;
}

.ce-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
    margin-bottom: 14px;
}

.ce-meta .form-group {
    margin-bottom: 0;
}

.ce-options {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 20px;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.ce-option-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ce-mini-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-light);
}

.ce-options .sticky-flags {
    margin: 0;
    gap: 8px;
}

.ce-exit-missing {
    background: #fff;
    border: 1px solid var(--border);
}

.ce-flows-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 10px;
}

.ce-flows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.ce-flow,
.flow-editor.ce-flow {
    margin: 0;
    padding: 14px;
    background: var(--bg);
    border-radius: 16px;
}

.ce-flow.is-exit {
    background: #f3f4ff;
}

.ce-flow-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ce-flow-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    flex: 1;
}

.ce-flow-index,
.ce-exit-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 980px;
    background: #e8e8ed;
    color: #6e6e73;
    white-space: nowrap;
}

.ce-exit-badge {
    background: #1d1d1f;
    color: #fff;
}

.ce-flow-name {
    flex: 1;
    min-width: 140px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
}

.ce-flow-name:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px var(--apple-blue-light);
}

.ce-flow-name[readonly] {
    background: #f5f5f7;
    color: var(--text-light);
}

.ce-flow-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ce-flow-move {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ce-flow-move .ce-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.ce-icon-btn-neutral {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text);
}

.ce-icon-btn-neutral:hover {
    background: rgba(0, 0, 0, 0.1);
}

.copy-flow-modal {
    z-index: 2100;
}

.copy-flow-card {
    max-width: 440px;
}

.copy-flow-form {
    padding-top: 8px;
}

.copy-flow-source {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--text-light);
}

.copy-flow-source strong {
    color: var(--text);
}

.copy-flow-dest {
    width: 100%;
    margin-top: 6px;
}

.copy-flow-dest .segmented-btn {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.copy-flow-dest input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.copy-flow-dest input:checked + span,
.copy-flow-dest .segmented-btn:has(input:checked) {
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    border-radius: 980px;
}

.copy-flow-dest .segmented-btn span {
    padding: 7px 10px;
}

.copy-flow-status {
    min-height: 18px;
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-light);
}

.copy-flow-status.is-ok {
    color: #248a3d;
}

.copy-flow-status.is-error {
    color: #c41e3a;
}

.ce-sticky {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.ce-logic {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 980px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    font-family: inherit;
}

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

.ce-section {
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    min-width: 0;
}

.ce-section-filters {
    grid-column: 1 / -1;
}

.ce-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 650;
    color: var(--text);
}

.ce-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 8px;
}

.ce-rows:empty::before {
    content: 'None yet';
    display: block;
    padding: 6px 2px;
    font-size: 12px;
    color: var(--text-light);
}

.ce-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ce-row select,
.ce-row input[type="text"],
.ce-filter-row input {
    flex: 1;
    min-width: 0;
    width: auto;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

.ce-row select:focus,
.ce-row input:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px var(--apple-blue-light);
}

.ce-row .offer-select-flags:empty {
    display: none;
}

.ce-row .offer-select-flags {
    margin: 0;
    flex: 0 0 auto;
}

.ce-pct {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 8px 0 0;
}

.ce-pct input {
    width: 58px;
    border: 0;
    background: transparent;
    padding: 8px 6px 8px 10px;
    font-size: 14px;
    font-family: inherit;
    text-align: right;
}

.ce-pct input:focus {
    outline: none;
    box-shadow: none;
}

.ce-pct span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
}

.ce-icon-btn {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 69, 58, 0.1);
    color: #c41e3a;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.ce-icon-btn:hover {
    background: rgba(255, 69, 58, 0.18);
}

.ce-landing,
.ce-flow .landing-row {
    margin: 0;
    padding: 8px;
    background: var(--bg);
    border-radius: 10px;
}

.ce-nested {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e8e8ed;
}

.ce-nested-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
}

.ce-nested-head em {
    font-style: normal;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.36);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    z-index: 2000;
    overflow-y: auto;
    padding: 40px 22px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text);
}

.modal form {
    padding: 24px 26px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 12px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: -1px;
}

.tab-btn.active {
    color: var(--apple-blue);
    border-bottom-color: var(--apple-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.landing-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.landing-tabs .tab-btn {
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 980px;
    margin: 0;
}

.landing-tabs .tab-btn.active {
    background: var(--apple-blue);
    color: #fff;
    border-color: var(--apple-blue);
}

.code-editor {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    resize: vertical;
}

.offer-logo-cell {
    width: 60px;
    text-align: center;
}

.offer-logo-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
}

.offer-logo-placeholder {
    color: var(--text-light);
    font-size: 14px;
}

.offer-logo-preview {
    margin-top: 8px;
}

.offer-logo-preview img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pagination-bar-bottom {
    margin-top: 16px;
    margin-bottom: 0;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-light);
}

.pagination-meta {
    color: var(--secondary);
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 12px;
    border-radius: 980px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.pagination-btn:hover {
    background: var(--hover);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination-btn.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: var(--text-light);
}

.empty-table {
    text-align: center;
    color: var(--text-light);
    padding: 28px 12px;
}

.an-param-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0 12px;
}

.an-param-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}

.an-preview {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 20px;
}

.an-preview-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 8px 0 6px;
}

.an-preview-label:first-child {
    margin-top: 0;
}

.an-preview code {
    display: block;
    font-size: 13px;
    word-break: break-all;
    color: var(--text);
}

.an-param-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.an-chip {
    display: inline-block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.country-flags,
.country-flag-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    vertical-align: middle;
}

.country-flag-list {
    min-height: 28px;
    margin-bottom: 8px;
}

.country-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 18px;
    line-height: 1;
    cursor: default;
    user-select: none;
}

.country-flag-list .country-flag {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 6px;
    gap: 4px;
}

.country-flag-remove {
    border: 0;
    background: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 0 0 2px;
}

.country-flag[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: calc(100% + 7px);
    transform: translateX(-50%);
    background: #1d1d1f;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    padding: 5px 8px;
    border-radius: 7px;
    white-space: nowrap;
    z-index: 40;
    pointer-events: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.country-picker {
    position: relative;
}

.country-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 20;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
}

.country-suggest-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    background: none;
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.country-suggest-item:hover,
.country-suggest-item.active {
    background: var(--hover);
}

.country-suggest-iso {
    font-size: 12px;
    color: var(--text-light);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.postback-urls-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.postback-url-item {
    padding: 22px 24px;
}

.postback-url-header h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
}

.postback-url-box {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.postback-url-input {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    background: var(--bg);
}

.postback-url-description {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
}

.postback-url-description code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.currency-meta {
    padding: 22px 24px;
}

.currency-meta-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.ua-cell {
    white-space: nowrap;
    overflow: visible;
}

.ua-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-right: 4px;
    border-radius: 6px;
    vertical-align: middle;
    position: relative;
    cursor: default;
}

.ua-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    pointer-events: none;
}

.ua-icon[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: calc(100% + 7px);
    transform: translateX(-50%);
    background: #1d1d1f;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    padding: 5px 8px;
    border-radius: 7px;
    white-space: nowrap;
    z-index: 30;
    pointer-events: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.ua-device.ua-desktop { color: #5b6578; background: #eef1f6; }
.ua-device.ua-mobile { color: #0f766e; background: #ccfbf1; }
.ua-device.ua-tablet { color: #1d4ed8; background: #dbeafe; }
.ua-device.ua-bot { color: #92400e; background: #fef3c7; }
.ua-device.ua-unknown { color: #86868b; background: #f3f4f6; }
.ua-os.ua-windows { color: #0078d4; background: #e6f2fb; }
.ua-os.ua-macos,
.ua-os.ua-ios { color: #1d1d1f; background: #ececee; }
.ua-os.ua-android { color: #3ddc84; background: #e6f9ee; }
.ua-os.ua-linux { color: #e95420; background: #fde8e0; }
.ua-os.ua-chromeos { color: #1a73e8; background: #e8f0fe; }
.ua-os.ua-unknown { color: #86868b; background: #f3f4f6; }
.ua-browser.ua-chrome { color: #fbbc04; background: #fff6d9; }
.ua-browser.ua-firefox { color: #ff7139; background: #ffece5; }
.ua-browser.ua-safari { color: #006cff; background: #e5f0ff; }
.ua-browser.ua-edge { color: #0078d4; background: #e6f2fb; }
.ua-browser.ua-opera { color: #ff1b2d; background: #ffe6e8; }
.ua-browser.ua-samsung { color: #1428a0; background: #e8eaf6; }
.ua-browser.ua-yandex { color: #fc3f1d; background: #ffe9e5; }
.ua-browser.ua-ie { color: #1ebbee; background: #e5f7fd; }
.ua-browser.ua-unknown { color: #86868b; background: #f3f4f6; }

.click-row-sticky td {
    background: #fffbeb;
}

.sticky-cell {
    white-space: nowrap;
}

.sticky-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-right: 3px;
    padding: 0 5px;
    border-radius: 6px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
}

.sticky-chip-offer {
    background: #dcfce7;
    color: #166534;
}

.sticky-chip-landing {
    background: #dbeafe;
    color: #1e40af;
}

.sticky-none {
    color: #c7c7cc;
}

.cell-sticky {
    background: #fde68a !important;
    font-weight: 600;
}

@media (max-width: 768px) {
    body.has-sidebar {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-height: 0;
        position: sticky;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
    }

    .sidebar-brand {
        padding: 0;
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        width: 100%;
        order: 3;
        padding: 8px 0 12px;
    }

    .nav-menu.active {
        display: flex;
    }

    .main-content {
        padding: 24px 16px 60px;
    }

    .page-title {
        font-size: 28px;
    }

    .page-header,
    .analytics-header,
    .campaign-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-header-controls,
    .stats-toolbar {
        width: 100%;
        justify-content: flex-start;
    }

    .stats-toolbar select {
        max-width: none;
        flex: 1 1 140px;
    }

    .players-filters .stats-toolbar input[type="text"],
    .players-filters .stats-toolbar input[type="date"] {
        max-width: none;
        flex: 1 1 140px;
    }

    .stats-dates input[type="date"] {
        width: 118px;
    }

    .filter-row,
    .editor-row,
    .editor-row-filter,
    .an-param-row,
    .ce-meta,
    .ce-grid,
    .ce-flow-head {
        grid-template-columns: 1fr;
    }

    .ce-flow-title,
    .ce-row,
    .ce-filter-row {
        flex-wrap: wrap;
    }

    .chart-wrap-lg {
        height: 240px;
    }

    .modal-content {
        margin: 16px;
        max-width: calc(100% - 32px);
    }

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

    .pagination-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .postback-url-box {
        flex-direction: column;
    }
}

.badge-role-admin {
    background: rgba(29, 29, 31, 0.1);
    color: #1d1d1f;
}

.badge-role-manager {
    background: var(--apple-blue-light);
    color: var(--apple-blue);
}

.badge-error-php,
.badge-error-exception {
    background: rgba(255, 69, 58, 0.12);
    color: #c41e3a;
}

.badge-error-tracking {
    background: var(--apple-blue-light);
    color: var(--apple-blue);
}

.badge-error-postback {
    background: rgba(255, 214, 10, 0.22);
    color: #9a7b00;
}

.badge-error-app {
    background: #eeeef0;
    color: #6e6e73;
}

.section-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 420px;
}

.section-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 980px;
    background: #f5f5f7;
    color: #6e6e73;
    font-size: 11px;
    font-weight: 600;
}

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.view-users .section-title {
    margin-top: 36px;
}

.view-users .section-title + .page-subtitle {
    margin: -8px 0 16px;
}

.session-current td {
    background: rgba(0, 113, 227, 0.05);
}

.ua-text {
    margin-top: 6px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-light);
}

.section-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.section-picker .check-pill {
    background: #fff;
    border: 1px solid var(--border);
    margin: 0;
}

.section-picker input:disabled + span {
    opacity: 0.55;
}

.domain-help {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
}

.domain-help li {
    margin-bottom: 6px;
}

.domain-ssl-select {
    min-width: 220px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14px;
    background: #fff;
}

.origin-cert-form textarea,
#originCertForm textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    min-height: 88px;
}

#originCertForm > .form-hint {
    margin: 0 0 16px;
}

.origin-cert-card {
    margin-bottom: 20px;
    padding-bottom: 8px;
}

.origin-cert-card .chart-card-hint {
    margin: 0 0 10px;
}

.origin-cert-card .table-container {
    background: transparent;
    box-shadow: none;
    max-height: 420px;
    overflow: auto;
    margin: 0 -8px 4px;
}

.origin-cert-table .data-table {
    font-size: 13px;
}

.origin-cert-table .data-table th,
.origin-cert-table .data-table td {
    padding: 7px 10px;
}

.origin-cert-table .data-table th:nth-child(2),
.origin-cert-table .data-table td:nth-child(2),
.origin-cert-table .data-table th:nth-child(3),
.origin-cert-table .data-table td:nth-child(3),
.origin-cert-table .data-table th:nth-child(4),
.origin-cert-table .data-table td:nth-child(4) {
    width: 1%;
    white-space: nowrap;
}

.origin-cert-table .origin-cert-hosts {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.origin-cert-row-actions {
    white-space: nowrap;
    text-align: right;
}

.origin-cert-row-actions .btn {
    margin-left: 4px;
    padding: 4px 10px;
    font-size: 12px;
}

.origin-cert-status {
    margin: 8px 0 0;
    font-size: 13px;
}

.origin-cert-status.is-error {
    color: #b42318;
}

.nowrap {
    white-space: nowrap;
}

.muted {
    color: var(--muted, #6b7280);
}

.server-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.usage-bar {
    height: 10px;
    background: #e8e8ed;
    border-radius: 980px;
    overflow: hidden;
    margin: 10px 0 8px;
}

.usage-bar span {
    display: block;
    height: 100%;
    background: var(--apple-blue);
    border-radius: inherit;
}

.status-list {
    margin-top: 14px;
}

.status-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f2;
    font-size: 14px;
}

.status-list dt {
    color: var(--text-light);
    font-weight: 500;
}

.status-list dd {
    text-align: right;
    word-break: break-word;
}

.server-cert-table {
    margin-top: 12px;
    box-shadow: none;
}

@media (max-width: 768px) {
    .server-grid {
        grid-template-columns: 1fr;
    }

    .domain-ssl-select {
        min-width: 0;
        width: 100%;
    }
}

.files-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: -8px 0 18px;
    font-size: 14px;
}

.files-crumb {
    border: 0;
    background: none;
    color: var(--apple-blue);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
}

.files-crumb:hover {
    text-decoration: underline;
}

.files-crumb.is-current {
    color: var(--text);
    cursor: default;
}

.files-crumb-sep {
    color: var(--text-light);
}

.files-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 20px;
    align-items: start;
}

.files-list-card,
.files-preview-card {
    min-width: 0;
}

.files-table .files-name {
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.files-table .files-name-dir {
    color: var(--apple-blue);
}

.files-table .files-name:hover {
    text-decoration: underline;
}

.files-table tr.is-active td {
    background: rgba(0, 113, 227, 0.06);
}

.files-row-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.files-preview-card .chart-card-head {
    align-items: center;
}

.files-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.files-preview-body {
    max-height: 70vh;
    overflow: auto;
    padding: 0 4px 8px;
}

.files-preview-code,
.files-editor {
    margin: 0;
    padding: 14px 16px;
    background: #f5f5f7;
    border-radius: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.files-editor-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 420px;
}

.files-editor {
    display: block;
    width: 100%;
    min-height: 420px;
    border: 1px solid transparent;
    color: var(--text);
    resize: vertical;
    outline: none;
}

.files-editor:focus {
    border-color: rgba(0, 113, 227, 0.35);
    background: #fff;
}

.files-editor-json {
    background: #1d1d1f;
    color: #f5f5f7;
    min-height: 520px;
}

.files-editor-json:focus {
    background: #1d1d1f;
    border-color: rgba(100, 210, 255, 0.45);
}

.files-editor-status {
    margin: 0;
    font-size: 12px;
    color: var(--text-light);
}

.files-editor-status.is-ok {
    color: #248a3d;
}

.files-editor-status.is-error {
    color: #c41e3a;
}

.files-preview-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

@media (max-width: 960px) {
    .files-layout {
        grid-template-columns: 1fr;
    }
}
