.ibadah-app {
    --ib-accent: #0f766e;
    --ib-accent-2: #134e4a;
    --ib-gold: #b45309;
    --ib-ink: #1e293b;
    --ib-muted: #64748b;
    --ib-line: #e7e1d8;
    --ib-card: #ffffff;
    --ib-soft: #f3f7f6;
    --ib-sand: #fff7ed;
    --ib-green: var(--ib-accent);
    --ib-bg: transparent;
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: 88px;
    color: var(--ib-ink);
    font-size: 15px;
}
.ibadah-app[data-theme="public"] {
    --ib-accent: var(--primary, #0f766e);
    --ib-accent-2: color-mix(in srgb, var(--primary, #0f766e) 72%, #0f172a);
    --ib-green: var(--ib-accent);
}
.ib-icon {
    width: 1.05em;
    height: 1.05em;
    display: inline-block;
    vertical-align: -0.15em;
    flex: none;
}
.ibadah-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin: 0 0 10px;
    padding: 2px 2px 12px;
    border-bottom: 1px solid var(--ib-line);
}
.ibadah-kicker {
    margin: 0 0 3px;
    color: var(--ib-gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.ibadah-top h2, .ibadah-welcome h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; }
.ibadah-top-side { display: flex; align-items: baseline; gap: 6px; text-align: right; }
.ibadah-top-side span { margin-right: 8px; }
.ibadah-top-side b { font-size: 18px; color: var(--ib-accent); line-height: 1.1; }
.ibadah-top-side span { font-size: 11px; font-weight: 700; color: var(--ib-muted); }
.ibadah-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ibadah-card-head h3 { margin: 0; }
.ibadah-card-head span { color: var(--ib-muted); font-size: 12px; font-weight: 700; }
.ibadah-group { margin: 0 0 14px; }
.ibadah-group > header { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 8px; }
.ibadah-group h3 { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ib-accent-2); }
.ibadah-group header span { color: var(--ib-muted); font-size: 12px; font-weight: 700; }
.ibadah-month-nav { justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ibadah-month-nav button { min-width: 36px; }
.ibadah-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
}
.ibadah-stat {
    padding: 14px 8px;
    border: 1px solid var(--ib-line);
    border-radius: 12px;
    background: var(--ib-card);
    text-align: center;
}
.ibadah-stat b { display: block; color: var(--ib-accent); font-size: 22px; }
.ibadah-stat:nth-child(2) b { color: var(--ib-gold); }
.ibadah-stat span { color: var(--ib-muted); font-size: 11px; font-weight: 700; }
.ibadah-card {
    margin: 0 0 14px;
    padding: 16px;
    border: 1px solid var(--ib-line);
    border-radius: 14px;
    background: var(--ib-card);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
}
.ibadah-card h3 { margin: 0 0 10px; font-size: 16px; }
.ibadah-card h3 .ib-icon { margin-right: 6px; color: var(--ib-accent); }
.ibadah-muted { color: var(--ib-muted); font-size: 13px; line-height: 1.5; }
.ibadah-progress { height: 8px; margin: 0 0 14px; border-radius: 99px; background: #efeae3; overflow: hidden; }
.ibadah-progress > div { height: 100%; background: linear-gradient(90deg, var(--ib-accent), var(--ib-gold)); transition: width .3s; }
.ibadah-prayer-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    margin-top: 12px;
}
.ibadah-prayer {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    min-width: 0; padding: 11px 3px; border: 1px solid var(--ib-line);
    border-radius: 12px; background: var(--ib-soft); color: inherit; cursor: pointer;
}
.ibadah-prayer-icon { color: var(--ib-accent); }
.ibadah-prayer-icon .ib-icon { width: 18px; height: 18px; }
.ibadah-prayer strong { font-size: 11px; }
.ibadah-prayer.is-done { background: var(--ib-sand); border-color: var(--ib-gold); }
.ibadah-prayer.is-done .ibadah-prayer-icon,
.ibadah-prayer.is-done strong { color: var(--ib-gold); }
.ibadah-section { margin: 16px 0 8px; color: var(--ib-accent-2); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: 12px; }
.ibadah-section::before {
    content: "";
    display: inline-block;
    width: 7px; height: 7px;
    margin-right: 8px;
    background: var(--ib-gold);
    transform: rotate(45deg);
    vertical-align: 1px;
}
.ibadah-habit {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid #f1ece6;
}
.ibadah-habit:last-child { border-bottom: 0; }
.ibadah-check {
    width: 30px; height: 30px; flex: none; padding: 0;
    display: grid; place-items: center;
    border: 2px solid var(--ib-accent); border-radius: 50%;
    background: #fff; color: #fff; cursor: pointer;
}
.ibadah-check .ib-icon { width: 15px; height: 15px; }
.ibadah-check.is-done { background: var(--ib-accent); border-color: var(--ib-accent); }
.ibadah-habit .label { flex: 1; min-width: 0; }
.ibadah-habit .label strong { display: block; font-size: 14px; }
.ibadah-habit small { color: #78846d; }
.ibadah-info {
    flex: none; padding: 5px 8px;
    border: 1px solid #fed7aa; border-radius: 999px; background: var(--ib-sand);
    color: var(--ib-gold); font-size: 11px; font-weight: 700; cursor: pointer;
}
.ibadah-badge-mark {
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center;
    border-radius: 10px; background: #f1f5f9; color: #94a3b8;
}
.ibadah-badge-mark.is-open { background: var(--ib-sand); color: var(--ib-gold); }
.ibadah-chip .ib-icon { width: 14px; height: 14px; }
.ibadah-tabs {
    position: sticky; bottom: 0; z-index: 4;
    display: flex; justify-content: center;
    margin: 18px -4px -8px; padding: 8px 4px 10px;
    background: color-mix(in srgb, var(--ib-card) 92%, transparent);
    border-top: 1px solid var(--ib-line);
    backdrop-filter: blur(8px);
}
.ibadah-tabs button {
    flex: 1; max-width: 160px; padding: 8px 4px;
    border: 0; border-radius: 12px; background: none;
    color: var(--ib-muted); font-size: 11px; font-weight: 700; cursor: pointer;
}
.ibadah-tabs button .ib-icon { width: 18px; height: 18px; display: block; margin: 0 auto 3px; }
.ibadah-tabs button.is-active { color: var(--ib-accent); background: var(--ib-soft); }
.ibadah-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.ibadah-day, .ibadah-dow {
    padding: 6px 2px; border-radius: 10px; font-size: 11px; background: #f4f1eb;
}
.ibadah-dow { background: transparent; color: var(--ib-muted); font-weight: 800; }
.ibadah-day {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; min-height: 48px; border: 0; cursor: pointer; color: inherit; line-height: 1.15;
}
.ibadah-day-num { font-size: 13px; font-weight: 800; }
.ibadah-day-pct { font-size: 10px; font-weight: 800; color: var(--ib-muted); white-space: nowrap; }
.ibadah-day.is-level-1 { background: color-mix(in srgb, var(--ib-accent) 16%, white); }
.ibadah-day.is-level-1 .ibadah-day-pct { color: var(--ib-accent-2); }
.ibadah-day.is-level-2 { background: color-mix(in srgb, var(--ib-accent) 32%, white); }
.ibadah-day.is-level-2 .ibadah-day-pct { color: var(--ib-accent-2); }
.ibadah-day.is-level-3 { background: color-mix(in srgb, var(--ib-accent) 58%, white); color: #f8fafc; }
.ibadah-day.is-level-3 .ibadah-day-pct { color: #f8fafc; }
.ibadah-day.is-level-4 { background: var(--ib-accent); color: #f8fafc; }
.ibadah-day.is-level-4 .ibadah-day-pct { color: #f8fafc; }
.ibadah-day.is-today { box-shadow: inset 0 0 0 2px var(--ib-gold); }
.ibadah-day.is-selected { box-shadow: inset 0 0 0 2px var(--ib-accent-2); }
.ibadah-day.is-today.is-selected { box-shadow: inset 0 0 0 2px var(--ib-accent-2), inset 0 0 0 4px var(--ib-gold); }
.ibadah-day.is-other { opacity: .35; }
.ibadah-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 9px; align-items: end; text-align: center; }
.ibadah-bar { height: 88px; display: flex; align-items: end; border-radius: 8px; background: #efeae3; overflow: hidden; }
.ibadah-bar > div { width: 100%; background: linear-gradient(180deg, var(--ib-gold), var(--ib-accent)); }
.ibadah-field { display: grid; gap: 6px; margin: 0 0 12px; }
.ibadah-field span { font-size: 12px; font-weight: 800; }
.ibadah-field input, .ibadah-field select, .ibadah-field textarea {
    width: 100%; padding: 11px 12px; border: 1px solid var(--ib-line);
    border-radius: 10px; background: #fff; color: inherit; font: inherit;
}
.ibadah-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ibadah-btn, .ibadah-app button.primary {
    border: 0; border-radius: 10px; padding: 10px 13px;
    background: var(--ib-soft); color: var(--ib-ink); font-weight: 700; cursor: pointer;
}
.ibadah-app button.primary { background: var(--ib-accent); color: #fff; }
.ibadah-chip {
    display: inline-grid; place-items: center; min-width: 28px;
    margin: 3px; padding: 6px 8px;
    border-radius: 8px; background: #f1f5f9; color: #64748b; font-size: 12px;
}
.ibadah-quote { margin: 10px 0; padding: 10px 13px; border-left: 4px solid var(--ib-gold); background: var(--ib-sand); line-height: 1.65; }
.ibadah-empty { padding: 20px; text-align: center; color: #839079; }
.ibadah-modal {
    position: fixed; inset: 0; z-index: 40;
    display: grid; place-items: center; padding: 20px;
    background: rgba(15, 23, 42, .62);
}
.ibadah-modal .panel {
    width: min(460px, 100%); max-height: 85vh; overflow: auto;
    padding: 22px; border-radius: 16px; background: #fff;
}
.ibadah-modal h3 .ib-icon { margin-right: 6px; color: var(--ib-accent); }
.ibadah-toast {
    position: fixed; top: 16px; left: 50%; z-index: 50;
    transform: translateX(-50%); min-width: 220px;
    padding: 12px 18px; border: 1px solid color-mix(in srgb, var(--ib-accent) 35%, white); border-radius: 12px;
    background: #f8fafc; color: var(--ib-ink); box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
    text-align: center; font-weight: 700;
}
.ibadah-hidden { display: none !important; }
.ibadah-welcome { max-width: 440px; margin: 28px auto 12px; padding: 8px 4px 24px; }
.ibadah-welcome .ibadah-muted { margin: 10px 0 16px; }
.ibadah-badge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.ibadah-badge-tile {
    display: grid; gap: 4px; align-content: start;
    padding: 14px; border: 1px solid var(--ib-line); border-radius: 14px; background: var(--ib-card);
}
.ibadah-badge-tile.is-open { background: var(--ib-sand); border-color: #fed7aa; }
.ibadah-badge-tile strong { font-size: 14px; }
.ibadah-badge-tile small { color: var(--ib-muted); }
@media (max-width: 560px) {
    .ibadah-top { flex-direction: column; align-items: flex-start; }
    .ibadah-top-side { text-align: left; justify-items: start; }
}
[data-cms-theme="dark"] .ibadah-app {
    --ib-ink: #e2e8f0;
    --ib-muted: #94a3b8;
    --ib-line: #334155;
    --ib-card: #0f172a;
    --ib-soft: rgba(45, 212, 191, .12);
    --ib-sand: rgba(180, 83, 9, .18);
    --ib-accent: #2dd4bf;
    --ib-accent-2: #99f6e4;
    --ib-gold: #fdba74;
    --ib-green: var(--ib-accent);
}
[data-cms-theme="dark"] .ibadah-stat,
[data-cms-theme="dark"] .ibadah-card,
[data-cms-theme="dark"] .ibadah-modal .panel { background: #0f172a; color: #e2e8f0; }
[data-cms-theme="dark"] .ibadah-habit { border-color: #334155; }
[data-cms-theme="dark"] .ibadah-check { background: transparent; }
[data-cms-theme="dark"] .ibadah-day { background: #1e293b; color: #e2e8f0; }
[data-cms-theme="dark"] .ibadah-day-pct { color: #94a3b8; }
[data-cms-theme="dark"] .ibadah-day.is-level-1 { background: rgba(45, 212, 191, .22); }
[data-cms-theme="dark"] .ibadah-day.is-level-2 { background: rgba(45, 212, 191, .4); }
[data-cms-theme="dark"] .ibadah-day.is-level-3 { background: #0f766e; color: #f8fafc; }
[data-cms-theme="dark"] .ibadah-day.is-level-3 .ibadah-day-pct,
[data-cms-theme="dark"] .ibadah-day.is-level-4 .ibadah-day-pct { color: #f8fafc; }
[data-cms-theme="dark"] .ibadah-day.is-level-4 { background: #115e59; color: #f8fafc; }
[data-cms-theme="dark"] .ibadah-field input,
[data-cms-theme="dark"] .ibadah-field select,
[data-cms-theme="dark"] .ibadah-field textarea { background: #1e293b; color: #e2e8f0; }
@media (max-width: 390px) {
    .ibadah-prayer-grid { gap: 4px; }
    .ibadah-prayer { padding: 9px 1px; }
    .ibadah-prayer strong { font-size: 10px; }
}
