:root {
  --ink: #17232d; --muted: #60707c; --line: #d5dde3; --soft: #f4f7f8; --white: #fff;
  --teal: #08766c; --teal-dark: #075b54; --blue: #2457a6; --amber: #a96405; --red: #b4233a;
  --human: #08766c; --local: #2457a6; --chatgpt: #8b3f86; --local-ref: #ca7a04; --chatgpt-ref: #cb4c58;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #edf2f4; font: 16px/1.5 Inter, "Segoe UI", Arial, sans-serif; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.app-header { min-height: 68px; padding: 0 clamp(18px,4vw,52px); display: flex; align-items: center; gap: 22px; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); text-decoration: none; font-size: 1.18rem; font-weight: 800; }
.context-label { color: var(--muted); font-size: .9rem; }
.app-header nav { margin-left: auto; display: flex; gap: 8px; }
.workspace { max-width: 1180px; margin: 0 auto; padding: 30px clamp(16px,4vw,36px) 60px; }
h1,h2,h3,p { margin-top: 0; } h1 { font-size: clamp(1.8rem,4vw,2.7rem); line-height: 1.12; margin-bottom: 12px; } h2 { font-size: 1.25rem; } h3 { font-size: 1rem; }
.lead { max-width: 760px; color: var(--muted); font-size: 1.06rem; }
.home-grid,.two-col { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; align-items: start; }
.dashboard-grid { display: grid; grid-template-columns: 310px minmax(0,1fr); gap: 18px; align-items: start; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 12px 32px rgba(25,39,49,.06); }
.panel-header { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-header h2,.panel-header h3 { margin: 0; }
.panel-body { padding: 20px; }
.stack { display: grid; gap: 15px; }
.compact { gap: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--white); text-decoration: none; font-weight: 700; }
.button:hover,.button:focus-visible { border-color: #95a5b0; background: #f8fafb; outline: 3px solid rgba(36,87,166,.14); }
.button.primary { color: white; border-color: var(--teal); background: var(--teal); } .button.primary:hover { background: var(--teal-dark); }
.button.blue { color: white; border-color: var(--blue); background: var(--blue); }
.button.warn { color: #5b3300; border-color: #e3b366; background: #fff5df; }
.button.danger { color: white; border-color: var(--red); background: var(--red); }
.button.small { min-height: 34px; padding: 5px 10px; font-size: .88rem; }
.button:disabled { opacity: .52; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
label { display: grid; gap: 6px; color: #44545f; font-size: .88rem; font-weight: 700; }
input,textarea,select { width: 100%; border: 1px solid #bcc8cf; border-radius: 5px; background: white; color: var(--ink); }
input,select { min-height: 41px; padding: 8px 10px; } textarea { min-height: 104px; padding: 10px; resize: vertical; }
input:focus,textarea:focus,select:focus { border-color: var(--blue); outline: 3px solid rgba(36,87,166,.14); }
.form-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); color: var(--ink); font-weight: 500; }
.check input { width: auto; min-height: auto; margin-top: 4px; }
.notice { padding: 12px 14px; border-left: 4px solid var(--amber); background: #fff7e6; color: #5e3a04; }
.notice.success { border-color: var(--teal); background: #e9f7f4; color: #074e48; }
.notice.error { border-color: var(--red); background: #fff0f2; color: #7d1728; }
.muted,.help { color: var(--muted); } .help { font-size: .88rem; } .mono { font-family: Consolas, monospace; }
.role-card { padding: 24px; min-height: 220px; display: flex; flex-direction: column; } .role-card .button { margin-top: auto; align-self: flex-start; }
.resume-box { border-top: 1px solid var(--line); padding-top: 14px; }
.session-list { display: grid; gap: 8px; }
.session-item { width: 100%; padding: 11px; text-align: left; border: 1px solid var(--line); border-radius: 5px; background: white; }
.session-item.active { border-color: var(--teal); box-shadow: inset 3px 0 var(--teal); }
.session-item strong,.session-item span { display: block; } .session-item span { color: var(--muted); font-size: .82rem; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(110px,1fr)); gap: 9px; }
.metric { min-height: 72px; padding: 11px 13px; border: 1px solid var(--line); background: var(--soft); }
.metric strong { display: block; font-size: 1.28rem; } .metric span { color: var(--muted); font-size: .78rem; }
.phase-bar { display: flex; overflow-x: auto; border: 1px solid var(--line); background: white; }
.phase-step { min-width: 104px; padding: 10px 8px; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: white; font-size: .82rem; }
.phase-step.current { color: white; background: var(--teal); font-weight: 800; } .phase-step.past { color: var(--teal-dark); background: #eaf6f4; }
.task-box { padding: 17px; border: 1px solid var(--line); background: #f8fafb; white-space: pre-wrap; }
.condition { padding: 17px; border-left: 5px solid var(--blue); background: #eef4fd; }
.code-card { padding: 20px; text-align: center; border: 2px solid var(--teal); background: #ecf8f6; }
.code-card strong { display: block; font: 800 1.55rem Consolas, monospace; letter-spacing: 1px; }
.timer-row { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border: 1px solid var(--line); background: white; }
.timer { font: 800 1.3rem Consolas, monospace; } .timer.urgent { color: var(--red); }
.editor { min-height: 260px; }
.editor-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .88rem; }
.rating-card { padding: 18px; border: 1px solid var(--line); background: white; }
.rating-card + .rating-card { margin-top: 14px; }
.rating-text { padding: 15px; border: 1px solid var(--line); background: #f8fafb; white-space: pre-wrap; }
.source-label { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 10px; border: 1px solid var(--blue); border-radius: 5px; color: var(--blue); background: #eef4fd; font-size: .86rem; font-weight: 800; }
.criterion { display: grid; grid-template-columns: minmax(180px,1fr) minmax(220px,1.4fr) 44px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.criterion:last-child { border-bottom: 0; } .criterion input { accent-color: var(--teal); padding: 0; }
.score { display: flex; align-items: center; justify-content: center; width: 40px; height: 34px; border-radius: 20px; color: white; background: var(--teal); font-weight: 800; }
.endpoints { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; font-weight: 500; }
.chart-scroll { overflow-x: auto; } .chart { min-width: 850px; width: 100%; height: auto; border: 1px solid var(--line); background: white; }
.legend { display: flex; flex-wrap: wrap; gap: 11px 18px; font-size: .84rem; color: var(--muted); } .swatch { width: 13px; height: 13px; display: inline-block; margin-right: 5px; vertical-align: -2px; }
table { width: 100%; border-collapse: collapse; } th,td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; } th { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); } .tab { padding: 11px 14px; border: 0; border-bottom: 3px solid transparent; background: white; color: var(--muted); } .tab.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 800; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px,calc(100vw - 40px)); padding: 12px 15px; border: 1px solid var(--line); background: white; box-shadow: 0 12px 36px rgba(20,30,38,.18); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .15s; }
.toast.show { opacity: 1; transform: none; }
@media (max-width: 850px) { .home-grid,.two-col,.dashboard-grid,.form-row { grid-template-columns: 1fr; } .metrics { grid-template-columns: repeat(2,1fr); } .criterion { grid-template-columns: 1fr; } .context-label { display: none; } }
@media (max-width: 480px) { .metrics { grid-template-columns: 1fr 1fr; } .workspace { padding-top: 18px; } .app-header { gap: 8px; } }
