/* ===== หน้าแรก ===== */
.top-bar { display: flex; align-items: center; gap: .75rem; }
.top-bar .who { flex: 1; min-width: 0; }
.top-bar .who b { display: block; font-family: var(--font-head); font-size: 1.125rem; line-height: 1.25; color: var(--primary-ink); }
.top-bar .who span { font-size: .8125rem; color: var(--ink-mute); }
.date-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.hero { position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: 200px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.1rem; background: #2a1a0a url('/img/hero-temple.jpg') center/cover; box-shadow: var(--shadow-card); }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,10,0,.05) 0%, rgba(20,10,0,.82) 100%); }
.hero > * { position: relative; }
.hero .tag { position: absolute; top: .9rem; right: .9rem; background: var(--primary); padding: .25rem .8rem; border-radius: var(--r-pill); font-weight: 700; font-size: .8125rem; }
.hero h2 { color: #fff; font-size: 1.5rem; margin-bottom: .25rem; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.hero p { color: rgba(255,255,255,.85); font-size: .8125rem; margin-bottom: .75rem; }
.hero .btn { align-self: flex-start; background: linear-gradient(135deg, #D97706, #B45309); }
.countdown { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: var(--r-lg); background: linear-gradient(135deg, #B45309, #78350F); color: #fff; box-shadow: var(--shadow-card); }
.countdown .time { font-family: var(--font-head); font-size: 1.75rem; font-weight: 600; letter-spacing: .02em; }
.countdown small { opacity: .85; display: block; font-size: .75rem; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.quick a, .quick button { display: flex; flex-direction: column; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 600; color: var(--ink-soft); text-align: center; }
.quick .tile { width: 100%; max-width: 72px; aspect-ratio: 1; border-radius: 18px; display: grid; place-items: center; background: var(--amber-wash); color: var(--primary); border: 1px solid var(--line); }
.quick .tile.jade { background: var(--jade-wash); color: var(--jade); } .quick .tile.info { background: var(--info-wash); color: var(--info-ink); } .quick .tile.orange { background: #FFDBCA; color: #903f00; }
.event-main .head { display: flex; align-items: center; gap: .6rem; padding-bottom: .8rem; border-bottom: 1px dashed var(--line); margin-bottom: .8rem; }
.time-box { display: flex; align-items: center; gap: .5rem; padding: .4rem .7rem; border-radius: 12px; background: var(--amber-wash); color: var(--primary-ink); font-weight: 700; font-size: .875rem; }
.type-tag { display: inline-block; padding: .2rem .7rem; border-radius: 8px; background: #FFDBCA; color: #763300; font-size: .75rem; font-weight: 700; margin-bottom: .4rem; }
.type-tag.inauspicious { background: #E2E8F0; color: #334155; } .type-tag.auspicious { background: #FFDBCA; } .type-tag.temple { background: var(--jade-wash); color: var(--jade-ink); }
.event-title { font-family: var(--font-head); font-size: 1.375rem; font-weight: 600; line-height: 1.35; }
.loc { display: flex; align-items: flex-start; gap: .5rem; color: var(--ink-soft); font-size: .875rem; margin: .6rem 0; }
.loc .ms { color: var(--primary); margin-top: 1px; }
.host { display: flex; align-items: center; gap: .75rem; padding: .75rem; border-radius: var(--r-md); background: var(--info-wash); }
.host .who { flex: 1; min-width: 0; } .host b { display: block; font-size: .9375rem; } .host span { font-size: .75rem; color: var(--ink-soft); }
.round-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--jade); box-shadow: 0 1px 4px rgba(0,0,0,.12); flex: none; }
.event-row { display: flex; align-items: center; gap: .8rem; padding: .8rem; }
.event-row .when { flex: none; text-align: center; padding: .4rem .55rem; border-radius: 12px; background: var(--amber-wash); color: var(--primary-ink); font-weight: 700; font-size: .875rem; line-height: 1.25; }
.event-row .body { flex: 1; min-width: 0; } .event-row .body b { display: block; font-size: 1rem; } .event-row .body span { font-size: .8125rem; color: var(--ink-mute); }
.routine-circles { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: .5rem; margin-top: 1rem; }
.routine-circle { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; font-size: .75rem; font-weight: 700; }
.routine-circle .c { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--canvas-2); border: 1px dashed var(--line); color: var(--ink-mute); transition: background .2s; }
.routine-circle.done .c { background: var(--jade-wash); color: var(--jade); border: 0; }
.routine-circle small { font-weight: 600; color: var(--ink-mute); } .routine-circle.done small { color: var(--jade-ink); }
.quote { display: flex; gap: .9rem; padding: 1rem 1.1rem; border-radius: var(--r-lg); background: var(--amber-wash); border: 1px solid var(--line); }
.quote .mark { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; }
.quote b { color: var(--primary-ink); display: block; margin-bottom: .2rem; } .quote em { color: var(--ink-soft); font-size: .875rem; }

/* ===== ปฏิทิน ===== */
.cal-head { display: flex; align-items: center; gap: .5rem; } .cal-head h2 { flex: 1; font-size: 1.375rem; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; text-align: center; margin-top: .75rem; }
.wday { border-radius: 14px; padding: .35rem 0 .45rem; min-height: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-soft); font-weight: 700; }
.wday small { font-size: .6875rem; color: var(--ink-mute); font-weight: 600; } .wday .num { font-size: 1.0625rem; }
.wday[aria-pressed='true'] { background: var(--primary); color: #fff; } .wday[aria-pressed='true'] small { color: rgba(255,255,255,.85); }
.dots { display: flex; gap: 3px; min-height: 7px; } .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--jade); }
.dots i.pending { background: var(--gold); } .dots i.conflict { background: var(--danger); } .wday[aria-pressed='true'] .dots i { box-shadow: 0 0 0 1.5px rgba(255,255,255,.9); }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: .75rem; }
.month-grid .dow { text-align: center; font-size: .75rem; font-weight: 700; color: var(--ink-mute); padding: .25rem 0; }
.cell { aspect-ratio: 1 / 1.12; border-radius: 12px; display: flex; flex-direction: column; align-items: center; padding-top: .3rem; gap: 2px; position: relative; font-weight: 700; color: var(--ink); }
.cell.out { opacity: .35; } .cell:hover { background: var(--amber-tint); }
.cell .wp { position: absolute; top: 3px; right: 4px; font-size: .625rem; color: var(--gold); } .cell .wp .ms { font-size: .75rem; font-variation-settings: 'FILL' 1; }
.cell.today { box-shadow: inset 0 0 0 2px var(--gold); } .cell[aria-pressed='true'] { background: var(--primary); color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .75rem; color: var(--ink-soft); font-weight: 600; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line-soft); }
.legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--jade); }
.legend .p::before { background: var(--gold); } .legend .c::before { background: var(--danger); }
.conflict-banner { display: flex; gap: .8rem; align-items: flex-start; } .conflict-banner .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--danger-wash); color: var(--danger); display: grid; place-items: center; flex: none; }
.conflict-banner h3 { color: var(--danger); font-size: .9375rem; font-family: var(--font-body); font-weight: 800; }
.group-title { display: flex; justify-content: space-between; font-weight: 700; font-size: .875rem; margin: 1.25rem 0 .5rem; } .group-title small { color: var(--ink-mute); font-weight: 600; }
.slot-label { font-size: .8125rem; font-weight: 800; color: var(--primary-ink); margin: 1rem 0 .4rem; display: flex; align-items: center; gap: .4rem; }
.agenda-item { display: block; color: inherit; } .agenda-item + .agenda-item { margin-top: .75rem; }
.agenda-item .meta { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; font-size: .8125rem; font-weight: 700; color: var(--primary-ink); }
.agenda-item h3 { font-size: 1.0625rem; margin-bottom: .2rem; }
.clash { border: 1px solid rgba(186,26,26,.35); border-radius: var(--r-lg); overflow: hidden; background: var(--card); }
.clash .bar { background: var(--danger-wash); color: var(--danger); font-weight: 700; font-size: .8125rem; padding: .5rem .9rem; display: flex; gap: .4rem; align-items: center; }
.clash .item { padding: .75rem .9rem; border-left: 4px solid var(--danger); margin: .75rem .9rem; } .clash .sep { text-align: center; font-size: .75rem; font-weight: 700; color: var(--gold); }

/* ===== รายละเอียดกิจ ===== */
.detail-hero { background: linear-gradient(135deg, #B45309, #78350F); color: #fff; border-radius: var(--r-lg); padding: 1.25rem; box-shadow: var(--shadow-card); }
.detail-hero h1 { color: #fff; font-size: 1.5rem; margin: .5rem 0; } .detail-hero .code { font-size: .75rem; opacity: .85; letter-spacing: .04em; }
.detail-hero .badge { background: rgba(255,255,255,.2); color: #fff; }
.check { display: flex; align-items: center; gap: .75rem; padding: .7rem .2rem; border-top: 1px solid var(--line-soft); min-height: 48px; width: 100%; text-align: left; }
.check:first-child { border-top: 0; } .check .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--gold); display: grid; place-items: center; flex: none; color: transparent; }
.check[aria-checked='true'] .box { background: var(--jade); border-color: var(--jade); color: #fff; } .check[aria-checked='true'] .txt { color: var(--ink-mute); text-decoration: line-through; }
.timeline { position: relative; padding-left: 1.4rem; margin: 0; list-style: none; } .timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 1rem 0; } .timeline li::before { content: ''; position: absolute; left: -1.4rem; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 3px solid var(--canvas); }
.timeline time { font-weight: 800; color: var(--primary-ink); font-size: .8125rem; display: block; }
.actions-bar { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.map-mock { height: 120px; border-radius: var(--r-md); background: repeating-linear-gradient(45deg, var(--info-wash), var(--info-wash) 12px, var(--canvas-2) 12px, var(--canvas-2) 24px); display: grid; place-items: center; color: var(--primary); margin-bottom: .75rem; }
.list-edit .li { display: flex; gap: .5rem; align-items: center; } .list-edit .li + .li { margin-top: .5rem; } .list-edit .li .input { flex: 1; min-width: 0; }
.ai-box { border: 1.5px dashed var(--gold); background: var(--amber-wash); border-radius: var(--r-lg); padding: 1rem; }
.ai-draft { border: 2px solid var(--jade); border-radius: var(--r-lg); background: var(--jade-wash); padding: 1rem; color: var(--jade-ink); }
.ai-draft dl { margin: .5rem 0; display: grid; grid-template-columns: 6.5rem 1fr; gap: .25rem .6rem; font-size: .875rem; color: var(--ink); } .ai-draft dt { color: var(--jade-ink); } .ai-draft dd { margin: 0; font-weight: 600; } .ai-draft .miss { color: var(--danger); }
.free-banner { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-radius: var(--r-md); font-weight: 700; font-size: .875rem; background: var(--jade-wash); color: var(--jade-ink); } .free-banner.busy { background: var(--danger-wash); color: var(--danger); align-items: flex-start; flex-direction: column; }

/* ===== กิจวัตร/บันทึก ===== */
.streak { display: flex; gap: 1rem; align-items: center; background: linear-gradient(135deg, #B45309, #78350F); color: #fff; border-radius: var(--r-lg); padding: 1rem 1.1rem; }
.streak b { font-family: var(--font-head); font-size: 2.25rem; line-height: 1; } .streak .week { display: flex; gap: 4px; margin-left: auto; } .streak .week i { width: 12px; height: 28px; border-radius: 6px; background: rgba(255,255,255,.25); } .streak .week i.on { background: var(--gold-soft); } .streak .week i.part { background: rgba(251,191,36,.55); }
.routine-item { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; padding: .9rem; } .routine-item + .routine-item { margin-top: .6rem; }
.routine-item .tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--gold); display: grid; place-items: center; color: transparent; flex: none; }
.routine-item[aria-checked='true'] .tick { background: var(--jade); border-color: var(--jade); color: #fff; }
.routine-item .t { font-weight: 800; color: var(--primary-ink); font-size: .8125rem; } .routine-item[aria-checked='true'] b { color: var(--ink-mute); }
.routine-item .ico { color: var(--primary); } .routine-item.off { opacity: .5; }
.note-card { display: block; color: inherit; } .note-card + .note-card { margin-top: .75rem; } .note-card h3 { font-size: 1.0625rem; } .note-card p { color: var(--ink-soft); font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: .25rem 0 .5rem; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; } .days button { min-height: 40px; border-radius: 12px; border: 1px solid var(--line); font-weight: 700; background: var(--card); } .days button[aria-pressed='true'] { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== ตั้งค่า ===== */
.id-card { background: linear-gradient(135deg, #B45309 0%, #78350F 100%); color: #fff; border-radius: var(--r-lg); padding: 1.25rem; aspect-ratio: 1.586 / 1; max-height: 230px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow-card); position: relative; overflow: hidden; }
.id-card::after { content: ''; position: absolute; right: -50px; top: -50px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(251,191,36,.35), transparent 70%); }
.id-card .avatar { border-color: var(--gold-soft); } .id-card h2 { color: #fff; font-size: 1.3125rem; } .id-card .sub { opacity: .9; font-size: .8125rem; } .id-card .reg { font-size: .75rem; opacity: .85; letter-spacing: .04em; }
.cfg-section h3 { font-family: var(--font-body); font-weight: 800; font-size: .9375rem; color: var(--primary-ink); margin-bottom: .25rem; display: flex; gap: .5rem; align-items: center; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(180deg, rgba(20,10,0,.35), rgba(20,10,0,.85)), url('/img/hero-temple.jpg') center/cover; }
.login .card { width: 100%; max-width: 380px; text-align: center; } .login img.logo { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto .75rem; }
[role='checkbox'][aria-checked='true'] .tick { background: var(--jade); border-color: var(--jade); color: #fff; }
[role='checkbox'][aria-checked='true'] b { color: var(--ink-mute); }
.tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--gold); display: grid; place-items: center; color: transparent; flex: none; }
.icon-btn .ms, .nav-item .ms { width: 1.5rem; height: 1.5rem; }
.nav-fab .disc .ms { width: 2rem; height: 2rem; }
.empty .ms { width: 2.5rem; height: 2.5rem; display: block; margin: 0 auto .5rem; }
.quick .tile .ms { width: 1.75rem; height: 1.75rem; }
