:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #667085;
    --line: #d9dee7;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --success-bg: #ecfdf3;
    --success: #067647;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

p { 
  margin-top: 1px;
}

body.is-test-environment {
    padding-top: 24px;
}

body.is-test-environment::before {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    height: 24px;
    background: #9ca3af;
}

a {
    color: inherit;
}

button,
input,
textarea {
    font: inherit;
}

button {
    min-height: 42px;
    border: 0;
    border-radius: 6px;
    padding: 0 16px;
    border: 1px solid var(--line);
    background: #fff;
    color: #333;
    font-weight: 500;
    cursor: pointer;
}

button:hover {
    background: #eef2f6;
}

button.secondary {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
}

button.secondary:hover {
    background: #eef2f6;
}

button.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

button.danger:hover {
    background: #fee4e2;
}

label {
    display: grid;
    gap: 6px;
    color: #344054;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(15, 118, 110, 0.16);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.auth-panel {
    width: min(100%, 420px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 28px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
}

.auth-panel h1,
.topbar h1 {
    margin: 0;
    line-height: 1.1;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.eyebrow a {
    color: inherit;
    text-decoration: none;
}

.eyebrow a:hover {
    text-decoration: underline;
}

.muted,
.empty {
    color: var(--muted);
}

.stack {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--panel);
    padding: 18px clamp(16px, 4vw, 40px);
}

.floating-logout {
    display: flex;
    justify-content: flex-end;
    padding: 24px clamp(16px, 4vw, 40px);
}

.admin-back-arrow {
    position: fixed;
    left: 16px;
    z-index: 20;
    color: #c7c7c7;
    font-size: 1.45rem;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
}

.admin-back-arrow:hover,
.admin-back-arrow:focus-visible {
    color: #9a9a9a;
    outline: none;
}

.admin-back-arrow-bottom {
    bottom: 16px;
}

.todo-back-link {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: #fff;
    color: #c7c7c7;
    font-size: 1.45rem;
    font-weight: 400;
    line-height: 1;
    padding: 13px;
    text-decoration: none;
}

.todo-back-link:hover,
.todo-back-link:focus-visible {
    color: #9a9a9a;
    outline: none;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    min-height: calc(100vh - 85px);
}

.dashboard-actions {
    display: flex;
    justify-content: flex-end;
    padding: 18px clamp(16px, 4vw, 42px) 24px;
}

.dashboard {
    min-height: calc(100vh - 60px);
    background: #fff;
    color: #0b0620;
    padding: 32px 16px 56px;
}

.dashboard-hero {
    margin: 0 auto;
    max-width: 760px;
    text-align: center;
}

.dashboard-hero h1 {
    margin: 0 0 8px;
    color: #0b0620;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 820;
    line-height: 1;
}

.dashboard-hero p {
    margin: 0;
    color: #5a5a5a;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
}

.dashboard-list {
    display: grid;
    gap: 14px;
    margin: 28px auto 0;
    max-width: 760px;
}

.dashboard-recurring-todos {
    display: grid;
    gap: 12px;
    margin: 28px auto 0;
    max-width: 760px;
}

.dashboard-recurring-todos h2 {
    margin: 0;
    color: #999;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

.dashboard-card {
    display: block;
    min-height: 0;
    border: 1px solid #dad0ec;
    border-radius: 8px;
    background: var(--panel);
    color: #0b0620;
    padding: 20px;
    text-decoration: none;
    transition: border-color 120ms ease, background 120ms ease;
}

.dashboard-card:hover {
    border-color: rgba(56, 29, 146, 0.45);
    background: #f7f5fb;
}

.dashboard-card.inactive {
    cursor: default;
}

.dashboard-card.inactive:hover {
    border-color: #dad0ec;
    background: var(--panel);
}

.dashboard-card strong {
    display: block;
    margin-bottom: 8px;
    margin-bottom: 2px;
    color: #0b0620;
    font-size: 1.25rem;
    font-weight: 820;
    line-height: 1.15;
}

.dashboard-card span {
    color: #381d92;
    color: #666;
    font-size: 1rem;
    font-weight: 390;
    line-height: 1.5;
    margin-left: 1px;
}
.dashboard-card:nth-child(2) span,
.dashboard-card:nth-child(6) span,
.dashboard-card:nth-child(7) span {
  margin-left: 0;
}

.static-page {
    min-height: calc(100vh - 85px);
    background: #fff;
    color: #0b0620;
    padding: clamp(48px, 10vh, 120px) 16px 64px;
}

.static-content {
    width: min(100%, 920px);
    margin: 0 auto;
}

.static-content h2 {
    margin: 42px 0 12px;
    color: #999;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.1;
    text-transform: uppercase;
}

.static-content h2:first-child {
    margin-top: 0;
}

.static-content p,
.static-content li {
    color: #0b0620;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 300;
    line-height: 1.55;
}

.static-content ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 1.35rem;
}

.static-content li::marker {
    color: #c7c7c7;
}

.static-content code {
    font-size: 0.95em;
}

.capital-grid,
.capital-faq {
    display: grid;
    gap: 14px;
}

.capital-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.capital-card,
.capital-block,
.capital-faq article {
    border: 1px solid #e8e4f2;
    border-radius: 8px;
    background: #fbfafc;
    padding: 16px;
}

.capital-card h3,
.capital-block h3,
.capital-faq h3 {
    margin: 0 0 8px;
    color: #0b0620;
    font-size: 1.05rem;
    font-weight: 700;
}

.capital-card p,
.capital-block p,
.capital-faq p {
    margin: 0;
}

.capital-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    font-size: 0.98rem;
}

.capital-table th,
.capital-table td {
    border-bottom: 1px solid #e8e4f2;
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

.capital-table th {
    color: #666;
    font-weight: 700;
}

.team-list {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.team-intro {
    text-align: center;
}

.team-member {
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 20px;
    align-items: start;
    border: 1px solid #e8e4f2;
    border-radius: 8px;
    background: #fff;
    padding: 18px;
}

.team-member-photo {
    display: block;
    width: 128px;
    aspect-ratio: 1;
    border-radius: 8px;
    background: #f3f4f6;
    object-fit: cover;
}

.team-photo-dropzone {
    width: 128px;
    border-radius: 8px;
}

.team-photo-dropzone.can-upload {
    cursor: pointer;
    outline: 2px dashed transparent;
    outline-offset: 5px;
    transition: outline-color 120ms ease, opacity 120ms ease;
}

.team-photo-dropzone.can-upload:hover,
.team-photo-dropzone.is-dragging {
    outline-color: #c7c7c7;
}

.team-photo-dropzone.is-uploading {
    opacity: 0.55;
}

.team-photo-dropzone input {
    display: none;
}

.team-member-content h3 {
    margin: 0 0 12px;
    color: #0b0620;
    font-size: 2em;
    font-weight: 300;
    line-height: 1.2;
    text-transform: uppercase;
}

.team-member-content dl {
    display: grid;
    gap: 11px;
    margin: 0 0 14px;
}

.team-member-content dl div {
    display: grid;
    gap: 1px;
}

.team-member-content dt {
    color: #999;
    font-weight: 400;
    line-height: 1;
}

.team-member-content dd {
    margin: 0;
    color: #333;
    font-size: 2em;
    font-weight: 300;
    line-height: 1;
}

.team-member-content dd a,
.team-member-content dd a:visited {
    color: #333;
    text-decoration: none;
}

.team-member-content dd a:hover {
    text-decoration: underline;
}

.team-member-content p a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.list-pane {
    border-right: 1px solid var(--line);
    background: #fbfcfd;
    padding: 18px;
}

.editor-pane {
    padding: clamp(18px, 4vw, 40px);
}

.search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.new-link {
    display: inline-flex;
    margin: 14px 0;
    color: var(--accent-dark);
    font-weight: 800;
    text-decoration: none;
}

.reference-list {
    display: grid;
    gap: 8px;
}

.reference-item {
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 12px;
    text-decoration: none;
}

.reference-item a {
    display: grid;
    gap: 3px;
    text-decoration: none;
}

.reference-item.active {
    border-color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}

.reference-item span,
.reference-item small {
    color: var(--muted);
}

.editor-form {
    display: grid;
    gap: 16px;
    max-width: 980px;
}

.body-field textarea {
    min-height: 440px;
}

.todo-list-item {
    gap: 10px;
}

.todo-order {
    display: flex;
    gap: 6px;
}

button.compact {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.85rem;
}

button.icon-button {
    width: 34px;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

.todo-page {
    min-height: calc(100vh - 85px);
    background: #fff;
    color: #0b0620;
    padding: clamp(48px, 10vh, 120px) 16px 64px;
}

.todo-document,
.todo-editor {
    width: min(100%, 920px);
    margin: 0 auto;
}

.todo-document {
    display: grid;
    gap: 18px;
}

.todo-document-actions {
    display: flex;
    justify-content: flex-start;
}

.todo-add-link {
    color: var(--accent);
    font-weight: 820;
    text-decoration: none;
}

.todo-add-link:hover {
    text-decoration: underline;
}

.todo-editor h2 {
    margin: 0;
    color: #999;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.1;
    text-transform: uppercase;
}

.todo-bullet-list {
    display: grid;
    gap: 12px;
    margin: 0;
    min-height: 28px;
    padding-left: 1.35rem;
    list-style: disc;
}

.todo-later-panel {
    margin-top: 44px;
}

.todo-later-panel > summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #999;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.1;
    list-style: none;
    text-transform: uppercase;
}

.todo-later-panel > summary::-webkit-details-marker {
    display: none;
}

.todo-later-panel > summary small {
    color: #c7c7c7;
    font-size: 0.9rem;
    font-weight: 400;
}

.todo-bullet-list-later {
    margin-top: 22px;
}

.todo-bullet {
    color: #0b0620;
    cursor: grab;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 300;
    line-height: 1.45;
}

.todo-bullet::marker {
    color: #c7c7c7;
}

.todo-bullet[draggable="false"] {
    cursor: default;
}

.todo-bullet.is-dragging {
    cursor: grabbing;
    opacity: 0.45;
}

.todo-bullet.is-editing {
    cursor: default;
}

.todo-bullet.is-file-drag-over > details {
    outline: 2px dashed var(--accent);
    outline-offset: 8px;
    border-radius: 8px;
    background: #f7f5fb;
}

.todo-bullet.is-uploading-images {
    cursor: progress;
    opacity: 0.72;
}

.todo-bullet summary {
    cursor: pointer;
    list-style: none;
}

.todo-bullet[draggable="true"] summary {
    cursor: grab;
}

.todo-bullet[draggable="true"].is-dragging summary {
    cursor: grabbing;
}

.todo-bullet summary::-webkit-details-marker {
    display: none;
}

.todo-bullet summary span {
    color: inherit;
}

.recurring-todos-section {
    display: grid;
    gap: 12px;
    margin-top: 44px;
}

.recurring-todos-section h2 {
    margin: 0;
    color: #999;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.1;
    text-transform: uppercase;
}

.recurring-todo-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.recurring-todo-item {
    border: 1px solid #dad0ec;
    border-radius: 8px;
    background: #fff;
}

.recurring-todo-item.is-completed {
    border-color: #d0e6dc;
    background: #f7fffb;
}

.recurring-todo-form {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.recurring-todo-check {
    display: flex;
    grid-template-columns: none;
    align-items: flex-start;
    gap: 10px;
    color: inherit;
    font-weight: 400;
}

.recurring-todo-check input {
    width: auto;
    margin-top: 4px;
    accent-color: var(--accent);
}

.recurring-todo-check strong {
    display: block;
    color: #0b0620;
    font-size: 1.05rem;
    font-weight: 820;
    line-height: 1.3;
}

.recurring-todo-check small,
.recurring-todo-status {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.recurring-todo-form p {
    margin: 0 0 0 28px;
    color: #5a5a5a;
    font-size: 0.95rem;
}

.recurring-todo-status {
    margin-left: 28px;
    color: var(--success);
}

.recurring-todo-status[hidden] {
    display: none;
}

.todo-notes {
    margin-top: 10px;
    border: 1px solid #e8e4f2;
    border-radius: 8px;
    background: #f7f5fb;
    color: #5a5a5a;
    padding: 12px;
    font-size: 1rem;
    font-weight: 400;
    white-space: normal;
    overflow-wrap: anywhere;
}

.todo-inline-edit-form {
    display: grid;
    gap: 12px;
    border: 1px solid #e8e4f2;
    border-radius: 8px;
    background: #f7f5fb;
    padding: 14px;
}

.todo-inline-edit-form label {
    font-size: 0.95rem;
}

.todo-inline-edit-form textarea {
    min-height: 130px;
}

.todo-bullet .todo-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.todo-bullet .todo-images img {
    display: block;
    width: 120px;
    height: 120px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
}

.todo-inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.todo-edit-link,
.secondary-link {
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 780;
    text-decoration: none;
}

.todo-edit-link:hover,
.secondary-link:hover {
    text-decoration: underline;
}

.todo-editor {
    margin-top: 72px;
    border-top: 1px solid #eee8f7;
    padding-top: 28px;
}

.todo-editor.empty-list {
    margin-top: 28px;
}

.database-todo-form {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.database-todo-form textarea {
    min-height: 150px;
}

.todo-dropzone {
    display: grid;
    place-items: center;
    min-height: 96px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f7f5fb;
    color: var(--muted);
    padding: 14px;
    text-align: center;
}

.todo-dropzone input {
    max-width: 320px;
}

.todo-dropzone:hover,
.todo-dropzone.dragging {
    border-color: var(--accent);
    background: #f0eafa;
}

.todo-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.todo-image {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 8px;
    font-weight: 600;
}

.todo-image img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    object-fit: cover;
}

.todo-image span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.todo-image input {
    width: auto;
}

.dropzone {
    display: grid;
    place-items: center;
    min-height: 130px;
    border: 2px dashed var(--line);
    border-radius: 8px;
    background: #fbfcfd;
    padding: 18px;
    text-align: center;
}

.dropzone input {
    max-width: 320px;
}

.dropzone small {
    color: var(--muted);
    font-weight: 600;
}

.dropzone:hover,
.dropzone.dragging {
    border-color: var(--accent);
    background: #f0fdfa;
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.notice {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
    font-weight: 700;
}

.notice.success {
    background: var(--success-bg);
    color: var(--success);
}

.notice.error {
    background: var(--danger-bg);
    color: var(--danger);
}

.migration-content {
    width: min(100%, 1080px);
}

.migration-content h1 {
    max-width: 860px;
}

.migration-checklist {
    display: grid;
    gap: 8px;
    list-style: none;
    padding-left: 0;
}

.migration-checklist li {
    border-left: 3px solid var(--accent);
    background: #f8fafc;
    padding: 9px 12px;
}

.migration-prompt {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 16px;
}

.migration-prompt pre {
    overflow-x: auto;
    margin: 12px 0 0;
    border-radius: 6px;
    background: #111827;
    color: #f9fafb;
    padding: 16px;
    white-space: pre-wrap;
}

.migration-prompt code {
    color: inherit;
    font-size: 0.9rem;
}

.keyboard-shortcuts {
    border-top: 1px solid var(--line);
    margin-top: 36px;
    padding-top: 18px;
}

.keyboard-shortcuts h2 {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.92rem;
    text-transform: uppercase;
}

.keyboard-shortcuts dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.keyboard-shortcuts dl div {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, max-content) 1fr;
}

.keyboard-shortcuts dt,
.keyboard-shortcuts dd {
    margin: 0;
}

.keyboard-shortcuts dd {
    color: var(--muted);
}

.keyboard-shortcuts kbd {
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #fff;
    color: var(--text);
    display: inline-block;
    font: 0.86rem ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    padding: 2px 6px;
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .list-pane {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .search {
        grid-template-columns: 1fr;
    }

    .dashboard {
        padding: 24px 16px 40px;
    }

    .dashboard-actions {
        padding: 14px 14px 20px;
    }

    .team-member {
        grid-template-columns: 1fr;
    }

    .team-member-content dl div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .keyboard-shortcuts dl div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

}
