:root {
    --cc-bg-top: #f8fafc;
    --cc-bg-mid: #f1f5f9;
    --cc-bg-bottom: #e2e8f0;
    --cc-ink: #0f172a;
    --cc-ink-soft: #64748b;
    --cc-line: rgba(15, 23, 42, 0.1);
    --cc-surface: #ffffff;
    --cc-surface-strong: #ffffff;
    --cc-primary: #3b82f6;
    --cc-secondary: #0ea5e9;
    --cc-success: #10b981;
    --cc-warning: #f59e0b;
    --cc-danger: #ef4444;
    --cc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --cc-radius-lg: 16px;
    --cc-radius-md: 12px;
    --cc-radius-sm: 8px;
    --cc-shell-width: 1440px;
}

html[data-theme="light"],
html[data-theme="auto"],
html {
    --primary: var(--cc-primary);
    --secondary: var(--cc-secondary);
    --accent: #ef8c65;
    --header-bg: transparent;
    --header-link-color: var(--cc-ink);
    --breadcrumbs-bg: rgba(255, 255, 255, 0.82);
    --breadcrumbs-link-fg: var(--cc-ink-soft);
    --breadcrumbs-fg: var(--cc-ink);
    --breadcrumbs-border-color: rgba(19, 34, 52, 0.08);
    --body-bg: transparent;
    --body-quiet-color: var(--cc-ink-soft);
    --body-fg: var(--cc-ink);
    --hairline-color: rgba(19, 34, 52, 0.08);
    --border-color: rgba(19, 34, 52, 0.08);
    --default-button-bg: rgba(255, 255, 255, 0.74);
    --default-button-hover-bg: rgba(255, 255, 255, 0.94);
    --default-button-border-color: rgba(19, 34, 52, 0.08);
    --object-tools-bg: transparent;
}

html[data-theme="dark"] {
    --cc-bg-top: #0b1220;
    --cc-bg-mid: #111827;
    --cc-bg-bottom: #0f172a;
    --cc-ink: #e5eef9;
    --cc-ink-soft: #94a3b8;
    --cc-line: rgba(148, 163, 184, 0.18);
    --cc-surface: #131d2d;
    --cc-surface-strong: #111827;
    --cc-surface-soft: #0f1726;
    --cc-surface-tint: #182235;
    --cc-primary: #60a5fa;
    --cc-secondary: #22d3ee;
    --cc-shadow: 0 18px 40px rgba(2, 8, 23, 0.5);
    --primary: var(--cc-primary);
    --secondary: var(--cc-secondary);
    --accent: #f59e0b;
    --header-bg: transparent;
    --header-link-color: var(--cc-ink);
    --breadcrumbs-bg: rgba(15, 23, 39, 0.92);
    --breadcrumbs-link-fg: var(--cc-ink-soft);
    --breadcrumbs-fg: var(--cc-ink);
    --breadcrumbs-border-color: rgba(148, 163, 184, 0.16);
    --body-bg: transparent;
    --body-quiet-color: var(--cc-ink-soft);
    --body-fg: var(--cc-ink);
    --hairline-color: rgba(148, 163, 184, 0.16);
    --border-color: rgba(148, 163, 184, 0.16);
    --default-button-bg: rgba(15, 23, 42, 0.72);
    --default-button-hover-bg: rgba(15, 23, 42, 0.9);
    --default-button-border-color: rgba(148, 163, 184, 0.18);
    --object-tools-bg: transparent;
}

body {
    color: var(--cc-ink);
    background: linear-gradient(180deg, var(--cc-bg-top) 0%, var(--cc-bg-mid) 54%, var(--cc-bg-bottom) 100%);
    background-attachment: fixed;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    background: linear-gradient(180deg, var(--cc-bg-top) 0%, var(--cc-bg-mid) 54%, var(--cc-bg-bottom) 100%);
}

body::before {
    display: none;
}

#container {
    position: relative;
    z-index: 1;
}

#header {
    width: min(var(--cc-shell-width), calc(100vw - 40px));
    margin: 16px auto 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#branding,
#user-tools {
    border: 1px solid var(--border-color);
    background: var(--cc-surface-strong);
    box-shadow: var(--cc-shadow);
}

#branding {
    display: flex;
    align-items: center;
    min-height: 76px;
    margin-bottom: 12px;
    padding: 16px 20px;
    border-radius: var(--cc-radius-lg);
}

.cc-admin-brand__link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--cc-ink);
    text-decoration: none;
}

.cc-admin-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--cc-primary), var(--cc-secondary));
    box-shadow: 0 18px 32px rgba(36, 87, 255, 0.24);
}

.cc-admin-brand__mark svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cc-admin-brand__copy {
    display: grid;
    gap: 3px;
}

.cc-admin-brand__copy strong {
    font-size: 1.1rem;
}

.cc-admin-brand__copy small {
    color: var(--cc-ink-soft);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#user-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    padding: 12px 18px;
    color: var(--cc-ink-soft);
    border-radius: var(--cc-radius-md);
}

#user-tools a,
#logout-form button {
    color: var(--cc-ink);
    font-weight: 600;
}

div.breadcrumbs {
    width: min(var(--cc-shell-width), calc(100vw - 40px));
    margin: 0 auto 18px;
    padding: 12px 18px;
    color: var(--breadcrumbs-fg, var(--cc-ink-soft));
    border: 1px solid var(--breadcrumbs-border-color, var(--border-color));
    border-radius: 16px;
    background: var(--breadcrumbs-bg);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

div.breadcrumbs a,
div.breadcrumbs a:link,
div.breadcrumbs a:visited {
    color: var(--breadcrumbs-link-fg);
    text-decoration: none !important;
    font-weight: 600;
}

div.breadcrumbs a:hover,
div.breadcrumbs a:focus-visible,
div.breadcrumbs a:active {
    color: var(--primary);
    text-decoration: none !important;
}

div.breadcrumbs a:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.22);
    outline-offset: 2px;
}

#content {
    width: min(var(--cc-shell-width), calc(100vw - 40px));
    margin: 0 auto 20px;
    overflow: visible;
}

body.cc-admin-dashboard.dashboard #content {
    width: min(var(--cc-shell-width), calc(100vw - 40px)) !important;
    padding: 0 !important;
    box-sizing: border-box;
}

#content-main {
    min-width: 0;
}

#content-related {
    min-width: 0;
}

#footer {
    width: min(var(--cc-shell-width), calc(100vw - 40px));
    margin: 0 auto 18px;
}

#content-main,
#content-related,
.module,
.inline-group,
.submit-row,
.object-tools a,
.dashboard #content-related .module {
    border-radius: var(--cc-radius-md);
}

.cc-dashboard {
    display: grid;
    gap: 28px;
}

body.cc-admin-dashboard #content-main,
body.cc-admin-dashboard #content-related {
    float: none;
    width: auto;
    margin: 0;
}

body.cc-admin-dashboard #content-related {
    background: transparent;
    border: 0;
}

body.cc-admin-dashboard #content-related .cc-panel,
body.cc-admin-dashboard #content-related .module {
    background: var(--cc-surface-strong);
    border: 1px solid var(--border-color);
    box-shadow: var(--cc-shadow);
}

.cc-dashboard__grid > *,
.cc-hero > *,
.cc-model-item > * {
    min-width: 0;
}

.cc-hero,
.cc-panel,
.module,
.inline-group,
.submit-row {
    padding: 30px;
    border: 1px solid var(--border-color);
    background: var(--cc-surface-strong);
    box-shadow: var(--cc-shadow);
}

.cc-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}

.cc-hero h1 {
    margin: 12px 0 0;
    max-width: none;
    font-size: clamp(1.9rem, 2.35vw, 2.8rem);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.cc-hero p {
    max-width: 62ch;
    margin: 10px 0 0;
    color: var(--cc-ink-soft);
    font-size: 0.96rem;
    line-height: 1.7;
}

.cc-eyebrow,
.cc-app-card__eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--cc-ink-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.cc-hero__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.cc-hero__actions .cc-button {
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.cc-hero__actions .cc-button:first-child {
    grid-column: 1 / -1;
}

.cc-hero__side {
    display: grid;
    gap: 14px;
}

.cc-hero__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.cc-metric {
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--cc-bg-top);
}

.cc-metric__label {
    display: block;
    color: var(--cc-ink-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cc-metric strong {
    display: block;
    margin-top: 8px;
    font-size: 1.1rem;
    line-height: 1.2;
    color: var(--cc-ink);
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-button,
.object-tools a,
input[type="submit"],
input[type="button"],
.submit-row input,
button.button,
a.button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    font-weight: 700;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cc-button:hover,
.object-tools a:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.submit-row input:hover,
button.button:hover,
a.button:hover {
    transform: translateY(-1px);
}

.cc-button--primary,
.button.default,
input[type="submit"].default,
.submit-row input.default {
    color: #fff;
    border: 0;
    background: var(--cc-primary);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
}

html[data-theme="dark"] .cc-button--primary,
html[data-theme="dark"] .button.default,
html[data-theme="dark"] input[type="submit"].default,
html[data-theme="dark"] .submit-row input.default {
    color: #f8fbff !important;
    background: linear-gradient(135deg, #60a5fa, #38bdf8);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.cc-button--ghost,
.object-tools a,
button,
input[type="button"],
.button,
a.button {
    color: var(--cc-ink);
    border: 1px solid var(--cc-line);
    background: rgba(255, 255, 255, 0.7);
}

.object-tools a,
.object-tools a:link,
.object-tools a:visited {
    color: var(--cc-ink) !important;
    background: rgba(255, 255, 255, 0.84);
    background-image: none !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.object-tools a.addlink,
.object-tools a.addlink:link,
.object-tools a.addlink:visited {
    color: #f8fbff !important;
    border: 0;
    background: linear-gradient(135deg, var(--cc-primary), var(--cc-secondary)) !important;
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.28);
}

.object-tools a.addlink:hover,
.object-tools a.addlink:focus-visible,
.object-tools a.addlink:active {
    color: #f8fbff !important;
}

.cc-dashboard__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}

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

.cc-panel__header > div {
    flex: 1 1 100%;
}

.cc-panel__header p {
    flex: 1 1 100%;
    margin: 10px 0 0;
    color: var(--cc-ink-soft);
    line-height: 1.6;
}

.cc-sidebar {
    display: grid;
    gap: 22px;
}

.cc-app-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

.cc-app-card {
    padding: 24px;
    border: 1px solid var(--cc-line);
    border-radius: var(--cc-radius-md);
    background: rgba(255, 255, 255, 0.64);
}

.cc-app-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.cc-app-card__header > div {
    min-width: 0;
}

.cc-app-card__header h3 {
    margin: 10px 0 0;
    font-size: 1.2rem;
}

.cc-app-card__header h3 a {
    color: var(--cc-ink);
}

.cc-app-card__count {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(19, 34, 52, 0.06);
    color: var(--cc-ink-soft);
    font-size: 0.8rem;
    font-weight: 600;
}

.cc-model-list {
    display: grid;
    gap: 16px;
}

.cc-model-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    padding: 20px 22px;
    border: 1px solid rgba(19, 34, 52, 0.06);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.64);
}

.cc-model-item__main h4 {
    margin: 0;
    font-size: 1rem;
}

.cc-model-item__main h4 a {
    color: var(--cc-ink);
}

.cc-model-item__main p {
    margin: 8px 0 0;
    color: var(--cc-ink-soft);
    line-height: 1.6;
}

.cc-model-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
}

.cc-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--cc-line);
    border-radius: 999px;
    color: var(--cc-ink);
    background: rgba(255, 255, 255, 0.78);
    font-weight: 600;
}

.cc-action-link--add {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, var(--cc-primary), var(--cc-secondary));
}

.cc-action-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cc-action-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--cc-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.64);
}

.cc-action-item__badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.cc-action-item.is-add .cc-action-item__badge {
    color: var(--cc-success);
    background: rgba(16, 150, 105, 0.12);
}

.cc-action-item.is-change .cc-action-item__badge {
    color: var(--cc-primary);
    background: rgba(36, 87, 255, 0.12);
}

.cc-action-item.is-delete .cc-action-item__badge {
    color: var(--cc-danger);
    background: rgba(166, 37, 43, 0.12);
}

.cc-action-item__body strong,
.cc-action-item__body a {
    color: var(--cc-ink);
}

.cc-action-item__body p {
    margin: 6px 0 0;
    color: var(--cc-ink-soft);
}

.cc-shortcuts {
    display: grid;
    gap: 12px;
}

.cc-shortcut {
    display: block;
    padding: 16px;
    border: 1px solid var(--cc-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.64);
}

.cc-shortcut strong {
    display: block;
    color: var(--cc-ink);
}

.cc-shortcut span {
    display: block;
    margin-top: 6px;
    color: var(--cc-ink-soft);
}

.cc-empty-state {
    padding: 16px;
    color: var(--cc-ink-soft);
    border: 1px dashed var(--cc-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
}

html[data-theme="dark"] div.breadcrumbs,
html[data-theme="dark"] .cc-eyebrow,
html[data-theme="dark"] .cc-app-card__eyebrow,
html[data-theme="dark"] .cc-app-card,
html[data-theme="dark"] .cc-model-item,
html[data-theme="dark"] .cc-action-item,
html[data-theme="dark"] .cc-shortcut,
html[data-theme="dark"] .cc-empty-state,
html[data-theme="dark"] #changelist-filter,
html[data-theme="dark"] #nav-sidebar,
html[data-theme="dark"] div.inline-related,
html[data-theme="dark"] .selector,
html[data-theme="dark"] .calendarbox,
html[data-theme="dark"] .clockbox,
html[data-theme="dark"] #changelist table tbody tr,
html[data-theme="dark"] .results tbody tr,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .cc-button--ghost,
html[data-theme="dark"] .object-tools a,
html[data-theme="dark"] button,
html[data-theme="dark"] input[type="button"],
html[data-theme="dark"] .button,
html[data-theme="dark"] a.button,
html[data-theme="dark"] .cc-action-link {
    background: var(--cc-surface);
    border-color: rgba(148, 163, 184, 0.18);
    color: var(--cc-ink);
}

html[data-theme="dark"] .cc-eyebrow,
html[data-theme="dark"] .cc-app-card__eyebrow,
html[data-theme="dark"] .cc-action-item__badge,
html[data-theme="dark"] .cc-app-card__count {
    background: var(--cc-surface-tint);
}

html[data-theme="dark"] .object-tools a.addlink,
html[data-theme="dark"] .object-tools a.addlink:link,
html[data-theme="dark"] .object-tools a.addlink:visited {
    color: #f8fbff !important;
    background: linear-gradient(135deg, #60a5fa, #22d3ee) !important;
}

html[data-theme="dark"] .cc-app-card,
html[data-theme="dark"] .cc-model-item,
html[data-theme="dark"] .cc-action-item,
html[data-theme="dark"] .cc-shortcut {
    background: var(--cc-surface-soft);
}

html[data-theme="dark"] .cc-action-item__body strong,
html[data-theme="dark"] .cc-action-item__body a,
html[data-theme="dark"] .cc-shortcut strong,
html[data-theme="dark"] .cc-model-item__main h4 a,
html[data-theme="dark"] .cc-app-card__header h3 a,
html[data-theme="dark"] .cc-panel__header h2,
html[data-theme="dark"] .module h2,
html[data-theme="dark"] .module caption,
html[data-theme="dark"] .inline-group h2 {
    color: var(--cc-ink);
}

html[data-theme="dark"] #changelist table tbody td:first-child,
html[data-theme="dark"] #changelist table tbody th:first-child,
html[data-theme="dark"] .results tbody td:first-child,
html[data-theme="dark"] .results tbody th:first-child,
html[data-theme="dark"] #changelist table tbody td:last-child,
html[data-theme="dark"] #changelist table tbody th:last-child,
html[data-theme="dark"] .results tbody td:last-child,
html[data-theme="dark"] .results tbody th:last-child,
html[data-theme="dark"] #changelist table tbody td,
html[data-theme="dark"] #changelist table tbody th,
html[data-theme="dark"] .results tbody td,
html[data-theme="dark"] .results tbody th {
    border-color: rgba(148, 163, 184, 0.12);
}

.module h2,
.module caption,
.inline-group h2 {
    padding: 0;
    font-size: 1.15rem;
    color: var(--cc-ink);
    background: transparent;
}

#changelist-filter,
#nav-sidebar,
div.inline-related,
.selector,
.calendarbox,
.clockbox {
    border-radius: var(--cc-radius-sm);
    border-color: var(--cc-line);
    background: rgba(255, 255, 255, 0.72);
}

table {
    border-collapse: separate;
    border-spacing: 0 10px;
}

#changelist table thead th,
.results thead th,
thead th {
    color: var(--cc-ink-soft);
    border-bottom: 0;
    background: transparent;
}

#changelist table tbody tr,
.results tbody tr {
    background: rgba(255, 255, 255, 0.74);
}

#changelist table tbody td,
#changelist table tbody th,
.results tbody td,
.results tbody th {
    padding-top: 14px;
    padding-bottom: 14px;
    border-top: 1px solid rgba(19, 34, 52, 0.05);
    border-bottom: 1px solid rgba(19, 34, 52, 0.05);
}

#changelist table tbody td:first-child,
#changelist table tbody th:first-child,
.results tbody td:first-child,
.results tbody th:first-child {
    border-left: 1px solid rgba(19, 34, 52, 0.05);
    border-radius: 16px 0 0 16px;
}

#changelist table tbody td:last-child,
#changelist table tbody th:last-child,
.results tbody td:last-child,
.results tbody th:last-child {
    border-right: 1px solid rgba(19, 34, 52, 0.05);
    border-radius: 0 16px 16px 0;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="tel"],
textarea,
select {
    border: 1px solid var(--cc-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(36, 87, 255, 0.44);
    box-shadow: 0 0 0 4px rgba(36, 87, 255, 0.1);
}

.submit-row {
    display: flex;
    gap: 10px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-weight: 700;
}

body.change-list #content-main > .object-tools,
body.change-form #content-main > .object-tools {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0;
}

body.change-list #changelist {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

body.change-list #toolbar,
body.change-list .actions,
body.change-list .changelist-footer,
body.change-form .submit-row {
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--cc-radius-md);
    background: linear-gradient(180deg, var(--cc-surface-strong) 0%, var(--cc-surface) 100%);
    box-shadow: var(--cc-shadow);
}

body.change-list #toolbar,
body.change-list .actions,
body.change-list .changelist-footer {
    padding: 14px 18px;
}

body.change-list .results {
    overflow: auto;
    padding: 0 8px 8px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--cc-radius-md);
    background: linear-gradient(180deg, var(--cc-surface-strong) 0%, var(--cc-surface) 100%);
    box-shadow: var(--cc-shadow);
}

body.change-list .results table {
    min-width: 920px;
}

body.change-form #content-main form > div {
    display: grid;
    gap: 18px;
}

body.change-form .submit-row {
    justify-content: flex-start;
}

body.change-form fieldset.module {
    margin: 0;
}

body.change-form .aligned .form-row:last-child {
    border-bottom: 0;
}

body.login #header {
    width: min(960px, calc(100vw - 40px));
    margin-top: 28px;
}

body.login #branding {
    justify-content: space-between;
    gap: 16px;
    min-height: 88px;
}

body.login #content,
body.login #footer {
    width: min(960px, calc(100vw - 40px));
}

body.login #content {
    margin-bottom: 36px;
}

body.login #content-main {
    width: auto;
}

.cc-admin-login {
    display: grid;
    gap: 18px;
}

.cc-admin-login__intro,
.cc-admin-login__card {
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: var(--cc-radius-lg);
    background: var(--cc-surface-strong);
    box-shadow: var(--cc-shadow);
}

.cc-admin-login__intro {
    display: grid;
    gap: 14px;
}

.cc-admin-login__intro h1 {
    margin: 0;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.cc-admin-login__intro p {
    max-width: 42ch;
    margin: 0;
    color: var(--cc-ink-soft);
    line-height: 1.7;
}

.cc-admin-login__tips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cc-admin-login__tips span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--cc-ink-soft);
    background: rgba(59, 130, 246, 0.08);
    font-size: 0.9rem;
    font-weight: 600;
}

.cc-admin-login__card {
    padding: 28px;
}

.cc-admin-login__form {
    display: grid;
    gap: 18px;
}

.cc-admin-login__notice {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.6;
}

.cc-admin-login__notice.is-error {
    color: #b42318;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.16);
}

.cc-admin-login__notice.is-warning {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.18);
}

.cc-login-field {
    display: grid;
    gap: 10px;
}

.cc-login-field label {
    color: var(--cc-ink-soft);
    font-size: 0.9rem;
    font-weight: 700;
}

.cc-login-field input[type="text"],
.cc-login-field input[type="password"] {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 16px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.86);
}

.cc-login-field__error {
    color: var(--cc-danger);
    font-size: 0.85rem;
    line-height: 1.5;
}

.cc-admin-login__meta {
    display: flex;
    justify-content: flex-end;
    margin-top: -6px;
}

.cc-admin-login__meta a {
    color: var(--primary);
    font-weight: 600;
}

body.login .submit-row {
    justify-content: stretch;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

body.login .submit-row input {
    width: 100%;
    min-height: 50px;
}

body.login #container {
    min-height: 100vh;
}

body.login #footer {
    padding-bottom: 12px;
}

@media (min-width: 900px) {
    .cc-app-grid {
        grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    }

    .cc-sidebar {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

@media (min-width: 1101px) {
    #header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 16px;
        align-items: start;
    }

    #branding {
        margin-bottom: 0;
    }

    #user-tools {
        justify-content: flex-end;
        flex-wrap: wrap;
        text-align: right;
        min-width: 320px;
    }

    #user-tools a,
    #logout-form button {
        white-space: nowrap;
    }

    .cc-hero h1 {
        font-size: clamp(2rem, 2.2vw, 2.7rem);
    }

    body.change-list #changelist .changelist-form-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 296px;
        gap: 18px;
        align-items: start;
    }

    body.change-list #changelist .changelist-form-container > div:last-child {
        min-width: 0;
        display: grid;
        gap: 16px;
    }

    body.change-list #changelist-filter {
        position: sticky;
        top: 18px;
        padding: 18px;
        box-shadow: var(--cc-shadow);
    }

    body.change-list #changelist-filter h2 {
        margin: 0 0 14px;
        font-size: 1.1rem;
    }

    body.change-list .changelist-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
}

@media (min-width: 1101px) and (max-width: 1599px) {
    body.cc-admin-dashboard .cc-dashboard__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.cc-admin-dashboard #content-main,
    body.cc-admin-dashboard #content-related {
        float: none !important;
        width: auto !important;
        margin: 0 !important;
    }

    .cc-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .cc-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        position: static;
    }
}

@media (min-width: 1280px) {
    .cc-model-item {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .cc-model-item__actions {
        justify-content: flex-end;
    }
}

@media (min-width: 1600px) {
    #header {
        grid-template-columns: minmax(420px, 1fr) auto;
        align-items: stretch;
        gap: 18px;
    }

    #branding {
        padding: 18px 22px;
    }

    #user-tools {
        min-width: 380px;
        justify-content: flex-end;
        text-align: right;
        padding: 14px 20px;
    }

    .cc-hero {
        grid-template-columns: minmax(0, 1fr) 380px;
        align-items: stretch;
    }

    .cc-hero h1 {
        font-size: clamp(2.05rem, 2.1vw, 2.9rem);
    }

    .cc-dashboard__grid {
        grid-template-columns: minmax(0, 1.16fr) 300px;
        align-items: start;
        gap: 30px;
    }

    .cc-sidebar {
        grid-template-columns: 1fr;
        position: sticky;
        top: 18px;
        align-self: start;
    }

    .cc-panel__header {
        grid-template-columns: minmax(0, 1fr) 320px;
        align-items: end;
    }
}

@media (min-width: 1800px) {
    .cc-dashboard__grid {
        grid-template-columns: minmax(0, 1.2fr) 320px;
    }

    .cc-hero {
        grid-template-columns: minmax(0, 1fr) 420px;
    }
}

@media (min-width: 1280px) {
    body.change-form #content-main form > div {
        grid-template-columns: minmax(0, 1fr);
    }

    body.change-form #content-main form > div:has(> fieldset.module:nth-of-type(2)) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.change-form #content-main form > div:has(.selector) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.change-form #content-main form > div > .submit-row,
    body.change-form #content-main form > div > .errornote,
    body.change-form #content-main form > div > .inline-group,
    body.change-form #content-main form > div > [class*="inline-related"],
    body.change-form #content-main form > div > script {
        grid-column: 1 / -1;
    }

    body.change-form #content-main form > div > fieldset.module {
        height: 100%;
    }

    body.change-form #content-main form > div:has(.selector) > fieldset.module {
        height: auto;
    }
}

@media (min-width: 1600px) {
    body.change-form #content {
        width: min(1220px, calc(100vw - 340px));
    }

    body.change-form #content-main {
        max-width: 1100px;
        margin: 0 auto;
    }

    body.change-form #content-main form > div {
        max-width: 980px;
        margin: 0 auto;
    }
}

@media (min-width: 980px) {
    .cc-admin-login {
        grid-template-columns: minmax(0, 1.05fr) 420px;
        align-items: start;
    }

    .cc-admin-login__intro {
        min-height: 100%;
    }
}

@media (max-width: 1100px) {
    #header {
        display: grid;
        gap: 12px;
    }

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

    body.login #header,
    body.login #content,
    body.login #footer {
        width: calc(100vw - 24px);
    }
}

@media (max-width: 767px) {
    #header,
    #content,
    div.breadcrumbs,
    #footer {
        width: calc(100vw - 24px);
        margin-left: auto;
        margin-right: auto;
    }

    #user-tools,
    #branding,
    .cc-hero,
    .cc-panel,
    .module,
    .inline-group,
    .submit-row {
        padding: 16px;
    }

    .cc-hero h1 {
        max-width: none;
        font-size: clamp(1.8rem, 9vw, 2.5rem);
    }

    .cc-hero__meta,
    .cc-hero__actions,
    .cc-app-grid,
    .cc-sidebar {
        grid-template-columns: 1fr;
    }

    .cc-hero__actions .cc-button:first-child {
        grid-column: auto;
    }

    body.login #branding,
    .cc-admin-login__intro,
    .cc-admin-login__card {
        padding: 18px;
    }

    body.login #branding {
        min-height: 74px;
    }

    .cc-admin-login__intro h1 {
        font-size: 1.7rem;
    }
}
