/*
  Hatim Takip

  Renkler İznik çinisinden: sır beyazı zemin, kobalt, firuze ve az miktarda mercan kırmızısı.
  Literata başlıklarda ve cüz numaralarında, Figtree arayüz metninde kullanılır.
  Sayfadaki tek koyu alan kobalt hatim başlığıdır; arkasındaki sekiz köşeli yıldız,
  mushafta hizb başlarını gösteren işarettir.

  Dosya telefon öncelikli yazılmıştır: temel kurallar dar ekran içindir,
  geniş ekran eklemeleri ilgili bölümün sonundaki min-width sorgularındadır.

  İçindekiler
    1. Yazı tipleri ve değişkenler
    2. Temel öğeler
    3. Sayfa iskeleti: üst başlık, içerik, alt bilgi
    4. Düğmeler
    5. Formlar
    6. Yüzeyler: kart, panel, not, bildirim, etiket
    7. Hatim halkası ve hatim başlığı
    8. Grup listesi
    9. Grup sayfaları: başlık, sekmeler, hatim sayfası, cüz listesi
   10. Tablolar: kişiler, geçmiş, hesaplar
   11. Ayarlar
   12. Giriş ve üye sayfası
   13. Dokunmatik ekran ve hareket tercihleri
*/

/* ---- 1. Yazı tipleri ve değişkenler ------------------------------------ */

@font-face {
    font-family: "Figtree";
    src: url("../fonts/figtree-latin-ext.woff2") format("woff2");
    font-weight: 300 900;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Figtree";
    src: url("../fonts/figtree-latin.woff2") format("woff2");
    font-weight: 300 900;
    font-display: swap;
    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;
}

@font-face {
    font-family: "Literata";
    src: url("../fonts/literata-latin-ext.woff2") format("woff2");
    font-weight: 400 700;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Literata";
    src: url("../fonts/literata-latin.woff2") format("woff2");
    font-weight: 400 700;
    font-display: swap;
    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 {
    --paper: #f2f5fa;
    --surface: #ffffff;
    --ink: #14223d;
    --muted: #55617a;
    --line: #d9e0ec;
    --line-soft: #e8edf5;
    --field-line: #a9b4c8;

    --cobalt: #1c3d8f;
    --cobalt-deep: #142c69;
    --cobalt-soft: #e7edfa;
    --cobalt-mist: #cfdcf7;
    --turquoise: #0b7b81;
    --turquoise-deep: #096368;
    --turquoise-soft: #dcf1f0;
    --turquoise-bright: #7fd8d3;
    --coral: #bf3a2b;
    --coral-deep: #992c20;
    --coral-soft: #fbe8e5;

    --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Literata", Georgia, "Times New Roman", serif;

    --radius: 10px;
    --radius-lg: 16px;
    --gutter: 1rem;
    --page-width: 72rem;

    /* Gölgeler gri değil, mürekkep rengine çalar. */
    --shadow-sm: 0 1px 2px rgb(20 34 61 / 0.06);
    --shadow: 0 1px 2px rgb(20 34 61 / 0.05), 0 10px 28px -14px rgb(20 34 61 / 0.22);
    --focus: 0 0 0 3px #fff, 0 0 0 5px var(--cobalt);

    color-scheme: light;
}

/* ---- 2. Temel öğeler --------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 1.0625rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
ul,
ol,
pre {
    margin: 0;
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 1.35rem + 2vw, 2.5rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
}

a {
    color: var(--cobalt);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}

a:hover {
    color: var(--cobalt-deep);
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus);
    border-radius: 4px;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 10;
    padding: 0.5rem 1rem;
    background: var(--cobalt);
    color: #fff;
    border-radius: var(--radius);
}

.skip-link:focus {
    top: 1rem;
    color: #fff;
}

.icon {
    width: 1.15em;
    height: 1.15em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.muted {
    color: var(--muted);
}

.lead {
    max-width: 62ch;
    color: var(--muted);
}

/* ---- 3. Sayfa iskeleti ------------------------------------------------- */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.site-header__inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0.4rem var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.75rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}

.brand:hover {
    color: var(--ink);
}

.brand img {
    border-radius: 7px;
}

/* Telefonda menü bir düğmeyle açılır. Betik çalışmıyorsa bağlantılar açık kalır. */
.menu-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0 0.95rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

.menu-toggle[aria-expanded="true"] {
    border-color: var(--cobalt);
    background: var(--cobalt-soft);
    color: var(--cobalt);
}

.site-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 0.35rem;
}

.js .site-nav {
    display: none;
}

.js .site-nav.is-open {
    display: flex;
}

.site-nav a,
.site-nav .link-button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 3rem;
    border-top: 1px solid var(--line-soft);
    color: var(--ink);
    font-size: 1.0625rem;
    text-decoration: none;
    text-align: left;
}

.site-nav a[aria-current="page"] {
    color: var(--cobalt);
    font-weight: 700;
}

.site-nav .link-button {
    color: var(--muted);
}

/* Kimin hesabıyla girildiği: baş harf ve kullanıcı adı. */
.who {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 3rem;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 0.9375rem;
}

.who__initial {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--cobalt-soft);
    color: var(--cobalt);
    font-weight: 700;
    text-transform: uppercase;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
}

.link-button--danger {
    color: var(--coral);
}

.page {
    flex: 1;
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 1.25rem var(--gutter) 3rem;
}

.is-bare .page {
    max-width: none;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.site-footer {
    padding: 1.1rem var(--gutter);
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
}

.site-footer__hijri {
    display: block;
}

/* Alt paylaşım çubuğu olan sayfada alt bilgi çubuğun altında kalmasın. */
body:has(.share-bar) .site-footer {
    padding-bottom: 5.75rem;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    margin-bottom: 1.25rem;
}

.page-head .lead {
    margin-top: 0.5rem;
}

.narrow {
    max-width: 34rem;
    margin: 0 auto;
}

.narrow--left {
    margin: 0;
}

.narrow--centered {
    margin: auto;
    padding: 3rem var(--gutter);
    width: 100%;
}

.narrow > h1,
.narrow > .lead {
    margin-bottom: 1.25rem;
}

.narrow > h1 + .lead {
    margin-top: -0.6rem;
}

.crumb {
    font-size: 0.9375rem;
}

.crumb a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: var(--muted);
    text-decoration: none;
}

.crumb a::before {
    content: "‹";
    margin-right: 0.4rem;
    font-size: 1.25em;
    line-height: 1;
}

.crumb a:hover {
    color: var(--cobalt);
}

.section-title {
    margin: 2.5rem 0 0.75rem;
}

.plain-list {
    padding: 0;
    list-style: none;
}

.plain-list li {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
}

@media (min-width: 40rem) {
    :root {
        --gutter: 1.5rem;
    }

    .site-header__inner {
        padding-block: 0.6rem;
        flex-wrap: nowrap;
    }

    .menu-toggle {
        display: none;
    }

    .site-nav,
    .js .site-nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
        width: auto;
        margin: 0;
    }

    .site-nav a,
    .site-nav .link-button {
        width: auto;
        min-height: 2.25rem;
        padding: 0 0.8rem;
        border: 0;
        border-radius: 999px;
        font-size: 0.9688rem;
        font-weight: 500;
    }

    .site-nav a:hover {
        background: var(--paper);
        color: var(--ink);
    }

    .site-nav a[aria-current="page"] {
        background: var(--cobalt-soft);
        font-weight: 600;
    }

    .site-nav .link-button:hover {
        background: var(--paper);
        text-decoration: none;
    }

    .who {
        order: 1;
        min-height: 0;
        margin-left: 0.6rem;
        padding-left: 1rem;
        border: 0;
        border-left: 1px solid var(--line);
    }

    .site-nav form {
        order: 2;
    }

    .page {
        padding: 2rem var(--gutter) 4rem;
    }

    .page-head {
        margin-bottom: 1.75rem;
    }

    .site-footer {
        font-size: 0.9375rem;
    }

    body:has(.share-bar) .site-footer {
        padding-bottom: 1.1rem;
    }
}

/* ---- 4. Düğmeler ------------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.5rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button:hover {
    border-color: var(--cobalt);
    color: var(--cobalt-deep);
}

.button:active {
    box-shadow: none;
}

.button--primary {
    border-color: var(--cobalt);
    background: var(--cobalt);
    color: #fff;
}

.button--primary:hover {
    border-color: var(--cobalt-deep);
    background: var(--cobalt-deep);
    color: #fff;
}

.button--danger {
    border-color: var(--coral);
    background: var(--coral);
    color: #fff;
}

.button--danger:hover {
    border-color: var(--coral-deep);
    background: var(--coral-deep);
    color: #fff;
}

.button--small {
    padding: 0.3rem 0.85rem;
    font-size: 0.9375rem;
}

.button--block {
    width: 100%;
}

.button[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

/* Uzun formlarda kaydet düğmesi ekranın altında kalır. */
.actions--sticky {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin: 1rem calc(-1 * var(--gutter)) 0;
    padding: 0.7rem var(--gutter);
    padding-bottom: max(0.7rem, env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 0.97);
    border-top: 1px solid var(--line);
}

.actions--sticky .button {
    flex: 1;
}

@media (min-width: 40rem) {
    .button--small {
        min-height: 2.25rem;
    }

    .actions--sticky {
        margin-inline: 0;
        padding-inline: 0;
        background: var(--paper);
    }

    .actions--sticky .button {
        flex: none;
    }
}

/* ---- 5. Formlar -------------------------------------------------------- */

.stack {
    display: grid;
    gap: 1.25rem;
}

.field {
    display: grid;
    gap: 0.35rem;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1.25rem;
}

.field-row + .field__hint {
    margin-top: -0.75rem;
}

label {
    font-weight: 600;
}

.optional {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.9375rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--field-line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
    resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: var(--cobalt);
    box-shadow: 0 0 0 3px rgb(28 61 143 / 0.2);
    border-radius: var(--radius);
}

input[readonly] {
    background: var(--paper);
}

input::placeholder {
    color: #8490a6;
}

.input--short {
    max-width: 8rem;
}

.input-validation-error {
    border-color: var(--coral) !important;
}

.field__hint {
    color: var(--muted);
    font-size: 0.9375rem;
}

.field__error,
.form-error {
    color: var(--coral);
    font-size: 0.9375rem;
    font-weight: 600;
}

.field__error:empty,
.form-error.validation-summary-valid {
    display: none;
}

.form-error {
    margin: 0 0 1rem;
}

ul.form-error,
.form-error ul {
    padding-left: 1.2rem;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-weight: 400;
    cursor: pointer;
}

.check input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0.15rem 0 0;
    flex: none;
    accent-color: var(--cobalt);
}

.inline-form,
.copy-field {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.inline-form input,
.inline-form select,
.copy-field input {
    flex: 1 1 12rem;
    width: auto;
}

.inline-form .button,
.copy-field .button {
    flex: 1 1 auto;
}

/* Tek başına duran formlar (yeni grup, şifre, kurulum) bir kart içinde durur. */
.narrow > form.stack {
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.narrow > form.stack > .actions .button,
.narrow > form.stack > .button {
    flex: 1;
}

.disclosure summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    min-height: 2.75rem;
    color: var(--cobalt);
    cursor: pointer;
    list-style: none;
}

.disclosure summary::-webkit-details-marker {
    display: none;
}

.disclosure summary::before {
    content: "";
    border: 0.33rem solid transparent;
    border-left-color: currentColor;
    border-right-width: 0;
    transition: transform 0.15s ease;
}

.disclosure[open] summary::before {
    transform: rotate(90deg);
}

.disclosure form {
    margin-top: 0.5rem;
}

@media (min-width: 40rem) {
    .inline-form .button,
    .copy-field .button {
        flex: none;
    }

    .narrow > form.stack {
        padding: 1.75rem;
    }

    .narrow > form.stack > .actions .button {
        flex: none;
    }
}

/* ---- 6. Yüzeyler ------------------------------------------------------- */

.panel,
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.panel {
    display: grid;
    gap: 0.85rem;
    padding: 1.1rem;
}

.panel p {
    color: var(--muted);
    font-size: 0.9375rem;
}

.panel .actions .button,
.panel .actions form {
    flex: 1 1 auto;
}

.panel .actions form .button {
    width: 100%;
}

.flash {
    margin-bottom: 1.25rem;
    padding: 0.8rem 1rem;
    border: 1px solid #b9e0de;
    border-left: 4px solid var(--turquoise);
    border-radius: var(--radius);
    background: var(--turquoise-soft);
}

.flash--error {
    border-color: #f1c6bf;
    border-left-color: var(--coral);
    background: var(--coral-soft);
}

.is-bare .flash {
    margin: 1rem var(--gutter) 0;
}

.note {
    padding: 0.65rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--muted);
}

.note--good {
    border-color: #b9e0de;
    background: var(--turquoise-soft);
    color: var(--ink);
}

.tag,
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--turquoise-soft);
    color: var(--turquoise);
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}

.tag {
    margin-left: 0.4rem;
}

.chip {
    font-variant-numeric: tabular-nums;
}

.empty {
    max-width: 36rem;
    padding: 2rem 1.25rem;
    background: var(--surface);
    border: 1px dashed var(--field-line);
    border-radius: var(--radius-lg);
}

.empty h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
}

.empty p {
    margin: 0.6rem 0 1.25rem;
    color: var(--muted);
}

.empty p:last-child {
    margin-bottom: 0;
}

@media (min-width: 40rem) {
    .panel {
        padding: 1.25rem;
    }

    .panel .actions .button,
    .panel .actions form {
        flex: none;
    }

    .empty {
        padding: 2.5rem 2rem;
    }
}

/* ---- 7. Hatim halkası ve hatim başlığı --------------------------------- */

.ring {
    display: block;
    width: 100%;
    max-width: 15rem;
    height: auto;
}

.ring--compact {
    width: 3.25rem;
    flex: none;
}

.ring__segment {
    fill: var(--line);
    transition: fill 0.25s ease;
}

.ring__segment.is-read {
    fill: var(--turquoise);
}

.ring__count {
    font-family: var(--font-display);
    font-size: 54px;
    font-weight: 600;
    fill: var(--ink);
}

.ring__label {
    font-family: var(--font-ui);
    font-size: 12.5px;
    fill: var(--muted);
}

/* Kobalt başlık. Telefonda yazılar solda, küçük halka sağda durur; halkanın içindeki
   yazı o boyutta okunmadığı için sayım yazıyla verilir. */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.15rem 1.3rem;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--cobalt) url("../img/hizb.svg") no-repeat right -5.5rem top -6rem / 13rem;
    color: #fff;
    box-shadow: var(--shadow);
}

.hero__text {
    position: relative;
    min-width: 0;
}

.hero h1 {
    color: #fff;
}

.hero__group {
    margin-bottom: 0.3rem;
    font-weight: 700;
    color: var(--turquoise-bright);
}

.hero__date {
    margin-top: 0.35rem;
}

.hero__hijri {
    color: var(--cobalt-mist);
    font-size: 0.9375rem;
}

.hero__progress {
    margin-top: 0.7rem;
    color: var(--cobalt-mist);
}

.hero__progress strong {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--turquoise-bright);
}

.hero .ring {
    position: relative;
    width: 6.5rem;
    flex: none;
}

.hero .ring text {
    display: none;
}

.hero .ring__segment {
    fill: rgb(255 255 255 / 0.2);
}

.hero .ring__segment.is-read {
    fill: var(--turquoise-bright);
}

.hero .ring__count {
    fill: #fff;
}

.hero .ring__label {
    fill: var(--cobalt-mist);
}

/* Geniş ekranda başlık sol sütunda dikey durur: yazılar üstte, büyük halka altta. */
@media (min-width: 62rem) {
    .hero {
        display: grid;
        justify-content: stretch;
        gap: 1.5rem;
        padding: 1.75rem 1.5rem 2rem;
        background-position: right -8.5rem bottom -8.5rem;
        background-size: 20rem;
    }

    .hero__date {
        margin-top: 0.5rem;
        font-size: 1.125rem;
    }

    .hero__hijri {
        font-size: 1rem;
    }

    .hero__progress {
        display: none;
    }

    .hero .ring {
        width: 100%;
        max-width: 13.5rem;
        margin: 0 auto;
    }

    .hero .ring text {
        display: inline;
    }
}

/* ---- 8. Grup listesi --------------------------------------------------- */

.group-list {
    display: grid;
    gap: 0.85rem;
    padding: 0;
    list-style: none;
}

.group-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.2rem 1rem;
    height: 100%;
    padding: 1.1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.group-row:hover {
    border-color: var(--cobalt);
    box-shadow: var(--shadow);
    color: var(--ink);
}

.group-row .ring {
    grid-row: 1 / span 2;
    align-self: start;
    margin-top: 0.15rem;
}

.group-row__body {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.group-row__name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.group-row:hover .group-row__name {
    color: var(--cobalt);
}

.group-row__meta {
    color: var(--muted);
    font-size: 0.9375rem;
}

.group-row__warn {
    color: var(--coral);
    font-size: 0.9375rem;
}

.group-row__count {
    grid-column: 2;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.group-row__count strong {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--turquoise);
}

@media (min-width: 48rem) {
    .group-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.1rem;
    }

    .group-row {
        padding: 1.35rem;
    }

    .group-row__name {
        font-size: 1.35rem;
    }
}

/* ---- 9. Grup sayfaları ------------------------------------------------- */

.group-head {
    margin-bottom: 1.25rem;
}

.group-head__name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.tabs {
    display: flex;
    gap: 1.1rem;
    margin-top: 0.5rem;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.tabs a {
    padding: 0.75rem 0.3rem;
    margin-bottom: -1px;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tabs a:hover {
    color: var(--ink);
}

.tabs a[aria-current="page"] {
    border-bottom-color: var(--cobalt);
    color: var(--cobalt);
}

.tabs a:focus-visible {
    box-shadow: inset 0 0 0 2px var(--cobalt);
}

/* Hatim sayfası. Telefonda sıra: başlık, hatimler arası geçiş, cüz listesi, paneller.
   Sol sütunun kutusu telefonda çözülür ki liste panellerin önüne alınabilsin. */
.round {
    display: grid;
    gap: 1.1rem;
}

.round__side {
    display: contents;
}

.round__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.round__nav .button {
    flex: 1;
}

.round__list {
    order: 1;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.round__share,
.round__advance,
.round__date-edit {
    order: 2;
}

.round__share-actions {
    display: none;
}

.list-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
}

.list-head a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    margin: -0.5rem 0 -0.5rem auto;
    font-size: 0.9375rem;
}

.message {
    max-height: 8.5rem;
    overflow: auto;
    padding: 0.75rem;
    background: var(--paper);
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* En sık yapılan iş başparmağın altında: listeyi kopyala ya da WhatsApp'a gönder. */
.share-bar {
    position: fixed;
    inset: auto 0 0;
    z-index: 5;
    display: flex;
    gap: 0.6rem;
    padding: 0.6rem var(--gutter);
    padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 0.97);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px -14px rgb(20 34 61 / 0.35);
}

.share-bar .button {
    flex: 1;
    min-height: 3rem;
}

.share-bar .button--primary {
    flex: 1.4;
}

/* Cüz listesi */
.juz-list {
    padding: 0;
    list-style: none;
}

.juz {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 3.5rem;
    padding: 0.3rem 0.75rem 0.3rem 0.85rem;
    border-bottom: 1px solid var(--line-soft);
}

.juz:last-child {
    border-bottom: 0;
}

.juz__number {
    flex: none;
    width: 1.9rem;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--cobalt);
    text-align: right;
}

.juz__name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.juz.is-vacant .juz__name {
    color: var(--muted);
    font-style: italic;
}

.juz.is-read .juz__number {
    color: var(--turquoise);
}

.juz__remind {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: -0.35rem;
    border-radius: 50%;
    color: var(--muted);
}

.juz__remind:hover {
    background: var(--paper);
    color: var(--cobalt);
}

.juz form {
    flex: none;
}

.juz__toggle,
.juz__state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0.25rem 0.9rem 0.25rem 0.65rem;
    border-radius: 999px;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
}

.juz__toggle {
    border: 1px solid var(--field-line);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.juz__toggle .icon {
    padding: 0.12em;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    stroke: transparent;
}

.juz__toggle:hover {
    border-color: var(--turquoise);
    color: var(--turquoise);
}

.juz__toggle[aria-pressed="true"],
.juz__state {
    border: 1px solid var(--turquoise);
    background: var(--turquoise);
    color: #fff;
}

.juz__toggle[aria-pressed="true"] .icon {
    border-color: transparent;
    stroke: currentColor;
}

.juz__toggle[aria-pressed="true"]:hover {
    background: var(--turquoise-deep);
    color: #fff;
}

.juz__toggle[disabled] {
    opacity: 0.6;
    cursor: progress;
}

/* Yönetim listesinde düğme yalnızca bir işaret kutusudur; yazı ekran okuyucular içindir. */
.juz__toggle--icon {
    width: 2.75rem;
    padding: 0;
    border-width: 1.5px;
}

.juz__toggle--icon .icon {
    width: 1.3rem;
    height: 1.3rem;
    padding: 0;
    border: 0;
    stroke-width: 2.6;
}

@media (min-width: 40rem) {
    .round__nav .button {
        flex: none;
    }

    .list-head {
        padding: 1rem 1.25rem;
    }

    .juz {
        padding-inline: 1.25rem 1rem;
    }

    .message {
        max-height: 13rem;
    }
}

@media (min-width: 46rem) {
    .juz-list {
        columns: 2;
        column-gap: 0;
        column-rule: 1px solid var(--line-soft);
    }

    .juz {
        break-inside: avoid;
    }

    /* İki sütunda her sütunun son satırı da çizgisini korur ki sütunlar eşit bitsin. */
    .juz:last-child {
        border-bottom: 1px solid var(--line-soft);
    }
}

/* Geniş ekranda paneller solda, liste sağda; paylaşım düğmeleri panelin içinde. */
@media (min-width: 62rem) {
    .round {
        grid-template-columns: 19rem minmax(0, 1fr);
        gap: 2rem;
        align-items: start;
    }

    .round__side {
        display: grid;
        gap: 1.1rem;
        align-content: start;
        min-width: 0;
    }

    .round__list,
    .round__share,
    .round__advance,
    .round__date-edit {
        order: 0;
    }

    .round__share-actions {
        display: flex;
    }

    .share-bar {
        display: none;
    }
}

/* ---- 10. Tablolar ------------------------------------------------------ */

.table-wrap {
    padding: 0 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    vertical-align: middle;
}

/* Telefonda her satır alt alta okunan bir kayıt olur; başlık satırı gizlenir. */
thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

tbody {
    display: block;
}

tr {
    display: grid;
    gap: 0.4rem 0.75rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line-soft);
}

tr:last-child {
    border-bottom: 0;
}

tbody th,
td {
    display: block;
    min-width: 0;
    padding: 0;
}

td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--muted);
    font-size: 0.9375rem;
}

.members tr {
    grid-template-columns: 2.1rem minmax(0, 1fr);
    padding: 0.7rem 0;
}

.members tbody .members__juz {
    grid-row: 1 / span 2;
    align-self: center;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--cobalt);
    text-align: right;
}

.members td {
    grid-column: 2;
}

.history tr {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
}

.history tbody th {
    font-weight: 600;
}

.history__date {
    color: var(--muted);
    text-align: right;
}

.history__meter {
    grid-column: 1 / -1;
}

.meter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

progress {
    flex: 1;
    height: 0.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
    appearance: none;
}

progress::-webkit-progress-bar {
    background: var(--line);
}

progress::-webkit-progress-value {
    background: var(--turquoise);
    border-radius: 999px;
}

progress::-moz-progress-bar {
    background: var(--turquoise);
}

.users tr {
    gap: 0.35rem;
    padding: 1rem 0;
}

.users tbody th {
    font-size: 1.125rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.users__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 1.5rem;
}

.users__actions .disclosure[open] {
    flex-basis: 100%;
}

.users__actions .link-button {
    min-height: 2.75rem;
}

/* Geniş ekranda gerçek tablo görünümü. */
@media (min-width: 40rem) {
    .table-wrap {
        padding: 0.25rem 1.25rem;
        overflow-x: auto;
    }

    thead {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
        display: table-header-group;
    }

    tbody {
        display: table-row-group;
    }

    tr,
    .members tr,
    .history tr,
    .users tr {
        display: table-row;
        padding: 0;
        border: 0;
    }

    thead th,
    tbody th,
    td,
    .users__actions {
        display: table-cell;
        padding: 0.65rem 1rem 0.65rem 0;
        border-bottom: 1px solid var(--line-soft);
    }

    tbody tr:last-child th,
    tbody tr:last-child td {
        border-bottom: 0;
    }

    thead th {
        border-bottom-color: var(--line);
        color: var(--muted);
        font-size: 0.875rem;
        font-weight: 600;
    }

    td[data-label]::before {
        content: none;
    }

    .members {
        min-width: 30rem;
    }

    .members__juz {
        width: 4rem;
    }

    .members tbody .members__juz {
        text-align: left;
    }

    .members td:last-child {
        width: 15rem;
        padding-right: 0;
    }

    .history__date {
        color: var(--ink);
        text-align: left;
    }

    progress {
        flex: none;
        width: 12rem;
    }

    .users {
        min-width: 38rem;
    }

    .users tbody th {
        font-size: 1rem;
    }

    .users__actions {
        padding-right: 0;
        text-align: right;
        white-space: nowrap;
    }

    .users__actions > * {
        display: inline-block;
        margin-left: 1.25rem;
        vertical-align: middle;
        text-align: left;
    }

    .users__actions .link-button {
        min-height: 0;
    }
}

/* ---- 11. Ayarlar ------------------------------------------------------- */

.settings-block {
    display: grid;
    gap: 0.85rem;
    justify-items: start;
    margin-top: 1.1rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.settings-block p {
    color: var(--muted);
}

.settings-block p a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
}

.settings-block .copy-field,
.settings-block .inline-form,
.settings-block .stack,
.settings-block > form {
    width: 100%;
}

.settings-block > form:not(.stack):not(.inline-form) .button,
.settings-block .stack .actions .button {
    width: 100%;
}

.settings-block--danger {
    border-color: #f1c6bf;
}

.settings-block--danger h2 {
    color: var(--coral);
}

@media (min-width: 40rem) {
    .settings-block {
        padding: 1.5rem 1.75rem;
    }

    .settings-block > form:not(.stack):not(.inline-form) .button,
    .settings-block .stack .actions .button {
        width: auto;
    }
}

/* ---- Açılır pencere ----------------------------------------------------
   Betik yoksa pencere sayfada sıradan bir kart olarak görünür. */

.modal {
    width: min(100% - 2rem, 30rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px -20px rgb(20 34 61 / 0.45), 0 2px 6px rgb(20 34 61 / 0.08);
}

.modal::backdrop {
    background: rgb(20 34 61 / 0.45);
    backdrop-filter: blur(2px);
}

html:not(.js) .modal {
    position: static;
    display: block;
    width: auto;
    max-width: 34rem;
    margin: 1.5rem 0 0;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.modal__body {
    padding: 1.25rem;
}

.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: -0.25rem -0.5rem -0.5rem 0;
}

.modal__head h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
}

.modal__close {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    cursor: pointer;
}

.modal__close:hover {
    background: var(--paper);
    color: var(--ink);
}

.modal__close .icon {
    width: 1.3rem;
    height: 1.3rem;
}

.modal__lead {
    margin-top: -0.5rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.modal__actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line-soft);
}

.modal__actions .button {
    flex: 1;
}

/* Düzenleme penceresinde her form kendi bölümündedir. */
.modal__section {
    padding-top: 1.1rem;
    margin-top: 1.1rem;
    border-top: 1px solid var(--line-soft);
}

.modal__head + .modal__section {
    margin-top: 0.5rem;
    padding-top: 0;
    border-top: 0;
}

.modal__row-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: -0.25rem;
}

.modal__body > .modal__actions {
    margin-top: 1.25rem;
}

.link-button--action {
    color: var(--cobalt);
    font-weight: 600;
}

/* Telefonda pencere alttan açılan bir sayfa gibi durur. */
@media (max-width: 39.99rem) {
    .js .modal {
        width: 100%;
        max-width: none;
        margin: auto 0 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .js .modal__body {
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    }
}

@media (min-width: 40rem) {
    .modal__body {
        padding: 1.5rem 1.75rem 1.75rem;
    }

    .modal__actions {
        justify-content: flex-end;
    }

    .modal__actions .button {
        flex: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .modal[open] {
        animation: modal-in 0.18s ease-out;
    }

    .modal[open]::backdrop {
        animation: backdrop-in 0.18s ease-out;
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }
}

@keyframes backdrop-in {
    from {
        opacity: 0;
    }
}

/* ---- 12. Giriş ve üye sayfası ------------------------------------------ */

.gate {
    flex: 1;
    display: grid;
    grid-template-rows: auto 1fr;
}

/* Telefonda üstte ince bir tarih şeridi, altında form. */
.gate__panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0 1rem;
    padding: 1.1rem var(--gutter);
    overflow: hidden;
    background: var(--cobalt) url("../img/hizb.svg") no-repeat right -3.5rem top -4rem / 13rem;
    color: #fff;
}

.gate__panel > div {
    grid-row: 1 / span 2;
}

.gate__panel .ring {
    width: 3.5rem;
}

.gate__panel .ring__segment {
    fill: rgb(255 255 255 / 0.2);
}

.gate__panel .ring__segment.is-read {
    fill: var(--turquoise-bright);
}

.gate__date {
    align-self: end;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.25;
}

.gate__hijri {
    align-self: start;
    color: var(--cobalt-mist);
    font-size: 0.9375rem;
}

.gate__form {
    width: 100%;
    max-width: 26rem;
    margin: 0 auto;
    padding: 2rem var(--gutter);
    align-self: start;
}

.gate__form .lead {
    margin: 0.5rem 0 1.75rem;
}

@media (min-width: 52rem) {
    .gate {
        grid-template-columns: minmax(18rem, 2fr) 3fr;
        grid-template-rows: none;
    }

    .gate__panel {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-end;
        gap: 0.35rem;
        padding: 3rem;
        background-position: right -6rem top -6rem;
        background-size: 26rem;
    }

    .gate__panel > div {
        width: 100%;
        margin-bottom: auto;
    }

    .gate__panel .ring {
        width: min(100%, 18rem);
        max-width: none;
    }

    .gate__date {
        font-size: 2rem;
    }

    .gate__hijri {
        font-size: 1.0625rem;
    }

    .gate__form {
        align-self: center;
        padding: 2.5rem var(--gutter);
    }
}

.public {
    width: 100%;
    max-width: 52rem;
    margin: 0 auto;
    padding: 1rem var(--gutter) 3rem;
}

.public .hero {
    margin-bottom: 1rem;
}

.public .lead,
.public .note {
    margin: 0 0 1rem;
}

.public .juz-list {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 40rem) {
    .public {
        padding-top: 2rem;
    }
}

/* Üye sayfasında başlık geniş ekranda da yatay kalır: sayfa tek sütundur. */
@media (min-width: 62rem) {
    .public .hero {
        display: flex;
        padding: 1.75rem 2rem;
    }

    .public .hero .ring {
        width: 9rem;
        margin: 0;
    }

    .public .hero .ring text {
        display: none;
    }

    .public .hero__progress {
        display: block;
    }
}

/* ---- 13. Dokunmatik ekran ve hareket tercihleri ------------------------ */

/* Fareyle kullanılan geniş ekranda işaret kutuları biraz küçülür. */
@media (min-width: 62rem) and (pointer: fine) {
    .juz {
        min-height: 3.1rem;
    }

    .juz__toggle,
    .juz__state {
        min-height: 2.35rem;
    }

    .juz__toggle--icon {
        width: 2.35rem;
    }

    .juz__remind {
        width: 2.35rem;
        height: 2.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
