/* ============================================================
   테스트 옵션 (/test/)

   껍데기(.md-shell · .md-bar · .md-gate)는 /doctor/ 것을 그대로 쓴다.
   여기서는 카드·관문 목록·입력 격자만 정의한다.

   이 화면은 «개발자가 들여다보는 곳» 이다. 예쁘게 보다는
   한 화면에 많이 보이는 쪽을 택했다 — 글자를 작게, 간격을 좁게.
   ============================================================ */

.ts-main {
    flex: 1;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 12px 14px 48px;
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
}

/* 가짜 데이터를 넣는 곳이라는 사실은 늘 보여야 한다 */
.ts-warn {
    display: flex; gap: 9px; align-items: flex-start;
    margin: 4px 0 14px;
    padding: 11px 13px;
    border: 1px solid #f2c94c66;
    background: #fff8e1;
    border-radius: 12px;
    font-size: 0.8rem; line-height: 1.55; color: #7a5b00;
}
.ts-warn i { margin-top: 2px; color: #c99a00; }
.ts-warn code {
    background: #ffffffcc; border: 1px solid #e6d4a0; border-radius: 5px;
    padding: 1px 5px; font-size: 0.76rem;
}

.ts-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 15px 16px 16px;
    margin-bottom: 12px;
}
.ts-card.danger { border-color: #f0c3c3; background: #fffafa; }

.ts-card h2 {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 8px;
    font-size: 0.95rem; font-weight: 800; letter-spacing: -0.02em;
    color: var(--ink-1);
}
.ts-card h2 i { color: var(--brand-deep); font-size: 0.88rem; }
.ts-card.danger h2 i { color: #c0392b; }

.ts-lead {
    margin: 0 0 12px;
    font-size: 0.79rem; line-height: 1.65; color: var(--ink-3);
}
.ts-lead b { color: var(--ink-2); font-weight: 700; }
.ts-lead a { color: var(--brand-deep); font-weight: 700; }

/* ── 관문 목록 ───────────────────────────────────────── */
.ts-gates { list-style: none; margin: 0; padding: 0; }
.ts-gates li {
    display: flex; align-items: baseline; gap: 9px;
    padding: 8px 0;
    border-top: 1px solid #f1f4f7;
    font-size: 0.82rem;
}
.ts-gates li:first-child { border-top: 0; }
.ts-gates .g-mark {
    flex: 0 0 auto;
    width: 17px; height: 17px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.62rem; color: #fff;
    transform: translateY(2px);
}
.ts-gates .ok  .g-mark { background: #2f9e6e; }
.ts-gates .no  .g-mark { background: #d0453a; }
.ts-gates .g-label { flex: 0 0 auto; font-weight: 700; color: var(--ink-2); }
.ts-gates .g-note  { color: var(--ink-3); font-size: 0.78rem; line-height: 1.5; }
.ts-gates .no .g-label { color: #c0392b; }
.ts-load { color: var(--ink-3); font-size: 0.82rem; }

/* 무엇이 얼마나 움직였나 */
.ts-changes {
    margin-top: 11px; padding: 10px 12px;
    background: #f6f9fc; border-radius: 10px;
    font-size: 0.78rem; line-height: 1.7; color: var(--ink-2);
}
.ts-changes b { display: block; margin-bottom: 3px; color: var(--ink-3); font-size: 0.74rem; }
.ts-changes .c-worse  { color: #c0392b; }
.ts-changes .c-better { color: #2f9e6e; }
.ts-changes .c-new    { color: var(--ink-3); }

/* ── 버튼 ────────────────────────────────────────────── */
.ts-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.ts-btn {
    border: 1px solid var(--line); background: #fff; border-radius: 9px;
    padding: 8px 13px;
    font-family: inherit; font-size: 0.79rem; font-weight: 700;
    color: var(--ink-2); cursor: pointer;
}
.ts-btn:hover { background: #f4f8fb; }
.ts-btn:disabled { opacity: 0.45; cursor: default; }
.ts-btn.primary { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.ts-btn.primary:hover { filter: brightness(1.08); }
.ts-btn.warn { border-color: #e3b0ab; color: #c0392b; }
.ts-btn.warn:hover { background: #fdf1f0; }

.ts-check {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 0.79rem; color: var(--ink-3); cursor: pointer;
}

/* ── 날짜 · 입력 격자 ────────────────────────────────── */
.ts-daterow { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.ts-daterow label { font-size: 0.79rem; font-weight: 700; color: var(--ink-2); }
.ts-daterow input,
.ts-daterow select {
    border: 1px solid var(--line); border-radius: 9px; background: #fff;
    padding: 7px 10px; font-family: inherit; font-size: 0.82rem; color: var(--ink-1);
}

.ts-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}
.ts-f { display: flex; flex-direction: column; gap: 3px; }
.ts-f label { font-size: 0.72rem; font-weight: 700; color: var(--ink-3); }
.ts-f .u { font-weight: 500; color: #9aa7b4; }
.ts-f input {
    width: 100%;
    border: 1px solid var(--line); border-radius: 8px;
    padding: 7px 9px;
    font-family: inherit; font-size: 0.84rem; color: var(--ink-1);
}
.ts-f input:focus { outline: 2px solid var(--brand-soft, #cdeaf0); outline-offset: -1px; }

/* ── 표 ─────────────────────────────────────────────── */
.ts-table-wrap { overflow-x: auto; }
.ts-table { width: 100%; border-collapse: collapse; font-size: 0.76rem; white-space: nowrap; }
.ts-table th, .ts-table td {
    padding: 6px 9px; text-align: right;
    border-bottom: 1px solid #f1f4f7; color: var(--ink-2);
}
.ts-table th { color: var(--ink-3); font-weight: 700; font-size: 0.72rem; }
.ts-table th:first-child, .ts-table td:first-child { text-align: left; }
.ts-table .src {
    display: inline-block; padding: 1px 6px; border-radius: 999px;
    font-size: 0.66rem; font-weight: 700;
    background: #eef3f8; color: var(--ink-3);
}
.ts-table .src.test { background: #fff2cc; color: #8a6a00; }

/* ── 결과 출력 ──────────────────────────────────────── */
.ts-out {
    margin-top: 12px; padding: 11px 13px;
    background: #f6f9fc; border-radius: 10px;
    font-size: 0.8rem; line-height: 1.7; color: var(--ink-2);
    white-space: pre-wrap; word-break: break-word;
}
.ts-out.bad { background: #fdf1f0; color: #a5342a; }
.ts-out b { display: block; margin-bottom: 4px; }

.ts-note { margin: 10px 0 0; font-size: 0.78rem; color: var(--ink-3); }
.ts-note.bad { color: #c0392b; }

.ts-foot {
    margin: 18px 2px 0;
    font-size: 0.74rem; color: #9aa7b4;
}
.ts-foot code {
    background: #f1f4f7; border-radius: 4px; padding: 1px 5px; font-size: 0.72rem;
}

/* 계획 한 줄 */
.ts-plan { font-size: 0.82rem; line-height: 1.7; color: var(--ink-2); }
.ts-plan b { color: var(--ink-1); }
.ts-plan .due { color: var(--brand-deep); font-weight: 700; }
.ts-plan .due.now { color: #c0392b; }

@media (max-width: 640px) {
    .ts-main { padding-left: 11px; padding-right: 11px; }
    .ts-fields { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
}
