/* Giriş seçimi: seçim ekranı, "üyeliksiz alan" etiketi, sağ üst hesap düğmesi ve paneli. */
.gs-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.4;
    background: #e2e8f0;
    color: #334155;
}
.gs-badge-local { background: #fef3c7; color: #92400e; }
.gs-badge-account { background: #dcfce7; color: #166534; }
.gs-badge-soon { background: #ede9fe; color: #5b21b6; }
[data-theme="dark"] .gs-badge-local { background: #422b18; color: #fed7aa; }
[data-theme="dark"] .gs-badge-account { background: #14532d; color: #bbf7d0; }
[data-theme="dark"] .gs-badge-soon { background: #3b2a6b; color: #ddd6fe; }

/* --- Seçim ekranı --- */
.gs-chooser {
    position: fixed;
    inset: 0;
    z-index: 10000;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    padding: 24px 16px;
    background: var(--bg-body);
}
.gs-chooser-inner {
    width: min(100%, 960px);
    margin-block: auto;
    text-align: center;
}
.gs-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    text-align: left;
}
.gs-brand-logo {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 1.8rem;
}
.gs-brand-text strong { display: block; font-size: 1.25rem; color: var(--primary-text); line-height: 1.2; }
.gs-brand-text small { display: block; color: var(--text-muted); font-size: 0.9rem; }
.gs-chooser-title { margin: 0 0 0.35rem; font-size: clamp(1.5rem, 3.4vw, 2rem); color: var(--text-main); text-align: center; display: block; }
.gs-chooser-note { margin: 0 0 1.75rem; color: var(--text-muted); }
.gs-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    text-align: left;
}
.gs-choice {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 1.25rem;
    background: var(--bg-card);
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.gs-choice:hover { border-color: var(--primary); transform: translateY(-2px); }
.gs-choice:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.gs-choice-head { display: flex; align-items: center; gap: 0.75rem; }
.gs-choice-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--bg-body);
    font-size: 1.5rem;
}
.gs-choice-title { font-size: 1.2rem; font-weight: 800; line-height: 1.25; }
.gs-choice-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.gs-choice-body { flex: 1; color: var(--text-muted); line-height: 1.6; font-size: 0.95rem; }
.gs-choice-action {
    margin-top: 0.25rem;
    padding: 0.75rem 1rem;
    border-radius: 0.8rem;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    text-align: center;
}
.gs-choice-account .gs-choice-action { background: #15803d; }

/* --- Giriş sayfası --- */
.gs-area { margin-bottom: 1rem; }
.gs-area-note { margin: 0.6rem 0 0; font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }
.gs-change {
    display: block;
    margin: 1.1rem auto 0;
    padding: 0.25rem 0.5rem;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
}
.gs-change:hover { color: var(--primary-text); }

/* Sağ üstteki hesap düğmesi (ve paneli) */
.gs-account {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: min(320px, calc(100% - 32px));
}
.gs-account-button {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 2px solid var(--primary);
    border-radius: 1rem;
    background: var(--bg-card);
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: background 0.15s, border-color 0.15s;
}
.gs-account-button:hover { background: #eff6ff; }
[data-theme="dark"] .gs-account-button:hover { background: #1e293b; }
.gs-account-button:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.gs-account-button.is-open { background: var(--primary); color: #fff; }
.gs-account-button.is-open small { color: #dbeafe; }
.gs-account-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-body);
    font-size: 1.15rem;
}
.gs-account-text strong { display: block; font-size: 0.98rem; }
.gs-account-text small { display: block; margin-top: 0.15rem; font-size: 0.78rem; line-height: 1.45; color: var(--text-muted); }
.gs-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: min(410px, calc(100vw - 32px));
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    margin-top: 0.6rem;
    padding: 1.1rem 1.1rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--bg-card);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
.gs-panel[hidden] { display: none; }
.gs-panel-title { margin: 0 2rem 0.6rem 0; font-size: 1.05rem; color: var(--text-main); }
.gs-panel-text { margin: 0 0 1rem; font-size: 0.9rem; line-height: 1.55; color: var(--text-muted); }
.gs-panel-close {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.gs-panel-close:hover { background: var(--bg-body); }
.gs-primary {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 0.8rem;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.gs-primary:hover { background: var(--primary-dark); }

/* --- Hesap formları (giriş, kayıt, kurtarma, ayarlar) --- */
.ha-tabs { display: flex; gap: 0.3rem; margin: 0 0 0.9rem; padding: 0.25rem; border-radius: 0.8rem; background: var(--bg-body); }
.ha-tab {
    flex: 1;
    padding: 0.5rem 0.6rem;
    border: 0;
    border-radius: 0.6rem;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.ha-tab.is-active { background: var(--bg-card); color: var(--primary-text); box-shadow: var(--shadow); }
.ha-tab:focus-visible { outline: 3px solid var(--primary); outline-offset: 1px; }
.ha-form { display: flex; flex-direction: column; gap: 0.7rem; }
.ha-field { display: flex; flex-direction: column; gap: 0.25rem; }
.ha-field label { font-size: 0.85rem; font-weight: 700; color: var(--text-main); }
.ha-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: var(--bg-body);
    color: var(--text-main);
    font: inherit;
}
.ha-field input:focus-visible { outline: 3px solid var(--primary); outline-offset: 1px; }
.ha-field input[aria-invalid="true"] { border-color: #dc2626; }
.ha-help { font-size: 0.78rem; line-height: 1.45; color: var(--text-muted); }
.ha-password { position: relative; display: block; }
.ha-password input { padding-right: 4.6rem; }
.ha-toggle {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    padding: 0.25rem 0.55rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--primary-text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.ha-check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.85rem; line-height: 1.45; color: var(--text-main); cursor: pointer; }
.ha-check input { margin-top: 0.2rem; flex: none; }
.ha-check a { color: var(--primary-text); }
.ha-error { padding: 0.6rem 0.75rem; border-radius: 0.7rem; background: #fee2e2; color: #991b1b; font-size: 0.88rem; line-height: 1.45; }
[data-theme="dark"] .ha-error { background: #451a1a; color: #fecaca; }
.ha-error[hidden] { display: none; }
.ha-note { margin: 0; padding: 0.6rem 0.75rem; border-radius: 0.7rem; background: var(--bg-body); color: var(--text-main); font-size: 0.88rem; line-height: 1.5; }
.ha-note-ok { background: #dcfce7; color: #166534; }
[data-theme="dark"] .ha-note-ok { background: #14532d; color: #bbf7d0; }
.ha-note[hidden] { display: none; }
.ha-title { margin: 0 0 0.6rem; font-size: 1rem; color: var(--text-main); }
.ha-text { margin: 0 0 0.8rem; font-size: 0.88rem; line-height: 1.55; color: var(--text-muted); }
.ha-link { align-self: center; padding: 0.25rem 0.5rem; border: 0; background: transparent; color: var(--primary-text); font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.ha-secondary {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: var(--bg-card);
    color: var(--text-main);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.ha-secondary:hover { border-color: var(--primary); }
.gs-primary:disabled, .ha-secondary:disabled { opacity: 0.55; cursor: not-allowed; }
.ha-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.8rem; }
.ha-recovery .gs-primary, .ha-home .gs-primary { margin-top: 0.6rem; }
.ha-code {
    display: block;
    margin: 0 0 0.8rem;
    padding: 0.8rem 0.6rem;
    border: 2px dashed var(--primary);
    border-radius: 0.8rem;
    background: var(--bg-body);
    color: var(--text-main);
    font: 700 1.1rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.06em;
    text-align: center;
    user-select: all;
    overflow-wrap: anywhere;
}
.ha-settings { margin: 0.8rem 0; padding: 0.4rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ha-settings summary { padding: 0.5rem 0; font-weight: 700; color: var(--text-main); cursor: pointer; }
.ha-settings .ha-form { margin: 0.8rem 0 1.2rem; }
.ha-settings h4 { margin: 0; font-size: 0.92rem; color: var(--text-main); }
.ha-settings > .ha-secondary { margin-bottom: 0.6rem; }
.ha-turnstile { min-height: 0; }

/* --- Sınıflarım --- */
.ha-classes { margin-bottom: 0.8rem; }
.ha-class-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.8rem; }
.ha-class { padding: 0.7rem 0.8rem; border: 1px solid var(--border); border-radius: 0.8rem; background: var(--bg-body); }
.ha-class-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.ha-class-info { min-width: 0; }
.ha-class-info strong { display: block; color: var(--text-main); overflow-wrap: anywhere; }
.ha-class-info small { display: block; color: var(--text-muted); font-size: 0.76rem; }
.ha-open { flex: none; padding: 0.5rem 1rem; border: 0; border-radius: 0.7rem; background: var(--primary); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.ha-open:hover { background: var(--primary-dark); }
.ha-open:disabled { opacity: 0.6; cursor: wait; }
.ha-pending { display: block; margin-top: 0.4rem; color: #92400e; font-size: 0.78rem; }
[data-theme="dark"] .ha-pending { color: #fed7aa; }
.ha-more { margin-top: 0.4rem; font-size: 0.82rem; }
.ha-more summary { color: var(--text-muted); cursor: pointer; }
.ha-more-body { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.ha-mini { padding: 0.3rem 0.65rem; border: 1px solid var(--border); border-radius: 0.6rem; background: var(--bg-card); color: var(--text-main); font: inherit; font-size: 0.8rem; cursor: pointer; }
.ha-mini:hover:not(:disabled) { border-color: var(--primary); }
.ha-mini:disabled { opacity: 0.5; cursor: default; }
.ha-class-panel { margin-top: 0.6rem; }
.ha-class-panel[hidden] { display: none; }
.ha-danger { padding: 0.6rem 0.9rem; border: 0; border-radius: 0.7rem; background: #dc2626; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.ha-danger:disabled { opacity: 0.6; }
.ha-version-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.ha-version-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.82rem; color: var(--text-main); }
.ha-new-class { margin-top: 0.4rem; }
.ha-class-footer .ha-help { margin: 0 0 0.5rem; }

/* --- Aktarma --- */
.ha-import { margin-top: 0.8rem; padding: 0.4rem 0; border-top: 1px solid var(--border); }
.ha-import summary { padding: 0.4rem 0; font-size: 0.88rem; font-weight: 700; color: var(--text-main); cursor: pointer; }
.ha-import .ha-form { margin: 0.8rem 0 1.1rem; }
.ha-import h4, .ha-delete-account h4 { margin: 0; font-size: 0.92rem; color: var(--text-main); }
.ha-field input[type="file"] { padding: 0.45rem; font-size: 0.82rem; }
.ha-field select { width: 100%; box-sizing: border-box; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 0.7rem; background: var(--bg-body); color: var(--text-main); font: inherit; }
.ha-delete-account { margin-top: 0.4rem; padding-top: 0.9rem; border-top: 1px dashed #dc2626; }

/* --- Eşitleme rozeti ve çakışma penceresi --- */
.es-badge { margin-left: 0.5rem; padding: 0.25rem 0.7rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-body); color: var(--text-muted); font: inherit; font-size: 0.78rem; font-weight: 600; line-height: 1.4; cursor: pointer; white-space: nowrap; }
.es-badge:hover { border-color: var(--primary); }
.es-badge[data-durum="esit"] { color: #166534; background: #dcfce7; border-color: transparent; }
.es-badge[data-durum="cevrimdisi"], .es-badge[data-durum="cakisma"], .es-badge[data-durum="hata"], .es-badge[data-durum="oturum"] { color: #92400e; background: #fef3c7; border-color: transparent; }
[data-theme="dark"] .es-badge[data-durum="esit"] { color: #bbf7d0; background: #14532d; }
[data-theme="dark"] .es-badge[data-durum="cevrimdisi"], [data-theme="dark"] .es-badge[data-durum="cakisma"], [data-theme="dark"] .es-badge[data-durum="hata"], [data-theme="dark"] .es-badge[data-durum="oturum"] { color: #fed7aa; background: #422b18; }
.es-modal { position: fixed; inset: 0; z-index: 10001; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, 0.6); }
.es-dialog { display: flex; flex-direction: column; gap: 0.6rem; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 1.3rem; border-radius: 1.1rem; background: var(--bg-card); color: var(--text-main); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
.es-title { margin: 0; font-size: 1.15rem; color: var(--text-main); display: block; }
.es-text { margin: 0 0 0.3rem; font-size: 0.92rem; line-height: 1.55; color: var(--text-muted); }
.es-choice { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.9rem; border: 2px solid var(--border); border-radius: 0.8rem; background: var(--bg-body); color: var(--text-main); font: inherit; text-align: left; cursor: pointer; }
.es-choice:hover { border-color: var(--primary); }
.es-choice:focus-visible, .es-later:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.es-choice small { color: var(--text-muted); font-size: 0.8rem; line-height: 1.4; }
.es-later { align-self: center; padding: 0.4rem 0.8rem; border: 0; background: transparent; color: var(--text-muted); font: inherit; text-decoration: underline; cursor: pointer; }

@media (max-width: 820px) {
    .gs-choices { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    /* Telefonda düğme sayfanın başında tam genişlikte şerit olur; kartın üstüne binmez. */
    .gs-account { position: static; width: min(100%, 760px); margin: 0 auto 14px; }
    .gs-panel { position: relative; top: auto; right: auto; width: auto; max-height: none; overflow: visible; }
    .gs-choice { padding: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
    .gs-choice, .gs-account-button { transition: none; }
    .gs-choice:hover { transform: none; }
}
