:root {
    --ink: #0b1620;
    --muted: #6d7886;
    --line: rgba(12, 23, 34, .1);
    --gold: #d8b45f;
    --gold-2: #f4d98f;
    --emerald: #0f6f5b;
    --deep: #07140f;
    --paper: #f7f4ed;
    --white: #ffffff;
    --danger: #c0392b;
    --success: #18794e;
    --shadow: 0 24px 70px rgba(4, 17, 28, .16);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.alert {
    border-radius: 18px;
    padding: 14px 16px;
    font-weight: 700;
}

.alert.success {
    background: rgba(24, 121, 78, .11);
    color: var(--success);
}

.alert.error {
    background: rgba(192, 57, 43, .11);
    color: var(--danger);
}

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

.wide {
    grid-column: 1 / -1;
}

/* Install */
.setup-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(216, 180, 95, .32), transparent 34%),
        linear-gradient(135deg, #07140f, #0e2530);
    color: var(--paper);
}

.setup-card {
    width: min(620px, calc(100vw - 32px));
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 32px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
    backdrop-filter: blur(20px);
}

.setup-card h1 {
    margin: 10px 0 18px;
    font-size: 38px;
}

.setup-card a {
    color: var(--gold-2);
}

.setup-mark {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    background: var(--gold);
    color: #161105;
    border-radius: 50%;
    font-size: 34px;
}

.danger-note {
    color: #ffd5ce;
}

/* Admin login */
.admin-login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #08140f, #102b35 55%, #0a191f);
    color: var(--white);
    padding: 24px;
}

.login-shell {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 28px;
    align-items: stretch;
}

.login-brand,
.login-form {
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
    backdrop-filter: blur(24px);
    border-radius: 34px;
}

.login-brand {
    min-height: 540px;
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background:
        radial-gradient(circle at 16% 20%, rgba(216, 180, 95, .28), transparent 28%),
        linear-gradient(150deg, rgba(8, 30, 24, .95), rgba(10, 42, 53, .72));
}

.moon {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gold);
    color: #160f02;
    font-size: 46px;
    margin-bottom: auto;
}

.login-brand p,
.section-title p,
.next-prayer p,
.countdown-panel p {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 12px;
    color: var(--gold-2);
    font-weight: 800;
}

.login-brand h1 {
    margin: 18px 0 0;
    font-size: clamp(36px, 5vw, 64px);
    line-height: .98;
    max-width: 700px;
}

.login-form {
    padding: 34px;
    color: var(--ink);
    background: var(--paper);
    align-self: center;
}

.login-form h2 {
    font-size: 30px;
    margin: 0 0 22px;
}

.login-form label,
.stack-form label,
.times-form label {
    display: block;
    color: #34404d;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-form input,
.stack-form input,
.date-jump input,
.announcement-add input,
.times-form input {
    width: 100%;
    border: 1px solid rgba(12, 23, 34, .14);
    background: rgba(255, 255, 255, .76);
    border-radius: 15px;
    padding: 13px 14px;
    color: var(--ink);
    outline: none;
}

.upload-grid input {
    width: 100%;
    border: 1px solid rgba(12, 23, 34, .14);
    background: rgba(255, 255, 255, .76);
    border-radius: 15px;
    padding: 13px 14px;
    color: var(--ink);
    outline: none;
    margin-top: 8px;
}

.login-form input:focus,
.stack-form input:focus,
.announcement-add input:focus,
.times-form input:focus {
    border-color: var(--emerald);
    box-shadow: 0 0 0 4px rgba(15, 111, 91, .12);
}

.login-form button,
.stack-form button,
.date-jump button,
.times-form button,
.announcement-add button,
.announcement-item button {
    border: 0;
    border-radius: 15px;
    background: var(--emerald);
    color: white;
    padding: 13px 18px;
    font-weight: 900;
    cursor: pointer;
}

.login-form button {
    width: 100%;
    margin-top: 18px;
}

/* Admin */
.admin-body {
    background: #f4f0e7;
    color: var(--ink);
    min-height: 100vh;
}

.admin-topbar {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.product-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0d231c;
    color: var(--gold-2);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 900;
    font-size: 13px;
}

.admin-topbar h1 {
    margin: 10px 0 0;
    font-size: clamp(28px, 4vw, 46px);
}

.admin-topbar nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-topbar nav a {
    text-decoration: none;
    background: white;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 11px 16px;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(15, 25, 35, .06);
}

.admin-layout {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 40px;
    display: grid;
    grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
    gap: 22px;
}

.admin-panel {
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(12, 23, 34, .1);
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 18px 60px rgba(12, 23, 34, .08);
}

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-title p {
    color: var(--emerald);
}

.section-title h2 {
    margin: 6px 0 0;
    font-size: 24px;
}

.copy-url {
    padding: 16px;
    background: #101f1a;
    color: var(--gold-2);
    border-radius: 18px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow-wrap: anywhere;
}

.stack-form {
    display: grid;
    gap: 12px;
}

.date-jump,
.announcement-add {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.date-jump input {
    max-width: 220px;
}

.times-form {
    display: grid;
    gap: 12px;
}

.time-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .62);
}

.time-row strong {
    font-size: 17px;
}

.time-row label {
    margin: 0;
}

.announcement-list {
    display: grid;
    gap: 10px;
}

.announcement-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: rgba(255, 255, 255, .62);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px;
}

.announcement-item.is-off {
    opacity: .55;
}

.announcement-item > div {
    display: flex;
    gap: 8px;
}

.announcement-item form {
    margin: 0;
}

.announcement-item button {
    padding: 10px 12px;
}

.announcement-item button.danger {
    background: var(--danger);
}

.upload-grid {
    display: grid;
    grid-template-columns: 130px 1fr repeat(5, minmax(110px, 140px));
    gap: 12px;
    align-items: end;
}

.upload-grid label {
    color: #34404d;
    font-size: 13px;
    font-weight: 800;
}

.upload-action {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.upload-action a {
    display: inline-flex;
    align-items: center;
    min-height: 45px;
    text-decoration: none;
    color: var(--emerald);
    font-weight: 900;
}

.sync-now-form {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.sync-now-form div {
    display: grid;
    gap: 6px;
}

.sync-now-form strong {
    font-size: 18px;
}

.sync-now-form span {
    color: var(--muted);
}

/* TV Display */
.tv-body {
    min-height: 100vh;
    overflow: hidden;
    color: #f7f1e4;
    background: #06100d;
}

.tv-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
        radial-gradient(circle at 50% 0%, rgba(216, 180, 95, .12), transparent 42%);
    background-size: 70px 70px, 70px 70px, 100% 100%;
    mask-image: radial-gradient(circle at center, black, transparent 86%);
    pointer-events: none;
}

.ambient {
    position: fixed;
    width: 42vw;
    height: 42vw;
    border-radius: 50%;
    filter: blur(82px);
    opacity: .24;
    animation: floatGlow 12s ease-in-out infinite alternate;
}

.ambient-one {
    top: -18vw;
    left: -12vw;
    background: #d8b45f;
}

.ambient-two {
    right: -18vw;
    bottom: -22vw;
    background: #0f6f5b;
    animation-delay: -5s;
}

@keyframes floatGlow {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(4vw, 2vw, 0) scale(1.08);
    }
}

.tv-stage {
    position: relative;
    z-index: 1;
    height: 100vh;
    padding: clamp(22px, 2.5vw, 40px);
    display: grid;
    grid-template-rows: auto minmax(210px, 1fr) auto auto auto auto;
    gap: clamp(12px, 1.45vw, 22px);
}

.tv-hero,
.focus-row,
.schedule-head,
.prayer-grid,
.jummah-strip,
.tv-footer {
    animation: riseIn .7s ease both;
}

.focus-row {
    animation-delay: .08s;
}

.prayer-grid {
    animation-delay: .16s;
}

.schedule-head {
    animation-delay: .24s;
}

.jummah-strip {
    animation-delay: .28s;
}

.tv-footer {
    animation-delay: .32s;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tv-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.mosque-identity {
    display: flex;
    gap: 18px;
    align-items: center;
}

.tv-logo {
    width: clamp(62px, 5.3vw, 94px);
    height: clamp(62px, 5.3vw, 94px);
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-2), var(--gold));
    color: #171003;
    font-size: clamp(38px, 4.6vw, 60px);
    box-shadow: 0 18px 50px rgba(216, 180, 95, .28);
    overflow: hidden;
}

.tv-logo.has-logo {
    background: rgba(255, 255, 255, .92);
    padding: 8px;
}

.tv-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mosque-identity h1 {
    margin: 0;
    font-size: clamp(34px, 4.6vw, 76px);
    line-height: .94;
    letter-spacing: -.05em;
}

.mosque-identity p,
.clock-block p {
    margin: 9px 0 0;
    color: rgba(247, 244, 237, .68);
    font-weight: 700;
    font-size: clamp(15px, 1.25vw, 21px);
}

.dot-sep {
    color: rgba(244, 217, 143, .65);
    padding: 0 8px;
}

#screenStatus {
    color: var(--gold-2);
}

.is-offline #screenStatus {
    color: #ffb3a8;
}

.clock-block {
    text-align: right;
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: flex-end;
}

.analog-clock {
    position: relative;
    width: clamp(66px, 5.5vw, 96px);
    height: clamp(66px, 5.5vw, 96px);
    border-radius: 50%;
    border: 1px solid rgba(244, 217, 143, .4);
    background:
        radial-gradient(circle at center, rgba(244, 217, 143, .18), transparent 28%),
        rgba(255, 255, 255, .045);
    box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .025);
}

.analog-clock::before,
.analog-clock::after {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .06);
}

.hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform-origin: bottom center;
    border-radius: 999px;
}

.hour-hand {
    width: 4px;
    height: 26%;
    background: #fff;
    margin-left: -2px;
}

.minute-hand {
    width: 3px;
    height: 34%;
    background: var(--gold-2);
    margin-left: -1.5px;
}

.second-hand {
    width: 1px;
    height: 38%;
    background: #ff7b86;
}

.clock-dot {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold-2);
    left: calc(50% - 4.5px);
    top: calc(50% - 4.5px);
}

#liveClock {
    font-size: clamp(44px, 5.5vw, 96px);
    line-height: .9;
    font-weight: 950;
    letter-spacing: -.06em;
    color: var(--gold-2);
    font-variant-numeric: tabular-nums;
}

.focus-row {
    display: grid;
    grid-template-columns: .76fr 1.24fr;
    gap: clamp(18px, 2vw, 28px);
    align-items: stretch;
}

.next-prayer,
.countdown-panel {
    border: 1px solid rgba(244, 217, 143, .15);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .032)),
        radial-gradient(circle at 0% 0%, rgba(216, 180, 95, .12), transparent 44%);
    border-radius: clamp(24px, 2.7vw, 38px);
    padding: clamp(24px, 2.7vw, 38px);
    box-shadow: 0 22px 70px rgba(0, 0, 0, .22);
    backdrop-filter: blur(18px);
}

.next-prayer h2 {
    margin: 14px 0 24px;
    font-size: clamp(64px, 8.3vw, 142px);
    line-height: .84;
    letter-spacing: -.08em;
}

.next-times {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.next-times span {
    flex: 1;
    min-width: 180px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    padding-top: 16px;
    color: rgba(247, 244, 237, .72);
    font-size: clamp(17px, 1.7vw, 26px);
    font-weight: 800;
}

.next-times strong {
    display: block;
    color: white;
    font-size: clamp(27px, 2.6vw, 44px);
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
}

.countdown-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#countdown {
    margin-top: 14px;
    color: var(--gold-2);
    font-size: clamp(76px, 11.2vw, 190px);
    line-height: .84;
    font-weight: 950;
    letter-spacing: -.07em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 20px 80px rgba(216, 180, 95, .18);
}

#statusText {
    margin-top: 22px;
    color: rgba(247, 244, 237, .72);
    font-size: clamp(18px, 1.8vw, 30px);
    font-weight: 800;
}

.schedule-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    padding: 0 4px 10px;
}

.schedule-head p,
.jummah-strip p {
    margin: 0 0 5px;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: rgba(244, 217, 143, .82);
    font-size: clamp(10px, .85vw, 13px);
    font-weight: 900;
}

.schedule-head h3 {
    margin: 0;
    font-size: clamp(21px, 2.1vw, 34px);
    letter-spacing: -.035em;
}

.schedule-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    min-width: clamp(250px, 23vw, 430px);
}

.schedule-legend span {
    color: rgba(247, 244, 237, .56);
    font-size: clamp(13px, 1.05vw, 17px);
    font-weight: 900;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.prayer-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.prayer-line {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .095);
    background: rgba(255, 255, 255, .052);
    border-radius: 22px;
    padding: clamp(15px, 1.35vw, 21px);
    min-height: 132px;
    transition: transform .35s ease, background .35s ease, border-color .35s ease;
}

.prayer-line::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(244, 217, 143, .24), transparent 55%);
    opacity: 0;
    transition: opacity .35s ease;
}

.prayer-line.active {
    transform: translateY(-6px);
    background: rgba(216, 180, 95, .16);
    border-color: rgba(244, 217, 143, .52);
}

.prayer-line.active::before {
    opacity: 1;
}

.prayer-line.focus-window {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, .72);
    background: linear-gradient(135deg, rgba(244, 217, 143, .26), rgba(255, 255, 255, .07));
    box-shadow: 0 18px 60px rgba(216, 180, 95, .16);
}

.prayer-line.focus-window::after {
    content: "Prayer window";
    position: absolute;
    top: 12px;
    right: 12px;
    color: #08140f;
    background: var(--gold-2);
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
    z-index: 2;
}

.prayer-line.focus-window.before-azan::after {
    content: "Azan soon";
}

.prayer-line.focus-window.before-iqamah::after {
    content: "Iqamah soon";
}

.prayer-line.focus-window.after-iqamah::after {
    content: "Prayer time";
}

.prayer-line strong,
.prayer-line span {
    position: relative;
    z-index: 1;
    display: block;
}

.prayer-line strong {
    font-size: clamp(24px, 2vw, 38px);
    line-height: 1;
    margin-bottom: 16px;
}

.prayer-line span {
    color: rgba(247, 244, 237, .68);
    font-size: clamp(17px, 1.35vw, 24px);
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.prayer-line .iqamah {
    color: white;
    font-size: clamp(22px, 1.75vw, 32px);
    margin-top: 6px;
}

.sunrise-line {
    background: rgba(244, 217, 143, .11);
}

.sunrise-line .iqamah {
    font-size: clamp(14px, 1vw, 18px);
    color: rgba(247, 244, 237, .54);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.jummah-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    border: 1px solid rgba(15, 111, 91, .32);
    background: linear-gradient(90deg, rgba(15, 111, 91, .2), rgba(255, 255, 255, .035));
    border-radius: 22px;
    padding: clamp(14px, 1.25vw, 20px) clamp(18px, 1.7vw, 28px);
}

.jummah-strip strong {
    display: block;
    font-size: clamp(26px, 2.4vw, 44px);
    line-height: 1;
    letter-spacing: -.04em;
}

.jummah-strip > div:last-child {
    display: flex;
    gap: clamp(18px, 2vw, 32px);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.jummah-strip span {
    color: rgba(247, 244, 237, .62);
    font-weight: 850;
    font-size: clamp(15px, 1.25vw, 21px);
}

.jummah-strip b {
    color: #fff;
    font-size: clamp(22px, 2vw, 34px);
    margin-left: 8px;
    font-variant-numeric: tabular-nums;
}

.jummah-special {
    display: none;
    min-height: min(56vh, 620px);
    place-items: center;
    text-align: center;
    border: 1px solid rgba(244, 217, 143, .2);
    border-radius: clamp(28px, 4vw, 54px);
    padding: clamp(30px, 5vw, 74px);
    background:
        radial-gradient(circle at 50% 0%, rgba(244, 217, 143, .22), transparent 42%),
        linear-gradient(135deg, rgba(15, 111, 91, .32), rgba(255, 255, 255, .045));
    box-shadow: 0 30px 100px rgba(0, 0, 0, .24);
}

.jummah-kicker {
    color: var(--gold-2);
    text-transform: uppercase;
    letter-spacing: .28em;
    font-weight: 950;
    font-size: clamp(12px, 1vw, 18px);
}

.jummah-special h2 {
    margin: 16px 0 10px;
    font-size: clamp(76px, 11vw, 190px);
    line-height: .84;
    letter-spacing: -.08em;
}

.jummah-special p {
    margin: 0 0 28px;
    color: rgba(247, 244, 237, .7);
    font-size: clamp(22px, 2.2vw, 42px);
    font-weight: 850;
}

.jummah-special-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
    width: min(1100px, 100%);
}

.jummah-special-grid span {
    border-top: 1px solid rgba(255, 255, 255, .16);
    padding-top: 16px;
    color: rgba(247, 244, 237, .62);
    font-size: clamp(18px, 1.7vw, 28px);
    font-weight: 850;
}

.jummah-special-grid strong,
#jummahSpecialCountdown {
    display: block;
    color: white;
    font-size: clamp(36px, 4vw, 72px);
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
}

.jummah-mode .focus-row,
.jummah-mode .schedule-head,
.jummah-mode .prayer-grid,
.jummah-mode .jummah-strip {
    display: none;
}

.jummah-mode .jummah-special {
    display: grid;
}

.prayer-focus-mode .next-prayer,
.prayer-focus-mode .countdown-panel {
    border-color: rgba(244, 217, 143, .36);
    background:
        radial-gradient(circle at 0% 0%, rgba(244, 217, 143, .22), transparent 42%),
        linear-gradient(135deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04));
}

.tv-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.ticker {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .055);
    border-radius: 999px;
    padding: 12px 0;
}

#announcementTicker {
    white-space: nowrap;
    display: inline-block;
    padding-left: 100%;
    animation: tickerMove 32s linear infinite;
    font-size: clamp(17px, 1.55vw, 27px);
    font-weight: 850;
    color: var(--paper);
}

@keyframes tickerMove {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

#displayNote {
    color: var(--gold-2);
    font-weight: 900;
    font-size: clamp(15px, 1.18vw, 21px);
    white-space: nowrap;
}

.footer-side {
    display: grid;
    justify-items: end;
    gap: 7px;
}

.cctv-status {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    color: rgba(247, 244, 237, .7);
    font-size: clamp(12px, .9vw, 16px);
    font-weight: 850;
}

.cctv-status strong {
    color: #9ff0c8;
    border: 1px solid rgba(159, 240, 200, .32);
    background: rgba(159, 240, 200, .08);
    border-radius: 999px;
    padding: 4px 9px;
}

#systemBy {
    color: rgba(247, 244, 237, .62);
    font-weight: 850;
    font-size: clamp(12px, .9vw, 16px);
    white-space: nowrap;
}

#systemBy span {
    color: #ff6b7a;
}

#lastSync {
    color: rgba(247, 244, 237, .42);
    font-size: clamp(11px, .78vw, 14px);
    font-weight: 750;
}

@media (max-width: 1200px) {
    .prayer-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tv-stage {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }
}

@media (max-width: 860px) {
    .login-shell,
    .admin-layout,
    .focus-row {
        grid-template-columns: 1fr;
    }

    .login-brand {
        min-height: 360px;
    }

    .admin-topbar,
    .tv-hero,
    .tv-footer {
        flex-direction: column;
        display: flex;
        align-items: stretch;
        text-align: left;
    }

    .clock-block {
        text-align: left;
    }

    .time-row {
        grid-template-columns: 1fr;
    }

    .date-jump,
    .announcement-add,
    .announcement-item,
    .sync-now-form {
        flex-direction: column;
        align-items: stretch;
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }

    .prayer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .schedule-head,
    .jummah-strip {
        flex-direction: column;
        align-items: stretch;
    }

    .schedule-legend {
        min-width: 0;
    }

    .jummah-strip > div:last-child {
        justify-content: flex-start;
    }

    .jummah-special-grid {
        grid-template-columns: 1fr;
    }

    .tv-footer {
        display: grid;
        grid-template-columns: 1fr;
    }

    #displayNote {
        white-space: normal;
    }

    .footer-side {
        justify-items: start;
    }

    #systemBy {
        white-space: normal;
    }

    .clock-block {
        justify-content: flex-start;
    }
}

/* Premium Masjid Board Redesign */
.tv-loader {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 18px;
    color: #f9f0dc;
    background:
        radial-gradient(circle at 50% 34%, rgba(213, 176, 93, .18), transparent 32%),
        linear-gradient(135deg, #030907, #071814 52%, #09101b);
    transition: opacity .55s ease, visibility .55s ease;
}

.is-loaded .tv-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-mark {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid rgba(243, 211, 142, .28);
    background: rgba(255, 255, 255, .045);
    box-shadow: 0 28px 90px rgba(0, 0, 0, .34);
}

.loader-mark span {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 4px solid rgba(243, 211, 142, .18);
    border-top-color: #f3d38e;
    animation: loaderSpin .9s linear infinite;
}

@keyframes loaderSpin {
    to {
        transform: rotate(360deg);
    }
}

.tv-loader h2 {
    margin: 6px 0 0;
    font-size: clamp(30px, 3vw, 54px);
    letter-spacing: -.04em;
}

.tv-loader p {
    margin: 0;
    color: rgba(249, 240, 220, .62);
    font-size: clamp(16px, 1.4vw, 24px);
    font-weight: 750;
}

.is-loading .tv-stage,
.is-loading .ambient {
    opacity: 0;
}

.tv-body {
    background:
        radial-gradient(circle at 18% 0%, rgba(202, 163, 76, .18), transparent 30%),
        radial-gradient(circle at 82% 18%, rgba(15, 111, 91, .18), transparent 34%),
        linear-gradient(135deg, #030806 0%, #071914 48%, #08101a 100%);
}

.tv-body::before {
    background:
        linear-gradient(rgba(243, 211, 142, .018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(243, 211, 142, .018) 1px, transparent 1px);
    background-size: 92px 92px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.82), rgba(0,0,0,.14));
}

.ambient {
    opacity: .16;
    filter: blur(110px);
}

.tv-stage {
    padding: clamp(24px, 2.4vw, 44px);
    gap: clamp(12px, 1.25vw, 20px);
    grid-template-rows: auto minmax(260px, 1fr) auto auto auto auto;
}

.tv-stage::before {
    content: "";
    position: absolute;
    inset: clamp(12px, 1.3vw, 22px);
    border: 1px solid rgba(243, 211, 142, .12);
    border-radius: clamp(28px, 3vw, 48px);
    pointer-events: none;
}

.tv-hero {
    align-items: center;
    padding: clamp(12px, 1vw, 18px) clamp(16px, 1.6vw, 26px);
    border: 1px solid rgba(243, 211, 142, .1);
    border-radius: 28px;
    background: rgba(255, 255, 255, .035);
    backdrop-filter: blur(16px);
}

.tv-logo {
    border-radius: 24px;
    background: linear-gradient(135deg, #f4dc9b, #c99439);
    box-shadow: none;
}

.mosque-identity h1 {
    font-size: clamp(38px, 4.2vw, 74px);
    letter-spacing: -.055em;
}

.mosque-identity p,
.clock-block p {
    color: rgba(249, 240, 220, .58);
}

#screenStatus {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#screenStatus::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7ee2aa;
    box-shadow: 0 0 0 5px rgba(126, 226, 170, .12);
}

#liveClock {
    color: #f3d38e;
    font-size: clamp(44px, 5vw, 92px);
}

.focus-row {
    grid-template-columns: .92fr 1.08fr;
    gap: clamp(14px, 1.4vw, 24px);
}

.next-prayer,
.countdown-panel {
    border: 1px solid rgba(243, 211, 142, .14);
    border-radius: 34px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .028)),
        radial-gradient(circle at 50% 0%, rgba(243, 211, 142, .12), transparent 50%);
    box-shadow: none;
}

.next-prayer h2 {
    color: #fff8e8;
    font-size: clamp(82px, 9vw, 168px);
}

#countdown {
    color: #f3d38e;
    font-size: clamp(84px, 10vw, 188px);
    text-shadow: none;
}

.prayer-line {
    border-radius: 24px;
    border-color: rgba(243, 211, 142, .1);
    background: rgba(255, 255, 255, .04);
    min-height: clamp(128px, 12vh, 168px);
}

.prayer-line strong {
    color: #fff8e8;
}

.prayer-line span {
    color: rgba(249, 240, 220, .55);
}

.prayer-line .iqamah {
    color: #f5d890;
}

.prayer-line.active {
    background:
        linear-gradient(135deg, rgba(243, 211, 142, .18), rgba(255, 255, 255, .055));
    border-color: rgba(243, 211, 142, .42);
}

.ticker {
    border-radius: 18px;
    border-color: rgba(243, 211, 142, .1);
    background: rgba(255, 255, 255, .038);
}

#systemBy {
    color: rgba(249, 240, 220, .46);
}

@media (max-width: 1200px) {
    .prayer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 860px) {
    .focus-row {
        grid-template-columns: 1fr;
    }

    .tv-hero,
    .tv-footer {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }

    .clock-block {
        justify-content: flex-start;
        text-align: left;
    }

    .prayer-grid {
        grid-template-columns: 1fr 1fr;
    }
}
