:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #1f5eff;
  --primary-dark: #1644ba;
  --ok: #0f9f6e;
  --run: #f59e0b;
  --hold: #ef4444;
  --ready: #64748b;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif; }
button, input { font: inherit; }
.app-shell { width: min(760px, 100%); margin: 0 auto; padding: 14px 12px 42px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px 16px; }
.eyebrow { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { font-size: 24px; margin: 2px 0 0; line-height: 1.15; }
h2 { margin: 0 0 10px; font-size: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; margin: 0 0 12px; }
.login-card { margin-top: 12px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; line-height: 1.45; }
.field-row { display: grid; gap: 6px; margin-bottom: 12px; }
.field-row label { font-size: 13px; color: var(--muted); font-weight: 700; }
input { width: 100%; height: 46px; border: 1px solid #d7dce5; border-radius: 14px; background: #fff; padding: 0 14px; outline: none; }
input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(31, 94, 255, .10); }
button { border: 0; border-radius: 14px; height: 44px; padding: 0 14px; font-weight: 800; cursor: pointer; }
button.primary { color: white; background: var(--primary); }
button.primary:active { background: var(--primary-dark); }
button.ghost { color: var(--text); background: #eef2ff; }
button.full { width: 100%; }
.msg { min-height: 20px; margin-top: 10px; color: var(--hold); font-size: 13px; }
.hidden { display: none !important; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.badge.muted { background: #e5e7eb; color: #374151; }
.badge.done { background: #dcfce7; color: #047857; }
.badge.progress { background: #fef3c7; color: #92400e; }
.badge.hold { background: #fee2e2; color: #991b1b; }
.badge.ready { background: #e2e8f0; color: #334155; }
.sticky-search { position: sticky; top: 0; z-index: 10; border-radius: 0 0 20px 20px; margin-left: -12px; margin-right: -12px; }
.search-row { display: grid; grid-template-columns: 1fr 86px; gap: 8px; }
.nav-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.loading, .error { margin: 12px 0; padding: 14px; border-radius: 16px; }
.loading { color: var(--muted); background: #fff; border: 1px dashed var(--line); }
.error { color: #991b1b; background: #fff1f2; border: 1px solid #fecdd3; white-space: pre-wrap; }
.summary-card { overflow: hidden; }
.summary-title { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.summary-title h2 { font-size: 20px; margin: 0; line-height: 1.25; word-break: keep-all; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.meta-item { background: #f8fafc; border: 1px solid #edf2f7; border-radius: 14px; padding: 10px; min-height: 58px; }
.meta-label { display: block; color: var(--muted); font-size: 11px; font-weight: 800; margin-bottom: 3px; }
.meta-value { font-size: 14px; font-weight: 800; word-break: break-word; }
.progress-wrap { margin-top: 14px; }
.progress-line { height: 12px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress-line span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #16a34a); border-radius: inherit; transition: width .25s ease; }
.progress-caption { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0; position: sticky; top: 116px; z-index: 9; background: rgba(244, 246, 251, .94); padding: 8px 0; backdrop-filter: blur(10px); }
.tabs button { height: 38px; border-radius: 999px; background: #e8edf7; color: #475569; font-size: 13px; }
.tabs button.active { background: var(--text); color: white; }
.process-card { position: relative; padding-left: 52px; }
.process-card::before { content: ""; position: absolute; left: 29px; top: 56px; bottom: -13px; width: 2px; background: #d7dce5; }
.process-card:last-child::before { display: none; }
.step-dot { position: absolute; left: 16px; top: 20px; width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; color: white; font-size: 12px; font-weight: 900; }
.step-dot.done { background: var(--ok); }
.step-dot.progress { background: var(--run); }
.step-dot.hold { background: var(--hold); }
.step-dot.ready { background: var(--ready); }
.process-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.process-name { font-size: 17px; font-weight: 900; }
.process-spec { margin-top: 4px; color: #334155; font-size: 14px; line-height: 1.45; }
.process-detail { display: grid; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.warn { color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; padding: 8px; }
.info-list { display: grid; gap: 8px; }
.info-row { display: grid; grid-template-columns: 108px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: 0; }
.info-row b { color: var(--muted); font-size: 13px; }
.info-row span { font-weight: 700; word-break: break-word; }
.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: #f8fafc; font-size: 12px; }
.image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.image-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.image-card button { height: auto; display: block; width: 100%; padding: 0; background: #f8fafc; }
.image-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.image-card div { padding: 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.empty { padding: 22px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 18px; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .92); z-index: 100; display: grid; grid-template-rows: auto 1fr; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: white; padding: calc(env(safe-area-inset-top) + 10px) 12px 10px; }
.modal-head button { background: white; color: var(--text); }
.modal img { width: 100%; height: 100%; object-fit: contain; padding: 0 8px calc(env(safe-area-inset-bottom) + 8px); }
@media (max-width: 430px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  h1 { font-size: 21px; }
  .card { border-radius: 18px; padding: 14px; }
  .summary-title { display: grid; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .tabs { top: 112px; }
  .tabs button { font-size: 12px; padding: 0 8px; }
  .image-grid { grid-template-columns: 1fr; }
}
