:root {
    --navy-950: #0b1f3a;
    --navy-800: #17365d;
    --navy-700: #214d7a;
    --blue-100: #e9f1f8;
    --blue-50: #f4f8fb;
    --ink: #17212b;
    --muted: #667382;
    --line: #d9e0e7;
    --line-strong: #bbc7d3;
    --surface: #ffffff;
    --canvas: #f5f7f9;
    --green: #176b48;
    --green-soft: #e8f5ee;
    --amber: #9a5a08;
    --amber-soft: #fff4d8;
    --red: #a52626;
    --red-soft: #fdecec;
    --gray-soft: #edf0f2;
    --shadow: 0 8px 24px rgba(11, 31, 58, 0.08);
    --radius: 6px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
    color-scheme: light;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background-color: var(--canvas);
    font-family: "Trebuchet MS", Candara, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    background-image: repeating-linear-gradient(90deg, rgba(23, 54, 93, 0.025) 0, rgba(23, 54, 93, 0.025) 1px, transparent 1px, transparent 48px);
    content: "";
    pointer-events: none;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3,
legend {
    color: var(--navy-950);
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(1.85rem, 4vw, 2.65rem);
    line-height: 1.1;
}

h2 {
    margin-bottom: 12px;
    font-size: 1.35rem;
    line-height: 1.25;
}

h3 {
    margin-bottom: 8px;
    font-size: 1.02rem;
}

a {
    color: var(--navy-700);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
summary,
input,
select,
textarea {
    outline-offset: 3px;
}

:focus-visible {
    outline: 3px solid #3a7cae;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--navy-950);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--surface);
    padding: 10px 12px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--navy-700);
    box-shadow: 0 0 0 3px rgba(33, 77, 122, 0.12);
}

fieldset {
    min-width: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}

legend {
    padding: 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
}

code {
    font-family: Consolas, "Courier New", monospace;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--navy-700);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.muted,
.field-hint {
    color: var(--muted);
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    padding: 9px 15px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--large {
    min-height: 50px;
    padding: 12px 21px;
}

.button--primary {
    border-color: var(--navy-800);
    color: #ffffff;
    background: var(--navy-800);
}

.button--primary:hover {
    background: var(--navy-950);
}

.button--secondary {
    border-color: var(--line-strong);
    color: var(--navy-800);
    background: var(--surface);
}

.button--secondary:hover,
.button--quiet:hover {
    border-color: var(--navy-700);
    background: var(--blue-50);
}

.button--quiet {
    border-color: transparent;
    color: var(--navy-800);
    background: transparent;
}

.button--success {
    border-color: var(--green);
    color: #ffffff;
    background: var(--green);
}

.button--danger {
    border-color: var(--red);
    color: #ffffff;
    background: var(--red);
}

.button--danger-quiet {
    border-color: #e4bcbc;
    color: var(--red);
    background: var(--surface);
}

.notice {
    max-width: 1180px;
    margin: 0 auto 20px;
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: var(--radius);
    padding: 14px 18px;
    background: var(--surface);
}

.notice p:last-child,
.notice h2:last-child {
    margin-bottom: 0;
}

.notice--success {
    border-left-color: var(--green);
    background: var(--green-soft);
}

.notice--error {
    border-left-color: var(--red);
    background: var(--red-soft);
}

.notice--info {
    border-left-color: var(--navy-700);
    background: var(--blue-50);
}

.topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: grid;
    min-height: 74px;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    padding: 10px max(20px, calc((100vw - 1460px) / 2));
    box-shadow: 0 2px 12px rgba(11, 31, 58, 0.05);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--navy-950);
    text-decoration: none;
}

.brand span:last-child {
    display: grid;
    line-height: 1.15;
}

.brand small {
    color: var(--muted);
    font-size: 0.72rem;
}

.site-footer {
    display: flex;
    justify-content: center;
    gap: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.92);
    padding: 14px 20px 22px;
    font-size: 0.78rem;
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 4px;
    color: #ffffff;
    background: var(--navy-800);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.brand-mark--large {
    width: 56px;
    height: 56px;
    margin-bottom: 18px;
    font-size: 1.7rem;
}

.main-nav {
    display: flex;
    gap: 5px;
}

.main-nav a {
    min-height: 42px;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    padding: 10px 13px 7px;
    font-weight: 800;
    text-decoration: none;
}

.main-nav a:hover,
.main-nav a.is-active {
    border-bottom-color: var(--navy-700);
    color: var(--navy-950);
}

.account-area {
    display: flex;
    align-items: center;
    gap: 5px;
}

.account-area form,
.task-actions form {
    margin: 0;
}

.account-name {
    max-width: 160px;
    margin-right: 7px;
    overflow: hidden;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-shell {
    width: min(1460px, calc(100% - 40px));
    min-height: calc(100vh - 150px);
    margin: 0 auto;
    padding: 42px 0 60px;
    animation: page-enter 240ms ease-out both;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.page-heading h1,
.page-heading p {
    margin-bottom: 0;
}

.date-stamp {
    color: var(--muted);
    font-weight: 800;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.metric-card {
    display: grid;
    min-height: 104px;
    align-content: space-between;
    border: 1px solid var(--line);
    border-top: 4px solid var(--navy-700);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--surface);
    padding: 15px 17px;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(11, 31, 58, 0.04);
}

.metric-card:hover {
    border-color: var(--navy-700);
}

.metric-card span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.metric-card strong {
    color: var(--navy-950);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.05rem;
    line-height: 1;
}

.composer,
.form-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 22px;
    box-shadow: var(--shadow);
}

.composer {
    margin-bottom: 38px;
    border-top: 5px solid var(--navy-800);
}

.composer textarea {
    min-height: 92px;
}

.composer-controls,
.form-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto;
    align-items: end;
    gap: 14px;
    margin-top: 13px;
}

.form-panel {
    max-width: 820px;
    margin: 0 auto;
}

.form-panel textarea,
.form-panel .form-row {
    margin-bottom: 18px;
}

.form-panel .form-row {
    grid-template-columns: 1fr;
}

.list-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 14px;
}

.list-toolbar h2,
.list-toolbar p {
    margin-bottom: 0;
}

.result-count {
    color: var(--muted);
    font-family: "Trebuchet MS", Candara, sans-serif;
    font-size: 0.88rem;
}

.search-form {
    display: grid;
    width: min(460px, 100%);
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.filter-tabs a {
    min-width: max-content;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    padding: 11px 14px 8px;
    font-weight: 800;
    text-decoration: none;
}

.filter-tabs a:hover,
.filter-tabs a.is-active {
    border-bottom-color: var(--navy-700);
    color: var(--navy-950);
}

.task-list {
    display: grid;
    gap: 12px;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(330px, 0.72fr);
    align-items: start;
    gap: 28px;
}

.task-section {
    min-width: 0;
}

.recipe-panel {
    position: sticky;
    top: 98px;
    min-width: 0;
    border-left: 4px solid var(--green);
    padding-left: 20px;
}

.recipe-panel__header,
.recipe-row__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.recipe-panel__header {
    margin-bottom: 14px;
}

.recipe-panel__header h2,
.recipe-panel__header p {
    margin-bottom: 0;
}

.recipe-panel__header a {
    flex: 0 0 auto;
    font-weight: 800;
}

.recipe-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 13px;
}

.recipe-metrics div {
    display: grid;
    min-height: 68px;
    align-content: space-between;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 9px 11px;
}

.recipe-metrics strong {
    color: var(--navy-950);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    line-height: 1;
}

.recipe-metrics span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.recipe-list,
.recipe-archive-list,
.client-list {
    display: grid;
    gap: 9px;
}

.recipe-row {
    display: grid;
    gap: 6px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 12px 13px;
    overflow-wrap: anywhere;
}

.recipe-row--completed {
    border-left-color: #7a858f;
    color: #68717a;
    background: var(--gray-soft);
    text-decoration: line-through;
    text-decoration-color: #7b838b;
    text-decoration-thickness: 1.5px;
}

.recipe-row--deleted {
    border-left-color: var(--red);
    color: var(--muted);
    background: #f7f8f9;
}

.recipe-row__name {
    min-width: 0;
    color: inherit;
    font-size: 0.96rem;
}

.recipe-flag {
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    border-left: 6px solid #98a2b3;
    border-radius: var(--radius);
    background: #f2f4f7;
    padding: 9px 10px;
}

.recipe-flag--green {
    border-left-color: var(--green);
    background: var(--green-soft);
}

.recipe-flag--yellow {
    border-left-color: var(--amber);
    background: var(--amber-soft);
}

.recipe-flag--red {
    border-left-color: var(--red);
    background: var(--red-soft);
}

.recipe-flag__title {
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.recipe-flag--unrated .recipe-flag__title {
    color: #344054;
}

.recipe-flag--yellow .recipe-flag__title {
    color: var(--amber);
}

.recipe-flag--red .recipe-flag__title {
    color: var(--red);
}

.recipe-flag__note {
    font-size: 0.78rem;
    line-height: 1.35;
}

.recipe-flag-editor {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    padding: 9px 10px;
}

.recipe-flag-editor summary {
    cursor: pointer;
    color: var(--navy-800);
    font-size: 0.8rem;
    font-weight: 800;
}

.recipe-flag-editor form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.recipe-flag-editor label {
    margin-bottom: 0;
    font-size: 0.78rem;
}

.recipe-flag-editor select,
.recipe-flag-editor textarea {
    min-height: 40px;
}

.recipe-flag-editor textarea {
    min-height: 86px;
}

.recipe-flag-editor .button {
    justify-self: start;
}

.recipe-status {
    flex: 0 0 auto;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--green);
    background: var(--green-soft);
    padding: 2px 7px;
    font-size: 0.68rem;
    font-weight: 900;
}

.recipe-row--completed .recipe-status,
.recipe-row--deleted .recipe-status {
    color: #59636d;
    background: #e2e6e9;
}

.recipe-row__date,
.recipe-row__completion,
.recipe-refresh-status,
.recipe-empty {
    color: inherit;
    font-size: 0.78rem;
}

.recipe-refresh-status {
    margin: 11px 0 0;
    color: var(--muted);
}

.recipe-refresh-status.is-error {
    color: var(--red);
}

.recipe-empty {
    margin: 0;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
    padding: 18px 12px;
    text-align: center;
}

.recipe-archive {
    max-width: 900px;
}

.admin-columns {
    display: grid;
    grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
    align-items: start;
    gap: 26px;
}

.sync-client-form {
    margin: 0;
}

.sync-client-form form {
    display: grid;
    gap: 9px;
}

.sync-client-form button {
    margin-top: 8px;
}

.sync-secret {
    max-width: none;
}

.credential-row {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 12px;
    border-top: 1px solid rgba(23, 107, 72, 0.2);
    padding: 9px 0;
}

.credential-row span {
    font-weight: 800;
}

.credential-row code {
    overflow-wrap: anywhere;
}

.client-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.75fr) auto;
    align-items: start;
    gap: 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 15px;
}

.client-row--disabled {
    border-left-color: #7a858f;
    color: var(--muted);
    background: var(--gray-soft);
}

.client-row code {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 0.74rem;
}

.client-facts {
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 0.76rem;
}

.task-row {
    border: 1px solid var(--line);
    border-left: 5px solid var(--navy-700);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 18px;
    box-shadow: 0 2px 9px rgba(11, 31, 58, 0.045);
}

.task--wichtig {
    border-left-color: var(--amber);
}

.task--dringend {
    border-left-color: var(--red);
}

.task--completed {
    border-left-color: #7a858f;
    color: #68717a;
    background: var(--gray-soft);
}

.task--completed .task-strike {
    text-decoration: line-through;
    text-decoration-color: #7b838b;
    text-decoration-thickness: 1.5px;
}

.task--archived {
    border-style: dashed;
    border-left-style: solid;
    border-left-color: #737f89;
    color: #68717a;
    background: #f5f6f7;
}

.task-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
}

.task-identity,
.task-meta,
.task-facts,
.task-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.priority-badge {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--navy-800);
    background: var(--blue-50);
    padding: 3px 10px;
    font-size: 0.76rem;
    font-weight: 900;
}

.priority-badge--wichtig {
    border-color: #e4bd6c;
    color: #784300;
    background: var(--amber-soft);
}

.priority-badge--dringend {
    border-color: #e5a7a7;
    color: #8b1f1f;
    background: var(--red-soft);
}

.task-number {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.task-meta {
    justify-content: flex-end;
    color: var(--muted);
    font-size: 0.85rem;
}

.task-body {
    margin: 17px 0 14px;
    overflow-wrap: anywhere;
    color: inherit;
    font-size: 1.04rem;
    white-space: normal;
}

.task-facts {
    color: var(--muted);
    font-size: 0.86rem;
}

.task-facts span {
    border-left: 3px solid var(--line-strong);
    padding-left: 9px;
}

.reply-thread {
    display: grid;
    gap: 7px;
    margin-top: 15px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.reply {
    border-left: 3px solid var(--line-strong);
    padding: 6px 10px;
}

.reply p {
    margin-bottom: 2px;
    overflow-wrap: anywhere;
}

.reply span {
    color: var(--muted);
    font-size: 0.78rem;
}

.task-actions {
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 13px;
}

.reply-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    margin-top: 12px;
}

.audit-log {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.84rem;
}

.audit-log summary {
    width: fit-content;
    cursor: pointer;
    font-weight: 800;
}

.audit-entries {
    display: grid;
    gap: 5px;
    margin-top: 9px;
    border-left: 2px solid var(--line);
    padding-left: 12px;
}

.audit-entries div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.empty-state {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.75);
    padding: 38px 22px;
    text-align: center;
}

.empty-state p:last-child,
.empty-state h3:last-child {
    margin-bottom: 0;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination a {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--navy-800);
    background: var(--surface);
    font-weight: 800;
    text-decoration: none;
}

.pagination a.is-active {
    border-color: var(--navy-800);
    color: #ffffff;
    background: var(--navy-800);
}

.trash-list {
    display: grid;
    gap: 13px;
}

.trash-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
    gap: 24px;
    border: 1px solid var(--line);
    border-left: 5px solid #7a858f;
    border-radius: var(--radius);
    background: var(--surface);
    padding: 20px;
}

.trash-row h2 {
    overflow-wrap: anywhere;
    font-family: "Trebuchet MS", Candara, sans-serif;
    font-size: 1.05rem;
}

.trash-actions {
    display: grid;
    align-content: start;
    gap: 12px;
}

.purge-form {
    display: grid;
    gap: 7px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.auth-page,
.installer-page {
    display: grid;
    min-height: 100vh;
    grid-template-rows: 1fr auto;
    background-color: #eef3f7;
    background-image: repeating-linear-gradient(135deg, rgba(23, 54, 93, 0.04) 0, rgba(23, 54, 93, 0.04) 1px, transparent 1px, transparent 18px);
}

.auth-shell {
    display: grid;
    width: min(100% - 32px, 480px);
    min-height: calc(100vh - 70px);
    place-items: center;
    margin: 0 auto;
    padding: 34px 0;
}

.auth-panel {
    width: 100%;
    border: 1px solid var(--line);
    border-top: 6px solid var(--navy-800);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 34px;
    box-shadow: var(--shadow);
}

.auth-brand {
    margin-bottom: 26px;
}

.auth-brand p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 9px;
}

.auth-form input {
    margin-bottom: 9px;
}

.auth-cancel {
    margin-top: 10px;
    text-align: center;
}

.site-footer {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.85);
    padding: 15px max(20px, calc((100vw - 1460px) / 2));
    font-size: 0.78rem;
}

.error-shell {
    width: min(100% - 32px, 650px);
    margin: auto;
    border: 1px solid var(--line);
    border-top: 6px solid var(--red);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 34px;
    box-shadow: var(--shadow);
}

.installer-shell {
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
    padding: 50px 0 64px;
}

.installer-header {
    max-width: 740px;
    margin-bottom: 28px;
}

.installer-header > p:last-child {
    color: var(--muted);
    font-size: 1.08rem;
}

.requirements-panel,
.installer-form,
.setup-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 24px;
    box-shadow: var(--shadow);
}

.requirements-panel {
    margin-bottom: 20px;
}

.requirements-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px 24px;
}

.requirement-row {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid var(--line);
}

.status {
    flex: 0 0 auto;
}

.status--ok {
    color: var(--green);
}

.status--bad {
    color: var(--red);
}

.installer-form {
    display: grid;
    gap: 22px;
}

.installer-form input {
    margin-bottom: 13px;
}

.account-grid,
.setup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.setup-card h3 {
    margin-top: 24px;
}

.secret-code,
.uri-code {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--blue-50);
    padding: 10px;
}

.secret-code {
    color: var(--navy-950);
    font-size: 1.05rem;
    font-weight: 800;
}

.uri-code {
    margin-top: 9px;
    font-size: 0.74rem;
}

.recovery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.recovery-grid code {
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #f8f9fa;
    padding: 7px;
    text-align: center;
}

.installer-finish {
    margin-top: 26px;
    text-align: center;
}

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .topbar {
        grid-template-columns: auto 1fr;
        gap: 8px 18px;
    }

    .main-nav {
        justify-self: end;
    }

    .account-area {
        grid-column: 1 / -1;
        justify-content: flex-end;
        border-top: 1px solid var(--line);
        padding-top: 7px;
    }

    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trash-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .app-shell,
    .installer-shell {
        width: min(100% - 24px, 1180px);
        padding-top: 24px;
    }

    .topbar {
        position: static;
        grid-template-columns: 1fr;
        padding: 11px 12px;
    }

    .brand {
        justify-self: start;
    }

    .main-nav {
        width: 100%;
        justify-self: stretch;
        overflow-x: auto;
        border-top: 1px solid var(--line);
    }

    .account-area {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .account-name {
        display: none;
    }

    .page-heading,
    .list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .metrics,
    .account-grid,
    .setup-grid,
    .requirements-list {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 84px;
    }

    .composer,
    .form-panel,
    .auth-panel,
    .requirements-panel,
    .installer-form,
    .setup-card {
        padding: 18px;
    }

    .composer-controls,
    .form-panel .form-row {
        grid-template-columns: 1fr;
    }

    .composer-controls .button {
        width: 100%;
    }

    .search-form {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .task-row {
        padding: 14px;
    }

    .task-header {
        flex-direction: column;
        gap: 7px;
    }

    .task-meta {
        justify-content: flex-start;
    }

    .task-actions .button,
    .task-actions form {
        flex: 1 1 130px;
    }

    .task-actions form .button {
        width: 100%;
    }

    .reply-form {
        grid-template-columns: 1fr;
    }

    .audit-entries div {
        flex-direction: column;
        gap: 0;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }
}

@media (max-width: 420px) {
    .metrics {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        width: calc(100% - 20px);
    }

    .recovery-grid {
        grid-template-columns: 1fr;
    }

    .button {
        overflow-wrap: anywhere;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

@media print {
    body {
        background: #ffffff;
    }

    .installer-header,
    .installer-finish,
    .notice {
        display: none;
    }

    .setup-grid {
        grid-template-columns: 1fr 1fr;
    }

    .setup-card {
        box-shadow: none;
        break-inside: avoid;
    }
}

@media (max-width: 1100px) {
    .dashboard-columns,
    .admin-columns {
        grid-template-columns: 1fr;
    }

    .recipe-panel {
        position: static;
        border-top: 4px solid var(--green);
        border-left: 0;
        padding-top: 20px;
        padding-left: 0;
    }
}