/* home.css — ทักทาย · สลับผู้ดู · บัตรนัดมอบตัว (จุดเด่น) · เส้นทางก่อนมอบตัว · ประกาศ · ช่วยเหลือ */

.hello { margin: 4px 0 18px; display: grid; gap: 2px; }
.hello__greet { color: var(--brand); font-size: .8rem; font-weight: 600; letter-spacing: .06em; }
.hello__name { font-size: 1.9rem; line-height: 1.35; }
.hello__nick { margin-left: .3em; font-family: var(--font-body); font-weight: 400; font-size: 1.05rem; color: var(--ink-2); }
/* สมัครอะไรไว้: ระดับ · รอบ · ภาคเรียน */
.hello__facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; list-style: none; }
.hello__facts li {
    display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line-soft); font-weight: 600; font-size: .95rem;
}
.hello__fact-label { font-weight: 400; font-size: .8rem; color: var(--ink-2); }

/* สลับผู้ดู */
.viewer { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.viewer__label { font-size: .86rem; color: var(--ink-2); }
.viewer__seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-soft); }
.viewer__opt {
    font: inherit; font-size: .92rem; font-weight: 500; min-height: 44px; padding: 0 18px; border: 0;
    border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer;
    transition: background-color .15s ease, color .15s ease, transform .1s ease-out;
}
.viewer__opt:active { transform: scale(.96); }
.viewer__opt[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: inset 0 0 0 1px var(--brand); }

.home { display: grid; gap: 18px; }
.home__side { display: grid; gap: 18px; align-content: start; }
@media (min-width: 900px) {
    .home { grid-template-columns: minmax(340px, 400px) 1fr; align-items: start; gap: 24px; }
    .home__ticket { position: sticky; top: 90px; }
}

/* ── บัตรนัดมอบตัว ──────────────────────────────────────── */
.ticket {
    position: relative; overflow: hidden;
    background:
        radial-gradient(90% 60% at 100% 0%, rgb(255 255 255 / 9%), transparent 70%),
        var(--ticket);
    color: var(--ticket-ink);
    border-radius: 24px;
    box-shadow: var(--shadow-ticket);
}
.ticket__main { padding: 22px 20px 14px; display: grid; gap: 14px; }
.ticket__head { display: flex; align-items: center; gap: 10px; }
.ticket__label {
    font-family: var(--font-display); font-size: .95rem; font-weight: 600; letter-spacing: .04em;
    color: var(--ticket-ink-2); margin-right: auto;
}
.ticket__count {
    background: #fff; color: var(--brand); font-family: var(--font-display); font-weight: 700;
    border-radius: 999px; padding: 3px 12px; font-size: .95rem; white-space: nowrap;
}
.ticket__date { display: flex; align-items: center; gap: 14px; }
.ticket__day {
    font-family: var(--font-display); font-weight: 700; font-size: 4.4rem; line-height: .9;
    font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.ticket__month { display: grid; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; line-height: 1.3; }
.ticket__weekday { font-family: var(--font-body); font-weight: 400; font-size: .95rem; color: var(--ticket-ink-2); }
.ticket__facts { list-style: none; display: grid; gap: 6px; font-size: 1rem; }
.ticket__facts li { display: flex; gap: 10px; align-items: flex-start; }
.ticket__facts .icon { color: var(--ticket-ink-2); margin-top: 3px; }
.ticket__note {
    background: rgb(255 255 255 / 9%); border-radius: var(--r-sm); padding: 10px 12px;
    font-size: .93rem; color: var(--ticket-ink);
}
.ticket__empty { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.35; }
.ticket__empty-sub { color: var(--ticket-ink-2); font-size: .93rem; margin-top: -8px; }

/* รอยปรุ: เส้นประ + รอยเว้าสองข้าง (วงกลมสีพื้นหลังหน้า) */
.ticket__tear {
    position: relative; height: 24px;
    background: repeating-linear-gradient(90deg, var(--ticket-line) 0 8px, transparent 8px 15px) center / calc(100% - 48px) 2px no-repeat;
}
.ticket__tear::before, .ticket__tear::after {
    content: ""; position: absolute; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--paper);
}
.ticket__tear::before { left: -12px; }
.ticket__tear::after { right: -12px; }

.ticket__stub { padding: 12px 20px 20px; display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; }
.ticket__stub div { display: grid; min-width: 0; }
.ticket__who { grid-column: 1 / -1; }
.ticket__stub dt { font-size: .76rem; color: var(--ticket-ink-2); letter-spacing: .02em; }
.ticket__stub dd { font-weight: 600; overflow-wrap: anywhere; }
.ticket__who dd { font-family: var(--font-display); font-size: 1.2rem; }
.ticket__num { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: .06em; }

.ticket--pending .ticket__main { padding-bottom: 18px; }

/* ── เส้นทางก่อนมอบตัว ─────────────────────────────────── */
.journey { list-style: none; display: grid; margin: 0 -6px; }
.step { position: relative; }
/* เส้นเชื่อมไปขั้นถัดไป (สีเขียวเมื่อขั้นนี้เสร็จ) */
.step:not(:last-child)::before {
    content: ""; position: absolute; left: 21px; top: 46px; bottom: -10px; width: 2px;
    background: var(--line); border-radius: 2px;
}
.step--done:not(:last-child)::before { background: color-mix(in srgb, var(--green) 55%, var(--line)); }
.step__link {
    display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start;
    padding: 12px 6px; border-radius: var(--r-sm); color: inherit; text-decoration: none; min-height: 56px;
    transition: background-color .15s ease, transform .1s ease-out;
}
.step__link:hover { background: var(--surface-2); }
.step__link:active { transform: scale(.985); background: var(--surface-2); }
.step__dot {
    position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid var(--line); background: var(--surface); color: #fff; margin-top: 1px;
}
.step--done .step__dot { background: var(--green); border-color: var(--green); color: var(--surface); }
.step--attention .step__dot { background: var(--maroon); border-color: var(--maroon); color: var(--surface); }
.step--next .step__dot { border-color: var(--brand); }
.step--next .step__dot::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
.step__text { display: grid; gap: 1px; min-width: 0; }
.step__title { font-weight: 600; font-size: 1.02rem; }
.step__detail { color: var(--ink-2); font-size: .93rem; }
.step--attention .step__detail { color: var(--maroon); font-weight: 500; }
.step--upcoming .step__title { color: var(--ink-2); }
.step__missing { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.step__missing span {
    font-size: .84rem; padding: 2px 10px; border-radius: 999px;
    background: var(--maroon-soft); color: var(--maroon);
}
.step__go { color: var(--ink-2); margin-top: 5px; }

/* ── ประกาศล่าสุด ───────────────────────────────────────── */
.news { list-style: none; display: grid; }
.news__item {
    display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--line);
    text-decoration: none; color: inherit; min-height: 44px;
}
.news li:first-child .news__item { border-top: 0; padding-top: 2px; }
.news__title { font-weight: 500; }
.news__title .badge { margin-right: 6px; vertical-align: 2px; }
.news__date { font-size: .84rem; color: var(--ink-2); }
.news__item:hover .news__title { color: var(--brand); }

/* ── ช่วยเหลือ ─────────────────────────────────────────── */
.helpbox { display: grid; gap: 10px; }
.helpbox__row {
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
    background: var(--surface); border: 1px solid var(--line-soft); border-radius: 24px;
    padding: 16px 18px; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, transform .1s ease-out;
}
.helpbox__row:hover { border-color: var(--brand); }
.helpbox__row:active { transform: scale(.985); }
.helpbox__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.helpbox__title { display: block; font-weight: 600; }
.helpbox__text { display: block; color: var(--ink-2); font-size: .9rem; }

/* ── การชำระเงิน (การ์ดหน้าหลัก) ─────────────────────────── */
.paycard { display: grid; gap: 10px; }
.paycard .panel__title { margin-bottom: 0; }
.paycard__status {
    display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--r); text-decoration: none; color: var(--ink);
    background: var(--surface-2); border: 1px solid transparent;
}
.paycard__status:hover { border-color: var(--brand); }
.paycard__status.tone-ok { background: var(--green-soft); }
.paycard__status.tone-warn { background: var(--maroon-soft); }
.paycard__headline { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 1.05rem; }
.paycard__status.tone-ok .paycard__headline { color: var(--green); }
.paycard__status.tone-warn .paycard__headline { color: var(--maroon); }
.paycard__nums { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .93rem; }
.paycard__nums strong { font-family: var(--font-display); font-size: 1.05rem; }
.paycard__k { color: var(--ink-2); font-size: .86rem; }
.paycard__hint { color: var(--ink-2); font-size: .9rem; }
.paycard__due { display: flex; gap: 6px; align-items: center; font-size: .88rem; color: var(--ink-2); }
.paycard__due.is-late { color: var(--maroon); font-weight: 600; }
.paycard__promo { display: flex; gap: 10px; align-items: flex-start; color: var(--brand); }
.paycard__promo > span { display: grid; color: var(--ink); }
.paycard__promo-name { font-weight: 600; }
.paycard__promo-off { color: var(--green); font-size: .9rem; font-weight: 500; }
/* ทางเข้า /profile จากการ์ดทักทาย (9 พ.ย. 69) */
.hello__profile { display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin-top: 10px; min-height: 40px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--brand); font-weight: 600; text-decoration: none; }
.hello__profile:hover { background: var(--surface-2); }
