@font-face {
    font-family: "Noto Naskh Arabic";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/noto-naskh-arabic-arabic.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: "Noto Naskh Arabic";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/noto-naskh-arabic-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --ink: #17211d;
    --muted: #60706a;
    --paper: #fffdf7;
    --line: #e5d9c4;
    --green: #176f4b;
    --teal: #167c80;
    --gold: #c38b2f;
    --progress: 0%;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    /* يمنع الزوم بالنقر مرتين (الزوم بإصبعين يفضل شغال) */
    touch-action: manipulation;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(22, 124, 128, 0.16), transparent 28rem),
        linear-gradient(180deg, #f5efe4 0%, #eef5f0 100%);
}

button {
    font: inherit;
}

.app-shell {
    width: min(100%, 760px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(13, 74, 68, 0.25);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.install-button {
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 22px;
    color: white;
    background: linear-gradient(135deg, var(--green), var(--teal));
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
}

.install-button[hidden],
.ios-hint[hidden] {
    display: none;
}

.ios-hint {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 253, 247, 0.82);
    font-size: 0.92rem;
}

.eyebrow {
    margin: 0 0 2px;
    color: var(--green);
    font-size: 0.9rem;
    font-weight: 700;
}

h1 {
    margin: 0;
    font-size: clamp(1.7rem, 7vw, 3rem);
    line-height: 1;
}

.icon-button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--green);
    background: rgba(255, 253, 247, 0.78);
    cursor: pointer;
    font-size: 1.35rem;
}

.tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.tab {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 253, 247, 0.76);
    cursor: pointer;
    font-weight: 700;
}

.tab.active {
    color: white;
    border-color: var(--green);
    background: linear-gradient(135deg, var(--green), var(--teal));
}

.summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.82);
}

.summary-label {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
}

.summary strong {
    font-size: 1.25rem;
}

.progress-ring {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: conic-gradient(var(--green) var(--progress), #eadfcd 0);
}

.progress-ring span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--paper);
    color: var(--green);
    font-weight: 800;
    font-size: 0.88rem;
}

.dhikr-list {
    display: grid;
    gap: 12px;
    padding-bottom: 28px;
    flex: 1 0 auto;
}

.noscript-note {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.92);
}

.about {
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 253, 247, 0.7);
    font-size: 0.95rem;
    line-height: 1.9;
}

.about h2 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 1.15rem;
}

.about p {
    margin: 0 0 8px;
}

.about ul {
    margin: 0 0 8px;
    padding-right: 20px;
}

.about strong {
    color: var(--green);
}

.app-footer {
    padding: 16px 8px 4px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.9;
}

.app-footer a {
    color: var(--green);
    font-weight: 700;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

.app-footer .footer-site {
    display: block;
    direction: ltr;
    font-size: 0.82rem;
    opacity: 0.8;
    font-weight: 400;
}

.dhikr-card {
    scroll-margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: rgba(255, 253, 247, 0.92);
    box-shadow: 0 12px 30px rgba(23, 33, 29, 0.08);
}

.dhikr-card.complete {
    border-color: rgba(23, 111, 75, 0.5);
    background: rgba(234, 248, 239, 0.92);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.counter,
.note {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.note {
    color: var(--gold);
}

.dhikr-text {
    margin: 0 0 14px;
    font-size: 1.22rem;
    line-height: 2;
    font-weight: 600;
    white-space: pre-line;
}

.dhikr-fadl {
    margin: -2px 0 14px;
    padding: 10px 12px;
    border-right: 3px solid var(--gold);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(195, 139, 47, 0.09);
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-line;
}

.count-button {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    color: white;
    background: var(--green);
    cursor: pointer;
    font-weight: 800;
}

.count-button:disabled {
    color: var(--green);
    background: #d9ecdf;
    cursor: default;
}

@media (max-width: 520px) {
    .app-shell {
        padding-left: 14px;
        padding-right: 14px;
    }

    .brand-logo {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .dhikr-text {
        font-size: 1.08rem;
        line-height: 1.9;
    }

    .summary {
        padding: 12px;
    }
}
