/*
 * Cheer up 清掃報告 — 画面のデザイン
 *
 * 方針: 清潔感のある青緑（ティール）を基調に、「Cheer up」の明るさをオレンジの差し色で表す。
 * 角は丸く、枠線より淡い影で区切り、やわらかい印象にする。
 * 色・余白・角丸などは下の変数（:root）でまとめて調整できる。
 */

/* ================================================================ 基本の値 */
:root {
    --primary: #0f7c86;
    --primary-600: #0b6770;
    --primary-700: #084f56;
    --primary-50: #e9f6f5;
    --primary-100: #d3eeec;
    --accent: #f6a623;
    --accent-50: #fff5e3;
    --accent-700: #8a5500;

    --bg: #f2f7f6;
    --card: #ffffff;
    --text: #1d2b2f;
    --muted: #5d6f73;
    --line: #dde8e6;
    --line-strong: #c3d3d1;

    --danger: #c0392b;
    --danger-50: #fdeeec;
    --ok: #1b7f4b;
    --ok-50: #e6f5ec;
    --warn-50: #fff6e0;
    --warn-700: #7a5200;

    --before: #f3eee6;
    --before-text: #6b5638;
    --after: #dcf2ee;
    --after-text: #0d6454;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 60, 66, .06);
    --shadow: 0 1px 2px rgba(15, 60, 66, .05), 0 6px 20px rgba(15, 60, 66, .07);
    --shadow-lg: 0 10px 40px rgba(15, 60, 66, .18);
    --focus: 0 0 0 3px rgba(15, 124, 134, .28);

    --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic UI", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        radial-gradient(1200px 400px at 100% -120px, rgba(246, 166, 35, .10), transparent 60%),
        radial-gradient(900px 380px at -10% -80px, rgba(15, 124, 134, .12), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: .02em;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-700); }

h1, h2, h3 { font-weight: 700; letter-spacing: .03em; line-height: 1.4; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 16px; }
strong, b { font-weight: 700; }

.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.inactive { opacity: .55; }
.grow { flex: 1; min-width: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ================================================================ ヘッダー・メニュー */
.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 10px 20px;
    background: linear-gradient(115deg, var(--primary-700) 0%, var(--primary) 55%, #19a39a 100%);
    color: #fff;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.brand-mark .i { width: 22px; height: 22px; stroke-width: 2; }
.brand-text { font-size: 18px; font-weight: 700; letter-spacing: .04em; }
.brand-text small { font-size: 13px; font-weight: 500; opacity: .9; margin-left: 2px; }
.env-badge { background: rgba(255, 255, 255, .18); color: #fff; font-size: 12px; border-radius: 999px; padding: 1px 10px; border: 1px solid rgba(255, 255, 255, .35); }

.user-menu { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 14px; }
.user-menu form { margin: 0; }
.user-name { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; }
.avatar {
    display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255, 255, 255, .95); color: var(--primary-700);
    font-size: 13px; font-weight: 700;
}
.role { font-size: 11px; background: var(--accent); color: #3d2600; border-radius: 999px; padding: 0 8px; margin-left: 2px; }
.header-link, .link-button {
    display: inline-flex; align-items: center; gap: 5px;
    color: #fff; text-decoration: none; font: inherit; font-size: 14px;
    background: rgba(255, 255, 255, .12); border: 0; border-radius: 999px;
    padding: 5px 12px; cursor: pointer;
}
.header-link:hover, .link-button:hover { background: rgba(255, 255, 255, .24); color: #fff; }

.main-nav { background: rgba(255, 255, 255, .85); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.main-nav-inner { max-width: 1440px; margin: 0 auto; display: flex; gap: 4px; padding: 8px 16px; overflow-x: auto; scrollbar-width: none; }
.main-nav-inner::-webkit-scrollbar { display: none; }
.main-nav a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px;
    text-decoration: none; color: var(--muted); white-space: nowrap; font-size: 15px;
    transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--primary-50); color: var(--primary-700); }
.main-nav a.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(15, 124, 134, .3); }

/* ================================================================ 本文・カード */
.container { max-width: 1440px; margin: 0 auto; padding: 20px 16px 48px; }
.page-1col { max-width: 1000px; margin: 0 auto; }
.narrow { max-width: 540px; margin-left: auto; margin-right: auto; }

.card {
    background: var(--card);
    border: 1px solid rgba(221, 232, 230, .7);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h1 { margin: 0; }

.title-with-icon { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.title-with-icon .small { font-weight: 500; }
.title-icon {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px; border-radius: 11px;
    background: var(--primary); color: #fff; flex: none;
}
.title-icon .i { width: 19px; height: 19px; }
.title-icon.soft { background: var(--primary-50); color: var(--primary); }
.title-icon.warn { background: var(--danger-50); color: var(--danger); }

.crumb { margin: 0 0 6px; font-size: 14px; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.report-date { margin: 0 0 6px; font-size: 17px; }

.flash {
    display: flex; align-items: center; gap: 10px;
    background: var(--ok-50); border: 1px solid #b7e2c8; color: var(--ok);
    border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    animation: flash-in .35s ease-out;
}
.flash .i { width: 20px; height: 20px; stroke-width: 2.4; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.notice { background: var(--ok-50); border: 1px solid #b7e2c8; border-radius: var(--radius-sm); padding: 8px 12px; margin: 0 0 10px; }
.hint { margin: -6px 0 10px; font-size: 14px; }
.hint-below { margin: 12px 0 0; font-size: 14px; }
.error-box { background: var(--danger-50); border: 1px solid #f3c4bf; color: #7a271a; border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 12px; }
.error-box p { margin: 0 0 6px; }
.conflict-text { white-space: pre-wrap; background: #fff; border: 1px solid #f3c4bf; border-radius: 8px; padding: 8px; margin: 0; font: inherit; color: var(--text); }

/* ================================================================ ボタン */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 8px 18px;
    border: 1px solid var(--line-strong); border-radius: 12px;
    background: #fff; color: var(--text);
    font: inherit; font-weight: 700; font-size: 15px;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
}
.btn:hover { background: var(--primary-50); border-color: #a9d6d2; color: var(--primary-700); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary {
    background: linear-gradient(180deg, #13909b, var(--primary));
    border-color: var(--primary-600); color: #fff;
    box-shadow: 0 2px 8px rgba(15, 124, 134, .28);
}
.btn.primary:hover { background: linear-gradient(180deg, var(--primary), var(--primary-600)); color: #fff; }
.btn.danger { color: var(--danger); border-color: #efc2bd; background: #fff; }
.btn.danger:hover { background: var(--danger-50); color: #a52a1c; }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: 14px; border-radius: 10px; }
.btn.icon { min-height: 36px; min-width: 38px; padding: 4px 8px; border-radius: 10px; font-weight: 500; }
.btn-block { width: 100%; }
.btn:focus-visible, .btn:focus-within, a:focus-visible { outline: none; box-shadow: var(--focus); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ================================================================ フォーム */
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="search"], input[type="tel"], input[type="date"], select, textarea {
    font: inherit;
    font-weight: 500;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fbfdfd;
    color: var(--text);
    min-height: 44px;
    width: 100%;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); background: #fff; }
select { max-width: 100%; }
textarea { line-height: 1.6; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

.form-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.form-grid > * { min-width: 0; }
.form-grid label, .stack label, .search-form label { display: grid; gap: 5px; font-weight: 700; font-size: 15px; }
.stack { display: grid; gap: 14px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { flex: 1; min-width: 0; }
.inline-form label.grow { display: flex; align-items: center; gap: 8px; }
.inline-form:has(.carry-options) { flex-wrap: wrap; }
@media (min-width: 720px) {
    .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
    .form-grid .wide { grid-column: 1 / -1; }
}
.stack label.check-line, .form-grid label.check-line, .check-line { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check-line input { width: 20px; height: 20px; margin: 0; }
.remember-note { margin: -8px 0 0; }
.carry-options { flex: 1 1 100%; display: grid; gap: 4px; padding: 10px 12px; background: var(--primary-50); border-radius: var(--radius-sm); }
.carry-options .check-line { font-size: 14px; }
.carry-options input { width: 18px; height: 18px; }

.search-form { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) {
    .search-form { grid-template-columns: repeat(4, 1fr); align-items: end; }
    .search-form .actions { grid-column: 1 / -1; }
}

dl.info { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 16px; }
dl.info dt { font-weight: 700; color: var(--muted); }
dl.info dd { margin: 0; }

/* ================================================================ ログイン画面 */
.auth-page .site-header { display: none; }
.auth-page { background: linear-gradient(160deg, #e3f4f2 0%, #f6fbfa 45%, #fff4e1 100%); min-height: 100vh; }
.auth-wrap { max-width: 440px; margin: 7vh auto 40px; }
.auth-hero { text-align: center; margin-bottom: 18px; }
.auth-mark {
    display: inline-grid; place-items: center;
    width: 64px; height: 64px; border-radius: 20px;
    background: linear-gradient(140deg, var(--accent), #f7c35c);
    color: #fff; box-shadow: 0 8px 24px rgba(246, 166, 35, .35);
}
.auth-mark .i { width: 36px; height: 36px; stroke-width: 2; }
.auth-title { font-size: 24px; font-weight: 700; margin: 12px 0 2px; color: var(--primary-700); letter-spacing: .06em; }
.auth-lead { margin: 0; color: var(--muted); }
.auth-card { padding: 26px; box-shadow: var(--shadow-lg); }
.auth-foot { margin: 16px 0 0; text-align: center; }

/* ================================================================ 報告書一覧 */
.report-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.report-list a {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 12px; border-radius: 14px;
    text-decoration: none; color: var(--text);
    border: 1px solid transparent;
    transition: background .15s, border-color .15s, transform .15s;
}
.report-list a:hover { background: var(--primary-50); border-color: var(--primary-100); }
.report-list a:hover .chev { transform: translateX(3px); color: var(--primary); }
.date-badge {
    flex: none; display: grid; justify-items: center; width: 56px;
    border-radius: 12px; overflow: hidden; background: #fff;
    border: 1px solid var(--line); box-shadow: var(--shadow-sm); line-height: 1.15;
}
.date-badge .m { width: 100%; text-align: center; background: var(--primary); color: #fff; font-size: 12px; padding: 2px 0; }
.date-badge .d { font-size: 22px; font-weight: 700; padding-top: 3px; }
.date-badge .w { font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.report-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.report-main .name { font-weight: 700; font-size: 16px; }
.report-main .sub { font-size: 14px; color: var(--muted); }
.report-main .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 13px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-50); color: var(--primary-700); border-radius: 999px; padding: 0 10px; }
.chev { color: var(--line-strong); transition: transform .15s, color .15s; }

.list-summary { color: var(--muted); font-size: 14px; margin: -4px 0 10px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; }
.pager .current { background: var(--primary); border-color: var(--primary); color: #fff; cursor: default; }
.pager-gap { color: var(--muted); padding: 0 4px; }

/* ================================================================ 報告書: 上部 */
.progress-box { margin: 8px 0 14px; padding: 12px 14px; background: var(--primary-50); border-radius: var(--radius-sm); }
.progress-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 14px; margin-bottom: 8px; }
.progress-bar { height: 10px; background: #fff; border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06); }
.progress-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #2bb3a3); transition: width .4s ease; }
.pdf-form { align-items: center; }
.pdf-form label { display: flex; align-items: center; gap: 8px; width: 100%; font-weight: 700; }
.pdf-form select { width: auto; min-height: 40px; }
.sub-heading { display: flex; align-items: center; gap: 6px; font-size: 16px; margin: 20px 0 6px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.phrase-select { width: auto; max-width: 100%; min-height: 38px; font-size: 14px; min-width: 0; flex: 1 1 200px; background: var(--accent-50); border-color: #f1d9a8; }

/* ================================================================ 撮影箇所・写真 */
.loc-head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
    padding-bottom: 10px; margin-bottom: 14px;
    border-bottom: 2px solid var(--primary-100);
}
.loc-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.loc-head h2::before { content: ""; width: 6px; height: 20px; border-radius: 3px; background: var(--primary); }
.loc-status { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 10px; }
.loc-status.done { background: var(--ok-50); color: var(--ok); }
.loc-status.partial { background: var(--warn-50); color: var(--warn-700); }
.loc-status.empty { background: #eef2f2; color: var(--muted); }
.tools, .item-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tools form, .item-tools form { margin: 0; }
details.rename { position: relative; }
details.rename summary { list-style: none; }
details.rename summary::-webkit-details-marker { display: none; }
details.rename[open] .inline-form {
    position: absolute; right: 0; top: 44px; z-index: 5;
    width: min(320px, 80vw);
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 10px; box-shadow: var(--shadow-lg);
}

.item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; background: #fcfefe; }
.item .slots { display: flex; gap: 8px; align-items: stretch; }
.item .arrow {
    align-self: center; display: grid; place-items: center; flex: none;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--primary-50); color: var(--primary); font-size: 11px;
}
.item-single .slots .slot { max-width: 50%; }
.item-tools { justify-content: flex-end; margin-top: 10px; }
.item-tools .kind { margin-right: auto; color: var(--muted); font-size: 13px; }

.slot { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.slot-label { text-align: center; font-weight: 700; font-size: 13px; letter-spacing: .08em; border-radius: 999px; padding: 2px 0; background: var(--before); color: var(--before-text); }
.slot-label.after { background: var(--after); color: var(--after-text); }
.slot-label.single { background: #eef2f2; color: var(--muted); }
.slot-body {
    aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: repeating-linear-gradient(45deg, #f3f7f7, #f3f7f7 10px, #eef4f4 10px, #eef4f4 20px);
    border: 1px dashed var(--line-strong);
}
.slot-body:has(img) { border-style: solid; border-color: var(--line); background: #e9efef; }
.slot-body a { display: flex; width: 100%; height: 100%; cursor: zoom-in; }
.slot-body img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s; }
.slot-body a:hover img { transform: scale(1.03); }
.slot-body .empty { color: var(--muted); font-size: 14px; }
.slot-status { min-height: 1.4em; font-size: 13px; }
.slot-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-actions form { margin: 0; display: flex; flex: 1; }
.slot-actions .btn { flex: 1; }
.status-uploading { color: var(--primary); }
.status-done { color: var(--ok); }
.status-error { color: var(--danger); }
.status-error button { margin-left: 6px; }

.add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.add-row form { margin: 0; }
.bulk-status { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.bulk-status li { padding: 2px 0; }

.location.just-added { animation: just-added 2.5s ease-out; }
@keyframes just-added {
    0%, 40% { box-shadow: 0 0 0 4px rgba(246, 166, 35, .45); }
    100% { box-shadow: var(--shadow); }
}

.drag-handle { cursor: grab; color: var(--muted); display: none; letter-spacing: 0; }
.dragging { opacity: .45; outline: 2px dashed var(--primary); }
@media (hover: hover) and (pointer: fine) {
    .drag-handle { display: inline-flex; }
}

/* 指摘事項 */
.issues-card { border-color: #f6d3cf; background: linear-gradient(180deg, #fff8f7, #fff 120px); }
.issue { border: 1px solid #f3cdc8; border-radius: 14px; padding: 12px; margin-bottom: 14px; background: #fff; }
.issue .loc-head { border-bottom-color: #f6d3cf; }
.issue .loc-head h3 { margin: 0; font-size: 16px; color: #8f2a1f; }

/* ================================================================ チェック表 */
.checklist details > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.checklist details > summary::-webkit-details-marker { display: none; }
.checklist details > summary::before { content: "▶"; font-size: 11px; color: var(--muted); transition: transform .15s; }
.checklist details[open] > summary::before { transform: rotate(90deg); }
.summary-title { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; }
.summary-title .i { color: var(--primary); }
.summary-hint { color: var(--muted); font-size: 13px; }
.badge { font-size: 13px; font-weight: 700; border-radius: 999px; padding: 2px 12px; background: var(--ok-50); color: var(--ok); }
.badge.warn { background: var(--warn-50); color: var(--warn-700); }
.check-section { margin-top: 18px; }
.check-section h3 {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px;
    font-size: 15px; margin: 0 0 6px; padding: 6px 10px;
    background: var(--primary-50); color: var(--primary-700); border-radius: 10px;
}
.fill-buttons { display: flex; gap: 4px; }
.fill-buttons .btn.small { min-height: 30px; padding: 2px 10px; font-size: 13px; font-weight: 500; }
.check-items { margin: 0; padding: 0; list-style: none; }
.check-item { padding: 8px 2px; border-bottom: 1px solid #edf3f2; }
.check-item .label { display: block; margin-bottom: 4px; }
.check-item .no, .template-items .no { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.8em; }
.check-item .answer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px; min-width: 56px; padding: 4px 14px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    background: #fff; cursor: pointer; font-weight: 700;
    transition: background .15s, border-color .15s, color .15s;
}
.chip span:hover { border-color: var(--primary); }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(15, 124, 134, .3); }
.chip-clear input:checked + span { background: #eef2f2; border-color: var(--line-strong); color: var(--muted); box-shadow: none; font-weight: 500; }
.chip input:focus-visible + span { box-shadow: var(--focus); }
.answer-status { font-size: 13px; }
.issue-link { display: block; margin-top: 4px; }
.issue-link form { margin: 0; }
.issue-link[hidden] { display: none; }
.remarks-form { display: grid; gap: 6px; margin-top: 10px; grid-template-columns: minmax(0, 1fr); }
.remarks-form > * { min-width: 0; }
.remarks-form label { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.remarks-form .btn { justify-self: start; }
.remove-checklist { margin-top: 18px; }
@media (min-width: 720px) {
    .check-item { display: flex; align-items: center; gap: 12px; }
    .check-item .label { flex: 1; margin: 0; }
}

/* ================================================================ 一覧（物件・ひな形・表） */
.property-list { list-style: none; padding: 0; margin: 0; }
.property-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 6px; border-top: 1px solid var(--line); }
.property-list li:first-child { border-top: 0; }
.property-link { flex: 1; min-width: 200px; display: grid; text-decoration: none; color: var(--text); }
.property-link .name { font-weight: 700; }
.property-link .meta { color: var(--muted); font-size: 14px; }
.property-link:hover .name { color: var(--primary); }

.template-items { padding: 0; list-style: none; margin: 0 0 12px; }
.template-items li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid #edf3f2; }
.template-items li > form { flex: 1 1 calc(100% - 3em); }
.template-items li > .tools { margin-left: auto; }
.template-items li.inactive input { text-decoration: line-through; }
.stack-sm { flex-wrap: wrap; }
@media (min-width: 900px) {
    .template-items li > form { flex: 1 1 0; }
}

.list-table { width: 100%; border-collapse: collapse; }
.list-table th, .list-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.list-table thead th { font-size: 13px; color: var(--muted); font-weight: 700; }
.list-table tbody tr:hover { background: #f8fbfb; }
@media (max-width: 640px) {
    .list-table thead { display: none; }
    .list-table tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
    .list-table td { display: flex; gap: 8px; border: 0; padding: 2px 0; }
    .list-table td[data-label]::before { content: attr(data-label); color: var(--muted); min-width: 7em; }
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: linear-gradient(160deg, var(--primary-50), #fff); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat .label { display: block; color: var(--muted); font-size: 13px; }
.stat .value { display: block; font-size: 22px; font-weight: 700; color: var(--primary-700); }

.danger-zone { border-color: #f3cdc8; }

/* ================================================================ 操作履歴・ゴミ箱・実施状況・管理 */
.history summary { cursor: pointer; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.history summary .i { color: var(--primary); }
.history-list { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; }
.history-list li { display: grid; grid-template-columns: 6.5em 7em 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid #edf3f2; }
.history-list .when, .history-list .who { color: var(--muted); }
@media (max-width: 640px) {
    .history-list li { grid-template-columns: 1fr; gap: 0; }
}

.trash-list { list-style: none; padding: 0; margin: 0; }
.trash-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.trash-photos { display: flex; gap: 4px; min-width: 64px; }
.trash-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: #eee; }
.trash-info { flex: 1; min-width: 200px; display: grid; gap: 2px; }

.status-scroll { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
.status-table { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 14px; }
.status-table th, .status-table td { border-bottom: 1px solid var(--line); border-right: 1px solid #edf3f2; padding: 8px 6px; text-align: center; vertical-align: top; }
.status-table th.prop { text-align: left; width: 220px; background: #fbfdfd; }
.status-table thead th { background: var(--primary-50); color: var(--primary-700); white-space: nowrap; }
.status-table td.done { background: var(--ok-50); }
.status-table td.done a { display: block; font-weight: 700; }
.status-table td.missing { background: #fffaf0; color: var(--warn-700); }
.status-table .now { box-shadow: inset 0 -3px 0 var(--accent); }
.zip-link { display: block; font-size: 12px; font-weight: 500; }

.admin-menu { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.admin-menu a {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
    padding: 12px; border-radius: 14px; text-decoration: none; color: var(--text); border: 1px solid var(--line);
    transition: background .15s, border-color .15s;
}
.admin-menu a:hover { background: var(--primary-50); border-color: var(--primary-100); }
.admin-menu .title-icon { grid-row: 1 / 3; }
.logo-preview { max-height: 60px; max-width: 100%; background: #f4f6f9; padding: 6px; border-radius: 8px; }

/* ================================================================ 小窓（拡大表示・確認） */
dialog { border: 0; border-radius: 18px; padding: 0; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(8, 40, 44, .55); backdrop-filter: blur(3px); }
.lightbox { width: min(1100px, 96vw); max-height: 94vh; background: #0f1a1c; color: #fff; }
.lightbox-head, .lightbox-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; }
.lightbox-head { justify-content: space-between; }
.lightbox-body { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 8px; }
.lightbox-body img { max-width: calc(96vw - 140px); max-height: calc(94vh - 140px); object-fit: contain; border-radius: 10px; background: #1b2a2d; }
.lb-nav { min-width: 44px; font-size: 24px; }
.lightbox .btn { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .18); box-shadow: none; }
.lightbox .btn:hover { background: rgba(255, 255, 255, .18); }
.modal { width: min(640px, 94vw); padding: 24px; }
.modal h2 { margin-top: 0; }
.precheck-list { margin: 0 0 12px; padding-left: 1.4em; }
.precheck-list li { margin: 4px 0; }
.precheck-list.warn li { color: #7a271a; }
.assign-list { max-height: 55vh; overflow: auto; padding-left: 1.6em; }
.assign-list li { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.assign-list img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: #eee; }

/* ================================================================ デスクトップ用 2カラム
   左（main・top）に主な内容、右（side）に補助の内容。右側はスクロールしても画面内に留まる。
   画面幅が狭い場合（スマホ等）は、HTMLの並び順どおり1列に並ぶ。 */
@media (min-width: 1100px) {
    .page-2col {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 460px;
        grid-template-areas: "top side" "main side";
        grid-template-rows: auto 1fr;
        column-gap: 22px;
        align-items: start;
    }
    .page-2col > .top { grid-area: top; }
    .page-2col > .main { grid-area: main; }
    .page-2col > .side {
        grid-area: side;
        position: sticky;
        top: 70px;
        max-height: calc(100vh - 82px);
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: var(--radius);
    }
    .page-2col > .side .form-grid, .top-pair .form-grid { grid-template-columns: minmax(0, 1fr); }
    .page-2col > .side .search-form { grid-template-columns: 1fr 1fr; }
    .page-2col > .side .search-form > label:nth-of-type(-n+2),
    .page-2col > .side .search-form > .actions { grid-column: 1 / -1; }

    .top-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
    .top-pair > .card { height: 100%; }

    .locations { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 0 18px; align-items: start; }
    .location .items { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 12px; margin-bottom: 12px; }
    .location .items .item { margin-bottom: 0; }

    .page-2col > .side .check-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    .page-2col > .side .check-item .label { flex: 1; margin: 0; font-size: 14px; }
    .page-2col > .side .check-item .issue-link { flex: 1 1 100%; margin: 2px 0 0; }
    .page-2col > .side .chip span { min-height: 34px; min-width: 44px; padding: 2px 10px; font-size: 14px; }
    .page-2col > .side .check-section h3 { position: sticky; top: 0; z-index: 1; }
}

/* ================================================================ スマホ */
@media (max-width: 640px) {
    .site-header { padding: 10px 14px; }
    .user-menu { margin-left: 0; width: 100%; }
    .header-link span { display: none; }
    .user-name { margin-right: auto; }
    .main-nav a { padding: 6px 12px; font-size: 14px; }
}
@media (max-width: 480px) {
    .container { padding: 12px 10px 40px; }
    .card { padding: 14px; border-radius: 14px; }
    .item { padding: 8px; }
    .slot-actions { flex-direction: column; }
    .report-list a { gap: 10px; padding: 8px; }
}
