:root {
  --ink: #16352b;
  --muted: #5c6e65;
  --paper: #f7f7f1;
  --card: #fff;
  --line: #d6ded7;
  --accent: #0a7957;
  --soft: #e4f2ea;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans KR", sans-serif; }
.shell { max-width: 980px; margin: auto; padding: 32px 20px 72px; }
.hero { padding: 28px 0 24px; }
.eyebrow { margin: 0; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .09em; }
.hero h1 { margin: .25rem 0 .7rem; font-size: clamp(2rem, 6vw, 3.5rem); line-height: 1.1; }
.hero p { max-width: 650px; color: var(--muted); }
.lab-link { display: inline-block; color: var(--ink); font-weight: 700; }

.record-box, .panel, .card { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 5px 18px #153d2510; }
.record-box h2, .panel h2 { margin: .1rem 0 1rem; font-size: 1.25rem; }
form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
label, fieldset { display: grid; min-width: 0; gap: 5px; font-size: .88rem; font-weight: 700; }
.wide { grid-column: span 2; }
input, select, textarea, button { width: 100%; min-width: 0; border: 1px solid #b9c7bd; border-radius: 9px; padding: 9px; background: #fff; color: var(--ink); font: inherit; }
textarea { resize: vertical; }
button { cursor: pointer; border: 0; background: var(--ink); color: white; font-weight: 800; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { display: inline-flex; width: auto; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 99px; padding: 5px 9px; background: #fff; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.tag input { width: 1rem; height: 1rem; margin: 0; padding: 0; accent-color: var(--accent); }
.status { min-height: 1.5em; margin: .7rem 0 0; color: var(--accent); font-weight: 700; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 28px 0 18px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tabs button { width: auto; flex: 0 0 auto; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted); white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--soft); color: var(--ink); }
.panel { min-height: 210px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 15px; border-radius: 12px; background: var(--soft); }
.metric strong { display: block; font-size: 1.7rem; }
.metric span, .meta, .hint { color: var(--muted); font-size: .88rem; }
.list { display: grid; gap: 10px; }
.run { padding: 14px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.run:first-child { border-top: 0; }
.run-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.badge { display: inline-block; margin: 3px 5px 3px 0; border-radius: 99px; padding: 2px 8px; background: var(--soft); font-size: .78rem; font-weight: 800; }
.badge.overdue { background: #ffe5da; color: #8f3308; }
.badge.today { background: #fff0be; color: #6c4a00; }
.badge.scheduled { background: #e9eef3; color: #314b60; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.actions button { width: auto; padding: 6px 9px; background: #356354; font-size: .82rem; }
.actions button.danger { background: #8e3e32; }
.empty { padding: 28px 0; color: var(--muted); text-align: center; }
.bar-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 28px; align-items: center; gap: 9px; margin: 10px 0; }
.bar { height: 12px; overflow: hidden; border-radius: 99px; background: #e7ece8; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

html[data-form-layout="compact"] .record-box { padding: 18px; }
html[data-form-layout="compact"] form { grid-template-columns: minmax(0, 1fr); }
html[data-form-layout="compact"] .wide { grid-column: auto; }
html[data-form-layout="compact"] form > button { min-height: 52px; }

@media (max-width: 1024px) {
  .record-box { padding: 18px; }
  form { grid-template-columns: minmax(0, 1fr); }
  .wide { grid-column: auto; }
  form > button { min-height: 52px; }
}

@media (max-width: 650px) {
  .shell { padding: 18px 14px 48px; }
  .record-box, .panel { padding: 16px; border-radius: 14px; }
  .hero { padding-top: 18px; }
  .grid { grid-template-columns: 1fr; }
  .run-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .bar-row { grid-template-columns: 84px minmax(0, 1fr) 25px; }
}
