/* RefereeHub web — design tokens and components from design/html (same values as the desktop's Light/Dark themes).
   Phone layouts (≤ 767px) are adapted from the same components; see docs/DESIGN.md "Web". */

/* Barlow Semi Condensed (SIL Open Font License 1.1, see fonts/OFL.txt), self-hosted: no requests to Google at runtime.
   latin + latin-ext covers Turkish (ç ğ ı İ ö ş ü); unicode-range lets browsers load only the subsets a page uses. */
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 500; font-display: swap;
             src: url("../fonts/barlow-semi-condensed-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 500; font-display: swap;
             src: url("../fonts/barlow-semi-condensed-500-latin-ext.woff2") format("woff2"); 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: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap;
             src: url("../fonts/barlow-semi-condensed-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap;
             src: url("../fonts/barlow-semi-condensed-600-latin-ext.woff2") format("woff2"); 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: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap;
             src: url("../fonts/barlow-semi-condensed-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap;
             src: url("../fonts/barlow-semi-condensed-700-latin-ext.woff2") format("woff2"); 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; }

/* ===== Tokens ===== */
:root {
    --bg: #EEF1F6; --surface: #FFFFFF; --card: #FFFFFF; --raised: #FFFFFF; --sunken: #E3E8F0; --border: #D3DAE5; --border-strong: #7C8AA3;
    --text: #0F1B2D; --text2: #4A5870; --text-dis: #A0AABB; --ph: #66748C;
    --primary: #C2410C; --primary-h: #A8380A; --on-primary: #FFFFFF; --primary-sub: #FFE7D6; --on-primary-sub: #7A2806;
    --accent: #A16207; --on-accent: #FFFFFF; --accent-sub: #FEF3C7; --on-accent-sub: #713F12;
    --ctrl: #FFFFFF; --ctrl-h: #F1F4F8; --ctrl-dis: #E9EDF3; --subtle-h: #0F1B2D0F; --subtle-p: #0F1B2D1A; --input: #FFFFFF;
    --focus: #0F1B2D; --focus-in: #FFFFFF;
    --success: #15803D; --success-sub: #DCFCE7; --warning: #A16207; --warning-sub: #FEF3C7;
    --error: #C81E1E; --error-sub: #FDE2E2; --info: #1D4ED8; --info-sub: #DBEAFE;
    --inverse: #0F1B2D; --on-inverse: #F4F6FA; --inv-primary: #FF9A4D;
    --sh1: 0 1px 2px rgba(15,27,45,.08), 0 0 0 1px rgba(15,27,45,.04); --sh2: 0 2px 6px rgba(15,27,45,.12);
    --sh3: 0 8px 16px rgba(15,27,45,.16); --sh4: 0 32px 64px rgba(15,27,45,.22), 0 2px 21px rgba(15,27,45,.16);
    /* Bahnschrift where Windows has it; everywhere else the self-hosted Barlow Semi Condensed (design fallback). */
    --ft: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --fd: "Bahnschrift", "Barlow Semi Condensed", "Segoe UI", system-ui, sans-serif;
    --on-error: #FFFFFF;
    --nav-w: 240px; --nav-w-collapsed: 72px; --header-h: 64px; --bottom-nav-h: 64px; --content-max: 1360px;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0F1B2D; --surface: #16263D; --card: #16263D; --raised: #1D3150; --sunken: #0B1524; --border: #26395A; --border-strong: #6F82A3;
    --text: #F4F6FA; --text2: #A9B6CC; --text-dis: #5D6D88; --ph: #8C9AB3;
    --primary: #FF7A1A; --primary-h: #FF8F3D; --on-primary: #1A0D00; --primary-sub: #3A2412; --on-primary-sub: #FFB27A;
    --accent: #FFD23F; --on-accent: #1A1400; --accent-sub: #3A3214; --on-accent-sub: #FFE07A;
    --ctrl: #1D3150; --ctrl-h: #24395C; --ctrl-dis: #16263D; --subtle-h: #FFFFFF12; --subtle-p: #FFFFFF0A; --input: #0F1B2D;
    --focus: #F4F6FA; --focus-in: #0F1B2D;
    --success: #4ADE80; --success-sub: #12321F; --warning: #FBBF24; --warning-sub: #3A2C0C;
    --error: #FF6B6B; --error-sub: #3E1A1F; --info: #60A5FA; --info-sub: #13284A;
    --inverse: #F4F6FA; --on-inverse: #0F1B2D; --inv-primary: #C2410C; --on-error: #1A0505;
    --sh1: 0 1px 2px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.2); --sh2: 0 2px 6px rgba(0,0,0,.45);
    --sh3: 0 8px 16px rgba(0,0,0,.55); --sh4: 0 32px 64px rgba(0,0,0,.6), 0 2px 21px rgba(0,0,0,.5);
    color-scheme: dark;
}

/* The navigation is dark in both themes (design .side). */
.side, .bottom-nav {
    --surface: #0A1422; --text: #F4F6FA; --text2: #A9B6CC; --sunken: #132238; --border: #1E2E48; --border-strong: #6F82A3;
    --subtle-h: #FFFFFF12; --primary: #FF7A1A; --on-primary: #1A0D00; --primary-sub: #FF7A1A24; --on-primary-sub: #FFB27A;
    --ctrl: #132238; --ctrl-h: #1D3150; --success: #4ADE80; --info: #60A5FA; --warning: #FBBF24; --focus: #F4F6FA; --focus-in: #0A1422;
    color: var(--text);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
/* Reserve the scroll bar's space so content never changes width when a list grows past the viewport. */
html { scrollbar-gutter: stable; }
body { font-family: var(--ft); font-size: 14px; line-height: 20px; color: var(--text); background: var(--bg); -webkit-text-size-adjust: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; box-shadow: 0 0 0 1px var(--focus-in); }
/* Headings receive focus after navigation for screen readers; that focus is not a keyboard target. */
[tabindex="-1"]:focus { outline: none; box-shadow: none; }
a { color: var(--primary); }
a:hover { color: var(--primary-h); }
button { font: inherit; }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-lg { width: 24px; height: 24px; }

.cap { font-size: 12px; line-height: 16px; color: var(--text2); }
.sec { color: var(--text2); }
.h1 { font-family: var(--fd); font-size: 28px; line-height: 36px; font-weight: 600; }
.h2 { font-family: var(--fd); font-size: 20px; line-height: 28px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.h3 { font-family: var(--fd); font-size: 16px; line-height: 22px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.k { font-family: var(--fd); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }

/* ===== Controls ===== */
.btn { height: 32px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--ctrl); color: var(--text);
       display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--ctrl-h); color: var(--text); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-p { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn-p:hover { background: var(--primary-h); border-color: var(--primary-h); color: var(--on-primary); }
.btn-t { background: transparent; border-color: transparent; }
.btn-t:hover { background: var(--subtle-h); }
.btn-ic { width: 32px; padding: 0; }
.btn-lg { height: 44px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.lnk { border: 0; background: transparent; padding: 4px 0; color: var(--primary); cursor: pointer; text-decoration: underline; }
.lnk:hover { color: var(--primary-h); }

.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > label, .fld .l { font-size: 13px; line-height: 16px; font-weight: 600; }
.inp { height: 40px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--input); color: var(--text);
       padding: 0 12px; display: flex; align-items: center; gap: 8px; }
.inp:focus-within { border-color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); }
.inp.err { border-color: var(--error); box-shadow: inset 0 -2px 0 var(--error); }
.inp input, .inp select { border: 0; background: transparent; font: inherit; color: var(--text); outline: none; flex: 1; min-width: 0; height: 100%; }
.inp input::placeholder { color: var(--ph); }
.inp select option { background: var(--surface); color: var(--text); }
.inp .i { color: var(--text2); }
.inp-sm { height: 32px; }
.inp-btn { border: 0; background: transparent; color: var(--text2); display: inline-flex; padding: 4px; cursor: pointer; border-radius: 4px; }
.msg { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; line-height: 16px; color: var(--error); }
.msg .i { width: 14px; height: 14px; margin-top: 1px; }
.chk { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); flex: none; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.kbd { font-size: 12px; line-height: 16px; padding: 0 5px; border: 1px solid var(--border); border-radius: 4px; color: var(--text2); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--sh1); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.row:hover { background: var(--subtle-h); }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.badge .i { width: 14px; height: 14px; stroke-width: 2; }
.ok { background: var(--success-sub); color: var(--success); }
.wa { background: var(--warning-sub); color: var(--warning); }
.er { background: var(--error-sub); color: var(--error); }
.in { background: var(--info-sub); color: var(--info); }
.ne { background: var(--sunken); color: var(--text2); }
.ac { background: var(--accent-sub); color: var(--on-accent-sub); }

/* InfoBar (design: icon + bold title + message on a tinted background) */
.infobar { display: flex; gap: 12px; padding: 12px; border-radius: 8px; border: 1px solid var(--border); }
.infobar .i { width: 20px; height: 20px; margin-top: 0; }
.infobar-title { font-weight: 600; }
.infobar.error { background: var(--error-sub); } .infobar.error > .i { color: var(--error); }
.infobar.warning { background: var(--warning-sub); } .infobar.warning > .i { color: var(--warning); }
.infobar.success { background: var(--success-sub); } .infobar.success > .i { color: var(--success); }
.infobar.info { background: var(--info-sub); } .infobar.info > .i { color: var(--info); }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength span { height: 4px; border-radius: 2px; background: var(--sunken); }
.strength span.on { background: var(--primary); }

/* ===== Boot screen and error bar ===== */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--text2); }
.boot-logo { width: 48px; height: 48px; border-radius: 8px; background: #FF7A1A; animation: boot 1.2s ease-in-out infinite; }
@keyframes boot { 50% { opacity: .45; } }
#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; padding: 12px 16px; background: var(--error-sub);
                   color: var(--text); border-top: 1px solid var(--error); align-items: center; gap: 16px; }
#blazor-error-ui .dismiss { margin-left: auto; border: 0; background: transparent; color: var(--text); font-size: 20px; cursor: pointer; }

/* ===== Shell ===== */
.shell { min-height: 100vh; display: flex; }
.side { position: sticky; top: 0; height: 100vh; flex: 0 0 var(--nav-w); width: var(--nav-w); background: var(--surface); border-right: 1px solid var(--border);
        display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 20px; }
.side-brand-name { font-family: var(--fd); font-size: 16px; line-height: 20px; font-weight: 600; }
.nav { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 4px; color: var(--text); text-decoration: none; position: relative; }
.nav:hover { background: var(--subtle-h); color: var(--text); }
.nav.active { background: var(--primary-sub); color: var(--on-primary-sub); font-weight: 600; }
.nav.active::before { content: ""; position: absolute; left: 0; top: 12px; width: 3px; height: 16px; border-radius: 2px; background: var(--primary); }
.side-spacer { flex: 1; }
.side-user { display: flex; align-items: center; gap: 12px; padding: 12px 6px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.side-user-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.side-user-text > span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--primary-sub); color: var(--on-primary-sub); display: flex;
          align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; overflow: hidden; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: #FF7A1A; color: #1A0D00; display: flex; align-items: center; justify-content: center; flex: none; }
.logo svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; }
.logo-lg { width: 44px; height: 44px; } .logo-lg svg { width: 32px; height: 32px; }

.shell.collapsed .side { flex-basis: var(--nav-w-collapsed); width: var(--nav-w-collapsed); }
.shell.collapsed .side .label, .shell.collapsed .side-brand-text, .shell.collapsed .side-user-text, .shell.collapsed .side-user .btn { display: none; }
.shell.collapsed .nav { justify-content: center; padding: 0; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.header { min-height: var(--header-h); display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 12px 32px;
          background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.header-title { display: flex; flex-direction: column; min-width: 0; }
.header-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-spacer { flex: 1; }
.header-search { flex: 0 1 360px; min-width: 200px; height: 32px; }
.content { width: 100%; max-width: var(--content-max); padding: 24px 32px 32px; }

.bottom-nav { display: none; }
.fab { display: none; }

/* Tablets: icons-only sidebar. */
@media (max-width: 1023px) {
    .shell:not(.expanded) .side { flex-basis: var(--nav-w-collapsed); width: var(--nav-w-collapsed); }
    .shell:not(.expanded) .side .label, .shell:not(.expanded) .side-brand-text,
    .shell:not(.expanded) .side-user-text, .shell:not(.expanded) .side-user .btn { display: none; }
    .shell:not(.expanded) .nav { justify-content: center; padding: 0; }
    .header-search { display: none; }
}

/* Phones: no sidebar; compact header, bottom navigation, floating "Yeni maç". */
@media (max-width: 767px) {
    .side { display: none; }
    .header { padding: 8px 16px; gap: 8px; min-height: 56px; }
    .header .h1 { font-size: 22px; line-height: 28px; }
    .header .collapse-btn, .header .new-match { display: none; }
    .content { padding: 16px 16px calc(var(--bottom-nav-h) + 24px + env(safe-area-inset-bottom)); }
    .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
                  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); }
    .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text2);
                    text-decoration: none; font-size: 11px; line-height: 14px; }
    .bottom-nav a.active { color: var(--on-primary-sub); font-weight: 600; }
    .bottom-nav a .i { width: 22px; height: 22px; }
    .fab { display: inline-flex; position: fixed; right: 16px; bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 21;
           width: 56px; height: 56px; border-radius: 999px; box-shadow: var(--sh3); }
    .fab .i { width: 24px; height: 24px; }
}

/* Account menu (phones: the header avatar opens it). */
.menu { position: absolute; right: 16px; top: 52px; min-width: 240px; padding: 8px; background: var(--raised); border: 1px solid var(--border);
        border-radius: 8px; box-shadow: var(--sh3); z-index: 30; display: flex; flex-direction: column; gap: 2px; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 4px; border: 0;
                        background: transparent; color: var(--text); text-decoration: none; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--subtle-h); }
.menu-head { padding: 8px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.header-avatar { display: none; border: 0; background: transparent; padding: 0; cursor: pointer; }
@media (max-width: 767px) { .header-avatar { display: inline-flex; } }

/* ===== Sign-in (design Giris) ===== */
.auth { min-height: 100vh; display: flex; }
.auth-brand { flex: 0 0 620px; position: relative; overflow: hidden; background: #0A1422; color: #F4F6FA; padding: 48px 56px; display: flex; flex-direction: column; }
.auth-court { position: absolute; right: -40px; top: 40px; width: 414px; height: 720px; opacity: .9; pointer-events: none; }
.auth-court svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.auth-brand-head { display: flex; align-items: center; gap: 12px; position: relative; }
.auth-brand-name { font-family: var(--fd); font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: .02em; }
.auth-hero { position: relative; max-width: 420px; display: flex; flex-direction: column; gap: 24px; }
.auth-hero h1 { font-family: var(--fd); font-size: 48px; line-height: 52px; font-weight: 600; text-transform: uppercase; letter-spacing: .01em; }
.auth-hero ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; color: #A9B6CC; }
.auth-hero li { display: flex; gap: 12px; align-items: center; }
.auth-hero li .i { color: #FF7A1A; }
.auth-version { margin: 0; position: relative; font-size: 12px; line-height: 16px; color: #8C9AB3; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--bg); }
.auth-form { width: 420px; max-width: 100%; display: flex; flex-direction: column; gap: 24px; }
.auth-form form { display: flex; flex-direction: column; gap: 16px; }
.auth-title { font-family: var(--fd); font-size: 32px; line-height: 40px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text2); }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 1100px) { .auth-brand { flex-basis: 440px; padding: 40px; } .auth-hero h1 { font-size: 40px; line-height: 44px; } }
@media (max-width: 899px) {
    .auth { flex-direction: column; }
    .auth-brand { flex: none; padding: 20px 16px; }
    .auth-court, .auth-hero, .auth-version, .auth-brand .side-spacer { display: none; }
    .auth-main { padding: 24px 16px 40px; align-items: flex-start; }
    .auth-title { font-size: 26px; line-height: 32px; }
    .grid-2 { grid-template-columns: 1fr; }
}

/* ===== Empty / placeholder states ===== */
.empty { padding: 48px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.empty-icon { width: 56px; height: 56px; border-radius: 999px; background: var(--sunken); color: var(--text2); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.empty-icon .i { width: 24px; height: 24px; }
.empty p { margin: 0; max-width: 440px; }

/* ===== Shared page pieces (W2) ===== */
.page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.strong { font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; }
.block { display: block; }
.pad-20 { padding: 20px; }
.pad-16 { padding: 16px; margin: 0; }
.mb-16 { margin-bottom: 16px; }
.self-start { align-self: flex-start; }
.self-end { align-self: end; }
.push { margin-left: auto; }
.loading { padding: 32px; text-align: center; }
.btn-xs { height: 24px; padding: 0 8px; }
.btn-40 { height: 40px; }
.btn-danger { background: var(--error); border-color: var(--error); color: var(--on-error); font-weight: 600; }
.btn-danger:hover { filter: brightness(1.08); background: var(--error); color: var(--on-error); }
.btn-danger-outline { color: var(--error); border-color: var(--error); }
.btn-danger-outline:hover { background: var(--error-sub); color: var(--error); }
.back-btn { display: none; }
.back-link { align-self: flex-start; margin-left: -8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
.card-head.flush { padding: 0; }
.actions-right { display: flex; justify-content: flex-end; gap: 8px; }
.actions-left { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.area { min-height: 96px; resize: vertical; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--input); color: var(--text);
        font: inherit; padding: 8px 10px; width: 100%; }
.area:focus { outline: none; border-color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); }
.empty.compact { padding: 24px; gap: 4px; }

/* Filter and form fields (design .fl / .sel / .tag) */
.fl { display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.fl > span, .fl > label, .fl > legend { font-size: 12px; line-height: 16px; color: var(--text2); padding: 0; }
.sel { height: 32px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--input); color: var(--text); font: inherit;
       padding: 0 8px 0 10px; display: flex; align-items: center; gap: 6px; cursor: pointer; text-align: left; width: 100%; }
.sel:hover { background: var(--ctrl-h); }
.sel select, .sel input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; cursor: pointer; }
.sel select option { background: var(--surface); color: var(--text); }
.sel:focus-within { border-color: var(--primary); }
.sel-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-text.ph { color: var(--ph); }
.sel-tags { flex: 1; display: flex; gap: 4px; overflow: hidden; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 4px 0 8px; border-radius: 4px; background: var(--primary-sub);
       color: var(--on-primary-sub); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag-more { padding-right: 8px; flex: none; }
.tag button { border: 0; background: transparent; color: inherit; padding: 2px; display: inline-flex; cursor: pointer; border-radius: 2px; }
.tag button .i { width: 12px; height: 12px; stroke-width: 2.25; }
.backdrop { position: fixed; inset: 0; z-index: 40; }
.pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 41; background: var(--raised); border: 1px solid var(--border); border-radius: 8px;
       box-shadow: var(--sh3); padding: 4px; display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.multi-pop { min-width: 220px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px; cursor: pointer; }
.opt:hover, .opt.hl { background: var(--subtle-h); }
.multi-clear { align-self: flex-start; margin-top: 4px; height: 28px; }

/* ===== Match list (design MacListesi) ===== */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.toolbar .summary { font-size: 14px; line-height: 20px; color: var(--text2); }
.toolbar .count { height: 18px; padding: 0 6px; }
.seg-view { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; }
.seg-view button { height: 32px; padding: 0 12px; border: 0; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; background: var(--ctrl); color: var(--text); }
.seg-view button + button { border-left: 1px solid var(--border-strong); }
.seg-view button[aria-pressed="true"] { background: var(--primary-sub); color: var(--on-primary-sub); font-weight: 600; }
.filter-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.sources { border: 0; margin: 0; padding: 0; }
.sources-row { display: flex; gap: 12px; height: 32px; align-items: center; }
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-card .chips { border-top: 1px solid var(--border); padding-top: 12px; }

.list-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { height: 40px; padding: 0 12px; text-align: left; font-family: var(--fd); font-size: 13px; line-height: 16px; font-weight: 600; text-transform: uppercase;
          letter-spacing: .06em; color: var(--text2); background: var(--sunken); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { height: 56px; padding: 0 12px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.match-table { min-width: 1040px; table-layout: fixed; }
.match-table .c-src { width: 68px; } .match-table .c-date { width: 112px; } .match-table .c-org { width: 150px; } .match-table .c-venue { width: 160px; }
.match-table .c-role { width: 112px; } .match-table .c-status { width: 124px; } .match-table .c-net { width: 112px; } .match-table .c-pay { width: 108px; }
.venue-inline { display: none; }
/* The design's ten columns need about 1440px; narrower screens lose Kaynak and Salon (the venue moves under the teams). */
@media (max-width: 1439px) {
    .match-table { min-width: 860px; }
    .match-table .c-src, .match-table .c-venue, .list-foot .legend { display: none; }
    .venue-inline { display: inline; }
}
.match-table tbody tr { cursor: pointer; }
.match-table tbody tr:hover td { background: var(--subtle-h); }
.match-table td.wrap { white-space: normal; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.match-link { color: var(--text); font-weight: 600; text-decoration: none; }
.match-link:hover { color: var(--primary); text-decoration: underline; }
.sortbtn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; font: inherit; color: var(--text); padding: 0; cursor: pointer;
           text-transform: inherit; letter-spacing: inherit; }
.src { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 20px; padding: 0 4px; border-radius: 4px; font-size: 12px; line-height: 12px;
       font-weight: 700; border: 1px solid var(--border-strong); color: var(--text2); background: var(--surface); flex: none; }
.list-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 16px; background: var(--sunken); }
.list-foot .legend { display: inline-flex; gap: 16px; flex-wrap: wrap; }
.list-foot .totals { display: inline-flex; gap: 24px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--border); }
.match-cards { display: none; list-style: none; margin: 0; padding: 0; }
.mcard { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.mcard:hover, .mcard:active { background: var(--subtle-h); color: var(--text); }
.mcard-top, .mcard-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mcard-when { display: inline-flex; align-items: center; gap: 8px; }
.mcard-title { font-weight: 600; font-size: 15px; line-height: 20px; }

/* Calendar */
.cal { overflow: hidden; }
.cal-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cal-title { margin: 0 8px; font-size: 20px; line-height: 28px; font-weight: 600; }
.cal-legend { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.cal-grid { overflow-x: auto; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 840px; }
.cal-weekdays { background: var(--sunken); border-bottom: 1px solid var(--border); }
.cal-weekdays > div { padding: 8px 12px; font-weight: 600; }
.cal-cell { min-height: 112px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.weekend { background: var(--subtle-p); }
.cal-cell.other { background: var(--sunken); }
.cal-cell.other .cal-num { color: var(--text-dis); }
.cal-cell-head { display: flex; align-items: center; justify-content: space-between; }
.cal-num { width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; line-height: 16px;
           border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; }
.cal-num.today { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.cal-add { width: 24px; height: 24px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--text2); opacity: 0; }
.cal-add .i { width: 14px; height: 14px; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { background: var(--subtle-h); color: var(--text); }
.ev { display: flex; align-items: center; gap: 4px; height: 22px; padding: 0 6px; border-radius: 4px; font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-decoration: none; }
.ev b { font-weight: 600; }
.ev .ev-text { overflow: hidden; text-overflow: ellipsis; }
.ev:hover { filter: brightness(1.1); }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; justify-content: center; }
.dot { width: 6px; height: 6px; border-radius: 999px; }
.dot.ok { background: var(--success); } .dot.in { background: var(--info); } .dot.wa { background: var(--warning); } .dot.er { background: var(--error); }
.cal-agenda { display: none; }

/* ===== Match detail (design MacDetayi) ===== */
.identity { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.identity-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.identity-line { font-size: 14px; line-height: 20px; color: var(--text2); }
.identity-actions { display: flex; gap: 8px; }
.scoreboard { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 24px; }
.team.home { text-align: right; }
.team-name { font-family: var(--fd); font-size: 24px; line-height: 32px; font-weight: 600; overflow-wrap: anywhere; }
.score { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.score-sets { font-family: var(--fd); font-size: 40px; line-height: 52px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; gap: 16px; }
.score-sets .dash { color: var(--text-dis); }
.set-list { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.identity-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 16px; border-top: 1px solid var(--border); align-items: center; }
.fact { display: inline-flex; align-items: center; gap: 8px; }
.fact > .i { color: var(--text2); }
.map-link { display: inline-flex; align-items: center; gap: 4px; }
.map-link .i { width: 14px; height: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { height: 44px; padding: 0 16px; border: 0; background: transparent; color: var(--text2); cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
       border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; font-family: var(--fd); font-size: 15px; text-transform: uppercase; letter-spacing: .05em; }
.tab:hover { color: var(--text); background: var(--subtle-h); }
.tab.on { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }
.cnt { font-size: 12px; line-height: 16px; padding: 0 6px; border-radius: 999px; background: var(--sunken); color: var(--text2); font-weight: 600; font-family: var(--ft);
       letter-spacing: 0; text-transform: none; }
.tabpanel { padding-top: 24px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.split.notes { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.dl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px 16px; margin: 0; }
.dl dt { color: var(--text2); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.history li { display: flex; gap: 12px; align-items: flex-start; }
.table-card { overflow: hidden; }
.tbl.crew td { height: 52px; }
.tbl.crew tr.me td { background: var(--primary-sub); }
.note-new { display: flex; flex-direction: column; gap: 12px; }
.note-list { overflow: hidden; }
.note { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-bottom: 1px solid var(--border); }
.note:last-child { border-bottom: 0; }
.note-text { flex: 1; min-width: 0; }
.note-text p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ===== Add / edit match (design MacEkle) ===== */
.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.edit-form { min-width: 0; display: flex; flex-direction: column; gap: 16px; container-type: inline-size; }
.edit-rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 24px); }
.form-sec { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.form-sec-raised { position: relative; z-index: 2; }
.sh { display: flex; align-items: center; gap: 12px; }
.no { width: 28px; height: 28px; border-radius: 4px; background: var(--primary-sub); color: var(--on-primary-sub); font-family: var(--fd); font-weight: 700;
      display: flex; align-items: center; justify-content: center; flex: none; }
.g { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
/* Four fields in a row need a wide form (the date input alone takes ~150px); the rail leaves less room on laptops. */
@container (max-width: 760px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.align-end { align-items: end; }
.edit-form .fld { min-width: 0; position: relative; }
.edit-form .inp { height: 36px; padding: 0 10px; }
.edit-form .fld > .l { font-size: 13px; line-height: 16px; font-weight: 600; }
.req::after { content: " *"; color: var(--error); }
.inp.warn { border-color: var(--warning); box-shadow: inset 0 -2px 0 var(--warning); }
.inp.disabled { background: var(--ctrl-dis); }
.inp.disabled input { color: var(--text-dis); }
.ok-ic { display: inline-flex; color: var(--success); }
.suggest .pop { top: 64px; }
.pop-sep { height: 1px; background: var(--border); margin: 4px 0; }
.opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-new { align-items: flex-start; }
.opt-plus { width: 24px; height: 24px; border-radius: 4px; background: var(--primary-sub); color: var(--on-primary-sub); display: flex; align-items: center; justify-content: center; flex: none; }
.opt-action { color: var(--primary); font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; align-self: flex-start; border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; }
.seg button { height: 36px; padding: 0 14px; border: 0; border-left: 1px solid var(--border-strong); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
              background: var(--ctrl); color: var(--text); }
.seg button:first-child { border-left: 0; }
.seg button[aria-checked="true"] { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.sets { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.edit-form .inp.set { width: 96px; }
.crew-rows { display: flex; flex-direction: column; gap: 8px; }
.crew-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 32px; gap: 8px; align-items: center; }
.tariff-note { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 4px; background: var(--sunken); }
.tariff-note > .i { color: var(--info); }
.tariff-note > span { flex: 1; }
.check-36 { height: 36px; }
.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 0; }
.form-actions .btn-p { padding: 0 20px; }
.preview { display: flex; flex-direction: column; gap: 12px; }
.badge.live { background: var(--primary-sub); color: var(--on-primary-sub); }
.fee-lines { display: flex; flex-direction: column; }
.ln { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.ln .v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ln .v.neg { color: var(--error); }
.net-box { border-radius: 8px; background: var(--sunken); padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.net-box .k { font-size: 12px; }
.net-value { font-family: var(--fd); font-size: 40px; line-height: 44px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.preview p { margin: 0; }
.checks { display: flex; flex-direction: column; gap: 10px; }
.check-item { display: flex; gap: 10px; align-items: flex-start; }
.check-item .i { margin-top: 2px; }
.check-item.success .i { color: var(--success); }
.check-item.warning .i { color: var(--warning); }
.check-item.info .i { color: var(--info); }

/* ===== Toasts and dialog ===== */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px;
          width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 6px 6px 16px; border-radius: 8px; background: var(--inverse); color: var(--on-inverse);
         box-shadow: var(--sh3); }
.toast-error > .i { color: var(--error); }
.toast-text { flex: 1; }
.toast-action { border: 0; background: transparent; color: var(--inv-primary); font-weight: 600; cursor: pointer; height: 32px; padding: 0 8px; border-radius: 4px; }
.toast-close { border: 0; background: transparent; color: var(--on-inverse); cursor: pointer; width: 32px; height: 32px; border-radius: 4px; display: inline-flex;
               align-items: center; justify-content: center; opacity: .8; }
.dialog::backdrop { background: rgba(5, 10, 20, .55); }
.dialog { position: fixed; z-index: 71; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; color: var(--text); width: min(440px, calc(100vw - 32px)); padding: 24px;
          display: flex; flex-direction: column; gap: 12px; box-shadow: var(--sh4); background: var(--raised); }
.dialog p { margin: 0; color: var(--text2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ===== Responsive (W2 screens) ===== */
@media (max-width: 1023px) {
    .split, .split.notes { grid-template-columns: minmax(0, 1fr); }
    .edit-layout { grid-template-columns: minmax(0, 1fr); }
    .edit-rail { position: static; }
}

@media (max-width: 767px) {
    .back-btn { display: inline-flex; margin-left: -8px; }
    .wide-only { display: none; }
    .toolbar { gap: 8px; }
    .toolbar .summary { flex-basis: 100%; order: 3; font-size: 13px; }
    .filter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .sources { grid-column: 1 / -1; }

    .table-scroll { display: none; }
    .match-cards { display: block; }
    .list-foot { flex-direction: column; align-items: flex-start; }
    .list-foot .legend { display: none; }

    .cal-head { padding: 8px 12px; }
    .cal-title { font-size: 18px; margin: 0 4px; }
    .cal-legend { display: none; }
    .cal-row { min-width: 0; }
    .cal-weekdays > div { padding: 6px 0; text-align: center; }
    .cal-cell { min-height: 52px; padding: 4px 2px; align-items: center; cursor: pointer; border-right: 0; }
    .cal-cell-head { justify-content: center; }
    .cal-cell .ev, .cal-add { display: none; }
    .cal-dots { display: flex; }
    .cal-cell.picked .cal-num:not(.today) { box-shadow: inset 0 0 0 2px var(--primary); font-weight: 600; }
    .cal-agenda { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
    .cal-agenda-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
    .agenda-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
    .agenda-time { font-weight: 600; width: 44px; flex: none; }
    .agenda-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .agenda-empty { padding: 0 16px 16px; margin: 0; }

    .identity { padding: 16px; gap: 16px; }
    .identity-actions { margin-left: auto; }
    .scoreboard { gap: 12px; }
    .team-name { font-size: 17px; line-height: 22px; }
    .score-sets { font-size: 30px; line-height: 38px; gap: 8px; }
    .identity-facts { gap: 8px 16px; }
    .tab { padding: 0 12px; font-size: 14px; }
    .tabpanel { padding-top: 16px; }
    .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .dl dd { margin-bottom: 10px; }

    .form-sec { padding: 16px; }
    .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: 1 / -1; }
    .seg { display: flex; }
    .seg button { flex: 1 1 auto; justify-content: center; }
    .crew-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 32px; }
    .form-actions { position: sticky; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); z-index: 5; background: var(--bg);
                    margin: 0 -16px; padding: 12px 16px; border-top: 1px solid var(--border); }
    .form-actions .header-spacer { display: none; }
    .form-actions .btn-p { flex: 1; }
    .net-value { font-size: 32px; line-height: 36px; }
    .toasts { bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom)); }
    /* Room under the last row for the floating "Yeni maç" button. */
    .content { padding-bottom: calc(var(--bottom-nav-h) + 88px + env(safe-area-inset-bottom)); }
}

/* ===== W3: shared pieces ===== */
.neg { color: var(--error); }
.pad-x { padding: 0 16px 12px; }
.inp-36 { height: 36px; padding: 0 10px; }
.card-head.top { align-items: flex-start; }
.card-head p, .chart-head p, .roles-card p { margin: 2px 0 0; }
.legend { display: inline-flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.swatch.paid { background: var(--primary); }
.swatch.pending { background: var(--primary-sub); border: 1px dashed var(--primary); }
.seg-view.small button { height: 28px; padding: 0 10px; gap: 6px; }
/* Home rows share the KPI row's three columns, so every card edge lines up (the wide cards span two). */
.home-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.home-row > * { min-width: 0; }

/* KPI cards (design Main / Kazanclar) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpis.three { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi { padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kpis.three .kpi { gap: 6px; }
.kpi-title { display: flex; align-items: center; gap: 8px; color: var(--text2); }
.kpi-value { font-family: var(--fd); font-size: 40px; line-height: 44px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-value.sm { font-size: 32px; line-height: 38px; }
.kpi-value.accent { color: var(--primary); }
.kpi-value.neg { color: var(--error); }
.kpi-foot { border-top: 1px solid var(--border); padding-top: 8px; margin-top: auto; display: flex; justify-content: space-between; gap: 8px; }
.k-icon { display: flex; gap: 6px; align-items: center; }

/* ===== Ana sayfa (design Main) ===== */
.home { gap: 24px; }
.home .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.month-nav { display: inline-flex; align-items: center; gap: 4px; }
/* The month keeps the width of the longest month names, so the arrows don't move while stepping. */
.month-label { display: inline-grid; justify-items: center; }
.month-label > span { grid-area: 1 / 1; }
.month-label .sizer { visibility: hidden; font-weight: 600; }
.home-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.greeting { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.date-line { margin: 4px 0 0; }
.chart-card { grid-column: span 2; padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 16px; }
.chart-card > p { margin: 0; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chart { position: relative; padding-left: 40px; }
.chart-axis { position: absolute; left: 0; right: 0; top: 0; height: 200px; }
.axis-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.axis-line .cap { position: absolute; top: -9px; left: 0; }
.axis-base { position: absolute; left: 32px; right: 0; bottom: 0; border-top: 1px solid var(--border-strong); }
.chart-bars { position: relative; height: 200px; display: flex; align-items: flex-end; gap: 12px; }
.chart-bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.bar-value { font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; text-align: center; margin-bottom: 4px; }
.bar-pending { background: var(--primary-sub); border: 1px dashed var(--primary); border-bottom: 0; border-radius: 3px 3px 0 0; }
.bar-paid { background: var(--primary); }
.bar-paid.top { border-radius: 3px 3px 0 0; }
.chart-bar:not(.selected) .bar-paid { opacity: .75; }
.chart-labels { display: flex; gap: 12px; margin-top: 6px; }
.chart-labels span { flex: 1 1 0; min-width: 0; text-align: center; }
.list-panel { display: flex; flex-direction: column; }
.list-panel.pending { grid-column: span 2; }
/* The roles card sets the row height; the pending list fills the same height and scrolls (no empty band below it). */
.home-row .list-panel.pending { height: 0; min-height: 100%; }
.home-row .list-panel.pending .pend-list { flex: 1 1 auto; min-height: 0; max-height: none; }
.list-panel .card-head a:not(.btn) { font-size: 14px; text-decoration: none; }
.up-row { color: inherit; text-decoration: none; }
.up-row:hover { color: inherit; }
.day-chip { width: 48px; flex: none; text-align: center; border-radius: 4px; background: var(--sunken); padding: 4px 0; }
.day-chip.soon { background: var(--primary-sub); color: var(--on-primary-sub); }
.day-num { font-size: 20px; line-height: 24px; font-weight: 600; }
.day-month { font-size: 12px; line-height: 16px; color: var(--text2); }
.day-chip.soon .day-month { color: inherit; }
.up-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.up-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-badges { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.roles-card { display: flex; flex-direction: column; gap: 16px; }
/* Every role and colleague is listed; each list scrolls on its own after five rows. */
.role-bars { display: flex; flex-direction: column; gap: 12px; max-height: calc(5 * 32px - 12px); overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.role-bar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 64px; align-items: center; gap: 12px; }
.role-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colleague-title { margin: 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14px; line-height: 20px; font-weight: 600; }
.colleagues { list-style: none; margin: 0; padding: 0 4px 0 0; display: flex; flex-direction: column; max-height: calc(5 * 36px); overflow-y: auto; overscroll-behavior: contain; }
.colleagues li { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 36px; border-bottom: 1px solid var(--border); }
.colleagues li:last-child { border-bottom: 0; }
.colleagues a { color: var(--primary); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colleagues a:hover { text-decoration: underline; }
.role-track { height: 12px; background: var(--sunken); border-radius: 2px; overflow: hidden; }
.role-track > div { height: 100%; background: var(--primary); border-radius: 2px; }
.role-count { text-align: right; }
.pend-date { width: 84px; flex: none; }
.pend-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); text-decoration: none; }
.pend-title:hover { color: var(--primary); }
.pend-amount { width: 104px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }

/* ===== Kazançlar (design Kazanclar) ===== */
.earnings { gap: 24px; }
.period-nav { display: inline-flex; align-items: center; gap: 4px; }
.period-label { font-family: var(--fd); font-weight: 600; font-size: 18px; min-width: 150px; text-align: center; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.planned-note { margin: -8px 0 0; display: flex; gap: 8px; align-items: center; }
.split-card { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.split-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.strong-text { color: var(--text); }
.split-bar { height: 16px; border-radius: 4px; overflow: hidden; display: flex; background: var(--primary-sub); border: 1px dashed var(--primary); }
.split-bar > div { background: var(--primary); }
.org-card { flex: 3 1 520px; display: flex; flex-direction: column; gap: 14px; }
.org-bar { display: grid; grid-template-columns: 210px minmax(0, 1fr) 110px; gap: 12px; align-items: center; }
.org-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-track { height: 14px; display: flex; }
.org-track .paid { background: var(--primary); border-radius: 2px 0 0 2px; }
.org-track .pending { background: var(--primary-sub); border: 1px dashed var(--primary); border-left: 0; border-radius: 0 2px 2px 0; }
.org-track .pending[style*="width: 0%"] { border: 0; }
.org-net { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.role-card { flex: 2 1 380px; }
.tbl.roles td { height: 48px; }
.tbl.roles tr.total td { background: var(--sunken); font-weight: 600; }
.payments-card { overflow: hidden; }
.pay-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; }
.mark-box { margin: 0 16px 16px; padding: 16px; border-radius: 8px; background: var(--raised); border: 1px solid var(--primary); display: flex; flex-direction: column; gap: 12px; }
.pay-table { min-width: 900px; table-layout: fixed; }
.pay-table .c-chk { width: 44px; text-align: center; }
.pay-table .c-date { width: 104px; }
.pay-table .c-org { width: 170px; }
.pay-table .c-role { width: 120px; }
.pay-table .c-amount { width: 112px; }
.pay-table .c-pay { width: 104px; }
.pay-table td { height: 52px; }
.pay-table tr.picked td { background: var(--primary-sub); }
.pay-cards { display: none; list-style: none; margin: 0; padding: 0; }
.pay-cards li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.pay-cards li.picked { background: var(--primary-sub); }
.pay-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; }
.pay-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }

/* ===== Match detail: Ücret dökümü ===== */
.split.fee { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.fee-card { overflow: hidden; }
.fee-section { display: flex; justify-content: space-between; padding: 8px 16px; background: var(--sunken); font-size: 12px; line-height: 16px; font-weight: 600;
               color: var(--text2); border-top: 1px solid var(--border); }
.fee-line { display: flex; justify-content: space-between; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); }
.fee-line > span:last-child { white-space: nowrap; }
.fee-line.strong { font-weight: 600; }
.fee-net { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px; background: var(--primary-sub); color: var(--on-primary-sub);
           font-family: var(--fd); font-weight: 600; font-size: 18px; }
.fee-net > span:last-child { font-size: 24px; line-height: 32px; }
.fee-card > p { margin: 0; }
.pay-card { display: flex; flex-direction: column; gap: 8px; }
.pay-card > .sec { margin: 4px 0 0; }
.paid-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.paid-amount { font-size: 18px; }
.paid-bar { height: 8px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.paid-bar > div { height: 100%; background: var(--primary); border-radius: 999px; }
.pay-records { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.pay-record { display: flex; align-items: center; gap: 8px; }
.pay-record-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pay-form { background: var(--sunken); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.pay-form .fld > label { font-size: 13px; }

/* ===== Responsive (W3 screens) ===== */
@media (max-width: 1023px) {
    .split.fee { grid-template-columns: minmax(0, 1fr); }
}

/* Below 1200px the side column would be too narrow for the upcoming matches, so the home cards stack. */
@media (max-width: 1199px) {
    .home-row { grid-template-columns: minmax(0, 1fr); }
    .chart-card, .list-panel.pending { grid-column: auto; }
    .home-row .list-panel.pending { height: auto; min-height: 0; }
    .home-row .list-panel.pending .pend-list { max-height: calc(5 * 57px); }
}

@media (max-width: 767px) {
    .home, .earnings { gap: 16px; }
    .kpis, .home .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .kpis.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpis.three .kpi:first-child { grid-column: 1 / -1; }
    .kpi { padding: 12px; gap: 4px; }
    .kpi-value, .kpi-value.sm { font-size: 22px; line-height: 28px; }
    .kpi-title { font-size: 13px; }
    .kpi .cap { font-size: 11px; }
    .chart { padding-left: 32px; }
    .chart-bars, .chart-labels { gap: 4px; }
    .chart-labels .cap { font-size: 10px; }
    .bar-value { font-size: 10px; }
    .role-bar { grid-template-columns: 96px minmax(0, 1fr) 56px; }
    .pend-row { flex-wrap: wrap; row-gap: 4px; }
    .pend-title { flex-basis: calc(100% - 96px); order: 0; }
    .pend-date { order: 1; width: auto; }
    .pend-row .badge { order: 2; }
    .pend-amount { order: 3; margin-left: auto; width: auto; }
    .pend-row .btn { order: 4; }
    .period-bar .seg-view { flex: 1 1 100%; }
    .period-bar .seg-view button { flex: 1; justify-content: center; }
    .period-nav { flex: 1; justify-content: space-between; }
    .org-bar { grid-template-columns: minmax(0, 1fr) 96px; }
    .org-track { grid-column: 1 / -1; grid-row: 2; }
    .pay-head .seg-view { order: 3; flex: 1 1 100%; }
    .pay-head .seg-view button { flex: 1; justify-content: center; }
    .payments-card .table-scroll { display: none; }
    .pay-cards { display: block; }
    .mark-box .g-3 { grid-template-columns: minmax(0, 1fr); }
    .fee-net > span:last-child { font-size: 20px; }
    /* Four columns do not fit a phone; the average is the least needed (the KPI card shows the overall one). */
    .tbl.roles th:nth-child(4), .tbl.roles td:nth-child(4) { display: none; }
    .tbl.roles th, .tbl.roles td { padding: 0 10px; }
}

/* ===== W4: İçe aktar (design IceAktar) ===== */
.pad-24 { padding: 24px; }
.badge.bordered { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text2); }
.badge.cx { background: var(--surface); border: 1px solid var(--error); color: var(--error); }
.actions-center { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.actions-left.tight { margin-top: 6px; }
.aliases { display: flex; flex-direction: column; gap: 8px; }
.aliases p { margin: 0; }
.aliases-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.alias button { border: 0; background: transparent; color: inherit; padding: 0; display: inline-flex; cursor: pointer; }
.alias button .i { width: 12px; height: 12px; }
.alias-input { width: 180px; height: 32px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.step { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.step.current { box-shadow: inset 0 -3px 0 var(--primary); }
.step.done { box-shadow: inset 0 -3px 0 var(--success); }
.step-dot { width: 32px; height: 32px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-family: var(--fd); font-weight: 700;
            font-size: 16px; flex: none; background: var(--surface); color: var(--text2); border: 1px solid var(--border-strong); }
.step.current .step-dot { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.step.done .step-dot { background: var(--success-sub); color: var(--success); border-color: var(--success); }
.step-text { display: flex; flex-direction: column; min-width: 0; }
.step-text .cap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-label { font-family: var(--fd); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text2); }
.step.current .step-label { color: var(--text); }
.step-card { display: flex; flex-direction: column; gap: 16px; }
.sources-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.source-card { text-align: left; color: var(--text); cursor: pointer; padding: 20px; border-radius: 8px; background: var(--surface); border: 2px solid var(--border);
               display: flex; gap: 16px; align-items: flex-start; }
.source-card.on { background: var(--primary-sub); border-color: var(--primary); }
.source-text { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.source-name { font-family: var(--fd); font-size: 18px; line-height: 22px; font-weight: 600; }
.radio-dot { width: 20px; height: 20px; border-radius: 999px; border: 2px solid var(--border-strong); flex: none; position: relative; }
.source-card.on .radio-dot { border-color: var(--primary); }
.source-card.on .radio-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 999px; background: var(--primary); }
.howto { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.step-card > p { margin: 0; }
.dropzone { position: relative; min-height: 180px; border: 2px dashed var(--primary); border-radius: 8px; background: var(--primary-sub); color: var(--on-primary-sub);
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; cursor: pointer; }
.dropzone.over { box-shadow: 0 0 0 3px var(--primary); }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop-title { font-weight: 600; font-size: 16px; }
.drop-link { text-decoration: underline; font-weight: 600; }
/* The real file input covers the zone, so both clicking and dropping a file work natively. */
.drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.preview-card { overflow: hidden; }
.preview-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; }
.preview-head > div:first-child { display: flex; flex-direction: column; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { height: 30px; padding: 0 10px; border-radius: 999px; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
        background: var(--ctrl); color: var(--text); border: 1px solid var(--border-strong); }
.pill[aria-pressed="true"] { background: var(--primary-sub); color: var(--on-primary-sub); border-color: var(--primary); }
.irows { display: flex; flex-direction: column; overflow-x: auto; }
.irow { display: grid; grid-template-columns: 44px 120px 110px minmax(200px, 1fr) 180px 150px minmax(220px, 1.2fr); gap: 0; align-items: start;
        border-bottom: 1px solid var(--border); min-width: 1000px; }
.irow > span { padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.irow.ihead > span { padding: 0 12px; height: 40px; justify-content: center; font-family: var(--fd); font-size: 13px; font-weight: 600; text-transform: uppercase;
                     letter-spacing: .06em; color: var(--text2); background: var(--sunken); }
.irow.picked { background: var(--primary-sub); }
.irow.suspicious { background: var(--warning-sub); }
.irow .c-chk { align-items: center; }
.irow .inp-sm { height: 30px; padding: 0 6px; }
.note-line { font-size: 13px; line-height: 18px; }
.same-note { padding: 12px 16px; background: var(--sunken); }
.preview-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; border-top: 1px solid var(--border); }
.result-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.result-card > p { margin: 0; }
.result-icon { width: 56px; height: 56px; border-radius: 999px; background: var(--success-sub); color: var(--success); display: flex; align-items: center; justify-content: center; }
.result-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 720px; margin: 8px 0; }
.result-stats > div { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 8px; background: var(--sunken); }
.result-stats b { font-family: var(--fd); font-size: 28px; line-height: 34px; }
.history .card-head { padding-bottom: 8px; }
.hist-date { width: 120px; flex: none; }
.hist-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== W4: Dışa aktar (design DisaAktar) ===== */
.export-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.export-bar p { margin: 0; flex: 1 1 360px; }
.export-grid { display: grid; grid-template-columns: 280px 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.export-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.export-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.export-card > p { margin: 0; }
.fl.plain { border: 0; margin: 0; padding: 0; gap: 8px; }
.cols-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cols { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.colrow { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); }
.colrow:not(.on) { color: var(--text2); }
.colrow .check { flex: 1; min-width: 0; }
.mvs { display: inline-flex; }
.mv { width: 24px; height: 24px; border: 0; border-radius: 4px; background: transparent; color: var(--text2); display: inline-flex; align-items: center; justify-content: center;
      cursor: pointer; padding: 0; }
.mv:hover:not(:disabled) { background: var(--subtle-h); color: var(--text); }
.mv:disabled { opacity: .35; cursor: default; }
.seg-view.full { display: flex; }
.seg-view.full button { flex: 1; justify-content: center; }
.tpl { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border-strong); border-radius: 4px; }
.tpl.on { background: var(--primary-sub); border-color: var(--primary); }
.tpl-pick { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; padding: 8px 10px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.tpl.on .tpl-pick { color: var(--on-primary-sub); }
.export-preview { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.preview-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.preview-well { background: var(--sunken); border: 1px solid var(--border); border-radius: 8px; padding: 24px; min-height: 420px; display: flex; flex-direction: column;
                align-items: center; justify-content: flex-start; overflow: hidden; }

/* Paper and sheet are always light, like the files themselves. */
.paper, .xl { --paper: #FFFFFF; --ink: #0F1B2D; --muted: #4A5870; --faint: #66748C; --rule: #E3E8F0; --subrule: #A0AABB; --group: #EEF1F6; --total: #FFE7D6;
              --accent: #FF7A1A; --brand: #C2410C; --sheet-text: #222222; --sheet-grid: #D4D4D4; --sheet-head: #F3F3F3; --sheet-head-text: #555555;
              --sheet-group: #F3F6FA; --sheet-title: #1E6B41; }
.paper { width: 100%; max-width: 440px; aspect-ratio: 440 / 622; background: var(--paper); color: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
         font-family: "Segoe UI", system-ui, sans-serif; overflow: hidden; padding: 22px 20px; display: flex; flex-direction: column; gap: 8px; }
.paper.landscape { max-width: 622px; aspect-ratio: 622 / 440; }
.paper-head { display: flex; justify-content: space-between; gap: 8px; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.paper-titles { min-width: 0; }
.paper-title { font-family: var(--fd); font-weight: 700; font-size: 13px; }
.paper-sub { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-brand { font-family: var(--fd); font-weight: 700; font-size: 10px; color: var(--brand); }
.paper-body { flex: 1; overflow: hidden; }
.paper table { width: 100%; border-collapse: collapse; font-size: 9px; line-height: 12px; }
.paper th { text-align: left; padding: 4px 5px; border-bottom: 1.5px solid var(--ink); font-weight: 700; white-space: nowrap; }
.paper td { padding: 4px 5px; border-bottom: 1px solid var(--rule); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.paper .num { text-align: right; }
/* Like the PDF itself: amounts and dates stay on one line, text columns wrap so every column fits the page. */
.paper td:not(.num) { white-space: normal; overflow-wrap: break-word; max-width: none; }
.paper tr.grp td { background: var(--group); font-weight: 700; padding-top: 5px; max-width: none; }
.paper tr.sub td { font-weight: 700; border-bottom-color: var(--subrule); }
.paper tr.tot td { font-weight: 700; border-top: 1.5px solid var(--ink); border-bottom: 0; background: var(--total); }
.paper-foot { display: flex; justify-content: space-between; font-size: 8px; color: var(--faint); border-top: 1px solid var(--rule); padding-top: 4px; }
.xl { width: 100%; background: var(--paper); color: var(--sheet-text); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); align-self: stretch; }
.xl-title { background: var(--sheet-title); color: #FFFFFF; font-size: 11px; padding: 4px 8px; font-family: Calibri, "Segoe UI", sans-serif; }
.xl-scroll { overflow-x: auto; }
.xl table { border-collapse: collapse; font-size: 10px; line-height: 14px; font-family: Calibri, "Segoe UI", sans-serif; }
.xl th, .xl td { border: 1px solid var(--sheet-grid); padding: 3px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.xl .hd { background: var(--sheet-head); color: var(--sheet-head-text); text-align: center; font-weight: 400; min-width: 24px; }
.xl .num { text-align: right; }
.xl .xl-header { font-weight: 700; background: var(--total); }
.xl tr.grp td:not(.hd) { background: var(--sheet-group); font-weight: 700; max-width: none; }
.xl tr.sub td:not(.hd) { font-weight: 700; }
.xl tr.tot td:not(.hd) { font-weight: 700; background: var(--total); }
.xl-tabs { display: flex; gap: 2px; background: var(--sheet-head); border-top: 1px solid var(--sheet-grid); font-size: 10px; font-family: Calibri, sans-serif; }
.xl-tabs span { padding: 3px 12px; color: var(--sheet-head-text); }
.xl-tabs span.on { background: var(--paper); color: var(--sheet-title); font-weight: 700; border-bottom: 2px solid var(--sheet-title); }

/* ===== Responsive (W4 screens) ===== */
@media (max-width: 1279px) {
    .export-grid { grid-template-columns: 280px minmax(0, 1fr); }
    .export-preview { grid-column: 1 / -1; }
}

@media (max-width: 1023px) {
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .pad-24 { padding: 16px; }
    .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
    .step { flex-direction: column; gap: 4px; padding: 8px 4px; text-align: center; }
    .step-dot { width: 28px; height: 28px; font-size: 14px; }
    .step-text .cap { display: none; }
    .step-label { font-size: 11px; letter-spacing: .02em; }
    .sources-grid { grid-template-columns: minmax(0, 1fr); }
    .source-card { padding: 14px; gap: 12px; }
    .alias-input { flex: 1 1 140px; width: auto; }
    .irows { overflow: visible; }
    .irow.ihead { display: none; }
    .irow { min-width: 0; grid-template-columns: 36px minmax(0, 1fr) auto;
            grid-template-areas: "chk match kind" "chk date date" "chk venue venue" "chk role role" "chk note note"; padding: 8px 4px; }
    .irow > span { padding: 2px 8px; }
    .irow .c-chk { grid-area: chk; padding-top: 6px; }
    .irow .c-kind { grid-area: kind; }
    .irow .c-date { grid-area: date; flex-direction: row; gap: 8px; }
    .irow .c-match { grid-area: match; }
    .irow .c-venue { grid-area: venue; color: var(--text2); font-size: 13px; }
    .irow .c-role { grid-area: role; }
    .irow .c-note { grid-area: note; }
    .preview-foot .foot-count { order: -1; flex-basis: 100%; }
    .result-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hist-row { flex-wrap: wrap; row-gap: 4px; }
    .hist-name { flex-basis: calc(100% - 60px); order: -1; }
    .hist-date { width: auto; }
    .export-grid { grid-template-columns: minmax(0, 1fr); }
    .export-bar .btn-p { flex: 1; }
    .preview-well { padding: 12px; min-height: 0; }
}

/* ===== W5: Medya tab (design MacDetayi) ===== */
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.media { display: flex; flex-direction: column; gap: 24px; }
.media-upload { display: flex; flex-direction: column; gap: 12px; }
.dropzone.small { min-height: 120px; padding: 16px; }
.uploads { display: flex; flex-direction: column; gap: 8px; }
.uploads-head { display: flex; justify-content: space-between; align-items: baseline; }
.fi { width: 36px; height: 36px; border-radius: 4px; background: var(--sunken); color: var(--text2); display: flex; align-items: center; justify-content: center; flex: none; }
.upload { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; }
.upload.failed { border-color: var(--error); background: var(--error-sub); }
.upload.failed .fi { color: var(--error); }
.upload-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.upload-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-photos { overflow: hidden; }
.photo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-danger-text { color: var(--error); }
.btn-danger-text:hover { color: var(--error); background: var(--error-sub); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.tile { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; }
.tile.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.tile-pick { position: relative; border: 0; padding: 0; background: var(--sunken); cursor: pointer; aspect-ratio: 4 / 3; display: block; }
.tile-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text2); }
.ph .i { width: 28px; height: 28px; stroke-width: 1.25; }
.tile-check { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 4px; border: 2px solid #FFFFFF; background: rgba(15, 27, 45, .35);
              display: flex; align-items: center; justify-content: center; color: transparent; }
.tile.on .tile-check { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tile-check .i { width: 14px; height: 14px; stroke-width: 2.5; }
.tile-foot { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; }
.tile-caption { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; align-items: start; }
.media-list { overflow: hidden; }
.link-hint { padding: 0 16px 12px; }
.link-form { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); }
.li:hover { background: var(--subtle-h); }
.li-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.li-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== W5: Ayarlar (design Ayarlar) ===== */
.settings { width: 100%; max-width: 1200px; display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.settings-nav { flex: 0 0 200px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--header-h) + 24px); }
.sub { display: block; padding: 8px 12px; border-radius: 4px; color: var(--text2); text-decoration: none; border: 0; background: transparent; text-align: left; cursor: pointer; }
.sub:hover { background: var(--subtle-h); color: var(--text); }
.sub.on { color: var(--text); font-weight: 600; background: var(--subtle-h); }
.settings-body { flex: 1 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.settings-body section { scroll-margin-top: calc(var(--header-h) + 16px); }
.settings-body .form-sec p { margin: 4px 0 0; }
.photo-row { display: flex; gap: 20px; align-items: center; }
.avatar-xl { width: 72px; height: 72px; font-family: var(--fd); font-size: 28px; }
.photo-row .photo-actions { flex-direction: column; align-items: flex-start; gap: 6px; }
/* Profile photo cropper: square frame with an inscribed circle; the corners are dimmed and cut off on save. */
.cropper { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.crop-frame { position: relative; flex: none; overflow: hidden; background: var(--sunken); cursor: grab; touch-action: none; user-select: none; border-radius: 4px; }
.crop-frame:active { cursor: grabbing; }
.crop-frame img { position: absolute; left: 0; top: 0; max-width: none; pointer-events: none; transform-origin: 0 0; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .6); outline: 2px solid rgba(255, 255, 255, .8); outline-offset: -2px; }
.crop-side { flex: 1 1 220px; display: flex; flex-direction: column; gap: 12px; max-width: 320px; }
.crop-side .h3, .crop-side p { margin: 0; }
.crop-zoom { display: flex; align-items: center; gap: 12px; }
.crop-zoom input { flex: 1; accent-color: var(--primary); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.alias-add { display: flex; gap: 8px; align-items: flex-end; max-width: 480px; }
.alias-add .fld { flex: 1; }
.alias-add .btn { margin-bottom: 0; height: 36px; }
/* Theme picker: two rows of fixed-size cards (--cols = half the presets, set by Settings.razor) that scroll sideways. Each card previews its preset from the --p-* colors set
   inline from the shared catalog, whatever the active theme is. */
.themes { --theme-card: 184px; display: grid; grid-template-columns: repeat(var(--cols, 9), var(--theme-card)); gap: 12px;
          overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 4px 4px 12px; margin: 0 -4px; }
.theme-card { scroll-snap-align: start; text-align: left; color: var(--text); cursor: pointer; padding: 8px 8px 10px; border-radius: 8px;
              background: var(--surface); border: 2px solid var(--border); display: flex; flex-direction: column; gap: 8px;
              transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.theme-card:hover { border-color: var(--border-strong); }
.theme-card.on { border-color: var(--primary); }
.tp { position: relative; height: 112px; border-radius: 6px; overflow: hidden; padding: 8px; display: flex; flex-direction: column; gap: 6px;
      background-color: var(--p-bg); color: var(--p-text); border: 1px solid var(--border); }
.tp-brand { display: flex; align-items: center; gap: 6px; font-size: 11px; line-height: 14px; font-weight: 600; position: relative; }
.tp-logo { width: 12px; height: 12px; border-radius: 3px; background: var(--p-primary); }
.tp-panel { position: relative; flex: 1; border-radius: 6px; background: var(--p-card); border: 1px solid var(--p-border); padding: 6px 8px;
            display: flex; flex-direction: column; gap: 5px; }
.tp-row { display: flex; align-items: center; justify-content: space-between; font-size: 10px; line-height: 12px; color: var(--p-text2); }
.tp-row b { color: var(--p-text); font-weight: 600; }
.tp-toggle { width: 20px; height: 11px; border-radius: 999px; background: var(--p-primary); position: relative; }
.tp-toggle::after { content: ""; position: absolute; right: 2px; top: 2px; width: 7px; height: 7px; border-radius: 999px; background: var(--p-on-primary); }
.tp-slider { height: 3px; border-radius: 999px; background: linear-gradient(90deg, var(--p-primary) 62%, var(--p-border) 62%); position: relative; }
.tp-slider::after { content: ""; position: absolute; left: 62%; top: -3px; width: 9px; height: 9px; margin-left: -4px; border-radius: 999px; background: var(--p-text); }
.tp-swatches { display: flex; gap: 4px; }
.tp-swatches span { width: 12px; height: 12px; border-radius: 3px; }
.tp-fx { position: absolute; left: 8px; bottom: 4px; font-size: 9px; line-height: 12px; color: var(--p-text2); }
.tp-system { background: linear-gradient(90deg, #0F1B2D 50%, #EEF1F6 50%); }
.theme-name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.theme-name span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-name .radio-dot { width: 16px; height: 16px; }
.theme-card.on .radio-dot { border-color: var(--primary); }
.theme-card.on .radio-dot::after { content: ""; position: absolute; inset: 2px; border-radius: 999px; background: var(--primary); }
/* Still pictures of the backdrops in the previews. */
.tp[data-fx="aurora"] { background-image: radial-gradient(70% 60% at 20% 20%, color-mix(in srgb, var(--p-primary) 40%, transparent), transparent 70%),
                                          radial-gradient(60% 60% at 90% 80%, color-mix(in srgb, var(--p-accent) 32%, transparent), transparent 70%); }
.tp[data-fx="waves"] { background-image: radial-gradient(120% 50% at 30% 115%, color-mix(in srgb, var(--p-primary) 45%, transparent), transparent 70%),
                                         radial-gradient(90% 40% at 90% -10%, color-mix(in srgb, var(--p-accent) 30%, transparent), transparent 70%); }
.tp[data-fx="gradient"] { background-image: linear-gradient(135deg, color-mix(in srgb, var(--p-primary) 30%, var(--p-bg)), var(--p-bg) 55%, color-mix(in srgb, var(--p-accent) 22%, var(--p-bg))); }
.tp[data-fx="grid"] { background-image: linear-gradient(color-mix(in srgb, var(--p-primary) 45%, transparent) 1px, transparent 1px),
                                        linear-gradient(90deg, color-mix(in srgb, var(--p-primary) 45%, transparent) 1px, transparent 1px);
                      background-size: 14px 14px; }
.tp[data-fx="rain"] { background-image: repeating-linear-gradient(105deg, transparent 0 14px, color-mix(in srgb, var(--p-text) 22%, transparent) 14px 15px); }
.tp[data-fx="snow"], .tp[data-fx="christmas"] { background-image: radial-gradient(circle, color-mix(in srgb, var(--p-text) 70%, transparent) 1px, transparent 1.5px),
                                                                  radial-gradient(circle, color-mix(in srgb, var(--p-text) 45%, transparent) 1px, transparent 1.5px);
                                               background-size: 23px 19px, 31px 27px; background-position: 0 0, 11px 9px; }
.tp[data-fx="code-rain"] { background-image: repeating-linear-gradient(90deg, transparent 0 9px, color-mix(in srgb, var(--p-primary) 30%, transparent) 9px 11px, transparent 11px 22px); }
.tp[data-fx="halloween"] { background-image: radial-gradient(circle, color-mix(in srgb, var(--p-primary) 60%, transparent) 1.5px, transparent 2px),
                                             radial-gradient(circle, color-mix(in srgb, var(--p-accent) 50%, transparent) 1.5px, transparent 2px);
                           background-size: 29px 23px, 37px 31px; background-position: 4px 6px, 17px 15px; }
.rw { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.rw.first { border-top: 0; padding-top: 0; }
.rw-text { flex: 1; min-width: 0; }
.rw-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { position: relative; width: 40px; height: 22px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--ctrl); cursor: pointer; flex: none; padding: 0; }
.sw span { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 999px; background: var(--text2); transition: left .15s; }
.sw.on { background: var(--primary); border-color: var(--primary); }
.sw.on span { left: 21px; background: var(--on-primary); }
.storage-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.storage-used { font-family: var(--fd); font-size: 24px; }
.storage-bar { height: 14px; border-radius: 4px; overflow: hidden; display: flex; background: var(--sunken); }
.storage-bar span + span { border-left: 2px solid var(--surface); }
.storage-bar span[style*="width: 0%"] { border-left: 0; }
.photo { background: var(--primary); } .video { background: var(--info); } .document { background: var(--text2); }
.swatch.photo { background: var(--primary); } .swatch.video { background: var(--info); } .swatch.document { background: var(--text2); }
.sub-form { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 8px; background: var(--sunken); }
.danger-zone { margin-top: 8px; padding: 16px; border-radius: 8px; border: 1px solid var(--error); background: var(--error-sub); display: flex; flex-direction: column; gap: 12px; }
.danger-head { display: flex; gap: 12px; align-items: flex-start; }
.danger-head > .i { color: var(--error); margin-top: 2px; }
.danger-confirm { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--error); }

/* ===== Responsive (W5 screens) ===== */
/* The section list goes above the sections as soon as both no longer fit side by side (200 + 32 + 640px next to the
   240px sidebar); a sticky list would otherwise cover the sections while scrolling. */
@media (max-width: 1199px) {
    .settings { gap: 16px; }
    .settings-nav { flex: 1 1 100%; flex-direction: row; overflow-x: auto; position: static; scrollbar-width: none; }
    .settings-nav .sub { white-space: nowrap; }
}

@media (max-width: 767px) {
    .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 12px 12px; }
    .media-photos .card-head { flex-wrap: wrap; }
    .themes { --theme-card: 156px; gap: 8px; }
    .tp { height: 100px; }
    .rw { flex-wrap: wrap; }
    .danger-head { flex-wrap: wrap; }
    .photo-row { gap: 12px; }
}

/* ===== W6: accessibility and phone polish ===== */
/* "İçeriğe geç": first stop for keyboard users, visible only when focused. */
.skip-link { position: fixed; left: 16px; top: -48px; z-index: 100; padding: 8px 16px; border-radius: 4px; background: var(--primary); color: var(--on-primary);
             font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; color: var(--on-primary); }
.content:focus { outline: none; }
/* Chip "×" and small links get a 24px touch target (WCAG 2.2 target size) without changing how they look. */
.tag button, .alias button { min-width: 24px; min-height: 24px; margin: -1px -4px -1px -2px; align-items: center; justify-content: center; }
.map-link, .list-panel .card-head a:not(.btn) { padding: 4px 0; }
@media (max-width: 767px) {
    .pend-title { white-space: normal; padding: 2px 0; }
    .pend-title .cap { display: block; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Brand text next to the logo; hidden with the labels when the sidebar is icons only. */
.side-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sortbtn { min-height: 32px; }

/* Tablets (768–1023px): the match and payment tables need ~860px, so the card lists are used, two per row. */
@media (max-width: 1023px) {
    .list-card .table-scroll, .payments-card .table-scroll { display: none; }
    .match-cards, .pay-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .match-cards li:nth-child(odd), .pay-cards li:nth-child(odd) { border-right: 1px solid var(--border); }
}
@media (max-width: 767px) {
    .match-cards, .pay-cards { display: block; }
    .match-cards li:nth-child(odd), .pay-cards li:nth-child(odd) { border-right: 0; }
}

/* ===== Feedback round 1: form controls ===== */
/* The field frame (.inp / .sel) shows focus; the input inside must not draw the global focus ring as a second box. */
.inp input:focus-visible, .inp select:focus-visible, .inp textarea:focus-visible,
.sel input:focus-visible, .sel select:focus-visible { outline: none; box-shadow: none; }
.sel:focus-within { box-shadow: inset 0 -2px 0 var(--primary); }
/* Native select boxes draw their own frame in dark mode; ours uses the field frame and a drawn chevron instead. */
.inp select, .sel select { -webkit-appearance: none; appearance: none; padding-right: 22px; cursor: pointer;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238C9AB3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0 center / 16px 16px; }
.inp select::-ms-expand, .sel select::-ms-expand { display: none; }
/* Sidebar "Masaüstü uygulaması" (a button styled like the navigation links). */
.nav-download { border: 0; background: transparent; width: 100%; cursor: pointer; font: inherit; color: var(--text2); }
.nav-download:hover { color: var(--text); }


/* Home: every pending payment; more than five scroll inside the card. */
.pend-list { max-height: calc(5 * 57px); overflow-y: auto; overscroll-behavior: contain; }

/* ===== Theme backdrops and card motion (data-fx / data-hover / data-motion on <html>, set by js/theme.js) =====
   The decoration sits behind the app (body::before for the CSS ones, a canvas from js/effects.js for particles); cards
   stay opaque except in the glass preset, so text contrast does not depend on the backdrop. */
#app { position: relative; z-index: 1; }
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; }
[data-fx="aurora"] body::before {
    background: radial-gradient(45% 40% at 18% 12%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 70%),
                radial-gradient(40% 45% at 85% 30%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%),
                radial-gradient(50% 40% at 50% 100%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 70%);
    background-size: 140% 140%; animation: fx-drift 28s ease-in-out infinite alternate; }
[data-fx="waves"] body::before {
    background: radial-gradient(90% 35% at 20% 108%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 70%),
                radial-gradient(80% 30% at 85% 104%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
                radial-gradient(70% 25% at 70% -6%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 70%);
    background-size: 160% 100%; animation: fx-drift 20s ease-in-out infinite alternate; }
[data-fx="gradient"] body::before {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 18%, var(--bg)), var(--bg) 45%, color-mix(in srgb, var(--accent) 12%, var(--bg)));
    background-size: 200% 200%; animation: fx-drift 24s ease-in-out infinite alternate; }
[data-fx="grid"] body::before {
    background: linear-gradient(color-mix(in srgb, var(--primary) 18%, transparent) 1px, transparent 1px),
                linear-gradient(90deg, color-mix(in srgb, var(--primary) 18%, transparent) 1px, transparent 1px);
    background-size: 48px 48px; animation: fx-grid 6s linear infinite;
    -webkit-mask-image: linear-gradient(transparent, #000 70%); mask-image: linear-gradient(transparent, #000 70%); }
@keyframes fx-drift { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
@keyframes fx-grid { from { background-position: 0 0; } to { background-position: 0 48px; } }
[data-motion="off"] body::before { animation: none; }
[data-preset="glass"] .card { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
[data-preset="glass"] .header { background: color-mix(in srgb, var(--surface) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

/* Clickable cards follow the theme's hover style. Only motion is switched off with "Hareketli efektler"; the glow is not motion. */
.mcard, .source-card { transition: transform .18s ease, box-shadow .18s ease; }
[data-motion="on"][data-hover="lift"] :is(.mcard, .source-card, .theme-card):hover { transform: translateY(-3px); box-shadow: var(--sh3); }
[data-motion="on"][data-hover="tilt"] :is(.mcard, .source-card, .theme-card):hover { transform: perspective(700px) rotateX(3deg) rotateY(-3deg) translateY(-2px); box-shadow: var(--sh3); }
[data-motion="on"][data-hover="zoom"] :is(.mcard, .source-card, .theme-card):hover { transform: scale(1.03); box-shadow: var(--sh3); }
[data-hover="glow"] :is(.mcard, .source-card, .theme-card):hover { box-shadow: 0 0 0 1px var(--primary), 0 0 18px color-mix(in srgb, var(--primary) 45%, transparent); }
