:root {
    color-scheme: light;
    --bg: #f4f6f2;
    --surface: #ffffff;
    --ink: #17201b;
    --muted: #66706a;
    --line: #dbe2da;
    --primary: #176c54;
    --primary-ink: #ffffff;
    --danger: #a33a30;
    --warn: #946200;
    --shadow: 0 16px 48px rgba(23, 32, 27, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

.topbar {
    display: flex;
    gap: 24px;
    align-items: end;
    justify-content: space-between;
    padding: 28px clamp(16px, 4vw, 48px) 18px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 18px;
    font-size: 22px;
}

h3 {
    margin-bottom: 0;
    font-size: 19px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 10px;
    min-width: min(520px, 100%);
}

.stats div {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.68);
}

.stats span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
}

.stats strong {
    font-size: 20px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 24px;
    padding: 24px clamp(16px, 4vw, 48px) 48px;
}

.panel,
.task-card,
.empty {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.create-panel {
    position: sticky;
    top: 18px;
    align-self: start;
    padding: 20px;
}

.create-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.create-head h2 {
    margin-bottom: 0;
}

.create-body {
    margin-top: 18px;
}

.create-panel.is-collapsed .create-body {
    display: none;
}

.icon-toggle {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 1px solid #bfd0c7;
    border-radius: 999px;
    background: #e6f3ed;
    color: var(--primary);
    cursor: pointer;
}

.icon-toggle span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: translate(-50%, -65%) rotate(45deg);
    transition: transform 0.16s ease;
}

.icon-toggle[aria-expanded="true"] span {
    transform: translate(-50%, -35%) rotate(225deg);
}

.icon-toggle:focus-visible {
    outline: 3px solid rgba(23, 108, 84, 0.22);
    outline-offset: 3px;
}

.form,
.mini-form {
    display: grid;
    gap: 12px;
}

label,
.mini-form {
    min-width: 0;
}

label span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd4cc;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 11px 12px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 108, 84, 0.14);
}

.price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid #b7c2bb;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
}

.button.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-ink);
}

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

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

.notice.success {
    background: #e6f3ed;
    color: #145541;
}

.notice.error {
    background: #f8e7e4;
    color: #842a22;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section-head h2 {
    margin-bottom: 0;
}

.section-head span {
    color: var(--muted);
    font-weight: 700;
}

.task-list {
    display: grid;
    gap: 14px;
}

.task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 18px;
    padding: 18px;
}

.task-title-row,
.meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.task-title-row {
    justify-content: space-between;
    margin-bottom: 10px;
}

.description {
    color: #334039;
    line-height: 1.55;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.badge.muted {
    background: #eef0ed;
    color: #56615b;
}

.badge.ready {
    background: #dff4e9;
    color: #145541;
}

.badge.work {
    background: #e4eef9;
    color: #1f527f;
}

.badge.warn {
    background: #fff0c9;
    color: var(--warn);
}

.badge.danger {
    background: #f8e7e4;
    color: var(--danger);
}

.badge.done {
    background: #dcefe0;
    color: #255c31;
}

.meta-row {
    margin: 14px 0;
    color: var(--muted);
    font-size: 14px;
}

.meta-row strong {
    color: var(--ink);
    font-size: 18px;
}

.photos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.photos a {
    display: block;
    width: 132px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef0ed;
    cursor: zoom-in;
}

.photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-open {
    overflow: hidden;
}

.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(12, 18, 15, 0.82);
}

.photo-modal[hidden] {
    display: none;
}

.photo-modal img {
    max-width: min(1120px, 96vw);
    max-height: 88vh;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
    object-fit: contain;
}

.photo-modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.photo-modal-close:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.55);
    outline-offset: 3px;
}

.report-note {
    margin-top: 14px;
    border-left: 3px solid var(--primary);
    padding-left: 12px;
}

.report-note span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.report-note p {
    margin-bottom: 0;
    line-height: 1.5;
}

.task-actions {
    display: grid;
    align-content: start;
    gap: 10px;
}

details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

summary {
    padding: 11px 12px;
    font-weight: 800;
    cursor: pointer;
}

details[open] {
    padding-bottom: 12px;
}

details[open] summary {
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}

.mini-form {
    padding: 0 12px 12px;
}

.mini-form + .mini-form {
    padding-top: 0;
}

.empty {
    display: grid;
    gap: 6px;
    padding: 24px;
    color: var(--muted);
}

.empty strong {
    color: var(--ink);
}

@media (max-width: 980px) {
    .topbar {
        display: grid;
        align-items: start;
    }

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

    .create-panel {
        position: static;
    }
}

@media (max-width: 720px) {
    .topbar,
    .layout {
        padding-left: 14px;
        padding-right: 14px;
    }

    .stats,
    .price-grid,
    .task-card {
        grid-template-columns: 1fr;
    }

    .task-card {
        padding: 14px;
    }

    .photos a {
        width: calc(50% - 5px);
    }
}
