:root {
    --green: #319067;
    --green-dark: #1f6b4a;
    --green-soft: #e8f5ef;
    --green-border: #319067;
    --emerald: #059669;
    --red-brand: #D0003B;
    --red-brand-dark: #a0002e;
    --red-brand-deep: #7a0023;
    --red-soft: #fdecea;
    --red-border: #d64545;
    --amber-soft: #fff3e0;
    --amber-border: #c77700;
    --ink: #3f3f46;
    --muted: #71717a;
    --paper: #F8FAFC;
    --card: #ffffff;
    --question-bg: #f3f3f3;
    --line: rgb(226, 232, 240);
    --card-border: rgb(226, 232, 240);
    --radius: 14px;
    --sidebar-w: 340px;
    --font-sans: "Google Sans", Roboto, sans-serif;
    --font-mono: "Source Code Pro", ui-monospace, monospace;
}

code,
pre,
.rehber-article-body code,
.rehber-article-body pre {
    font-family: var(--font-mono);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--paper);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.rehber-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.rehber-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.08), transparent 42%),
        linear-gradient(180deg, var(--red-brand) 0%, var(--red-brand-dark) 55%, var(--red-brand-deep) 100%);
    color: #fff7f8;
    padding: 28px 20px 32px;
    z-index: 40;
}

.rehber-close-btn {
    display: none;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
}

.rehber-brand {
    padding: 4px 8px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    margin-bottom: 22px;
}

.rehber-brand-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rehber-logo-link {
    display: block;
    min-width: 0;
}

.rehber-logo {
    display: block;
    width: 148px;
    filter: brightness(0) invert(1);
}

.rehber-brand-sub {
    margin: 18px 0 0;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #fff;
}

.rehber-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.rehber-nav-label {
    margin: 0 8px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 247, 248, 0.72);
}

.rehber-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rehber-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 6px;
    border-radius: 10px;
    color: rgba(255, 247, 248, 0.92);
    border: 1px solid transparent;
    font-size: 15px;
    line-height: 1.4;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.rehber-nav-icon {
    flex: 0 0 auto;
    width: 1.1em;
    margin-top: -0.15em;
    text-align: center;
    opacity: 0.95;
}

.rehber-nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
}

.rehber-nav-link.is-active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    font-weight: 500;
}

.rehber-nav-empty {
    padding: 10px 14px;
    color: rgba(255, 247, 248, 0.65);
    font-size: 0.9rem;
}

.rehber-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--paper);
}

.rehber-topbar {
    display: none;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.rehber-menu-btn,
.rehber-search-open-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--red-brand);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.rehber-search-open-btn {
    display: none;
    margin-left: auto;
}

.rehber-topbar-text {
    min-width: 0;
    flex: 1 1 auto;
}

.rehber-topbar-kicker {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.rehber-topbar-text strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rehber-search-shell {
    position: sticky;
    top: 0;
    z-index: 28;
    background: rgba(248, 250, 252, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
}

.rehber-search-shell[hidden] {
    display: block;
}

.rehber-search-shell-panel {
    width: min(860px, calc(100% - 64px));
    max-width: 100%;
    margin: 0 auto;
}

.rehber-search-shell-head {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.rehber-search-shell-head strong {
    font-size: 1.05rem;
    color: var(--ink);
}

.rehber-search-close-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--red-brand);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rehber-content {
    width: min(860px, calc(100% - 64px));
    max-width: 100%;
    margin: 0 auto;
    padding: 32px 0 72px;
    min-width: 0;
    overflow-x: hidden;
}

.rehber-live-search {
    position: relative;
    z-index: 25;
    margin: 0;
}

.rehber-live-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 0 14px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: var(--card);
    transition: border-color 0.2s ease;
}

.rehber-live-search.is-open .rehber-live-search-field,
.rehber-live-search-field:focus-within {
    border-color: rgba(208, 0, 59, 0.4);
}

.rehber-live-search-icon {
    color: var(--muted);
    font-size: 0.95rem;
}

.rehber-live-search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.98rem;
    padding: 13px 0;
    -webkit-appearance: none;
    appearance: none;
}

.rehber-live-search-input::-webkit-search-decoration,
.rehber-live-search-input::-webkit-search-cancel-button,
.rehber-live-search-input::-webkit-search-results-button,
.rehber-live-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.rehber-live-search-input::placeholder {
    color: #a1a1aa;
}

.rehber-live-search-clear {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--red-brand);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.rehber-live-search-clear:hover {
    background: var(--red-soft);
}

.rehber-live-search-clear[hidden] {
    display: none;
}

.rehber-live-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: min(420px, 60vh);
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px;
}

.rehber-live-search-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rehber-live-search-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--ink);
    text-decoration: none;
    background: #f4f4f5;
}

.rehber-live-search-item:hover,
.rehber-live-search-item.is-active {
    background: #fff5f7;
}

.rehber-live-search-item-meta {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--red-brand);
}

.rehber-live-search-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.rehber-live-search-item-excerpt {
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--muted);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rehber-live-search-empty,
.rehber-live-search-hint {
    padding: 14px 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.rehber-page-head {
    margin-bottom: 28px;
}

.rehber-page-head h1 {
    margin: 0;
    font-size: clamp(1.7rem, 2.4vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--ink);
}

.rehber-title-line {
    width: 6rem;
    height: 0.375rem;
    margin-top: 1.5rem;
    border-radius: 999px;
    background: var(--emerald);
}

.rehber-empty {
    padding: 28px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px dashed var(--card-border);
    color: var(--muted);
}

.rehber-article,
.rehber-quiz-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 18px;
    box-shadow: none;
    animation: rehberRise 0.45s ease both;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

.rehber-article {
    scroll-margin-top: 110px;
}

@keyframes rehberRise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.rehber-article-title {
    margin: 0 0 14px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
}

.rehber-article-body {
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--ink);
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rehber-article-body p,
.rehber-article-body li,
.rehber-article-body td,
.rehber-article-body th {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rehber-article-body p {
    margin: 0 0 1em;
}

.rehber-article-body p:last-child {
    margin-bottom: 0;
}

.rehber-article-body a {
    color: #154944;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
    overflow-wrap: anywhere;
    word-break: break-word;
    word-wrap: break-word;
}

.rehber-article-body a:hover,
.rehber-article-body a:focus {
    color: #0f3532;
    text-decoration-thickness: 2px;
}

.rehber-article-body a:visited {
    color: #1f5c56;
}

.rehber-article-body table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    margin: 1em 0 1.25em;
    color: #1A3A40;
    font-size: 0.98rem;
    line-height: 1.5;
    overflow-x: auto;
    display: table;
}

.rehber-article-body .table-wrap,
.rehber-article-body figure {
    width: 100%;
    overflow-x: auto;
}

.rehber-article-body thead th,
.rehber-article-body thead td,
.rehber-article-body tr:first-child th {
    background: #154944;
    color: #fff;
    font-weight: 600;
    text-align: left;
    vertical-align: middle;
    padding: 12px 14px;
    border: 1px solid #154944;
}

.rehber-article-body tbody td,
.rehber-article-body tbody th,
.rehber-article-body td {
    padding: 12px 14px;
    vertical-align: top;
    border: 1px solid rgba(21, 73, 68, 0.18);
    color: #1A3A40;
    background: #fff;
}

.rehber-article-body tbody tr:nth-child(odd) td,
.rehber-article-body tbody tr:nth-child(odd) th {
    background: #F2F7F5;
}

.rehber-article-body tbody tr:nth-child(even) td,
.rehber-article-body tbody tr:nth-child(even) th {
    background: #fff;
}

/* thead yoksa ilk satır başlık kabul edilir; sonraki satırlar zebra */
.rehber-article-body table:not(:has(thead)) tr:nth-child(n+2):nth-child(odd) td,
.rehber-article-body table:not(:has(thead)) tr:nth-child(n+2):nth-child(odd) th {
    background: #F2F7F5;
}

.rehber-article-body table:not(:has(thead)) tr:nth-child(n+2):nth-child(even) td,
.rehber-article-body table:not(:has(thead)) tr:nth-child(n+2):nth-child(even) th {
    background: #fff;
}

@media (max-width: 900px) {
    .rehber-article-body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.rehber-quiz-card {
    padding: 0;
    overflow: hidden;
}

.rehber-quiz-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 26px;
    font-weight: 700;
    color: var(--ink);
    user-select: none;
}

.rehber-quiz-summary::-webkit-details-marker {
    display: none;
}

.rehber-quiz-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.28rem;
    line-height: 1.3;
    color: #059669;
}

.rehber-quiz-title > i {
    color: #059669;
    font-size: 1.35rem;
}

.rehber-summary-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.rehber-score {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 20px;
    background: #ECFDF5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

.rehber-score b {
    font-weight: 700;
}

.rehber-quiz-summary > .rehber-summary-right > i,
.rehber-summary-right > i {
    transition: transform 0.2s ease;
    font-size: 1.05rem;
    color: #059669;
}

.rehber-quiz-card[open] .rehber-summary-right > i {
    transform: rotate(180deg);
}

.rehber-quiz-body {
    padding: 0 18px 18px;
    display: grid;
    gap: 12px;
}

.rehber-question {
    background: var(--question-bg);
    border: 0;
    border-radius: 12px;
    padding: 16px;
}

.rehber-question-text {
    margin: 0 0 12px;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.45;
}

.rehber-q-num {
    color: var(--emerald);
    margin-right: 4px;
}

.rehber-options {
    display: grid;
    gap: 10px;
}

.rehber-option {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid rgba(26, 26, 26, 0.12);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.rehber-option:hover:not(:disabled) {
    border-color: rgba(5, 150, 105, 0.45);
    background: #f3faf6;
}

.rehber-option:disabled {
    cursor: default;
}

.rehber-option-text {
    flex: 1;
    line-height: 1.45;
}

.rehber-option-icon {
    flex: 0 0 auto;
    width: 1.1em;
    text-align: center;
    font-size: 1rem;
}

.rehber-option.is-correct {
    background: var(--green-soft);
    border-color: var(--green-border);
    color: var(--green-dark);
}

.rehber-option.is-correct .rehber-option-icon::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f00c";
    color: var(--green);
}

.rehber-option.is-wrong {
    background: var(--red-soft);
    border-color: var(--red-border);
    color: #8a1f1f;
}

.rehber-option.is-wrong .rehber-option-icon::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f00d";
    color: var(--red-border);
}

.rehber-explain {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    font-size: 0.95rem;
    line-height: 1.55;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
}

.rehber-explain[hidden] {
    display: none !important;
}

.rehber-explain-icon {
    flex: 0 0 auto;
    margin-top: 0.2em;
}

.rehber-explain-body {
    flex: 1;
    min-width: 0;
}

.rehber-explain-label {
    display: inline;
    margin-right: 0.35em;
    font-weight: 700;
}

.rehber-explain-text {
    white-space: normal;
    word-break: break-word;
}

.rehber-explain.is-correct {
    background: var(--green-soft);
    border-color: var(--green-border);
    color: var(--green-dark);
}

.rehber-explain.is-wrong {
    background: var(--amber-soft);
    border-color: var(--amber-border);
    color: #7a4a00;
}

.rehber-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 28px;
}

.rehber-pager-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--card-border);
    box-shadow: none;
    color: var(--ink);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.rehber-pager-btn:hover {
    border-color: rgba(208, 0, 59, 0.35);
}

.rehber-pager-btn.is-disabled {
    visibility: hidden;
    pointer-events: none;
    box-shadow: none;
}

.rehber-pager-btn i {
    color: var(--red-brand);
    font-size: 1rem;
    flex: 0 0 auto;
}

.rehber-pager-btn span {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.rehber-pager-btn small {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.rehber-pager-btn strong {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.rehber-pager-next {
    justify-content: flex-end;
    text-align: right;
}

.rehber-pager-next span {
    align-items: flex-end;
}

.rehber-scroll-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 40;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--red-brand);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(208, 0, 59, 0.28);
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.rehber-scroll-top:hover {
    background: var(--red-brand-dark);
    transform: translateY(-2px);
}

.rehber-scroll-top[hidden] {
    display: none;
}

.rehber-backdrop {
    display: none;
}

@media (max-width: 900px) {
    .rehber-app {
        grid-template-columns: 1fr;
    }

    .rehber-topbar {
        display: flex;
    }

    .rehber-search-open-btn {
        display: inline-flex;
    }

    .rehber-article {
        scroll-margin-top: 84px;
    }

    .rehber-scroll-top {
        right: 16px;
        bottom: 16px;
    }

    .rehber-search-shell {
        position: fixed;
        inset: 0;
        z-index: 55;
        display: none;
        align-items: flex-start;
        justify-content: center;
        padding: 12px;
        background: rgba(20, 0, 6, 0.45);
        border-bottom: 0;
        backdrop-filter: none;
    }

    .rehber-search-shell[hidden] {
        display: none;
    }

    .rehber-app.is-search-open .rehber-search-shell,
    .rehber-app.is-search-open .rehber-search-shell[hidden] {
        display: flex;
    }

    .rehber-search-shell-panel {
        width: min(100%, 520px);
        margin: 8px auto 0;
        padding: 16px;
        border-radius: 16px;
        background: #fff;
        border: 1px solid var(--card-border);
        box-shadow: 0 18px 48px rgba(20, 0, 6, 0.22);
    }

    .rehber-search-shell-head {
        display: flex;
    }

    .rehber-live-search-results {
        max-height: min(55vh, 420px);
    }

    .rehber-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .rehber-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(90vw, 360px);
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        box-shadow: 12px 0 40px rgba(0, 0, 0, 0.28);
    }

    .rehber-app.is-nav-open .rehber-sidebar {
        transform: none;
    }

    .rehber-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20, 0, 6, 0.45);
        z-index: 30;
        border: 0;
        padding: 0;
        margin: 0;
        cursor: pointer;
    }

    .rehber-backdrop[hidden] {
        display: none;
    }

    .rehber-content {
        width: min(100% - 32px, 860px);
        padding: 24px 0 56px;
    }

    .rehber-article,
    .rehber-quiz-card {
        padding: 20px 16px;
    }

    .rehber-quiz-card {
        padding: 0;
    }

    .rehber-quiz-summary {
        padding: 16px;
        flex-wrap: wrap;
    }

    .rehber-quiz-body {
        padding: 0 12px 14px;
    }

    .rehber-pager {
        grid-template-columns: 1fr;
    }

    .rehber-pager-btn.is-disabled {
        display: none;
    }

    .rehber-pager-next {
        justify-content: flex-start;
        text-align: left;
    }

    .rehber-pager-next span {
        align-items: flex-start;
    }
}
