:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef4ff;
  --text: #132033;
  --muted: #65748b;
  --line: #dce3ed;
  --primary: #0b5fff;
  --primary-dark: #0847bf;
  --ok: #0c7a50;
  --issue: #c7441e;
  --na: #667085;
  --unchecked: #9a6700;
  --shadow: 0 12px 30px rgba(29, 46, 73, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.app-header { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 22px 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(12px); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 2px; font-size: 1.45rem; }
h2 { margin-bottom: 4px; font-size: 1.55rem; }
h3 { margin-bottom: 10px; }
.eyebrow { margin-bottom: 4px; color: var(--primary); font-size: .72rem; letter-spacing: .12em; font-weight: 800; }
.subtle { color: var(--muted); font-size: .9rem; margin-bottom: 0; }
.header-actions, .inline-actions, .section-heading, .view-heading, .bottom-action.split { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.save-state { font-size: .82rem; color: var(--ok); background: #e9f8f1; border-radius: 999px; padding: 7px 10px; white-space: nowrap; }
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.sidebar { padding: 24px 16px; min-height: calc(100vh - 92px); border-right: 1px solid var(--line); }
.nav-button { width: 100%; border: 0; background: transparent; color: var(--muted); padding: 12px; border-radius: 12px; text-align: left; margin-bottom: 6px; font-weight: 700; }
.nav-button span { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: #e8edf4; margin-right: 8px; }
.nav-button.active { color: var(--primary); background: var(--surface-2); }
.nav-button.active span { color: white; background: var(--primary); }
.offline-card { margin-top: 28px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .83rem; }
.offline-card p { color: var(--muted); line-height: 1.55; margin: 7px 0 12px; }
.network-badge { display: inline-block; border-radius: 999px; background: #edf1f5; padding: 5px 8px; font-size: .74rem; }
.content { padding: 28px; min-width: 0; }
.view { display: none; }
.view.active { display: block; }
.view-heading { margin-bottom: 18px; }
.sticky-heading { position: sticky; top: 88px; z-index: 20; background: rgba(244,247,251,.95); padding: 10px 0; backdrop-filter: blur(10px); }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.compact { grid-template-columns: 1fr 1fr; }
label { font-size: .82rem; font-weight: 700; color: var(--muted); }
input[type="text"], input[type="datetime-local"], textarea { width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; color: var(--text); background: #fff; outline: none; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,95,255,.1); }
textarea { min-height: 80px; resize: vertical; }
.button { border: 1px solid transparent; border-radius: 10px; padding: 9px 12px; font-weight: 750; background: #fff; color: var(--text); }
.button.primary { color: white; background: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { border-color: var(--line); background: #fff; }
.button.ghost { background: transparent; border-color: var(--line); }
.button.danger-ghost { color: #b42318; border-color: #f0c5c0; background: #fff; }
.button.large { padding: 12px 18px; }
.hidden { display: none !important; }
.file-label input { display: none; }
.checklist-section { border: 1px solid var(--line); border-radius: 14px; margin-top: 12px; overflow: hidden; }
.section-row { display: flex; gap: 8px; align-items: center; background: #f8fafc; padding: 10px; }
.section-row input { margin: 0; flex: 1; font-weight: 800; }
.section-items-editor { padding: 10px; }
.item-editor-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-editor-row input { margin: 0; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; padding: 7px; }
.add-item { margin-top: 2px; }
.bottom-action { margin: 24px 0 40px; text-align: right; }
.progress-wrap { min-width: 180px; text-align: right; }
.progress-track { height: 8px; border-radius: 999px; overflow: hidden; background: #dfe6ef; margin-top: 6px; }
.progress-bar { width: 0; height: 100%; background: var(--primary); transition: width .2s; }
.round-section { margin-bottom: 20px; }
.round-section-title { font-size: 1.05rem; margin: 0 0 8px; padding-left: 4px; }
.round-item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 15px; margin-bottom: 10px; box-shadow: 0 5px 18px rgba(29,46,73,.05); }
.round-item-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.item-title { font-weight: 800; line-height: 1.5; }
.status-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.status-pill { border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; background: #fff; color: var(--muted); font-size: .78rem; font-weight: 750; }
.status-pill.active[data-status="ok"] { color: white; background: var(--ok); border-color: var(--ok); }
.status-pill.active[data-status="issue"] { color: white; background: var(--issue); border-color: var(--issue); }
.status-pill.active[data-status="na"] { color: white; background: var(--na); border-color: var(--na); }
.status-pill.active[data-status="unchecked"] { color: #4b3500; background: #f6d779; border-color: #f6d779; }
.issue-area { display: none; border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 12px; }
.issue-area.visible { display: block; }
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.photo-input-label { display: inline-block; border: 1px dashed #a9b6c8; border-radius: 10px; padding: 9px 12px; color: var(--primary); font-weight: 800; font-size: .8rem; cursor: pointer; }
.photo-input-label input { display: none; }
.photo-chip { width: 88px; height: 88px; margin: 0; position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-chip img { width: 100%; height: 100%; object-fit: cover; }
.photo-chip button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; color: white; background: rgba(0,0,0,.62); }
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.metric strong { display: block; font-size: 1.45rem; margin-top: 3px; }
.report-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .76rem; }
.status-text.issue { color: var(--issue); font-weight: 800; }
.status-text.ok { color: var(--ok); font-weight: 800; }
.report-photos { display: flex; gap: 6px; flex-wrap: wrap; }
.report-photos img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
dialog { border: 0; padding: 0; border-radius: 18px; box-shadow: 0 25px 70px rgba(0,0,0,.18); }
dialog::backdrop { background: rgba(14,25,44,.45); }
.dialog-card { min-width: min(460px, 90vw); padding: 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@media (max-width: 860px) {
  .app-header { padding: 16px; align-items: flex-start; }
  .shell { display: block; }
  .sidebar { min-height: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); position: sticky; top: 79px; z-index: 25; background: rgba(244,247,251,.96); }
  .offline-card { display: none; }
  .nav-button { text-align: center; margin: 0; font-size: .8rem; }
  .nav-button span { display: none; }
  .content { padding: 16px 12px; }
  .grid.two, .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
  .view-heading { align-items: flex-start; flex-direction: column; }
  .inline-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .round-item-head { display: block; }
  .status-pills { justify-content: flex-start; margin-top: 10px; }
  .report-summary { grid-template-columns: 1fr 1fr; }
  .sticky-heading { top: 128px; }
  .progress-wrap { width: 100%; text-align: left; }
  .bottom-action.split { align-items: stretch; flex-direction: column-reverse; }
}
@media print {
  .app-header, .sidebar, .view-heading .inline-actions, .bottom-action { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .view { display: none !important; }
  #reportView { display: block !important; }
  .card, .metric { box-shadow: none; break-inside: avoid; }
}
