/* RomansCode Admin Panel
 * Cream paper, ink type, orange accent. No !important. Single @media block.
 */

:root {
    --bg:           #f4f1ea;
    --bg-alt:       #ebe7dc;
    --bg-card:      #ffffff;
    --ink:          #0a0a0a;
    --muted:        #5a5a5a;
    --line:         #d8d3c4;
    --accent:       #ff4a1c;
    --accent-soft:  #ffe8df;
    --success:      #2d7a4e;
    --success-soft: #d8edd9;
    --warn:         #a16207;
    --warn-soft:    #fef2d6;
    --error:        #b91c1c;
    --error-soft:   #fde2e2;
    --radius:       4px;
    --mono:         'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --serif:        'Fraunces', Georgia, serif;
}

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

html, body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--ink); }

/* ---------- Button spinner ---------- */

/*
 * When RC.spinner.attach(button) is called, the button's content is replaced
 * with the spinner SVG plus a generic "Working…" label, and the button gets
 * the `rc-btn-spinning` class. The SVG uses currentColor so it inherits the
 * button's text colour (works on primary orange buttons, dark ink buttons,
 * danger buttons — all of them).
 */
.rc-spin {
    display: inline-block;
    vertical-align: middle;
    animation: rc-spin-rotate 0.8s linear infinite;
}
@keyframes rc-spin-rotate {
    to { transform: rotate(360deg); }
}
.rc-spin-label {
    margin-left: 8px;
    vertical-align: middle;
}
.rc-btn-spinning {
    cursor: progress;
    /* Keep the button visually consistent — disabled state would dim it,
       but we want it to still look "active" while spinning. The disabled
       attribute is still set on the element for accessibility / preventing
       double-click; just override the visual dim. */
    opacity: 1;
}

code {
    font-family: var(--mono);
    font-size: 0.92em;
    background: var(--bg-alt);
    padding: 1px 6px;
    border-radius: 3px;
}

/* ---------- Bare layout (login screen) ---------- */

.rc-bare {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.rc-bare-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 36px 32px;
}
.rc-bare-logo {
    display: inline-block;
    position: relative;
    font-family: var(--serif);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    padding-bottom: 6px;
    margin-bottom: 24px;
}
.rc-bare-logo::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 22px;
    height: 3px;
    background: var(--accent);
}
.rc-bare h1 {
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.rc-bare p { color: var(--muted); margin-bottom: 24px; }

/* ---------- Full admin layout ---------- */

.rc-admin {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

.rc-sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--line);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Stick to the top of the viewport when scrolling long pages. */
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
}

.rc-brand {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}
.rc-brand a {
    display: inline-block;
    position: relative;
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
    padding-bottom: 4px;
}
.rc-brand a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 18px;
    height: 2px;
    background: var(--accent);
}
.rc-brand-sub {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 8px;
}

.rc-nav {
    padding: 0 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rc-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: background .12s, color .12s;
}
.rc-nav a:hover {
    background: var(--bg-alt);
    color: var(--ink);
}
.rc-nav a.is-active {
    background: var(--ink);
    color: var(--bg);
}

.rc-nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 10px;
}
.rc-nav-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background .12s, border-color .12s;
}
.rc-nav-group-header:hover {
    background: var(--bg-card);
}
.rc-nav-group-header::-webkit-details-marker { display: none; }
.rc-nav-group-text {
    flex: 1;
}
.rc-nav-group-icon {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
}
/* When the group contains the active page, accent the header */
.rc-nav-group.has-active > .rc-nav-group-header {
    border-color: var(--accent);
    color: var(--accent);
}
.rc-nav-group.has-active > .rc-nav-group-header .rc-nav-group-icon {
    color: var(--accent);
}
.rc-nav-chevron {
    flex-shrink: 0;
    color: var(--muted);
    transition: transform 0.15s ease;
}
.rc-nav-group[open] > .rc-nav-group-header .rc-nav-chevron {
    transform: rotate(90deg);
}
.rc-nav-child {
    padding-left: 22px;
}

/* ---------- Main content area ---------- */

.rc-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Sticky top bar — stays at top while the inner content scrolls */
.rc-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
}
.rc-topbar-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 18px;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.rc-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
}
.rc-topbar-link {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color .15s;
}
.rc-topbar-link:hover {
    color: var(--ink);
}
.rc-topbar-user {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink);
}
.rc-topbar-divider {
    width: 1px;
    height: 14px;
    background: var(--line);
}

.rc-main-inner {
    flex: 1;
    padding: 32px 40px 24px;
    max-width: 1080px;
}

.rc-footer {
    padding: 16px 32px 20px;
    text-align: right;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.04em;
    border-top: 1px solid var(--line);
}

.rc-page-head {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}
.rc-page-head h1 {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.rc-page-head p {
    color: var(--muted);
    font-size: 14px;
    margin-top: 6px;
}

/* ---------- Forms ---------- */

.rc-field { margin-bottom: 18px; }
.rc-field label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.rc-field .rc-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 5px;
}
.rc-field input[type="text"],
.rc-field input[type="email"],
.rc-field input[type="password"],
.rc-field input[type="url"],
.rc-field input[type="number"],
.rc-field select,
.rc-field textarea {
    width: 100%;
    padding: 10px 13px;
    background: var(--bg-card);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 14px;
    transition: border-color .15s;
}
.rc-field input[type="file"] {
    width: 100%;
    padding: 8px;
    background: var(--bg-card);
    color: var(--ink);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 13px;
    cursor: pointer;
}
.rc-field input[type="file"]:hover {
    border-color: var(--ink);
}
.rc-field input:focus,
.rc-field select:focus,
.rc-field textarea:focus {
    outline: none;
    border-color: var(--ink);
}
.rc-field textarea { min-height: 100px; resize: vertical; }

.rc-row { display: flex; gap: 14px; }
.rc-row > .rc-field { flex: 1; }

/* ---------- Buttons ---------- */

.rc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, transform .15s, border-color .15s;
}
.rc-btn:hover {
    background: var(--ink);
    color: var(--bg);
}
.rc-btn-primary {
    background: var(--ink);
    color: var(--bg);
}
.rc-btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.rc-btn-danger {
    background: transparent;
    color: var(--error);
    border-color: var(--error);
}
.rc-btn-danger:hover {
    background: var(--error);
    color: #fff;
}
.rc-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.rc-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* ---------- Cards / tables ---------- */

.rc-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
}
.rc-card h2 {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}
.rc-card p { color: var(--muted); margin-bottom: 12px; }
.rc-card p:last-child { margin-bottom: 0; }

.rc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.rc-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.rc-table th,
.rc-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.rc-table th {
    background: var(--bg-alt);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink);
}
.rc-table tr:last-child td { border-bottom: none; }
.rc-table tr:hover td { background: var(--bg-alt); }
.rc-table .rc-table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ---------- Badges ---------- */

.rc-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.rc-badge-success { background: var(--success-soft); color: var(--success); }
.rc-badge-warn    { background: var(--warn-soft);    color: var(--warn); }
.rc-badge-neutral { background: var(--bg-alt);       color: var(--muted); }
.rc-badge-accent  { background: var(--accent-soft);  color: var(--accent); }

/* ---------- Flash messages ---------- */

.rc-flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13px;
    border-left: 3px solid;
}
.rc-flash-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--success);
}
.rc-flash-error {
    background: var(--error-soft);
    color: var(--error);
    border-color: var(--error);
}
.rc-flash-info {
    background: var(--accent-soft);
    color: var(--ink);
    border-color: var(--accent);
}

/* ---------- Errors block (form validation) ---------- */

.rc-errors {
    background: var(--error-soft);
    border: 1px solid var(--error);
    border-left: 3px solid var(--error);
    color: var(--error);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13px;
}
.rc-errors p { color: var(--error); margin: 0; }
.rc-errors p + p { margin-top: 4px; }

/* ---------- Stat boxes (dashboard) ---------- */

.rc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.rc-stat {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}
.rc-stat-label {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.rc-stat-value {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ---------- Theme / Plugin cards ---------- */

.rc-thing-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rc-thing-card.is-active {
    border-color: var(--ink);
}
.rc-thing-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.rc-thing-name {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.rc-thing-meta {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    letter-spacing: 0.02em;
}
.rc-thing-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    flex: 1;
}
.rc-thing-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.rc-thing-actions form { display: inline; }

/* ---------- Tabs ---------- */

.rc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}
.rc-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
}
.rc-tab:hover { color: var(--ink); background: var(--bg-alt); }
.rc-tab.is-active { color: var(--ink); background: var(--bg-alt); font-weight: 600; }
.rc-tab-count {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    background: var(--bg);
    padding: 1px 7px;
    border-radius: 99px;
}
.rc-tab.is-active .rc-tab-count { color: var(--accent); }

/* ---------- Media library cards ---------- */

.rc-media-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.rc-media-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
.rc-media-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.rc-media-fallback {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}
.rc-media-meta { padding: 12px 14px; }
.rc-media-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}
.rc-media-info {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.rc-media-actions {
    display: flex;
    justify-content: flex-end;
}

/* ---------- Pagination ---------- */

.rc-pagination {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.rc-pagination-info {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

/* ---------- Colour input (section fields) ---------- */

.rc-color-input {
    display: flex;
    gap: 8px;
    align-items: center;
    max-width: 280px;
}
.rc-color-input input[type="color"] {
    width: 40px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    cursor: pointer;
    flex-shrink: 0;
}
.rc-color-input input[type="text"] {
    flex: 1;
}

/* ---------- Image field (section forms) ---------- */

.rc-image-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rc-image-preview {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 16 / 10;
    background: var(--bg-alt);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.rc-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.rc-image-field.has-image .rc-image-preview {
    border-style: solid;
}
.rc-image-actions {
    display: flex;
    gap: 8px;
}

/* ---------- Media picker modal ---------- */

.rc-picker {
    width: min(880px, 92vw);
    max-height: 88vh;
    /* Universal `* { margin: 0 }` reset above strips the UA's
       `dialog { margin: auto }` that handles centring. Restore it. */
    margin: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--ink);
    overflow: auto;
}
.rc-picker::backdrop {
    background: rgba(20, 20, 20, 0.45);
}
.rc-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}
.rc-picker-head h2 {
    margin: 0;
    font-size: 18px;
}
.rc-picker-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    flex-wrap: wrap;
}
.rc-picker-upload input[type="file"] {
    flex: 1;
    min-width: 200px;
}
.rc-picker-upload-msg {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    margin-left: auto;
}
.rc-picker-body {
    padding: 18px 22px;
}
.rc-picker-empty {
    color: var(--muted);
    padding: 30px 0;
    text-align: center;
}
.rc-picker-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.rc-picker-tab {
    background: transparent;
    border: 0;
    padding: 6px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--muted);
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.rc-picker-tab:hover { color: var(--ink); background: var(--bg-alt); }
.rc-picker-tab.is-active { color: var(--ink); background: var(--bg-alt); font-weight: 600; }
.rc-picker-tab-count {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    background: var(--bg);
    padding: 1px 7px;
    border-radius: 99px;
}
.rc-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.rc-picker-item {
    background: var(--bg-alt);
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, transform .15s;
}
.rc-picker-item:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}
.rc-picker-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.rc-picker-pagination {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.rc-picker-pagination-info {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

/* ---------- Icon picker (section fields) ---------- */

.rc-icon-field {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
}
.rc-icon-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.rc-icon-current::-webkit-details-marker { display: none; }
.rc-icon-current-mark {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    color: var(--ink);
}
.rc-icon-current-label {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink);
    flex: 1;
}
.rc-icon-current-label.rc-icon-empty {
    color: var(--muted);
    font-style: italic;
}
.rc-icon-current-toggle {
    font-size: 12px;
    color: var(--accent);
    font-family: var(--mono);
}
.rc-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 4px;
    padding: 10px;
    border-top: 1px solid var(--line);
    max-height: 280px;
    overflow-y: auto;
    background: var(--bg);
}
.rc-icon-option {
    appearance: none;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ink);
    padding: 0;
    transition: border-color 0.1s, background 0.1s;
}
.rc-icon-option:hover {
    border-color: var(--accent);
}
.rc-icon-option.is-selected {
    border-color: var(--accent);
    background: var(--accent-soft, rgba(255, 102, 0, 0.08));
}
.rc-icon-none-mark {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--muted);
}

/* ---------- Repeater field ---------- */

.rc-repeater {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rc-repeater-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rc-repeater-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.rc-repeater-row.sortable-ghost { opacity: 0.4; }
.rc-repeater-row.sortable-chosen { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.rc-repeater-drag {
    appearance: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: grab;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}
.rc-repeater-drag:hover { color: var(--ink); }
.rc-repeater-drag:active { cursor: grabbing; }
.rc-repeater-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
.rc-repeater-fields .rc-field { margin-bottom: 0; }
.rc-repeater-actions {
    display: flex;
    gap: 8px;
}
.rc-btn-danger {
    border-color: var(--line);
    color: var(--muted);
}
.rc-btn-danger:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* ---------- Mobile ---------- */

@media (max-width: 760px) {
    .rc-admin { grid-template-columns: 1fr; }
    .rc-sidebar {
        position: static;
        height: auto;
        overflow: visible;
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding: 16px 0;
    }
    .rc-brand { padding: 0 20px 14px; margin-bottom: 10px; }
    .rc-nav { padding: 0 14px; }
    .rc-topbar {
        flex-wrap: wrap;
        padding: 12px 18px;
    }
    .rc-topbar-title { font-size: 16px; }
    .rc-topbar-actions { gap: 10px; }
    .rc-main-inner { padding: 20px 18px 24px; }
    .rc-footer { padding: 14px 18px 16px; text-align: center; }
    .rc-page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .rc-page-head h1 { font-size: 26px; }
    .rc-row { flex-direction: column; gap: 0; }
    .rc-card { padding: 20px; }
    .rc-bare-card { padding: 28px 22px; }
    .rc-table { font-size: 12px; }
    .rc-table th, .rc-table td { padding: 9px 10px; }
    .rc-menu-item-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .rc-menu-item-body {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

/* ---------- Section drag handle + sortable states ---------- */

.rc-sec-drag {
    transition: color .15s;
}
.rc-sec-drag:hover {
    color: var(--ink);
}
.rc-sec-drag:active {
    cursor: grabbing;
}

/* The placeholder where the dragged item will land */
#rc-sections-sortable .rc-sortable-ghost {
    opacity: 0.35;
    background: var(--bg-alt, #ebe7dc);
}

/* The card currently being dragged */
.rc-sortable-chosen {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* The floating clone of the dragged card */
.rc-sortable-drag {
    opacity: 1;
}

/* ---------- Menu items editor ---------- */

.rc-menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rc-menu-item {
    display: flex;
    align-items: stretch;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.rc-menu-item-handle {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--muted);
    background: var(--bg-alt);
    cursor: grab;
    user-select: none;
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: -0.05em;
}
.rc-menu-item-handle:active {
    cursor: grabbing;
}
.rc-menu-item-body {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}
.rc-menu-item-form {
    flex: 1;
    margin: 0;
}
.rc-menu-item-row {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr auto;
    gap: 12px;
    align-items: end;
}
.rc-menu-item-mini-label {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 4px;
}
.rc-menu-item-row input[type="text"] {
    margin: 0;
    width: 100%;
}
.rc-menu-item-page-target {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 13px;
}
.rc-menu-item-page-target code {
    font-size: 12px;
}
.rc-menu-item-type-badge {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}
.rc-menu-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rc-menu-item-delete-form {
    margin: 0;
}
