/* Përkujtuesi Ditor · pamja pastel (tetor 2026)
   Baza navy, theksi i kuq vetëm për vonesa dhe shenja të vogla, sipërfaqe pastel rozë/jargavan/qiell.
   Ngarkohet pas style.css dhe mbishkruan vetëm atë që ndryshon. */

:root {
    --bg: #f4f3f7;
    --card: #ffffff;
    --ink: #14213d;
    --muted: #6d7387;
    --line: #e8e7ef;
    --accent: #cc0045;
    --accent-soft: #fde6ee;
    --ok: #3f9a5c;
    --ok-soft: #e4f4e8;
    --sunken: #f3f2f8;
    --field: #fff;
    --behind: #eceaf2;
    --radius: 24px;
    --radius-sm: 16px;
    --radius-xs: 12px;
    --shadow-card: 0 1px 2px rgba(20, 33, 61, 0.04), 0 4px 14px rgba(20, 33, 61, 0.04);
    --shadow-lift: 0 2px 4px rgba(20, 33, 61, 0.05), 0 10px 24px rgba(20, 33, 61, 0.07);
    --shadow-float: 0 4px 10px rgba(20, 33, 61, 0.06), 0 16px 40px rgba(20, 33, 61, 0.12);

    /* Pastelet: sfond (a→b), vija, teksti */
    --rosa-a: #ffd9e7; --rosa-b: #fff3f8; --rosa-bar: #e0457f; --rosa-ink: #7a1a40;
    --lilac-a: #ece2ff; --lilac-b: #f9f6ff; --lilac-bar: #8f6fdc; --lilac-ink: #3d2a73;
    --sky-a: #d6e2ff; --sky-b: #eef3ff; --sky-bar: #2f5bd3; --sky-ink: #14295e;
    --sage-a: #dcf1e2; --sage-b: #f2faf4; --sage-bar: #3f9a5c; --sage-ink: #1d4a2c;
    --rose-a: #ffd6dc; --rose-b: #fff1f3; --rose-bar: #cc0045; --rose-ink: #7d0a2c;
    --sand-a: #ffe6cf; --sand-b: #fff8f0; --sand-bar: #e0893a; --sand-ink: #6b3b0e;
    --glass-line: rgba(255, 255, 255, 0.75);
    --nav-bg: rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] {
    --bg: #0d1220;
    --card: #161c2c;
    --ink: #e9ecf5;
    --muted: #98a0b6;
    --line: #262e44;
    --accent: #ff4d7d;
    --accent-soft: #3a1a29;
    --ok: #6cc98a;
    --ok-soft: #1b3326;
    --sunken: #1d2436;
    --field: #1d2436;
    --behind: #080b14;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
    --shadow-float: 0 4px 12px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.45);

    --rosa-a: #4a1d33; --rosa-b: #24172a; --rosa-bar: #ff6f9f; --rosa-ink: #ffd0e0;
    --lilac-a: #33285a; --lilac-b: #1c1a33; --lilac-bar: #b39cff; --lilac-ink: #e3dbff;
    --sky-a: #1e3270; --sky-b: #151f3d; --sky-bar: #7fa2ff; --sky-ink: #dbe5ff;
    --sage-a: #1d3d2a; --sage-b: #142420; --sage-bar: #6cc98a; --sage-ink: #d4f2dd;
    --rose-a: #521628; --rose-b: #26141d; --rose-bar: #ff4d7d; --rose-ink: #ffd3dd;
    --sand-a: #4a3018; --sand-b: #241c16; --sand-bar: #f0a560; --sand-ink: #ffe3c7;
    --glass-line: rgba(255, 255, 255, 0.12);
    --nav-bg: rgba(22, 28, 44, 0.72);
}

body { font-size: 15.5px; letter-spacing: -0.005em; }
::selection { background: rgba(204, 0, 69, 0.14); }

/* ---------- Koka: avatari majtas, logoja në mes, kërkimi dhe zilja djathtas ---------- */

.top {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    padding: 14px 18px 8px;
}
.top > .top-avatar, .top > .top-avatar-wrap { justify-self: start; }
.top .brand { justify-self: center; }
.brand-logo { color: var(--ink); }
.brand-logo svg { height: 36px; width: 90px; }
.top-tools { justify-self: end; display: flex; gap: 8px; }
.top-avatar .avatar { width: 42px !important; height: 42px !important; border: 2px solid var(--card); box-shadow: var(--shadow-card); }

.round-btn {
    width: 42px; height: 42px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; background: var(--card); color: var(--ink);
    border: 1px solid var(--line); box-shadow: var(--shadow-card);
    text-decoration: none; transition: transform 0.15s ease;
}
.round-btn:active { transform: scale(0.92); }
.round-btn-ink { background: var(--ink); color: var(--card); border-color: var(--ink); }

/* ---------- Butonat ---------- */

.btn { border-radius: 999px; }
.btn-primary { background: var(--ink); color: var(--card); }
.btn-ghost { border-radius: 999px; }
.btn-round { background: var(--ink); color: var(--card); }

.pill-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 38px; padding: 0 20px; border-radius: 999px;
    background: var(--ink); color: var(--card);
    font-weight: 600; font-size: 15px;
}
.pill-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 12px 7px 14px; border-radius: 999px;
    background: var(--sunken); color: var(--ink); border: 1px solid var(--line);
    font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}

/* ---------- Kartat ---------- */

.card { border-radius: var(--radius); border-color: var(--line); }
.main { padding-top: 4px; }

.hello { margin: 6px 4px 12px; font-size: 15px; color: var(--muted); }
.hello strong { color: var(--ink); font-weight: 700; }

.sec-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin: 22px 4px 10px;
}
.sec-head h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }

/* ---------- Widget-et e Sot ---------- */

.widgets {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 30px; padding: 8px; box-shadow: var(--shadow-card);
}
.w {
    position: relative; overflow: hidden;
    border-radius: 24px; padding: 16px; min-height: 172px;
    text-decoration: none; color: var(--ink);
    border: 1px solid var(--glass-line);
    transition: transform 0.18s ease;
}
.w:active { transform: scale(0.985); }

.w-day {
    grid-column: 1 / -1; min-height: 176px;
    display: grid; grid-template-columns: minmax(96px, 0.8fr) 1.6fr; gap: 10px;
    background: linear-gradient(150deg, var(--rosa-a), var(--rosa-b) 85%);
}
.w-day-left { display: flex; flex-direction: column; justify-content: space-between; padding: 4px 2px 2px 4px; }
.w-day-date { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; color: var(--rosa-ink); }
.w-day-name { font-size: 14.5px; color: color-mix(in srgb, var(--rosa-ink) 62%, transparent); }
.w-day-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.w-slot {
    position: relative; display: flex; flex-direction: column; gap: 2px;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    border-radius: 16px; padding: 9px 12px 9px 20px; min-width: 0;
}
.w-slot::before {
    content: ""; position: absolute; left: 10px; top: 10px; bottom: 10px; width: 2px;
    border-radius: 2px; background: var(--rosa-bar);
}
.w-slot:nth-child(2)::before { background: var(--ink); }
.w-slot strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-slot small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.w-slot-late::before { background: var(--accent) !important; }
.w-slot-late small { color: var(--accent); font-weight: 600; }
.w-slot-fade {
    opacity: 0.5; filter: blur(0.6px); padding-top: 7px; padding-bottom: 0; max-height: 26px; overflow: hidden;
    -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent);
}
.w-slot-fade small { display: none; }
.w-slot-empty::before { background: var(--sage-bar); }

.w-next {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px;
    text-align: center;
    background: linear-gradient(160deg, var(--lilac-b), var(--rosa-a) 140%);
}
.w-next .glass { margin-bottom: auto; margin-top: 4px; }
.w-next-title { font-size: 15px; font-weight: 600; line-height: 1.25; }

.w-ring {
    display: flex; flex-direction: column;
    background: linear-gradient(170deg, var(--sky-a), var(--sky-b) 95%);
    color: var(--sky-ink);
}
.w-ring-num { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.w-ring-num small { font-size: 20px; font-weight: 500; opacity: 0.55; }
.w-ring-label { font-size: 14.5px; opacity: 0.7; margin-top: 2px; }
.ring {
    position: absolute; right: 12px; bottom: 12px;
    width: 76px; height: 76px; border-radius: 999px;
    background:
        radial-gradient(closest-side, transparent 80%, transparent 0),
        conic-gradient(var(--sky-bar) calc(var(--p, 0) * 1%), color-mix(in srgb, var(--card) 70%, transparent) 0);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--sky-bar) 28%, transparent);
}
.ring::before {
    content: ""; position: absolute; inset: 6px; border-radius: 999px; background: var(--card);
}
.ring-core {
    position: relative; width: 46px; height: 46px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center; color: #fff;
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--sky-bar) 55%, #fff), var(--sky-bar) 70%);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 3px 8px color-mix(in srgb, var(--sky-bar) 40%, transparent);
}

/* ---------- Ikona xhami ---------- */

.glass { position: relative; display: inline-block; width: var(--g); height: var(--g); flex: 0 0 auto; }
.glass-back, .glass-front { position: absolute; border-radius: 30%; }
.glass-back {
    inset: 4% 22% 22% 4%;
    background: linear-gradient(140deg, #ff8fb6, var(--accent));
    transform: rotate(-10deg);
    box-shadow: 0 8px 18px rgba(204, 0, 69, 0.25);
}
.glass-front {
    inset: 22% 4% 4% 22%;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(150deg, rgba(160, 190, 255, 0.85), rgba(47, 91, 211, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7), 0 10px 20px rgba(20, 41, 94, 0.22);
}
.glass-front .ic { filter: drop-shadow(0 1px 1px rgba(20, 33, 61, 0.35)); }

/* ---------- Kartat e Sot: puna e radhës dhe lista e adminit ---------- */

.one-card { padding: 18px; border-radius: 26px; }
.one-card .ch-badge { border-radius: 14px; }
.one-card .btn { border-radius: 999px; }
.menu-card { padding: 6px; border-radius: 26px; }
.menu-card .menu-row { border-radius: 18px; padding: 12px 12px; }
.menu-row .ic:first-child { color: var(--ink); }
.feed-hot .ic:first-child { color: var(--accent); }
.line-card { border-radius: 22px; }
.empty-card { border-radius: 26px; }

/* ---------- Java: fleta e ditëve ---------- */

.day-sheet {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 30px; padding: 12px 10px 12px; margin-bottom: 14px;
    box-shadow: var(--shadow-card);
}
.month-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
.month-pill {
    display: inline-flex; align-items: center; gap: 2px;
    background: var(--sunken); border: 1px solid var(--line); border-radius: 999px; padding: 3px;
}
.month-pill a {
    display: inline-flex; align-items: center; justify-content: center;
    height: 36px; min-width: 36px; border-radius: 999px; color: var(--ink); text-decoration: none;
}
.month-pill .month-name { padding: 0 10px; font-weight: 600; font-size: 16px; }
.month-pill a:active { background: var(--card); }

.day-strip {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px;
    margin: 14px 0 10px;
}
.day-pill {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    height: 76px; border-radius: 999px;
    background: var(--sunken); color: var(--ink); text-decoration: none;
    border: 1px solid var(--line);
    transition: transform 0.15s ease, background-color 0.2s ease;
}
.day-pill:active { transform: scale(0.94); }
.day-pill .day-num { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.day-pill .day-name { font-size: 11.5px; color: var(--muted); }
.day-pill.day-on { background: var(--ink); color: var(--card); border-color: var(--ink); box-shadow: 0 8px 18px rgba(20, 33, 61, 0.25); }
.day-pill.day-on .day-name { color: color-mix(in srgb, var(--card) 70%, transparent); }
.day-pill.day-today:not(.day-on) { border-color: var(--ink); }
.day-pill .chip-dot { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 999px; }

.week-line {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px;
    padding: 0 8px; font-size: 13.5px; color: var(--muted);
}
.week-line > span:first-child { color: var(--ink); font-weight: 600; }
.week-line .pill-link { margin-left: auto; padding: 5px 11px; font-size: 13px; }

.seg-week { margin-bottom: 12px; }

/* ---------- Java: vija e kohës ---------- */

.timeline { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.tl-row { display: grid; grid-template-columns: 46px 1fr; gap: 8px; align-items: start; position: relative; }
.tl-row::before {
    content: ""; position: absolute; left: 54px; right: 0; top: 10px; height: 1px; background: var(--line);
}
.tl-same::before { display: none; }
.tl-same { margin-top: -2px; }
.tl-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; position: relative; }

.tl-card {
    --a: var(--lilac-a); --b: var(--lilac-b); --bar: var(--lilac-bar); --tink: var(--lilac-ink);
    position: relative; z-index: 1; margin-top: 18px;
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 14px 14px 22px; border-radius: 22px;
    background: linear-gradient(120deg, var(--b) 10%, var(--a) 160%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    color: var(--ink); text-decoration: none;
    overflow: hidden;
    transition: transform 0.15s ease;
}
.tl-card:active { transform: scale(0.985); }
.tl-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px;
    background: var(--bar); border-radius: 22px 0 0 22px;
}
.tone-rosa { --a: var(--rosa-a); --b: var(--rosa-b); --bar: var(--rosa-bar); --tink: var(--rosa-ink); }
.tone-sky { --a: var(--sky-a); --b: var(--sky-b); --bar: var(--sky-bar); --tink: var(--sky-ink); }
.tone-sage { --a: var(--sage-a); --b: var(--sage-b); --bar: var(--sage-bar); --tink: var(--sage-ink); }
.tone-sand { --a: var(--sand-a); --b: var(--sand-b); --bar: var(--sand-bar); --tink: var(--sand-ink); }
.tone-rose { --a: var(--rose-a); --b: var(--rose-b); --bar: var(--rose-bar); --tink: var(--rose-ink); }

.tl-meta { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tone-rose .tl-meta { color: var(--accent); font-weight: 600; }
.tl-title { font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; padding-right: 50px; }
.tl-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; padding-right: 54px; }
.tl-people { display: inline-flex; align-items: center; gap: 6px; }
.tl-chs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tl-chs .ch-mini { color: color-mix(in srgb, var(--ink) 55%, transparent); }
.tl-card.post-done { opacity: 0.8; }
.tl-card.post-done .tl-title { text-decoration: none; }

.tl-act {
    position: absolute; right: 12px; bottom: 12px;
    width: 46px; height: 30px; border-radius: 999px; border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bar); color: #fff;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--bar) 35%, transparent);
}
.tl-act:active { transform: scale(0.92); }
.tl-act-done { background: var(--sage-bar); cursor: default; }

.me-tag {
    font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    background: var(--ink); color: var(--card);
}

/* ---------- Rrathët e njerëzve ---------- */

.av-stack { display: inline-flex; align-items: center; }
.av-stack .avatar { border: 2px solid var(--card); box-sizing: content-box; }
.av-stack .avatar + .avatar { margin-left: -9px; }
.av-more { background: var(--sunken) !important; color: var(--muted) !important; font-size: 11px !important; font-weight: 700; }

/* ---------- Navigimi: ishull xhami me ikona ---------- */

.tabbar {
    z-index: 60;
    width: auto; max-width: calc(100% - 24px);
    gap: 4px; padding: 6px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border: 1px solid var(--glass-line);
    box-shadow: var(--shadow-float);
}
.tab {
    flex: 0 0 auto; flex-direction: row; gap: 7px;
    height: 52px; min-width: 56px; padding: 0 12px; justify-content: center; white-space: nowrap;
    color: var(--ink); font-size: 14px; font-weight: 600;
    transition: background-color 0.2s ease, padding 0.2s ease;
}
.tab > span:last-child { display: none; }
.tab .ic { width: 23px; height: 23px; padding: 0; background: none !important; }
.tab-on { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(20, 33, 61, 0.1); padding: 0 16px; }
.tab-on > span:last-child { display: inline; }
html[data-theme="dark"] .tab-on { background: rgba(255, 255, 255, 0.1); }
.tab-dot { top: -6px; right: -8px; border: 2px solid var(--card); min-width: 19px; height: 19px; }

/* ---------- Desktop ---------- */

@media (min-width: 700px) {
    .shell { border-radius: 36px; }
    .top { display: flex; gap: 12px; }
    .top .brand { order: -1; margin-right: auto; }
    .top-tools { order: 1; }
    .top > .top-avatar, .top > .top-avatar-wrap { order: 2; }
    .tabbar { background: var(--nav-bg); padding: 6px; max-width: none; }
    .tab { height: 44px; font-size: 15px; padding: 0 18px; }
    .tab > span:last-child { display: inline; }
    .tab-on { background: var(--ink); color: var(--card); }
    .widgets, .sec-head, .hello, .day-sheet, .timeline, .seg-week, .status-line, .done-line,
    .view-sot > .card, .view-sot > details, .view-java > .card {
        grid-column: 1 / -1; width: 100%; max-width: 720px; justify-self: center;
    }
    .w-day { min-height: 190px; }
}

/* ---------- Grupet: lista ---------- */

.grp-list { padding: 6px; }
.grp-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 10px; border-radius: 20px;
    text-decoration: none; color: var(--ink);
    transition: background-color 0.15s ease;
}
.grp-row:active { background: var(--sunken); transform: scale(0.99); }
.grp-row + .grp-row { position: relative; }
.grp-row + .grp-row::before { content: ""; position: absolute; left: 72px; right: 12px; top: 0; height: 1px; background: var(--line); }
.grp-av {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: 0.02em;
    background: linear-gradient(150deg, color-mix(in srgb, var(--gc) 65%, #fff), var(--gc));
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
}
.grp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.grp-top, .grp-bottom { display: flex; align-items: center; gap: 8px; }
.grp-top strong { flex: 1; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-top small { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grp-preview { flex: 1; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-unread .grp-preview { color: var(--ink); font-weight: 500; }
.grp-unread .grp-top small { color: var(--sky-bar); font-weight: 700; }
.grp-badge {
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--sky-bar); color: #fff; font-size: 12px; font-weight: 700;
}
.empty-card .glass { margin: 4px auto 6px; }

/* ---------- Grupi: forma ---------- */

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; margin-bottom: 8px; }
.grp-form { display: flex; flex-direction: column; gap: 16px; }
.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot { position: relative; cursor: pointer; }
.color-dot input { position: absolute; opacity: 0; }
.color-dot span {
    width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--gc); color: transparent; box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--line);
}
.color-dot input:checked + span { color: #fff; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--gc); }
.member-pick { display: flex; flex-direction: column; background: var(--sunken); border-radius: 18px; padding: 4px; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; cursor: pointer; }
.member-name { flex: 1; font-weight: 600; }
.member-row input { position: absolute; opacity: 0; pointer-events: none; }
.member-check {
    width: 26px; height: 26px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid var(--line); color: transparent; background: var(--card);
}
.member-row input:checked ~ .member-check { background: var(--ink); border-color: var(--ink); color: var(--card); }
.member-row input:disabled ~ .member-check { opacity: 0.5; }
.danger-text { color: var(--accent); }

/* ---------- Grupi: biseda ---------- */

.main.view-grupi { padding: 0; }
.chat { display: flex; flex-direction: column; height: 100dvh; }
.chat-head {
    display: flex; align-items: center; gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 5;
}
.chat-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.chat-title > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.chat-title strong { font-size: 16.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 12px 14px; overscroll-behavior: contain; }
.chat-empty { text-align: center; color: var(--muted); padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.chat-msgs { display: flex; flex-direction: column; gap: 3px; }

.msg-day { display: flex; justify-content: center; margin: 14px 0 8px; }
.msg-day span {
    font-size: 12px; font-weight: 600; color: var(--muted);
    background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
}

.msg { display: flex; align-items: flex-end; gap: 6px; max-width: 86%; margin-top: 6px; position: relative; }
.msg-cont { margin-top: 0; padding-left: 36px; }
.msg-me { align-self: flex-end; flex-direction: row-reverse; }
.msg-me.msg-cont { padding-left: 0; }
.msg-av { flex: 0 0 auto; }
.bubble {
    position: relative; min-width: 64px;
    background: var(--card); color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 20px 20px 20px 6px;
    padding: 8px 12px 6px;
    box-shadow: 0 1px 1px rgba(20, 33, 61, 0.04);
    display: flex; flex-direction: column; gap: 4px;
}
.msg-cont .bubble { border-radius: 6px 20px 20px 6px; }
.msg-me .bubble { background: var(--ink); color: var(--card); border-color: var(--ink); border-radius: 20px 20px 6px 20px; }
.msg-me.msg-cont .bubble { border-radius: 20px 6px 6px 20px; }
html[data-theme="dark"] .msg-me .bubble { background: #2f5bd3; border-color: #2f5bd3; color: #fff; }
.msg-name { font-size: 12.5px; font-weight: 700; color: var(--av); }
.msg-text { font-size: 15.5px; line-height: 1.38; overflow-wrap: anywhere; }
.msg-time { align-self: flex-end; font-size: 11px; opacity: 0.55; font-variant-numeric: tabular-nums; margin-top: -2px; }
.msg-deleted { font-style: italic; opacity: 0.6; font-size: 14px; }
.bubble-image, .bubble-video { padding: 4px; }
.bubble-image .msg-text, .bubble-video .msg-text { padding: 2px 8px 0; }
.bubble-image .msg-time, .bubble-video .msg-time { padding: 0 8px 2px; }
.bubble-image .msg-name, .bubble-video .msg-name { padding: 2px 8px 0; }
.msg-img { display: block; width: 100%; max-width: 260px; max-height: 340px; object-fit: cover; border-radius: 16px; cursor: zoom-in; background: var(--sunken); }
.msg-video { display: block; width: 260px; max-width: 100%; border-radius: 16px; background: #000; }
.msg-file { display: flex; align-items: center; gap: 8px; color: inherit; font-weight: 600; font-size: 14px; text-decoration: none; padding: 6px 2px; }
.msg-file span { overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 3px; }

.voice { display: flex; align-items: center; gap: 10px; min-width: 200px; padding: 2px 0; }
.voice-play {
    width: 38px; height: 38px; flex: 0 0 auto; border-radius: 999px; border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--sky-bar); color: #fff;
}
.voice-play .ic { margin-left: 2px; }
.msg-me .voice-play { background: var(--card); color: var(--ink); }
.voice.playing .voice-play .ic { margin-left: 0; }
.voice-bar { flex: 1; height: 4px; border-radius: 999px; background: color-mix(in srgb, currentColor 18%, transparent); overflow: hidden; }
.voice-fill { display: block; height: 100%; width: 0; background: currentColor; border-radius: 999px; }
.voice-time { font-size: 12px; opacity: 0.7; font-variant-numeric: tabular-nums; min-width: 30px; }

.msg-del {
    display: none; align-self: center;
    width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer;
    background: var(--card); color: var(--accent); align-items: center; justify-content: center;
}
.msg-show-del .msg-del { display: inline-flex; }
@media (hover: hover) { .msg:hover .msg-del { display: inline-flex; } }

/* Fusha e shkrimit */
.composer {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border-top: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 6px;
}
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea {
    flex: 1; resize: none; font: inherit; font-size: 16px; line-height: 1.35; color: var(--ink);
    background: var(--card); border: 1px solid var(--line); border-radius: 22px;
    padding: 11px 16px; min-height: 46px; max-height: 140px;
}
.composer textarea:focus { outline: none; border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.comp-btn {
    width: 46px; height: 46px; flex: 0 0 auto; border-radius: 999px; border: 1px solid var(--line); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--card); color: var(--ink);
    transition: transform 0.12s ease;
}
.comp-btn:active { transform: scale(0.9); }
.comp-send, .comp-mic { background: var(--ink); color: var(--card); border-color: var(--ink); }
.is-recording .comp-mic { background: var(--accent); border-color: var(--accent); color: #fff; }
.is-sending .comp-send { opacity: 0.5; }
.composer-file, .composer-rec {
    display: flex; align-items: center; gap: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 14px; font-size: 14px;
}
.composer-file span { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-rec .muted { flex: 1; }
.composer-file[hidden], .composer-rec[hidden] { display: none; }
.rec-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--accent); animation: rec-blink 1s ease-in-out infinite; }
#rec-time { font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes rec-blink { 50% { opacity: 0.25; } }

@media (min-width: 700px) {
    .view-grupi { display: block !important; }
    .chat { height: calc(100dvh - 120px); max-width: 760px; margin: 0 auto; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; background: var(--bg); }
    .chat-head { padding-top: 12px; }
    .grp-list, .view-grupet > .card { grid-column: 1 / -1; width: 100%; max-width: 720px; justify-self: center; }
    .view-grupet .page-head, .view-grupi-form .page-head, .view-grupi-form > form { grid-column: 1 / -1; width: 100%; max-width: 720px; justify-self: center; }
}
.round-btn-spacer { width: 42px; height: 42px; flex: 0 0 auto; }
.login-grid form { display: contents; }
