:root {
    --bg: #eef3f2;
    --ink: #15232b;
    --muted: #5a6b73;
    --line: #d2ddd8;
    --card: #ffffff;
    --accent: #1a4d4a;
    --accent-2: #163a52;
    --danger: #8b2e2e;
    --ok: #1e4d32;
    --ok-bg: #e6f2ea;
    --danger-bg: #f8e8e6;
    --radius: 18px;
    --shadow: 0 1px 2px rgba(21, 35, 43, 0.04), 0 14px 36px rgba(21, 35, 43, 0.07);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    color: var(--ink);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: -0.011em;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 48% at 8% -8%, rgba(26, 77, 74, 0.07), transparent 52%),
        radial-gradient(ellipse 55% 36% at 100% 0%, rgba(22, 58, 82, 0.06), transparent 46%),
        linear-gradient(180deg, #f5f8f7 0%, #e8eef0 100%);
    background-attachment: fixed;
}

html.theme-fun,
body.theme-fun {
    overflow-x: hidden;
}

body.theme-fun {
    background-image:
        radial-gradient(ellipse 70% 42% at 6% -6%, rgba(232, 180, 196, 0.18), transparent 50%),
        radial-gradient(ellipse 50% 34% at 100% 4%, rgba(168, 210, 214, 0.22), transparent 48%),
        linear-gradient(180deg, #f7f4f6 0%, #eef4f3 100%);
}

.shell,
.main,
.card,
.top {
    position: relative;
    z-index: 1;
}

.shell {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 22px 56px;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.brand {
    color: var(--ink);
    text-decoration: none;
    font-weight: 720;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ver-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 720;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.login-card { margin-top: 40px; }

.login-mark {
    margin: 0 0 12px;
}

.login-card h1 { margin-top: 0; }

.top-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 14px;
    align-items: center;
    font-size: 0.92rem;
}

.top-nav a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 650;
}

.top-nav a:hover { color: var(--accent-2); }

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

.main h1 {
    margin: 0 0 10px;
    font-size: 1.72rem;
    letter-spacing: -0.035em;
    font-weight: 720;
    line-height: 1.2;
}

.lead { color: var(--muted); margin: 0 0 22px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 28px 30px;
    box-shadow: var(--shadow);
}

.card-narrow { max-width: 420px; margin: 56px auto 0; }

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card-link:hover {
    transform: translateY(-2px);
    border-color: #b7c9c4;
    box-shadow: 0 2px 4px rgba(21, 35, 43, 0.05), 0 18px 40px rgba(21, 35, 43, 0.09);
}

.card-link h2 { margin: 0 0 8px; font-size: 1.15rem; letter-spacing: -0.02em; }
.card-link p { margin: 0; color: var(--muted); }
.go { display: inline-block; margin-top: 16px; color: var(--accent); font-weight: 650; }

.mod-tag {
    display: inline-block;
    margin-bottom: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8f0ee;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 720;
    letter-spacing: 0.02em;
}

.grid { display: grid; gap: 18px; }

@media (min-width: 760px) {
    .grid { grid-template-columns: 1fr 1fr; }
}

.stack { display: grid; gap: 18px; }

label { display: grid; gap: 7px; font-weight: 650; font-size: 0.92rem; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"] {
    font: inherit;
}

input[type="text"],
input[type="password"] {
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
.choice-inline .num:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 77, 74, 0.12);
}

.btn {
    display: inline-block;
    border: 0;
    background: var(--accent);
    color: #fff;
    padding: 11px 18px;
    border-radius: 12px;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 6px 14px rgba(26, 77, 74, 0.18);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 10px 20px rgba(22, 58, 82, 0.2);
}

.btn:active { transform: translateY(0); }

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:disabled:hover {
    background: var(--accent);
    transform: none;
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--line);
    margin-left: 8px;
    box-shadow: none;
}

.btn-ghost:hover {
    background: #f3f7f6;
    color: var(--accent-2);
    box-shadow: none;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin: 0 0 16px;
}

.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-info { background: #e8eef0; color: var(--ink); }

.drop {
    position: relative;
    border: 1.5px dashed #b9c6c1;
    border-radius: 14px;
    padding: 30px 16px;
    text-align: center;
    background: #fbfdfc;
}

.drop.drag {
    border-color: var(--accent);
    background: #eef6f4;
}

.drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 16px;
}

.drop-title { margin: 0 0 6px; font-weight: 650; }
.muted, .hint, .crumb { color: var(--muted); font-size: 0.9rem; }
.crumb { margin: 0 0 14px; }
.crumb a { color: var(--accent); }
.file-name { margin: 10px 0 0; font-weight: 650; }

.drop.has-files { padding: 18px 16px; }

.file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.file-chip,
.recent-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdfc;
}

.file-chip.is-bad {
    border-color: #e3b6b0;
    background: var(--danger-bg);
}

.file-meta,
.recent-meta {
    min-width: 0;
}

.file-meta strong,
.recent-meta strong {
    display: block;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta small,
.recent-meta small {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
}

.file-err { color: var(--danger) !important; }

.file-x {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}

.file-x:hover {
    background: #f3f7f6;
    color: var(--danger);
}

.file-ico {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
    flex-shrink: 0;
}

.file-ico-docx { background: #2b579a; }
.file-ico-pptx { background: #d24726; }
.file-ico-xlsx { background: #217346; }
.file-ico-pdf { background: #b30b00; }
.file-ico-zip { background: #5a6b73; }
.file-ico-bin { background: #8a9aa0; }

.result-table-wrap { overflow-x: auto; margin: 10px 0 12px; }

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

.result-table th,
.result-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.result-table th { font-size: 0.78rem; color: var(--muted); font-weight: 650; }

.result-table small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }

.status-ok { color: var(--ok); font-weight: 700; }
.status-err { color: var(--danger); font-weight: 700; }

.recent-card { margin-top: 18px; }
.recent-card h2 { margin: 0 0 6px; font-size: 1.15rem; }

.recent-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.recent-list a {
    color: var(--accent);
    font-weight: 650;
    text-decoration: none;
}

.recent-list a:hover { color: var(--accent-2); }

html.theme-fun .file-chip,
html.theme-fun .recent-list li,
body.theme-fun .file-chip,
body.theme-fun .recent-list li {
    background: #fffafb;
    border-color: #eadfe3;
}

html.theme-fun .file-x:hover,
body.theme-fun .file-x:hover {
    background: #f8eef1;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px 16px;
    margin: 0;
}

legend { font-weight: 720; padding: 0 6px; }

.segments {
    display: flex;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.segment {
    flex: 1;
    margin: 0;
    display: block;
    font-weight: 650;
    position: relative;
}

.segment input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segment span {
    display: block;
    text-align: center;
    padding: 9px 8px;
    border-right: 1px solid var(--line);
    cursor: pointer;
    font-size: 0.92rem;
}

.segment:last-child span { border-right: 0; }

.segment input:checked + span {
    background: var(--accent);
    color: #fff;
}

.segment input:focus-visible + span {
    outline: 2px solid var(--accent-2);
    outline-offset: -2px;
}

.segments-lg .segment span {
    padding: 14px 10px;
    font-size: 1rem;
}

.format-pick .hint { margin: 0 0 12px; }

.format-soon-box {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff6e8;
    border: 1px solid #e8d2a8;
    color: #5c4a22;
    font-size: 0.92rem;
    font-weight: 550;
}

.format-soon-box strong {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #c9841a;
    color: #fff;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    vertical-align: 1px;
}

.submit-wrap { display: inline-block; position: relative; }

.submit-wrap.is-blocked { cursor: not-allowed; }

.submit-wrap.is-blocked .btn { pointer-events: none; }

.submit-wrap.is-blocked:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    white-space: nowrap;
    background: var(--ink);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 650;
    padding: 6px 10px;
    border-radius: 8px;
    z-index: 4;
    box-shadow: var(--shadow);
}

.pdf-only { display: grid; gap: 16px; }

.pdf-only.is-disabled {
    opacity: 0.45;
}

.pdf-only.is-disabled fieldset,
.pdf-only.is-disabled .choice {
    pointer-events: none;
}

.choices { display: grid; gap: 8px; }

.choices-compact {
    gap: 6px;
}

.choice {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    font-weight: 400;
}

.choice strong { display: block; }
.choice small { display: block; color: var(--muted); font-size: 0.85rem; }

.preview-frame-wrap,
.preview-text-wrap {
    margin-top: 14px;
}

.preview-frame {
    display: block;
    width: 100%;
    height: min(72vh, 820px);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.preview-text {
    max-height: 280px;
    overflow: auto;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.choice-inline .num {
    width: 64px;
    padding: 4px 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.foot {
    margin-top: 32px;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

code {
    background: #e8eef0;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.9em;
}

.cal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

.cal-grid .card h2 { margin: 0 0 6px; font-size: 1.15rem; }

@media (max-width: 720px) {
    .cal-grid { grid-template-columns: 1fr; }
    .shell { padding: 22px 16px 40px; }
    .theme-opt { padding: 5px 8px; font-size: 0.75rem; }
    .submit-wrap.is-blocked:hover::after {
        white-space: normal;
        max-width: 220px;
        left: auto;
        right: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .card-link {
        transition: none;
    }
    .btn:hover,
    .card-link:hover { transform: none; }
}

/* --- Tema seçici: yan yana iki buton (dropdown yok) --- */

.theme-switch {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--card);
}

.theme-opt {
    border: 0;
    background: transparent;
    padding: 6px 12px;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--muted);
    line-height: 1.2;
}

.theme-opt + .theme-opt { border-left: 1px solid var(--line); }

.theme-opt.is-active {
    background: var(--accent);
    color: #fff;
}

.theme-opt:not(.is-active):hover {
    background: #f3f7f6;
    color: var(--ink);
}

.fun-layer,
.fun-buddy {
    display: none;
}

html.theme-fun .fun-layer,
body.theme-fun .fun-layer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

html.theme-fun .sticker,
body.theme-fun .sticker {
    position: absolute;
    opacity: 0.07;
    user-select: none;
    line-height: 1;
    font-size: 56px;
    color: var(--ink);
}

html.theme-fun .svg-mascot,
body.theme-fun .svg-mascot {
    width: 88px;
    height: auto;
    font-size: 0;
}

html.theme-fun .s1, body.theme-fun .s1 { top: 4%; left: 3%; }
html.theme-fun .s2, body.theme-fun .s2 { top: 8%; right: 4%; font-size: 48px; }
html.theme-fun .s3, body.theme-fun .s3 { top: 42%; left: 1%; font-size: 40px; }
html.theme-fun .s4, body.theme-fun .s4 { bottom: 10%; right: 5%; font-size: 44px; }
html.theme-fun .s5, body.theme-fun .s5 { top: 28%; right: 2%; font-size: 32px; }
html.theme-fun .s6, body.theme-fun .s6 { bottom: 28%; left: 6%; font-size: 36px; }
html.theme-fun .s7, body.theme-fun .s7 { bottom: 6%; left: 12%; font-size: 40px; }
html.theme-fun .s8, body.theme-fun .s8 { top: 62%; right: 10%; font-size: 38px; }
html.theme-fun .s-cat, body.theme-fun .s-cat { bottom: 14%; right: 18%; }
html.theme-fun .s-hat, body.theme-fun .s-hat { top: 16%; left: 14%; }

html.theme-fun .main,
body.theme-fun .main {
    display: flex;
    flex-direction: column;
}

html.theme-fun .fun-buddy,
body.theme-fun .fun-buddy {
    display: flex;
    align-items: center;
    align-self: flex-end;
    gap: 8px;
    position: relative;
    margin-top: -14px;
    margin-right: 8px;
    background: #fffafb;
    border: 1px solid #eadfe3;
    border-radius: 999px;
    padding: 6px 12px 6px 8px;
    font-size: 0.82rem;
    font-weight: 650;
    color: #5a6b73;
    box-shadow: 0 6px 16px rgba(21, 35, 43, 0.06);
    z-index: 2;
    max-width: min(320px, 86vw);
    pointer-events: none;
}

html.theme-fun .fun-buddy-face,
body.theme-fun .fun-buddy-face { font-size: 1.15rem; line-height: 1; }

@media (max-width: 720px) {
    html.theme-fun .desktop-only,
    body.theme-fun .desktop-only { display: none; }
    html.theme-fun .sticker,
    body.theme-fun .sticker { font-size: 36px; }
    html.theme-fun .fun-buddy,
    body.theme-fun .fun-buddy {
        position: fixed;
        right: 12px;
        bottom: 12px;
        left: auto;
        margin: 0;
        align-self: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.theme-fun .sticker,
    body.theme-fun .sticker { opacity: 0.05; }
}

.poem-toggle {
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--muted);
    border-radius: 10px;
    padding: 6px 12px;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.2;
}

.poem-toggle:hover {
    color: var(--ink);
    background: #f3f7f6;
}

.poem-toggle[aria-pressed="false"] {
    color: var(--accent);
}

.home-poem-rail {
    display: none !important;
    position: fixed;
    top: 88px;
    bottom: 24px;
    width: min(20vw, 200px);
    z-index: 0;
    pointer-events: none;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}

.home-poem-rail.is-left {
    left: 12px;
    right: auto;
}

.home-poem-rail.is-right {
    right: 12px;
    left: auto;
    text-align: right;
}

.home-poem-kicker {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 720;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #8a6a74;
    opacity: 0.7;
}

.home-poem-window {
    flex: 1;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
}

.home-poem-track {
    animation: poem-up 88s linear infinite;
}

.home-poem-track.is-rev {
    animation: poem-down 96s linear infinite;
}

.home-poem-copy {
    margin: 0 0 2.2em;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 0.78rem;
    line-height: 1.85;
    color: #6b4450;
    white-space: pre-line;
    opacity: 0.55;
}

html.theme-fun .home-poem-copy,
body.theme-fun .home-poem-copy {
    color: #7a4454;
    opacity: 0.62;
}

@media (min-width: 1040px) {
    html.page-home:not(.poem-off) .home-poem-rail:not([hidden]),
    body.page-home:not(.poem-off) .home-poem-rail:not([hidden]) {
        display: flex !important;
    }
}

html.poem-off .home-poem-rail,
body.poem-off .home-poem-rail,
.home-poem-rail[hidden] {
    display: none !important;
}

@keyframes poem-up {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
}

@keyframes poem-down {
    from { transform: translateY(-50%); }
    to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .home-poem-track,
    .home-poem-track.is-rev { animation: none; }
}

/* Telefon + tablet (Samsung dahil): dokunma, güvenli alan, tek sütun */
@media (max-width: 1024px), (pointer: coarse) {
    .home-poem-rail {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .shell {
        max-width: 100%;
        padding: 18px 16px max(40px, env(safe-area-inset-bottom));
    }

    .top {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
    }

    .top-nav {
        width: 100%;
        justify-content: flex-start;
        row-gap: 8px;
    }

    .theme-opt,
    .poem-toggle {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 0.88rem;
    }

    .main h1 { font-size: 1.42rem; }

    .card {
        padding: 18px 16px 22px;
        border-radius: 14px;
    }

    .card-narrow {
        max-width: none;
        margin: 20px auto 0;
    }

    .drop {
        min-height: 132px;
        padding: 36px 14px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .file-x {
        width: 44px;
        height: 44px;
    }

    .choice input[type="radio"],
    .choice input[type="checkbox"] {
        width: 22px;
        height: 22px;
        margin-top: 3px;
    }

    .segment span {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px 8px;
    }

    .btn,
    .btn-ghost {
        min-height: 44px;
        padding: 12px 16px;
    }

    .alert .btn,
    .alert .btn-ghost {
        display: block;
        width: 100%;
        margin: 0 0 8px;
        text-align: center;
        box-sizing: border-box;
    }

    .alert .btn-ghost { margin-left: 0; }

    .preview-frame {
        height: 58vh;
        min-height: 260px;
        max-height: 640px;
    }

    .submit-wrap { display: block; }
    .submit-wrap .btn { width: 100%; }

    .foot { padding-bottom: env(safe-area-inset-bottom); }
}

@media (max-width: 599px) {
    .grid { grid-template-columns: 1fr; }
    .shell { padding-left: 12px; padding-right: 12px; }
    .brand { font-size: 0.95rem; }
}

@media (min-width: 600px) and (max-width: 1024px) {
    .grid { grid-template-columns: 1fr 1fr; }
    .top {
        flex-direction: row;
        align-items: center;
    }
    .top-nav { width: auto; }
}

@media (pointer: coarse) {
    .card-link:hover,
    .btn:hover {
        transform: none;
    }
}
