/* =====================================================================
   FinDoc :: assets/css/line.css
   หน้าเว็บฝั่งลูกค้า (เปิดผ่าน LINE) — ออกแบบสำหรับมือถือเป็นหลัก
   ===================================================================== */

:root {
    --ln-yellow: #FFCF25;
    --ln-dark:   #1B1F27;
    --ln-text:   #232833;
    --ln-muted:  #7B8494;
    --ln-line:   #E6E9F0;
    --ln-bg:     #F5F6F9;
    --ln-card:   #FFFFFF;
    --ln-green:  #06C755;
    --ln-red:    #E5484D;
    --ln-blue:   #3B82F6;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ln-bg);
    color: var(--ln-text);
    font-family: 'Kanit', 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }

/* กันรูปทุกใบล้นกรอบ ไม่ว่าไฟล์ต้นฉบับจะใหญ่แค่ไหน */
img { max-width: 100%; height: auto; }
p { margin: 0 0 10px; }
.text-muted { color: var(--ln-muted); }
code {
    background: #F0F2F6; border-radius: 5px; padding: 1px 5px;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
}

/* ------------------------- ส่วนหัว ------------------------- */
.ln-head {
    position: sticky; top: 0; z-index: 40;
    background: var(--ln-yellow);
    box-shadow: 0 2px 10px rgba(27, 31, 39, .08);
}
.ln-head-in {
    max-width: 720px; margin: 0 auto;
    display: flex; align-items: center; gap: 6px;
    padding: 10px 12px; min-height: 56px;
}
.ln-head-title { flex: 1; min-width: 0; text-align: center; line-height: 1.25; }
.ln-head-title b {
    display: block; font-size: 16px; font-weight: 600; color: var(--ln-dark);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ln-head-title span { display: block; font-size: 11.5px; color: rgba(27, 31, 39, .62); }
.ln-back {
    width: 36px; height: 36px; flex: 0 0 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; color: var(--ln-dark); font-size: 17px;
    background: rgba(255, 255, 255, .45);
}
.ln-back:active { background: rgba(255, 255, 255, .8); }

/* ------------------------- โครงหน้า ------------------------- */
.ln-main {
    max-width: 720px; margin: 0 auto;
    padding: 14px 12px 90px;
}
.ln-foot {
    max-width: 720px; margin: 0 auto;
    padding: 4px 12px 84px;
    text-align: center; font-size: 11.5px; color: var(--ln-muted);
}

/* ------------------------- แถบเมนูล่าง ------------------------- */
.ln-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: flex; background: #FFF;
    border-top: 1px solid var(--ln-line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 14px rgba(27, 31, 39, .06);
}
.ln-tabbar a {
    flex: 1; text-align: center; padding: 8px 2px 7px;
    color: var(--ln-muted); font-size: 10.5px; line-height: 1.3;
}
.ln-tabbar a i { display: block; font-size: 18px; margin-bottom: 2px; }
.ln-tabbar a.active { color: var(--ln-dark); font-weight: 500; }
.ln-tabbar a.active i { color: #C79A00; }

/* ------------------------- แจ้งผล ------------------------- */
.ln-alert {
    border-radius: 12px; padding: 11px 14px; margin: 0 0 12px;
    font-size: 13.5px; line-height: 1.6;
    display: flex; gap: 9px; align-items: flex-start;
}
.ln-alert i { margin-top: 3px; }
.ln-alert.ok  { background: #E8F8EE; color: #12693A; border: 1px solid #BFE9CF; }
.ln-alert.err { background: #FDECEC; color: #A32126; border: 1px solid #F6C9CB; }

/* ------------------------- หน้าแรก / ยินดีต้อนรับ ------------------------- */
.ln-hero { text-align: center; padding: 24px 8px 18px; }
.ln-hero.small { padding: 16px 8px 12px; }
.ln-hero-logo {
    width: 66px; height: 66px; margin: 0 auto 12px;
    border-radius: 20px; background: var(--ln-yellow); color: var(--ln-dark);
    display: flex; align-items: center; justify-content: center; font-size: 28px;
    box-shadow: 0 8px 20px rgba(255, 207, 37, .45);
}
.ln-hero h1 { margin: 0 0 4px; font-size: 21px; font-weight: 600; }
.ln-hero p  { margin: 0; font-size: 13px; color: var(--ln-muted); }

.ln-avatar {
    width: 66px; height: 66px; border-radius: 50%; object-fit: cover;
    display: block; margin: 0 auto 12px; border: 3px solid #FFF;
    box-shadow: 0 4px 14px rgba(27, 31, 39, .14);
}
.ln-avatar.txt {
    background: var(--ln-yellow); color: var(--ln-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 600;
}

/* ------------------------- การ์ด ------------------------- */
.ln-card {
    background: var(--ln-card); border: 1px solid var(--ln-line);
    border-radius: 16px; margin-bottom: 12px; overflow: hidden;
}
.ln-card-head {
    padding: 12px 15px; border-bottom: 1px solid var(--ln-line);
    font-size: 14px; font-weight: 600; background: #FCFCFD;
    display: flex; align-items: center; gap: 8px;
}
.ln-card-head i { color: #C79A00; }
.ln-card-body { padding: 15px; }
.ln-card-body.tight { padding: 6px 15px 12px; }

.ln-chip {
    margin-left: auto; background: #F0F2F6; color: var(--ln-muted);
    border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 500;
}
.ln-lead { font-size: 14px; color: var(--ln-muted); margin: 0 0 14px; text-align: center; }

/* ------------------------- ปุ่ม ------------------------- */
.ln-btn {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    width: 100%; padding: 13px 16px; border: 0; border-radius: 13px;
    font-family: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
    background: #F0F2F6; color: var(--ln-text);
}
.ln-btn + .ln-btn { margin-top: 9px; }
.ln-btn.primary { background: var(--ln-yellow); color: var(--ln-dark); font-weight: 600; }
.ln-btn.line    { background: var(--ln-green);  color: #FFF; font-weight: 600; font-size: 16px; }
.ln-btn.ghost   { background: #FFF; border: 1px solid var(--ln-line); color: var(--ln-muted); margin-top: 12px; }
.ln-btn:active  { transform: translateY(1px); }

.ln-icon-btn {
    flex: 0 0 44px; height: 44px; border: 1px solid var(--ln-line);
    border-radius: 11px; background: var(--ln-yellow); color: var(--ln-dark);
    font-size: 15px; cursor: pointer;
}

/* ------------------------- ฟอร์ม ------------------------- */
.ln-field { margin-bottom: 14px; }
.ln-field label {
    display: block; font-size: 13px; font-weight: 500;
    margin-bottom: 6px; color: #444B58;
}
.ln-field .req { color: var(--ln-red); }
.ln-input {
    width: 100%; padding: 11px 13px; font-family: inherit; font-size: 15px;
    border: 1px solid var(--ln-line); border-radius: 11px; background: #FFF;
    color: var(--ln-text); outline: none; -webkit-appearance: none;
}
.ln-input:focus { border-color: var(--ln-yellow); box-shadow: 0 0 0 3px rgba(255, 207, 37, .25); }
textarea.ln-input { resize: vertical; line-height: 1.6; }
select.ln-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%237B8494' d='M8 11L3 5.5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    background-size: 14px; padding-right: 34px;
}
.ln-hint { font-size: 11.5px; color: var(--ln-muted); margin-top: 5px; }

.ln-pass { position: relative; }
.ln-pass button {
    position: absolute; right: 4px; top: 4px; bottom: 4px; width: 42px;
    border: 0; background: transparent; color: var(--ln-muted); cursor: pointer; font-size: 15px;
}

/* ------------------------- ดาวให้คะแนน ------------------------- */
.ln-star { display: flex; align-items: center; gap: 4px; }
.ln-star button {
    border: 0; background: transparent; cursor: pointer; padding: 0 2px;
    font-size: 30px; line-height: 1; color: #D9DDE5;
}
.ln-star button.on { color: #F5A524; }
.ln-star span { margin-left: 8px; font-size: 13px; color: var(--ln-muted); }

/* ------------------------- โปรไฟล์ / สถิติ / เมนู ------------------------- */
.ln-profile {
    display: flex; align-items: center; gap: 12px;
    background: #FFF; border: 1px solid var(--ln-line);
    border-radius: 16px; padding: 13px 15px; margin-bottom: 12px;
}
.ln-profile .ln-avatar { width: 48px; height: 48px; margin: 0; flex: 0 0 48px; font-size: 20px; }
.ln-profile-txt { min-width: 0; }
.ln-profile-txt b {
    display: block; font-size: 15px; font-weight: 600; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ln-profile-txt span { font-size: 12px; color: var(--ln-muted); }

.ln-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.ln-stat {
    background: #FFF; border: 1px solid var(--ln-line); border-radius: 16px;
    padding: 14px 12px; text-align: center;
}
.ln-stat i { font-size: 17px; color: #C79A00; }
.ln-stat b { display: block; font-size: 22px; font-weight: 600; line-height: 1.3; }
.ln-stat span { font-size: 11.5px; color: var(--ln-muted); }

.ln-menu {
    background: #FFF; border: 1px solid var(--ln-line);
    border-radius: 16px; overflow: hidden; margin-bottom: 12px;
}
.ln-menu a {
    display: flex; align-items: center; gap: 12px; padding: 13px 15px;
    border-bottom: 1px solid var(--ln-line);
}
.ln-menu a:last-child { border-bottom: 0; }
.ln-menu a:active { background: #FAFBFC; }
.ln-menu .ic {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.ln-menu .ic.blue   { background: #E8F1FF; color: #2563EB; }
.ln-menu .ic.green  { background: #E6F9EE; color: #0F9D58; }
.ln-menu .ic.yellow { background: #FFF6D9; color: #B98A00; }
.ln-menu .ic.gray   { background: #F0F2F6; color: #64748B; }
.ln-menu .tx { flex: 1; min-width: 0; line-height: 1.4; }
.ln-menu .tx b { display: block; font-size: 14.5px; font-weight: 500; }
.ln-menu .tx small { font-size: 11.5px; color: var(--ln-muted); }
.ln-menu .ar { color: #C4CAD6; font-size: 14px; }

/* ------------------------- รายการเอกสาร ------------------------- */
.ln-filter { margin-bottom: 10px; }
.ln-filter-row { display: flex; gap: 8px; }
.ln-filter-row select.ln-input { flex: 0 0 120px; }
.ln-filter-row input.ln-input  { flex: 1; min-width: 0; }
.ln-clear { display: inline-block; margin-top: 8px; font-size: 12.5px; color: var(--ln-muted); }
.ln-result { font-size: 12.5px; color: var(--ln-muted); margin: 0 2px 10px; }

.ln-group {
    background: #FFF; border: 1px solid var(--ln-line);
    border-radius: 16px; overflow: hidden; margin-bottom: 10px;
}
.ln-group-head {
    background: #FCFBF4; border-bottom: 1px solid var(--ln-line);
    padding: 9px 12px; font-size: 12.5px; font-weight: 500; color: #5C6472;
    display: flex; align-items: center; gap: 7px;
}
.ln-group-head i { color: #D9B02B; }
.ln-group-head span {
    margin-left: auto; background: #FFF; border: 1px solid var(--ln-line);
    border-radius: 999px; padding: 0 8px; font-size: 11px; color: var(--ln-muted);
}

.ln-doc {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 12px; border-bottom: 1px solid #F1F3F7;
}
.ln-doc:last-child { border-bottom: 0; }
.ln-doc-ic {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
    background: #F0F2F6; color: #64748B;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.ln-doc-ic.pdf  { background: #FDECEC; color: #D9342B; }
.ln-doc-ic.jpg, .ln-doc-ic.jpeg,
.ln-doc-ic.png, .ln-doc-ic.gif  { background: #EEF2FF; color: #5B5BD6; }
.ln-doc-ic.xls, .ln-doc-ic.xlsx { background: #E6F7EE; color: #128A4E; }
.ln-doc-ic.doc, .ln-doc-ic.docx { background: #E8F1FF; color: #2563EB; }
/* พื้นที่กดทั้งแถว (ชื่อเอกสาร) — PDF/รูป กดแล้วเปิดดูได้เลย */
.ln-doc-hit {
    display: flex;
    align-items: center;
    gap: 11px;
    flex: 1;
    min-width: 0;
    margin: -11px 0 -11px -12px;
    padding: 11px 4px 11px 12px;
    border-radius: 12px;
}
.ln-doc-hit:active { background: #F4F6F9; }

.ln-doc-tx { flex: 1; min-width: 0; line-height: 1.45; }
.ln-doc-tx b {
    display: block; font-size: 13.5px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ln-doc-tx small { display: block; font-size: 11.5px; color: var(--ln-muted); }
.ln-dl {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
    background: var(--ln-yellow); color: var(--ln-dark);
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.ln-dl:active { filter: brightness(.93); }

/* ปุ่มเปิดดู (แว่นตา) = ปุ่มหลัก · ปุ่มบันทึกไฟล์ย่อลงเป็นปุ่มรอง */
.ln-dl.view {
    background: var(--ln-yellow);
    color: var(--ln-dark);
}
.ln-dl.sm {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin-left: 6px;
    border-radius: 10px;
    background: #F0F2F6;
    color: var(--ln-muted);
    font-size: 12.5px;
}

/* ------------------------- ตารางข้อมูล 2 คอลัมน์ ------------------------- */
.ln-info {
    display: flex; gap: 12px; padding: 9px 0;
    border-bottom: 1px dashed var(--ln-line); font-size: 13.5px;
}
.ln-info:last-child { border-bottom: 0; }
.ln-info span { flex: 0 0 42%; color: var(--ln-muted); font-size: 12.5px; }
.ln-info b { flex: 1; min-width: 0; font-weight: 500; word-break: break-word; }
.ln-addr { margin: 0; font-size: 13.5px; line-height: 1.8; }

/* ------------------------- วันหยุด ------------------------- */
.ln-hd {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px dashed var(--ln-line); font-size: 13px;
}
.ln-hd:last-child { border-bottom: 0; }
.ln-hd .d { flex: 0 0 84px; color: var(--ln-muted); font-size: 12px; }
.ln-hd .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-hd .l { color: #B98A00; font-size: 11.5px; }

/* ------------------------- คำติชม ------------------------- */
.ln-fb { padding: 12px 0; border-bottom: 1px dashed var(--ln-line); }
.ln-fb:last-child { border-bottom: 0; }
.ln-fb-top { display: flex; align-items: center; gap: 8px; }
.ln-fb-top b { font-size: 14px; font-weight: 500; }
.ln-fb-meta { font-size: 11.5px; color: var(--ln-muted); margin-bottom: 5px; }
.ln-fb-detail { margin: 0; font-size: 13.5px; line-height: 1.7; }
.ln-fb-reply {
    margin-top: 9px; background: #FCFBF4; border-left: 3px solid var(--ln-yellow);
    border-radius: 0 10px 10px 0; padding: 9px 12px; font-size: 13px; line-height: 1.7;
}
.ln-fb-reply b { display: block; font-size: 12px; color: #B98A00; margin-bottom: 2px; }
.ln-fb-reply small { display: block; font-size: 11px; color: var(--ln-muted); margin-top: 4px; }

.ln-tag {
    margin-left: auto; border-radius: 999px; padding: 1px 10px;
    font-size: 11px; font-weight: 500;
}
.ln-tag.gray   { background: #F0F2F6; color: #64748B; }
.ln-tag.yellow { background: #FFF6D9; color: #96700A; }
.ln-tag.green  { background: #E6F9EE; color: #0F7A43; }

/* ------------------------- ว่างเปล่า / หมายเหตุ ------------------------- */
.ln-empty {
    background: #FFF; border: 1px dashed var(--ln-line); border-radius: 16px;
    padding: 34px 20px; text-align: center; color: var(--ln-muted);
}
.ln-empty i { font-size: 38px; color: #D3D8E2; }
.ln-empty p { margin: 12px 0 0; font-size: 13.5px; }
.ln-empty.big { padding: 46px 22px; }
.ln-empty.big i { font-size: 46px; color: var(--ln-yellow); }
.ln-empty.big h2 { margin: 14px 0 6px; font-size: 18px; color: var(--ln-text); font-weight: 600; }
.ln-soon-note { font-size: 12.5px; }

.ln-note {
    margin-top: 14px; background: #FCFBF4; border: 1px solid #F2E6BC;
    border-radius: 12px; padding: 11px 13px;
    font-size: 12.5px; line-height: 1.75; color: #6C6446;
}
.ln-note i { color: #C79A00; margin-right: 4px; }
.ln-help { text-align: center; font-size: 12.5px; color: var(--ln-muted); padding: 4px 16px; }

/* ------------------------- จอใหญ่ ------------------------- */
@media (min-width: 640px) {
    .ln-stats { grid-template-columns: repeat(2, 1fr); }
    .ln-main  { padding-bottom: 100px; }
}

/* ------------------------- หนังสือชี้แจง (รายการ) ------------------------- */
.ln-letter {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFF;
    border: 1px solid var(--ln-line);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.ln-letter:active { background: #FAFBFC; }
.ln-letter-ic {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 12px;
    background: #FCFBF4;
    border: 1px solid #F2E6BC;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #C79A00;
    overflow: hidden;
}
.ln-letter-ic img {
    width: 100%;
    height: 100%;
    max-width: 38px;
    max-height: 30px;
    object-fit: contain;
}
.ln-letter-tx { flex: 1; min-width: 0; line-height: 1.5; overflow: hidden; }
.ln-letter-tx b {
    display: block; font-size: 14px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ln-letter-tx small {
    display: block; font-size: 11.5px; color: var(--ln-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ln-letter .ar { flex: 0 0 14px; }
.ln-letter .ar { color: #C4CAD6; font-size: 14px; }

/* เมนูหน้าหลัก : ไอคอนสีแดงอ่อน */
.ln-menu .ic.red { background: #FDECEC; color: #D9342B; }
