:root {
  --bg: #f5f6f8;
  --surface: #fff;
  --surface-2: #f8f9fb;
  --line: #dfe3e8;
  --line-dark: #cbd1d8;
  --text: #1b1f24;
  --muted: #68717d;
  --primary: #20242a;
  --primary-hover: #080a0c;
  --success: #147a48;
  --success-bg: #eef9f3;
  --warn: #9a6700;
  --warn-bg: #fff8df;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
* { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif; line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, input, select { min-height: 36px; }
input, select { width: 100%; border: 1px solid var(--line-dark); border-radius: 6px; background: #fff; color: var(--text); padding: 7px 10px; outline: 0; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: #7b8490; box-shadow: 0 0 0 3px rgba(32, 36, 42, .08); }
.topbar { height: 52px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar__inner { max-width: 1120px; height: 100%; margin: 0 auto; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { text-decoration: none; font-size: 13px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand span { margin-left: 5px; color: var(--muted); font-size: 10px; font-weight: 500; }
.topnav { display: flex; align-items: stretch; height: 100%; gap: 4px; }
.topnav a { display: flex; align-items: center; padding: 0 11px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; border-bottom: 2px solid transparent; }
.topnav a:hover, .topnav a.is-active { color: var(--text); border-bottom-color: var(--text); }
.shell { max-width: 1120px; margin: 0 auto; padding: 22px 18px 52px; }
.shell--settings { max-width: 900px; }
.page-head { min-height: 48px; margin-bottom: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0 0 3px; font-size: 18px; line-height: 1.35; }
.page-head p { margin: 0; color: var(--muted); font-size: 11px; }
.status { border: 1px solid; border-radius: 999px; padding: 4px 9px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status--ok { background: var(--success-bg); color: var(--success); border-color: #bae4ca; }
.status--warn { background: var(--warn-bg); color: var(--warn); border-color: #ead99c; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel--search { padding: 14px; }
.cid-form label, .field label { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 700; }
.cid-form__row { display: grid; grid-template-columns: minmax(0, 1fr) 144px; gap: 8px; }
.field-note { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.button { border: 1px solid transparent; border-radius: 6px; padding: 7px 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; transition: background .15s, border-color .15s, opacity .15s; }
.button:disabled { cursor: wait; opacity: .55; }
.button--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button--primary:hover:not(:disabled) { background: var(--primary-hover); }
.button--ghost { color: var(--text); background: #fff; border-color: var(--line-dark); }
.button--ghost:hover { background: var(--surface-2); }
.button--sm { min-height: 30px; padding: 5px 9px; font-size: 10px; }
.notice { margin: 12px 0; border: 1px solid; border-radius: 6px; padding: 9px 11px; font-size: 11px; }
.notice--error { border-color: #ffc9c5; background: var(--danger-bg); color: var(--danger); }
.notice--success { border-color: #bae4ca; background: var(--success-bg); color: var(--success); }
.result { margin-top: 14px; overflow: hidden; }
.panel__head { min-height: 57px; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel__head--compact { min-height: auto; padding: 0 0 10px; margin-bottom: 12px; }
.panel__head h2 { margin: 1px 0 0; font-size: 14px; line-height: 1.45; }
.eyebrow { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.work-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.work-image-wrap { min-height: 300px; background: var(--surface-2); border-right: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.work-image { width: 100%; height: 100%; max-height: 360px; object-fit: contain; display: block; }
.image-empty { color: #a0a8b1; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.work-data { padding: 2px 14px 12px; }
.detail-grid { margin: 0; display: grid; grid-template-columns: 1fr 1fr; }
.detail-grid > div { min-width: 0; padding: 9px 4px; border-bottom: 1px solid #edf0f2; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.detail-grid > div.span-2 { grid-column: 1 / -1; }
.detail-grid dt { color: var(--muted); font-size: 10px; font-weight: 600; }
.detail-grid dd { margin: 0; min-width: 0; font-size: 11px; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-flex; padding: 2px 6px; border-radius: 4px; background: #f0f2f4; color: #49515a; font-size: 9px; }
.samples { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.subhead { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; font-size: 10px; }
.subhead span { color: var(--muted); }
.sample-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.sample-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; background: #eee; }
.empty-state { margin-top: 14px; min-height: 240px; border: 1px dashed var(--line-dark); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.empty-state__icon { width: 48px; height: 48px; margin-bottom: 9px; border-radius: 10px; background: #e9ecef; color: #6c757d; display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.empty-state strong { color: #4b535c; font-size: 11px; }
.empty-state p { margin: 4px 0 0; font-size: 10px; }
.settings-stack { display: grid; gap: 12px; }
.settings-section { padding: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.field.span-2 { grid-column: 1 / -1; }
.required { margin-left: 4px; color: var(--danger); font-size: 9px; }
.badge { display: inline-flex; padding: 3px 6px; border-radius: 999px; background: #f0f2f4; color: var(--muted); font-size: 9px; font-weight: 700; }
.settings-actions { position: sticky; bottom: 0; z-index: 4; padding: 10px 0 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: linear-gradient(to bottom, rgba(245,246,248,0), var(--bg) 30%); }
.save-note { color: var(--muted); font-size: 9px; }
@media (max-width: 700px) {
  html { font-size: 13px; }
  .topbar { height: 48px; }
  .topbar__inner { padding: 0 12px; }
  .brand { font-size: 11px; }
  .brand span { display: none; }
  .topnav a { padding: 0 8px; font-size: 10px; }
  .shell { padding: 16px 10px 42px; }
  .page-head { margin-bottom: 10px; }
  .page-head h1 { font-size: 16px; }
  .panel--search, .settings-section { padding: 11px; }
  .cid-form__row { grid-template-columns: 1fr; }
  .button { width: 100%; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
  .work-layout { grid-template-columns: 1fr; }
  .work-image-wrap { min-height: 0; max-height: 340px; border-right: 0; border-bottom: 1px solid var(--line); }
  .work-image { max-height: 340px; }
  .work-data { padding: 2px 10px 10px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > div, .detail-grid > div.span-2 { grid-column: auto; grid-template-columns: 70px minmax(0, 1fr); padding: 8px 2px; }
  .sample-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid, .form-grid--3 { grid-template-columns: 1fr; gap: 10px; }
  .field.span-2 { grid-column: auto; }
  .settings-actions { padding-top: 12px; }
  .save-note { display: none; }
  .settings-actions .button { margin-left: auto; }
}
