:root {
  --ground: #f6f6f4;
  --surface: #ffffff;
  --ink-12: #1d232b;
  --ink-11: #3b434e;
  --ink-10: #6c7481;
  --ink-9: #8a919c;
  --ink-6: #dfe2e7;
  --ink-3: #f1f2f4;
  --success: #3f7a58;
  --danger: #b23a30;
  --shadow-button: 0 0 0 1px rgb(0 0 0 / .06), 0 1px 2px rgb(0 0 0 / .10);
  --shadow-panel: 0 0 0 1px rgb(0 0 0 / .05), 0 3px 5px -2px rgb(0 0 0 / .08);
  --ease: cubic-bezier(.23, 1, .32, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink-12);
  font: 400 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }

.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 max(24px, 5vw);
  background: var(--ink-12);
  color: #fff;
}
.wordmark { display: flex; align-items: baseline; gap: 10px; color: inherit; text-decoration: none; }
.wordmark-name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.wordmark-dept { font-size: 12px; color: rgb(255 255 255 / .6); }
.storage-note { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: rgb(255 255 255 / .65); }
.storage-note i { width: 6px; height: 6px; border-radius: 50%; background: #6cbf8f; }

.container { width: min(1120px, 92%); margin: 0 auto; }

.intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 36px 0 24px; }
.intro h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.intro p { margin: 8px 0 0; color: var(--ink-10); max-width: 58ch; text-wrap: pretty; }
.today { margin: 0; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border: 1px solid var(--ink-6);
  border-radius: 10px;
  margin-bottom: 16px;
}
.summary-item { padding: 16px 20px; }
.summary-item + .summary-item { border-left: 1px solid var(--ink-6); }
.summary-label, .summary-note { display: block; font-size: 12px; color: var(--ink-10); }
.summary strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.summary-note { font-size: 11px; color: var(--ink-9); }

.panel {
  background: var(--surface);
  border: 1px solid var(--ink-6);
  border-radius: 10px;
  box-shadow: var(--shadow-panel);
  padding: 22px 24px;
  margin-bottom: 16px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--ink-11); }
.field-full { grid-column: 1 / -1; }
.req, .field-note { color: var(--ink-9); }
.field input, .field textarea, .search input, .month input {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--ink-3);
  padding: 11px 12px;
  color: var(--ink-12);
  font-size: 14px;
  outline: none;
  transition: background .15s var(--ease), box-shadow .15s var(--ease);
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input:hover, .field textarea:hover, .search:hover, .month input:hover { background: #ebecef; }
.field input:focus, .field textarea:focus, .search:focus-within, .month input:focus {
  background: #eceef1;
  box-shadow: 0 0 0 2px var(--ink-12);
}
.hint { font-size: 12px; color: var(--ink-10); }

.upload {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink-3);
  cursor: pointer;
  transition: background .15s var(--ease);
}
.upload:hover { background: #ebecef; }
.upload svg { width: 20px; height: 20px; flex: none; color: var(--ink-10); }
.upload-copy { display: flex; flex-direction: column; gap: 2px; }
.upload-copy strong { font-size: 13px; font-weight: 600; }
.upload-copy small { font-size: 12px; color: var(--ink-10); }
.upload-link { margin-left: auto; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

.photo-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photo-thumb { width: 72px; height: 64px; position: relative; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgb(0 0 0 / .1); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.photo-thumb button {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / .65);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.button:active { transform: scale(.96); }
.button:focus-visible { outline: 2px solid var(--ink-12); outline-offset: 2px; }
.button svg { width: 15px; height: 15px; flex: none; }
.button-primary { background: var(--ink-12); color: #fff; box-shadow: var(--shadow-button); }
.button-primary:hover { background: #2c333d; }
.button-secondary { background: #fff; color: var(--ink-12); box-shadow: var(--shadow-button); }
.button-secondary:hover { background: #fafafa; }
.button-quiet { background: transparent; color: var(--ink-10); }
.button-quiet:hover { background: var(--ink-3); color: var(--ink-12); }
.form-message { margin: 0; font-size: 12px; color: var(--success); }
.form-message.error { color: var(--danger); }
.hidden { display: none !important; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 420px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--ink-3);
  transition: background .15s var(--ease), box-shadow .15s var(--ease);
}
.search svg { width: 16px; height: 16px; flex: none; color: var(--ink-10); }
.search input { padding: 10px 0; }
.month { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-10); }
.month input { width: auto; padding: 9px 11px; }

.table-wrap { border: 1px solid var(--ink-6); border-radius: 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-10);
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-6);
  white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid #eceef1; font-size: 13px; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody td { transition: background .15s var(--ease); }
tbody tr:hover td { background: #fafafa; }
.no-col { width: 44px; color: var(--ink-9); font-variant-numeric: tabular-nums; }
.action-col { width: 110px; }
.date-cell { white-space: nowrap; color: var(--ink-11); font-variant-numeric: tabular-nums; }
.description-cell { min-width: 240px; max-width: 400px; white-space: pre-wrap; line-height: 1.5; color: var(--ink-11); }
.tech-cell { min-width: 120px; color: var(--ink-11); }
.photo-count { color: var(--ink-10); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 10px; }
.row-actions button {
  border: 0;
  background: none;
  padding: 8px 4px;
  font-size: 12px;
  color: var(--ink-10);
  cursor: pointer;
}
.row-actions button:hover { color: var(--ink-12); text-decoration: underline; text-underline-offset: 3px; }
.row-actions .delete { color: var(--danger); }
.empty-cell { text-align: center; padding: 36px 16px; color: var(--ink-10); }
.empty-cell strong { display: block; margin-bottom: 4px; color: var(--ink-11); font-weight: 600; }
.table-foot { display: flex; justify-content: space-between; gap: 12px; margin: 12px 0 0; font-size: 12px; color: var(--ink-10); }
.format-note { color: var(--ink-9); }

.mobile-list { display: none; }
.mobile-report { border: 1px solid var(--ink-6); border-radius: 8px; padding: 14px; margin-bottom: 8px; }
.mobile-report .date-cell { font-size: 12px; color: var(--ink-10); }
.mobile-report h3 { margin: 6px 0 4px; font-size: 14px; font-weight: 600; }
.mobile-report p { margin: 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; color: var(--ink-11); }
.mobile-meta { margin-top: 8px; font-size: 12px; color: var(--ink-10); }
.mobile-report .row-actions { margin-top: 8px; }
.mobile-report .row-actions button { min-height: 44px; }

footer { padding: 12px 0 28px; font-size: 12px; color: var(--ink-9); }

.photo-dialog {
  border: 0;
  border-radius: 10px;
  padding: 10px;
  max-width: min(92vw, 900px);
  max-height: 90vh;
  background: var(--ink-12);
  box-shadow: 0 6px 8px -4px rgb(0 0 0 / .5);
}
.photo-dialog::backdrop { background: rgb(0 0 0 / .6); }
.photo-dialog img { display: block; max-width: 86vw; max-height: 78vh; object-fit: contain; border-radius: 4px; }
.dialog-close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink-12);
  cursor: pointer;
}
.dialog-close svg { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .topbar { height: 56px; padding: 0 20px; }
  .storage-note { font-size: 0; }
  .storage-note i { width: 8px; height: 8px; }
  .container { width: auto; margin: 0 20px; }
  .intro { flex-direction: column; align-items: flex-start; gap: 8px; padding: 26px 0 20px; }
  .intro h1 { font-size: 24px; }
  .summary-item { padding: 12px 14px; }
  .summary strong { font-size: 20px; }
  .summary-note { display: none; }
  .panel { padding: 18px 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .upload-link { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { max-width: none; }
  .month { justify-content: space-between; }
  .month input { flex: 1; }
  .table-wrap { display: none; }
  .mobile-list { display: block; }
  .form-actions .button-primary { width: 100%; }
  .table-foot { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .button:active { transform: none; }
}

@media print {
  body { background: #fff; }
  .topbar, .intro, .summary, #formPanel, .toolbar, .panel-head .button, .action-col, .row-actions, footer, .format-note { display: none !important; }
  .container { width: 100%; margin: 0; }
  .panel { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .panel-head { margin-bottom: 12px; }
  .table-wrap { display: block !important; overflow: visible; border: 1px solid #ddd; border-radius: 0; }
  table { min-width: 0; }
  th, td { font-size: 10px; padding: 6px; border: 1px solid #ddd; }
  .mobile-list { display: none !important; }
}
