*{box-sizing:border-box}
:root{
  --green:#0f6b45; --green2:#138457; --light:#eaf5ef; --border:#cbd8d1;
  --text:#173027; --muted:#63736c; --red:#c9362f; --redbg:#fff0ef;
  --bg:#f7faf8; --card:#fff; --radius:18px; --fs:18px;
}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:var(--fs)}
button,input,select{font:inherit}
button{cursor:pointer}
.app{min-height:100vh}
.header{position:sticky;top:0;z-index:10;background:rgba(247,250,248,.96);backdrop-filter:blur(8px);border-bottom:1px solid var(--border);padding:12px max(16px,env(safe-area-inset-left))}
.header-row{max-width:900px;margin:auto;display:flex;align-items:center;gap:12px}
.logo{font-size:28px}
.header-title{font-weight:800;line-height:1.15}
.header-sub{font-size:.75em;color:var(--muted)}
main{max-width:900px;margin:0 auto;padding:22px 16px 90px}
.screen-title{font-size:1.55em;font-weight:800;margin:8px 0 4px}
.muted{color:var(--muted)}
.center{text-align:center}
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:20px;box-shadow:0 2px 12px rgba(0,0,0,.04);margin-bottom:16px}
.big-logo{font-size:64px;margin-top:18px}
h1{font-size:1.65em;margin:.35em 0}
h2{font-size:1.25em;margin:.3em 0 .8em}
p{line-height:1.5}
.btn{border:0;border-radius:14px;padding:15px 18px;min-height:52px;font-weight:750}
.btn-primary{background:var(--green);color:#fff}
.btn-secondary{background:var(--light);color:var(--green);border:1px solid #a9cdbc}
.btn-outline{background:#fff;color:var(--green);border:1px solid var(--border)}
.btn-danger{background:var(--redbg);color:var(--red);border:1px solid #efb4b0}
.btn:active{transform:scale(.99)}
.stack{display:grid;gap:12px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.field{display:grid;gap:7px;margin-bottom:14px}
label{font-weight:700}
input,select{width:100%;min-height:52px;border:1px solid var(--border);border-radius:12px;background:#fff;padding:10px 13px;color:var(--text)}
.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:12px 0}
.toolbar .grow{flex:1}
.back{background:transparent;border:0;color:var(--green);padding:8px 4px;font-weight:700}
.info-strip{background:var(--light);border:1px solid #b8d9c7;border-radius:14px;padding:12px 14px;margin-bottom:14px}
.segment{display:flex;background:#edf3ef;border-radius:12px;padding:4px;margin:10px 0 16px}
.segment button{flex:1;border:0;background:transparent;border-radius:9px;padding:11px;color:var(--muted);font-weight:750}
.segment button.active{background:#fff;color:var(--green);box-shadow:0 1px 4px rgba(0,0,0,.08)}
.table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:14px;background:#fff}
table{width:100%;border-collapse:collapse;min-width:520px}
th,td{padding:10px 8px;border-bottom:1px solid var(--border);text-align:left}
th{background:#f1f6f3;font-size:.88em}
th.center,td.center{text-align:center}
tr:last-child td{border-bottom:0}
.status-dot{width:34px;height:34px;border-radius:50%;border:2px solid #b9c4be;background:#fff;display:inline-grid;place-items:center;color:#fff;font-weight:900}
.status-dot.on-red{background:var(--red);border-color:var(--red)}
.status-dot.on-green{background:var(--green);border-color:var(--green)}
.status-dot:focus{outline:3px solid #b8d9c7;outline-offset:2px}
.list{display:grid;gap:9px}
.list-item{display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:#fff;border:1px solid var(--border);border-radius:14px;padding:14px}
.list-item .grow{flex:1}
.avatar{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--light);color:var(--green);font-weight:800}
.large-card{text-align:center;padding:22px}
.large-index{color:var(--muted);font-weight:700}
.large-name{font-size:1.8em;font-weight:850;margin:8px 0 18px}
.status-btn{width:100%;min-height:68px;border-radius:16px;margin:7px 0;font-weight:850;font-size:1.05em;background:#fff;border:2px solid var(--border);color:var(--text)}
.status-btn.selected-red{background:var(--redbg);border-color:#e56a64;color:var(--red)}
.status-btn.selected-green{background:var(--light);border-color:#6cb18f;color:var(--green)}
.nav-buttons{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:15px}
.small{font-size:.85em}
.progress{height:10px;border-radius:10px;background:#e5ece8;overflow:hidden;margin:8px 0 16px}
.progress>div{height:100%;background:var(--green);width:0}
.setting-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid var(--border)}
.setting-row:last-child{border-bottom:0}
.font-buttons{display:flex;gap:7px}
.font-buttons button{border:1px solid var(--border);background:#fff;border-radius:10px;padding:8px 12px}
.font-buttons button.active{background:var(--light);border-color:#8fc3a7;color:var(--green);font-weight:800}
.footer-nav{position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid var(--border);padding:8px max(10px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-bottom));z-index:20}
.footer-nav-inner{max-width:900px;margin:auto;display:flex;justify-content:center;gap:28px}.footer-nav-inner.single{justify-content:center}
.footer-nav button{border:0;background:transparent;color:var(--muted);padding:8px 14px;font-size:.78em}
.footer-nav button.active{color:var(--green);font-weight:800}
.empty{padding:25px;text-align:center;color:var(--muted)}
@media(max-width:560px){
 .grid2{grid-template-columns:1fr}
 .card{padding:12px}
 main{padding:18px 10px 82px}
 .large-name{font-size:1.65em}
 .table-wrap{overflow-x:visible}
 table{min-width:0;width:100%;table-layout:fixed}
 th,td{padding:9px 6px}
 th:first-child,td:first-child{width:42px}
 th:nth-child(3),td:nth-child(3),th:nth-child(4),td:nth-child(4){width:58px}
 th:nth-child(2),td:nth-child(2){width:auto;overflow-wrap:anywhere}
 .status-dot{width:38px;height:38px}
}

.surat-cell{vertical-align:middle}
.ayat-wrap{margin-top:5px}
.ayat-input{min-height:38px;width:100%;padding:6px 9px;border:1px solid var(--border);border-radius:9px;background:#fbfdfc;color:var(--text);font-size:.85em}
.ayat-input:focus{outline:3px solid #b8d9c7;outline-offset:1px}
.large-ayat{max-width:360px;margin:0 auto 12px;display:block;text-align:center;min-height:48px;font-size:1em}
.block-setting{align-items:center}
@media(max-width:560px){
 .ayat-input{min-height:40px;font-size:.84em}
 th:first-child,td:first-child{width:42px}
 th:nth-child(3),td:nth-child(3),th:nth-child(4),td:nth-child(4){width:58px}
}


/* V1.8 - tambah surat langsung di bawah kartu */
.add-surat-area{margin-top:18px;text-align:center;padding-top:14px;border-top:1px dashed #c8d5cf}.add-surat-btn{width:100%;min-height:54px;font-weight:800;font-size:calc(var(--fs) * .95)}.add-surat-hint{margin-top:8px;line-height:1.45}

/* V1.9 - tombol instalasi PWA */
.install-area{margin-top:18px;padding-top:16px;border-top:1px dashed #c8d5cf}
.install-btn{width:100%;min-height:56px;font-weight:850}
.install-hint{margin-top:8px;line-height:1.45}
