/* Base */
:root{
    --bg: #08101f;
    --bg-soft: #0d172b;
    --panel: rgba(12, 20, 36, 0.78);
    --panel-strong: rgba(15, 24, 43, 0.92);
    --text: #f4f8ff;
    --muted: #a5b3cb;
    --line: rgba(255,255,255,0.08);
    --line-strong: rgba(255,255,255,0.14);
    --primary: #66d9ff;
    --primary-2: #8b98ff;
    --accent: #66d9ff;
    --accent-2: #8b98ff;
    --good: #22c55e;
    --warn: #f59e0b;
    --danger: #fb7185;
    --shadow: 0 20px 70px rgba(0,0,0,.35);
    --radius: 24px;
    --radius-sm: 16px;
    --radius-xs: 12px;
}

:root[data-theme="light"],
html[data-theme="light"]{
    --bg:#f3f7fb;
    --bg-soft:#ffffff;
    --panel:rgba(255,255,255,.88);
    --panel-strong:rgba(255,255,255,.98);
    --text:#102033;
    --muted:#607086;
    --line:rgba(19,38,64,.12);
    --line-strong:rgba(19,38,64,.2);
    --primary:#0ea5e9;
    --primary-2:#6366f1;
    --accent:#0ea5e9;
    --accent-2:#6366f1;
    --shadow:0 22px 70px rgba(30,64,105,.14);
}

:root[data-theme="dark"],
html[data-theme="dark"]{
    --bg: #08101f;
    --bg-soft: #0d172b;
    --panel: rgba(12, 20, 36, 0.78);
    --panel-strong: rgba(15, 24, 43, 0.92);
    --text: #f4f8ff;
    --muted: #a5b3cb;
    --line: rgba(255,255,255,0.08);
    --line-strong: rgba(255,255,255,0.14);
    --primary: #66d9ff;
    --primary-2: #8b98ff;
    --accent: #66d9ff;
    --accent-2: #8b98ff;
    --shadow: 0 20px 70px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
    margin:0;
    min-height:100vh;
    color:var(--text);
    background:
        radial-gradient(circle at top right, rgba(101,217,255,.12), transparent 30%),
        radial-gradient(circle at bottom left, rgba(139,152,255,.18), transparent 28%),
        linear-gradient(145deg,#06101f 0%,#0b1324 44%,#111c34 100%);
    font-family:Tahoma, Arial, sans-serif;
}
body::before{
    content:"";
    position:fixed;
    inset:0;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size:32px 32px;
    pointer-events:none;
    mask-image:linear-gradient(180deg, rgba(0,0,0,.5), transparent);
}
.hidden{display:none !important}
.muted{color:var(--muted)}
.eyebrow{
    color:#9ddff3;
    font-size:13px;
    font-weight:700;
    letter-spacing:.04em;
}
.glass-card{
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    backdrop-filter:blur(18px);
}
.stack{display:flex;flex-direction:column}
.gap-12{gap:12px}
.panel{
    background:rgba(255,255,255,.035);
    border:1px solid var(--line);
    border-radius:22px;
    padding:18px;
}
.mini-panel{padding:16px}
.panel-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}
.panel-head h3{
    margin:0;
    font-size:16px;
}
.field{
    display:flex;
    flex-direction:column;
    gap:8px;
}
.field span{
    font-size:14px;
    color:#d8e3f6;
}
.field input,
.field textarea,
.field select{
    width:100%;
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
    color:var(--text);
    border-radius:16px;
    padding:14px 16px;
    outline:none;
    font:inherit;
    transition:.2s ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus{
    border-color:rgba(102,217,255,.55);
    box-shadow:0 0 0 3px rgba(102,217,255,.12);
}
.field textarea{resize:vertical}
.primary-btn,
.ghost-btn,
.link-btn,
.icon-btn,
.chip-link{
    border:none;
    cursor:pointer;
    font:inherit;
    transition:.2s ease;
}
.primary-btn{
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    color:#07121d;
    font-weight:900;
    padding:13px 18px;
    border-radius:16px;
    text-decoration:none;
}
.primary-btn:hover{transform:translateY(-1px);filter:brightness(1.04)}
.ghost-btn,
.chip-link{
    background:rgba(255,255,255,.04);
    color:var(--text);
    border:1px solid var(--line);
    padding:11px 14px;
    border-radius:14px;
    text-decoration:none;
}
.ghost-btn:hover,
.chip-link:hover{
    background:rgba(255,255,255,.08);
}
.link-btn{
    background:transparent;
    color:#9ee6ff;
    padding:0;
}
.icon-btn{
    width:42px;
    height:42px;
    border-radius:14px;
    background:rgba(255,255,255,.05);
    color:var(--text);
    border:1px solid var(--line);
    font-size:24px;
    line-height:1;
}
.message{
    min-height:22px;
    font-size:14px;
    color:#ffd0d7;
}
.message.success{color:#9cf0c4}
.message.error{color:#ffd0d7}
.hint-box{
    background:rgba(102,217,255,.08);
    border:1px solid rgba(102,217,255,.2);
    color:#d8f4ff;
    border-radius:16px;
    padding:12px 14px;
    font-size:14px;
}
.form-row{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}
.form-row-inline{
    grid-template-columns:1fr;
}
.check-control{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 4px;
}
.check-control input{width:18px;height:18px}
.form-actions{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.danger-text{color:#ffd1d8}
.danger-mode{
    background:linear-gradient(135deg,#ff839c,#ffb482);
}
.brand-chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    width:max-content;
    padding:9px 12px;
    border-radius:999px;
    background:rgba(102,217,255,.09);
    border:1px solid rgba(102,217,255,.2);
    color:#bfefff;
    font-weight:700;
    font-size:13px;
}
.login-overlay{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:24px;
}
.auth-card{
    width:min(470px,100%);
    padding:28px;
}
.auth-card h1{margin:10px 0 10px;font-size:32px}

/* App layout */
.app-shell{
    display:grid;
    grid-template-columns:340px minmax(0,1fr);
    gap:22px;
    padding:22px;
}
.sidebar{
    display:flex;
    flex-direction:column;
    gap:18px;
}
.sidebar-top h2{
    margin:10px 0 8px;
    font-size:28px;
}
.main-content{
    display:flex;
    flex-direction:column;
    gap:18px;
}
.toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:20px 22px;
}
.toolbar-left,
.toolbar-right{
    display:flex;
    align-items:center;
    gap:14px;
    flex-wrap:wrap;
}
.toolbar h1{
    margin:4px 0 0;
    font-size:30px;
}
.inline-control{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    background:rgba(255,255,255,.04);
    border:1px solid var(--line);
    border-radius:14px;
}
.inline-control select{
    background:transparent;
    border:none;
    color:var(--text);
    font:inherit;
    outline:none;
}
.calendar-wrapper{
    padding:18px;
    min-height:calc(100vh - 160px);
}
.year-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
}
.month-card{
    border:1px solid var(--line);
    background:rgba(255,255,255,.03);
    border-radius:22px;
    padding:14px;
    min-height:320px;
}
.month-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding-bottom:10px;
    border-bottom:1px solid var(--line);
    margin-bottom:12px;
}
.month-head h3{margin:0;font-size:18px}
.weekdays,
.days-grid{
    display:grid;
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:8px;
}
.weekday{
    text-align:center;
    color:var(--muted);
    font-size:12px;
    padding-bottom:4px;
}
.day-cell{
    position:relative;
    min-height:76px;
    border-radius:18px;
    border:1px solid transparent;
    background:rgba(255,255,255,.03);
    padding:10px 8px 8px;
    cursor:pointer;
    transition:.2s ease;
    overflow:hidden;
}
.day-cell:hover{
    transform:translateY(-1px);
    border-color:rgba(102,217,255,.22);
    background:rgba(255,255,255,.055);
}
.day-cell.empty{
    visibility:hidden;
}
.day-cell.today{
    border-color:rgba(102,217,255,.55);
    box-shadow:inset 0 0 0 1px rgba(102,217,255,.35);
}
.day-cell.has-tasks{
    background:linear-gradient(180deg, rgba(102,217,255,.08), rgba(255,255,255,.03));
}
.day-number{
    font-weight:800;
    font-size:14px;
}
.day-task-count{
    position:absolute;
    top:8px;
    left:8px;
    min-width:24px;
    height:24px;
    display:grid;
    place-items:center;
    padding:0 6px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    background:rgba(102,217,255,.18);
    color:#d8f7ff;
}
.day-preview{
    margin-top:8px;
    display:flex;
    flex-direction:column;
    gap:4px;
}
.day-preview-item{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:11px;
    color:#d4e2fb;
    padding:4px 6px;
    border-radius:10px;
    background:rgba(255,255,255,.05);
    border:none;
    text-align:right;
    cursor:pointer;
}
.day-preview-item:hover{background:rgba(255,255,255,.09)}
.todo-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}
.empty-state{
    color:var(--muted);
    text-align:center;
    padding:24px 10px;
}
.task-card{
    border:1px solid var(--line);
    background:rgba(255,255,255,.03);
    border-radius:18px;
    padding:14px;
}
.task-card-top{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin-bottom:8px;
}
.task-priority{
    width:max-content;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
}
.priority-high{background:rgba(251,113,133,.13);color:#ffc7d0}
.priority-medium{background:rgba(245,158,11,.13);color:#ffe0ab}
.priority-low{background:rgba(34,197,94,.13);color:#bef3cf}
.task-title{
    margin:0 0 6px;
    font-size:15px;
}
.task-desc{
    margin:0 0 10px;
    color:var(--muted);
    font-size:13px;
    line-height:1.7;
}
.task-meta{
    color:#d8e5fb;
    font-size:12px;
    line-height:1.8;
}
.task-complete{
    opacity:.62;
    text-decoration:line-through;
}
.user-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.user-card strong{display:block}
.user-card small{display:block;color:var(--muted);margin-top:6px}
.chips{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}

/* Modal */
.modal{
    position:fixed;
    inset:0;
    z-index:20;
}
.modal-backdrop{
    position:absolute;
    inset:0;
    background:rgba(3,8,15,.7);
    backdrop-filter:blur(6px);
}
.modal-card{
    position:relative;
    width:min(640px,calc(100% - 24px));
    margin:40px auto;
    z-index:1;
    border-radius:28px;
    border:1px solid var(--line);
    background:var(--panel-strong);
    box-shadow:var(--shadow);
    padding:22px;
}
.modal-head{
    display:flex;
    align-items:start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:16px;
}
.modal-head h3{margin:4px 0 0;font-size:28px}

/* Admin */
.admin-shell{
    padding:22px;
    display:flex;
    flex-direction:column;
    gap:18px;
}
.admin-toolbar{padding:20px 22px}
.stats-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px;
}
.stat-card{
    padding:22px;
    display:flex;
    flex-direction:column;
    gap:10px;
}
.stat-card span{color:var(--muted);font-size:14px}
.stat-card strong{font-size:36px}
.admin-grid{
    display:grid;
    grid-template-columns:1.05fr 1.4fr;
    gap:18px;
}
.admin-panel{
    padding:18px;
}
.admin-panel-wide{
    grid-column:1 / -1;
}
.table-wrap{
    overflow:auto;
    border:1px solid var(--line);
    border-radius:18px;
}
.data-table{
    width:100%;
    border-collapse:collapse;
    min-width:720px;
}
.data-table th,
.data-table td{
    padding:14px 12px;
    border-bottom:1px solid var(--line);
    text-align:right;
    vertical-align:top;
}
.data-table th{
    background:rgba(255,255,255,.03);
    color:#dbe8ff;
    font-size:13px;
}
.data-table td{
    font-size:14px;
    color:#edf4ff;
}
.table-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}
.badge{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:7px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    border:1px solid var(--line);
}
.badge.admin{background:rgba(102,217,255,.08);color:#bdefff}
.badge.user{background:rgba(255,255,255,.05);color:#e7efff}
.badge.active{background:rgba(34,197,94,.1);color:#bff3d2}
.badge.inactive{background:rgba(251,113,133,.11);color:#ffc8d1}
.badge.done{background:rgba(34,197,94,.1);color:#bff3d2}
.badge.open{background:rgba(245,158,11,.12);color:#ffe0ab}

/* Utilities */
@media (max-width: 1350px){
    .year-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 1100px){
    .app-shell{
        grid-template-columns:1fr;
    }
    .sidebar{
        order:2;
    }
    .main-content{
        order:1;
    }
    .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .admin-grid{grid-template-columns:1fr}
}
@media (max-width: 800px){
    .toolbar{
        flex-direction:column;
        align-items:flex-start;
    }
    .year-grid{grid-template-columns:1fr}
    .form-row{grid-template-columns:1fr}
    .user-card{
        flex-direction:column;
        align-items:flex-start;
    }
    .stats-grid{grid-template-columns:1fr}
}

.small-action{padding:8px 10px;border-radius:12px;font-size:12px}

/* Theme switcher and light mode */
body[data-theme="light"]{
    --bg:#f3f7fb;
    --bg-soft:#ffffff;
    --panel:rgba(255,255,255,.86);
    --panel-strong:rgba(255,255,255,.96);
    --text:#102033;
    --muted:#607086;
    --line:rgba(19,38,64,.12);
    --line-strong:rgba(19,38,64,.2);
    --primary:#0ea5e9;
    --primary-2:#6366f1;
    --shadow:0 22px 70px rgba(30,64,105,.14);
    color:var(--text);
    background:
        radial-gradient(circle at top right, rgba(14,165,233,.16), transparent 30%),
        radial-gradient(circle at bottom left, rgba(99,102,241,.13), transparent 28%),
        linear-gradient(145deg,#f7fbff 0%,#eef5fc 50%,#f8fbff 100%);
}
body[data-theme="light"]::before{
    background-image:
        linear-gradient(rgba(15,23,42,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,.035) 1px, transparent 1px);
}
body[data-theme="light"] .eyebrow,
body[data-theme="light"] .link-btn{color:#0369a1}
body[data-theme="light"] .field span,
body[data-theme="light"] .data-table th,
body[data-theme="light"] .task-meta,
body[data-theme="light"] .day-preview-item{color:#25364d}
body[data-theme="light"] .hint-box{
    background:rgba(14,165,233,.09);
    border-color:rgba(14,165,233,.22);
    color:#16415b;
}
body[data-theme="light"] .brand-chip{
    background:rgba(14,165,233,.09);
    border-color:rgba(14,165,233,.2);
    color:#075985;
}
body[data-theme="light"] .primary-btn{color:#fff}
body[data-theme="light"] .day-task-count{color:#075985;background:rgba(14,165,233,.15)}
body[data-theme="light"] .priority-high{color:#9f1239}
body[data-theme="light"] .priority-medium{color:#92400e}
body[data-theme="light"] .priority-low{color:#166534}
body[data-theme="light"] .badge.admin{color:#075985}
body[data-theme="light"] .badge.user{color:#334155}
body[data-theme="light"] .badge.active,
body[data-theme="light"] .badge.done{color:#166534}
body[data-theme="light"] .badge.inactive{color:#9f1239}
body[data-theme="light"] .badge.open{color:#92400e}
body[data-theme="light"] .danger-text{color:#be123c}
body[data-theme="light"] .message.error,
body[data-theme="light"] .message{color:#be123c}
body[data-theme="light"] .message.success{color:#15803d}
body[data-theme="light"] .modal-backdrop{background:rgba(148,163,184,.45)}

.top-line{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
}
.theme-switcher{
    display:flex;
    align-items:center;
    gap:8px;
    padding:9px 12px;
    border-radius:14px;
    background:rgba(255,255,255,.04);
    border:1px solid var(--line);
    color:var(--text);
}
.theme-switcher.compact{padding:7px 10px;font-size:13px}
.theme-switcher select,
.inline-control select,
.field select{
    color:var(--text);
    background:var(--panel-strong);
}
.theme-switcher select{
    border:0;
    outline:0;
    font:inherit;
    min-width:70px;
}
.hint-box a{color:inherit;font-weight:900}
.admin-login-layout{
    grid-template-columns:minmax(300px,470px) minmax(320px,620px);
    gap:20px;
    align-items:center;
}
.db-setup-card{width:min(620px,100%);padding:24px}
.db-setup-card h3{margin:4px 0 0;font-size:24px}
.db-grid-first{margin-bottom:0}
.small-copy{margin:6px 0 0;font-size:13px}

.day-cell{
    color:var(--text);
    font:inherit;
    text-align:right;
    display:block;
}
.day-cell:focus-visible{
    outline:3px solid rgba(102,217,255,.28);
    outline-offset:2px;
}
.day-preview-item{
    font:inherit;
    color:var(--text);
}
.field input,
.field textarea,
.field select{
    color:var(--text);
    caret-color:var(--primary);
}
.field input::placeholder,
.field textarea::placeholder{color:var(--muted)}

@media (max-width: 900px){
    .admin-login-layout{grid-template-columns:1fr;align-items:start}
}

/* Calendar view improvements */
.calendar-message{
    min-height:0;
    margin:0 0 12px;
}
.month-grid-single{
    grid-template-columns:1fr !important;
}
.calendar-wrapper.monthly-mode{
    min-height:calc(100vh - 150px);
}
.calendar-wrapper.monthly-mode .month-card{
    min-height:calc(100vh - 205px);
}
.month-card-large{
    padding:18px;
}
.month-card-large .month-head h3{
    font-size:26px;
}
.month-card-large .weekday{
    font-size:14px;
    padding:8px 0;
}
.month-card-large .days-grid{
    gap:10px;
}
.month-card-large .day-cell{
    min-height:128px;
    padding:12px;
}
.month-card-large .day-number{
    font-size:18px;
}
.month-card-large .day-preview-item{
    font-size:13px;
    padding:6px 8px;
}
.day-preview-item.completed,
.day-task-row.is-completed h4{
    opacity:.62;
    text-decoration:line-through;
}
.day-more{
    color:var(--muted);
    font-size:11px;
    padding:3px 4px;
}

/* Day details modal */
.modal-card-wide{
    width:min(980px,calc(100% - 28px));
    max-height:calc(100vh - 54px);
    overflow:auto;
}
.modal-subtitle{
    margin:8px 0 0;
    line-height:1.8;
}
.day-modal-actions{
    display:flex;
    justify-content:flex-start;
    margin:0 0 16px;
}
.day-task-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}
.day-task-row{
    display:grid;
    grid-template-columns:120px minmax(0,1fr) auto;
    gap:14px;
    align-items:start;
    border:1px solid var(--line);
    background:rgba(255,255,255,.035);
    border-radius:20px;
    padding:14px;
}
.day-task-check{
    display:flex;
    align-items:center;
    gap:9px;
    font-weight:800;
    color:var(--text);
    cursor:pointer;
    padding-top:5px;
}
.day-task-check input{
    width:20px;
    height:20px;
    accent-color:var(--primary);
}
.day-task-body h4{
    margin:0 0 6px;
    font-size:17px;
}
.day-task-body p{
    margin:0 0 8px;
    color:var(--muted);
    line-height:1.8;
}
.day-task-meta{
    color:#d8e5fb;
    font-size:12px;
    line-height:1.8;
}
.day-task-actions{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

/* Stronger light theme support */
html[data-theme="light"] body,
body[data-theme="light"]{
    color:var(--text);
    background:
        radial-gradient(circle at top right, rgba(14,165,233,.16), transparent 30%),
        radial-gradient(circle at bottom left, rgba(99,102,241,.13), transparent 28%),
        linear-gradient(145deg,#f7fbff 0%,#eef5fc 50%,#f8fbff 100%);
}
html[data-theme="light"] .glass-card,
body[data-theme="light"] .glass-card{
    background:rgba(255,255,255,.86);
    border-color:rgba(19,38,64,.12);
}
html[data-theme="light"] .panel,
html[data-theme="light"] .month-card,
html[data-theme="light"] .day-cell,
html[data-theme="light"] .task-card,
html[data-theme="light"] .day-task-row,
body[data-theme="light"] .panel,
body[data-theme="light"] .month-card,
body[data-theme="light"] .day-cell,
body[data-theme="light"] .task-card,
body[data-theme="light"] .day-task-row{
    background:rgba(255,255,255,.62);
    border-color:rgba(19,38,64,.12);
}
html[data-theme="light"] .day-cell:hover,
body[data-theme="light"] .day-cell:hover{
    background:rgba(255,255,255,.9);
    border-color:rgba(14,165,233,.28);
}
html[data-theme="light"] .day-cell.has-tasks,
body[data-theme="light"] .day-cell.has-tasks{
    background:linear-gradient(180deg, rgba(14,165,233,.12), rgba(255,255,255,.7));
}
html[data-theme="light"] .day-task-meta,
body[data-theme="light"] .day-task-meta{
    color:#334155;
}
html[data-theme="light"] .ghost-btn,
html[data-theme="light"] .chip-link,
html[data-theme="light"] .inline-control,
html[data-theme="light"] .theme-switcher,
body[data-theme="light"] .ghost-btn,
body[data-theme="light"] .chip-link,
body[data-theme="light"] .inline-control,
body[data-theme="light"] .theme-switcher{
    background:rgba(255,255,255,.72);
    border-color:rgba(19,38,64,.13);
}
html[data-theme="light"] .field input,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .field select,
html[data-theme="light"] .theme-switcher select,
html[data-theme="light"] .inline-control select,
body[data-theme="light"] .field input,
body[data-theme="light"] .field textarea,
body[data-theme="light"] .field select,
body[data-theme="light"] .theme-switcher select,
body[data-theme="light"] .inline-control select{
    background:#ffffff;
    color:#102033;
    border-color:rgba(19,38,64,.14);
}
html[data-theme="light"] .modal-card,
body[data-theme="light"] .modal-card{
    background:rgba(255,255,255,.97);
}

@media (max-width: 800px){
    .month-card-large .day-cell{min-height:96px}
    .day-task-row{grid-template-columns:1fr}
    .day-task-actions{justify-content:flex-start}
    .modal-card-wide{margin:18px auto;max-height:calc(100vh - 36px)}
}


/* v3 hard fixes: theme + monthly layout */
html[data-theme="light"],
html[data-theme="light"] body,
body[data-theme="light"]{
    color:var(--text) !important;
    background:
        radial-gradient(circle at top right, rgba(14,165,233,.16), transparent 30%),
        radial-gradient(circle at bottom left, rgba(99,102,241,.13), transparent 28%),
        linear-gradient(145deg,#f7fbff 0%,#eef5fc 50%,#f8fbff 100%) !important;
}
html[data-theme="dark"],
html[data-theme="dark"] body,
body[data-theme="dark"]{
    color:var(--text);
    background:
        radial-gradient(circle at top right, rgba(101,217,255,.12), transparent 30%),
        radial-gradient(circle at bottom left, rgba(139,152,255,.18), transparent 28%),
        linear-gradient(145deg,#06101f 0%,#0b1324 44%,#111c34 100%);
}
html[data-theme="light"] body::before,
body[data-theme="light"]::before{
    background-image:
        linear-gradient(rgba(15,23,42,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,.035) 1px, transparent 1px);
}
html[data-theme="light"] .glass-card,
html[data-theme="light"] .panel,
html[data-theme="light"] .month-card,
html[data-theme="light"] .day-cell,
html[data-theme="light"] .task-card,
html[data-theme="light"] .modal-card,
html[data-theme="light"] .day-task-row{
    color:#102033;
}
.year-grid.month-grid-single,
.calendar-wrapper.monthly-mode .year-grid{
    display:grid;
    grid-template-columns:minmax(0,1fr) !important;
}
.calendar-wrapper.monthly-mode .month-card-large,
.calendar-wrapper.monthly-mode .month-card{
    width:100%;
    min-height:calc(100vh - 210px);
}
.calendar-wrapper.monthly-mode .days-grid{
    grid-auto-rows:minmax(118px, 1fr);
}
.calendar-wrapper.monthly-mode .day-cell{
    min-height:118px;
}

/* v4: compact calendar counters + editable task date + collaborators */
.day-cell{
    height:76px;
    min-height:76px;
}
.calendar-wrapper.monthly-mode .day-cell,
.month-card-large .day-cell{
    height:118px;
    min-height:118px;
}
.day-task-count{
    box-shadow:0 8px 18px rgba(0,0,0,.16);
}
.date-choice-box,
.collab-box{
    border:1px solid var(--line);
    background:rgba(255,255,255,.03);
    border-radius:18px;
    padding:12px;
}
.date-fields{
    display:grid;
    grid-template-columns:1fr 1fr 1fr;
    gap:8px;
}
.mini-date-field input,
.mini-date-field select{
    padding:12px 10px;
}
.collab-results{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:8px;
}
.collab-result{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.045);
    color:var(--text);
    border-radius:14px;
    padding:10px 12px;
    font:inherit;
    text-align:right;
    cursor:pointer;
}
.collab-result:hover{
    background:rgba(102,217,255,.10);
    border-color:rgba(102,217,255,.24);
}
.collab-result span,
.search-empty,
.selected-empty{
    color:var(--muted);
    font-size:12px;
}
.selected-collaborators{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:10px;
}
.collab-chip{
    border:1px solid rgba(102,217,255,.25);
    background:rgba(102,217,255,.10);
    color:var(--text);
    border-radius:999px;
    padding:8px 12px;
    font:inherit;
    cursor:pointer;
}
.collab-chip:hover{
    background:rgba(251,113,133,.12);
    border-color:rgba(251,113,133,.26);
}
html[data-theme="light"] .date-choice-box,
html[data-theme="light"] .collab-box,
body[data-theme="light"] .date-choice-box,
body[data-theme="light"] .collab-box{
    background:rgba(255,255,255,.68);
    border-color:rgba(19,38,64,.12);
}
html[data-theme="light"] .collab-result,
body[data-theme="light"] .collab-result{
    background:#fff;
    border-color:rgba(19,38,64,.12);
    color:#102033;
}
html[data-theme="light"] .collab-chip,
body[data-theme="light"] .collab-chip{
    color:#075985;
    background:rgba(14,165,233,.12);
}
@media (max-width: 720px){
    .date-fields{grid-template-columns:1fr}
    .collab-result{align-items:flex-start;flex-direction:column}
}

/* v6: keep task modal actions reachable + keep day counters away from day numbers */
.modal-card{
    max-height:calc(100vh - 48px);
    overflow-y:auto;
    overscroll-behavior:contain;
}
.modal-card .form-actions{
    position:sticky;
    bottom:0;
    z-index:6;
    margin-top:10px;
    padding:12px 0 2px;
    background:linear-gradient(180deg, rgba(0,0,0,0), var(--panel-strong) 22%, var(--panel-strong));
    border-top:1px solid var(--line);
}
.modal-card .message{
    margin-bottom:4px;
}
.day-number{
    position:relative;
    z-index:2;
    display:block;
    text-align:right;
    padding-left:34px;
    line-height:1.4;
}
.day-task-count{
    top:auto;
    left:8px;
    bottom:8px;
    z-index:3;
}
.month-card-large .day-task-count,
.calendar-wrapper.monthly-mode .day-task-count{
    bottom:10px;
    left:10px;
}
html[data-theme="light"] .modal-card .form-actions,
body[data-theme="light"] .modal-card .form-actions{
    background:linear-gradient(180deg, rgba(255,255,255,0), var(--panel-strong) 22%, var(--panel-strong));
}
@media (max-width:720px){
    .modal-card{
        width:calc(100% - 16px);
        margin:8px auto;
        max-height:calc(100vh - 16px);
        padding:16px;
        border-radius:22px;
    }
    .modal-card .form-actions{
        padding-bottom:6px;
    }
}

/* v7: weekly, daily timeline, task time, and smart dashboard */
.date-fields{
    grid-template-columns:repeat(4,minmax(0,1fr));
}
.time-pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:30px;
    padding:6px 10px;
    border-radius:999px;
    border:1px solid rgba(102,217,255,.22);
    background:rgba(102,217,255,.08);
    color:#c9f3ff;
    font-size:12px;
    font-weight:900;
}
.week-view-grid,
.day-view-grid,
.dashboard-grid{
    display:block !important;
}
.calendar-wrapper.weekly-mode,
.calendar-wrapper.daily-mode,
.calendar-wrapper.dashboard-mode{
    min-height:calc(100vh - 150px);
}
.view-hero,
.dashboard-hero{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:22px;
    border:1px solid var(--line);
    border-radius:24px;
    background:linear-gradient(135deg, rgba(102,217,255,.10), rgba(139,152,255,.07));
    margin-bottom:16px;
}
.view-hero h2,
.dashboard-hero h2{
    margin:6px 0 8px;
    font-size:28px;
}
.view-hero p,
.dashboard-hero p{margin:0;line-height:1.8}
.week-board,
.day-planner,
.dashboard-board{
    display:flex;
    flex-direction:column;
    gap:16px;
}
.week-columns{
    display:grid;
    grid-template-columns:repeat(7,minmax(190px,1fr));
    gap:12px;
    overflow-x:auto;
    padding-bottom:6px;
}
.week-day-column{
    min-height:520px;
    border:1px solid var(--line);
    border-radius:22px;
    padding:12px;
    background:rgba(255,255,255,.032);
    transition:.2s ease;
    cursor:pointer;
}
.week-day-column:hover,
.week-day-column.selected-column{
    border-color:rgba(102,217,255,.34);
    background:rgba(102,217,255,.06);
}
.week-day-column.today-column{
    box-shadow:inset 0 0 0 1px rgba(102,217,255,.35);
}
.week-day-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    padding-bottom:10px;
    margin-bottom:10px;
    border-bottom:1px solid var(--line);
}
.week-day-head strong,
.week-day-head span{display:block}
.week-day-head strong{font-size:15px}
.week-day-head span{margin-top:5px;color:var(--muted);font-size:12px;line-height:1.7}
.week-day-tasks,
.dashboard-task-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}
.mini-empty,
.compact-empty{
    padding:16px 10px;
    color:var(--muted);
    text-align:center;
    border:1px dashed var(--line-strong);
    border-radius:16px;
    background:rgba(255,255,255,.025);
}
.compact-task-card{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:16px;
    background:rgba(255,255,255,.035);
    cursor:pointer;
    transition:.2s ease;
}
.compact-task-card:hover{
    transform:translateY(-1px);
    border-color:rgba(102,217,255,.28);
    background:rgba(255,255,255,.06);
}
.compact-task-card strong,
.compact-task-card small{display:block}
.compact-task-card strong{font-size:14px;line-height:1.7}
.compact-task-card small{margin-top:4px;color:var(--muted);font-size:12px;line-height:1.7}
.compact-task-card.is-completed strong{
    opacity:.62;
    text-decoration:line-through;
}
.section-title-line{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:12px;
}
.section-title-line h3{margin:0;font-size:18px}
.section-title-line span{color:var(--muted);font-size:13px}
.untimed-strip,
.daily-timeline-card,
.dash-panel{
    border:1px solid var(--line);
    background:rgba(255,255,255,.032);
    border-radius:24px;
    padding:16px;
}
.untimed-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}
.timeline-scroll{
    position:relative;
    max-height:68vh;
    min-height:560px;
    overflow-y:auto;
    border:1px solid var(--line);
    border-radius:22px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,.035));
}
.timeline-canvas{
    position:relative;
    min-width:760px;
}
.timeline-hour-row{
    position:absolute;
    right:0;
    left:0;
    height:1px;
    display:grid;
    grid-template-columns:76px minmax(0,1fr);
    align-items:center;
    pointer-events:none;
}
.timeline-hour-row span{
    color:var(--muted);
    font-size:12px;
    font-weight:800;
    transform:translateY(-50%);
    padding-right:14px;
}
.timeline-hour-row i{
    display:block;
    height:1px;
    background:var(--line);
}
.timeline-task{
    position:absolute;
    right:92px;
    left:18px;
    min-height:52px;
    display:grid;
    grid-template-columns:70px minmax(0,1fr) auto;
    align-items:start;
    gap:12px;
    padding:12px;
    border:1px solid rgba(102,217,255,.22);
    border-radius:18px;
    background:linear-gradient(135deg, rgba(102,217,255,.13), rgba(139,152,255,.09));
    box-shadow:0 14px 36px rgba(0,0,0,.16);
}
.timeline-task h4{margin:0 0 4px;font-size:15px}
.timeline-task p{margin:0 0 4px;color:var(--muted);font-size:12px;line-height:1.6}
.timeline-task small{display:block;color:#d8e5fb;font-size:11px;line-height:1.6}
.timeline-task.is-completed h4{text-decoration:line-through;opacity:.62}
.timeline-task-time{
    width:max-content;
    padding:8px 10px;
    border-radius:999px;
    background:rgba(255,255,255,.10);
    border:1px solid var(--line);
    font-size:13px;
    font-weight:900;
    color:#d9f8ff;
}
.now-indicator{
    position:absolute;
    right:78px;
    left:0;
    height:2px;
    background:linear-gradient(90deg, transparent, var(--danger), var(--danger));
    z-index:5;
}
.now-indicator span{
    position:absolute;
    right:0;
    top:50%;
    transform:translateY(-50%);
    padding:4px 8px;
    border-radius:999px;
    background:rgba(251,113,133,.18);
    color:#ffd6dd;
    font-size:11px;
    font-weight:900;
}
.dashboard-rings{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}
.progress-ring,
.big-donut{
    --value:0%;
    width:104px;
    height:104px;
    border-radius:50%;
    display:grid;
    place-items:center;
    text-align:center;
    background:
        radial-gradient(circle at center, var(--panel-strong) 0 58%, transparent 59%),
        conic-gradient(var(--primary) var(--value), rgba(255,255,255,.08) 0);
    border:1px solid var(--line);
}
.progress-ring strong,
.progress-ring span,
.big-donut strong,
.big-donut span{display:block;grid-column:1;grid-row:1}
.progress-ring strong,
.big-donut strong{font-size:24px;align-self:center;margin-top:-12px}
.progress-ring span,
.big-donut span{font-size:11px;color:var(--muted);align-self:center;margin-top:34px;font-weight:800}
.kpi-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
}
.kpi-card{
    padding:16px;
    border:1px solid var(--line);
    border-radius:20px;
    background:rgba(255,255,255,.035);
}
.kpi-card span,
.kpi-card small{display:block;color:var(--muted)}
.kpi-card strong{display:block;font-size:32px;margin:8px 0 6px}
.dashboard-charts{
    display:grid;
    grid-template-columns:1.4fr 1fr 1fr;
    gap:14px;
}
.dashboard-lists{
    display:grid;
    grid-template-columns:1fr 1fr 1fr;
    gap:14px;
}
.monthly-panel{grid-column:span 1}
.month-bars{
    display:grid;
    grid-template-columns:repeat(12,minmax(32px,1fr));
    gap:10px;
    align-items:end;
    min-height:230px;
}
.month-bar-item{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:8px;
    min-width:0;
}
.bar-track{
    width:100%;
    height:150px;
    display:flex;
    align-items:flex-end;
    border-radius:999px;
    padding:4px;
    background:rgba(255,255,255,.045);
    border:1px solid var(--line);
}
.bar-track b{
    width:100%;
    display:block;
    min-height:6px;
    border-radius:999px;
    background:linear-gradient(180deg,var(--primary),var(--primary-2));
}
.month-bar-item span{font-size:11px;color:var(--muted);white-space:nowrap}
.month-bar-item small{font-size:12px;font-weight:900}
.priority-bars{
    display:flex;
    flex-direction:column;
    gap:14px;
    padding-top:10px;
}
.priority-row{
    display:grid;
    grid-template-columns:58px minmax(0,1fr) 34px;
    align-items:center;
    gap:10px;
}
.priority-row span,
.priority-row strong{font-size:13px}
.priority-row div{
    height:12px;
    background:rgba(255,255,255,.055);
    border-radius:999px;
    overflow:hidden;
}
.priority-row b{
    display:block;
    height:100%;
    min-width:4px;
    border-radius:999px;
    background:currentColor;
}
.status-panel{
    display:flex;
    flex-direction:column;
    align-items:center;
}
.big-donut{width:170px;height:170px;margin:10px auto}
.big-donut strong{font-size:38px;margin-top:-18px}
.big-donut span{margin-top:48px;font-size:13px}
.status-legend{
    width:100%;
    display:flex;
    justify-content:space-between;
    gap:10px;
    color:var(--muted);
    font-size:12px;
}
.user-workload,
.insight-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}
.workload-row{
    display:grid;
    grid-template-columns:150px minmax(0,1fr) 34px;
    gap:10px;
    align-items:center;
}
.workload-row strong,
.workload-row span{display:block}
.workload-row span{margin-top:4px;color:var(--muted);font-size:11px}
.workload-track{
    height:11px;
    background:rgba(255,255,255,.055);
    border-radius:999px;
    overflow:hidden;
}
.workload-track b{
    height:100%;
    display:block;
    border-radius:999px;
    background:linear-gradient(90deg,var(--primary),var(--primary-2));
}
.insight-list div{
    padding:12px;
    border:1px solid var(--line);
    border-radius:16px;
    background:rgba(255,255,255,.026);
}
.insight-list strong{display:block;margin-bottom:5px}
.insight-list p{margin:0;color:var(--muted);line-height:1.8;font-size:13px}
html[data-theme="light"] .time-pill,
body[data-theme="light"] .time-pill{
    color:#075985;
    background:rgba(14,165,233,.10);
}
html[data-theme="light"] .view-hero,
html[data-theme="light"] .dashboard-hero,
html[data-theme="light"] .week-day-column,
html[data-theme="light"] .untimed-strip,
html[data-theme="light"] .daily-timeline-card,
html[data-theme="light"] .dash-panel,
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .compact-task-card,
html[data-theme="light"] .mini-empty,
body[data-theme="light"] .view-hero,
body[data-theme="light"] .dashboard-hero,
body[data-theme="light"] .week-day-column,
body[data-theme="light"] .untimed-strip,
body[data-theme="light"] .daily-timeline-card,
body[data-theme="light"] .dash-panel,
body[data-theme="light"] .kpi-card,
body[data-theme="light"] .compact-task-card,
body[data-theme="light"] .mini-empty{
    background:rgba(255,255,255,.68);
    border-color:rgba(19,38,64,.12);
}
html[data-theme="light"] .timeline-scroll,
body[data-theme="light"] .timeline-scroll{
    background:#fff;
}
html[data-theme="light"] .timeline-task,
body[data-theme="light"] .timeline-task{
    background:linear-gradient(135deg, rgba(14,165,233,.12), rgba(99,102,241,.08));
    color:#102033;
    box-shadow:0 14px 36px rgba(30,64,105,.12);
}
html[data-theme="light"] .timeline-task small,
body[data-theme="light"] .timeline-task small{color:#334155}
html[data-theme="light"] .timeline-task-time,
body[data-theme="light"] .timeline-task-time{color:#075985;background:#fff}
@media (max-width: 1280px){
    .dashboard-charts{grid-template-columns:1fr 1fr}
    .dashboard-lists{grid-template-columns:1fr}
    .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 920px){
    .date-fields{grid-template-columns:1fr 1fr}
    .view-hero,
    .dashboard-hero{flex-direction:column;align-items:flex-start}
    .dashboard-charts{grid-template-columns:1fr}
    .week-columns{grid-template-columns:repeat(7, minmax(230px, 1fr))}
    .timeline-task{grid-template-columns:1fr;right:78px;left:12px}
    .timeline-canvas{min-width:640px}
    .month-bars{overflow-x:auto;grid-template-columns:repeat(12,44px)}
}
@media (max-width: 640px){
    .date-fields{grid-template-columns:1fr}
    .kpi-grid{grid-template-columns:1fr}
    .dashboard-rings{width:100%;justify-content:center}
    .workload-row{grid-template-columns:1fr}
    .timeline-scroll{min-height:520px}
}


/* Sticky top navigation + internal pages */
.sticky-topbar{
    grid-column:1/-1;
    position:sticky;
    top:14px;
    z-index:60;
    display:grid;
    grid-template-columns:auto minmax(260px,1fr) auto;
    align-items:center;
    gap:16px;
    padding:14px;
    background:rgba(12,20,36,.50);
    border-color:rgba(255,255,255,.18);
    box-shadow:0 18px 55px rgba(0,0,0,.26);
    backdrop-filter:blur(22px) saturate(160%);
}
html[data-theme="light"] .sticky-topbar,
:root[data-theme="light"] .sticky-topbar{
    background:rgba(255,255,255,.50);
    border-color:rgba(19,38,64,.14);
}
.topbar-menu-zone,
.topbar-planner,
.topbar-controls,
.topbar-brand{
    display:flex;
    align-items:center;
    gap:12px;
}
.topbar-menu-zone{min-width:220px}
.topbar-brand strong{
    display:block;
    white-space:nowrap;
}
.brand-orb{
    width:46px;
    height:46px;
    border-radius:18px;
    display:grid;
    place-items:center;
    font-weight:900;
    color:#07121d;
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    box-shadow:0 10px 28px rgba(102,217,255,.22);
}
.hamburger-btn{
    width:48px;
    height:48px;
    border-radius:16px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.06);
    display:grid;
    place-items:center;
    gap:4px;
    cursor:pointer;
    padding:11px;
    transition:.2s ease;
}
.hamburger-btn:hover{background:rgba(255,255,255,.1);transform:translateY(-1px)}
.hamburger-btn span{
    display:block;
    width:22px;
    height:2px;
    border-radius:999px;
    background:var(--text);
}
.topbar-planner{
    justify-content:center;
}
.topbar-year-title{
    text-align:center;
    min-width:220px;
}
.topbar-year-title h1{
    margin:2px 0 0;
    font-size:22px;
}
.topbar-controls{
    justify-content:flex-end;
    flex-wrap:wrap;
}
.topbar-controls .inline-control{
    min-width:118px;
}
.topbar-controls .primary-btn{
    white-space:nowrap;
}
.topbar-theme{
    min-width:96px;
}

.site-drawer{
    position:fixed;
    inset:0;
    z-index:100;
}
.drawer-backdrop{
    position:absolute;
    inset:0;
    background:rgba(2,8,23,.55);
    backdrop-filter:blur(8px);
}
.drawer-panel{
    position:absolute;
    top:0;
    right:0;
    width:min(390px,92vw);
    min-height:100%;
    padding:22px;
    background:var(--panel-strong);
    border-left:1px solid var(--line-strong);
    box-shadow:-24px 0 70px rgba(0,0,0,.38);
    display:flex;
    flex-direction:column;
    gap:10px;
    animation:drawerIn .22s ease both;
}
@keyframes drawerIn{
    from{transform:translateX(30px);opacity:.3}
    to{transform:translateX(0);opacity:1}
}
.drawer-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-bottom:10px;
}
.drawer-head h3{margin:4px 0 0;font-size:24px}
.drawer-link{
    width:100%;
    display:flex;
    align-items:center;
    gap:12px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.035);
    color:var(--text);
    border-radius:18px;
    padding:15px 16px;
    font:inherit;
    font-weight:800;
    cursor:pointer;
    text-align:right;
    transition:.2s ease;
}
.drawer-link span{
    width:34px;
    height:34px;
    border-radius:12px;
    display:grid;
    place-items:center;
    background:rgba(102,217,255,.10);
    color:#aeeeff;
}
.drawer-link:hover,
.drawer-link.active{
    background:linear-gradient(135deg,rgba(102,217,255,.18),rgba(139,152,255,.14));
    border-color:rgba(102,217,255,.32);
    transform:translateX(-2px);
}
.drawer-foot{
    margin-top:auto;
    padding:16px;
    border:1px dashed var(--line-strong);
    border-radius:18px;
    background:rgba(255,255,255,.035);
    line-height:1.9;
}
body.drawer-open{overflow:hidden}

.app-shell.content-only-mode .sidebar{display:none}
.app-shell.content-only-mode .main-content{grid-column:1/-1}
.content-page{
    padding:24px;
    min-height:calc(100vh - 150px);
}
.empty-page-shell{
    min-height:520px;
    display:grid;
    place-items:center;
    text-align:center;
    gap:18px;
}
.empty-page-icon{
    width:92px;
    height:92px;
    border-radius:30px;
    display:grid;
    place-items:center;
    margin:0 auto 14px;
    font-size:46px;
    color:#aeeeff;
    background:linear-gradient(135deg,rgba(102,217,255,.12),rgba(139,152,255,.14));
    border:1px solid rgba(102,217,255,.22);
}
.empty-page-shell h2{margin:6px 0 8px;font-size:34px}

.profile-page{
    display:flex;
    flex-direction:column;
    gap:20px;
}
.profile-hero{
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    gap:24px;
    align-items:center;
    padding:24px;
    border-radius:28px;
    border:1px solid var(--line);
    background:
        radial-gradient(circle at 12% 15%, rgba(102,217,255,.18), transparent 34%),
        linear-gradient(135deg,rgba(255,255,255,.07),rgba(255,255,255,.025));
}
.profile-avatar-large{
    width:168px;
    height:168px;
    border-radius:48px;
    padding:4px;
    background:rgba(255,255,255,.08);
    border:1px solid var(--line-strong);
    box-shadow:0 24px 60px rgba(0,0,0,.25);
}
.code-avatar-svg{
    display:block;
    width:100%;
    height:100%;
    filter:drop-shadow(0 14px 24px rgba(0,0,0,.18));
}
.profile-hero-body h2{
    margin:6px 0 8px;
    font-size:42px;
}
.profile-badges{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:18px;
}
.profile-badges span{
    padding:10px 12px;
    border-radius:999px;
    background:rgba(102,217,255,.09);
    border:1px solid rgba(102,217,255,.18);
    color:#c8f4ff;
    font-weight:800;
}
html[data-theme="light"] .profile-badges span{
    color:#075985;
    background:rgba(14,165,233,.08);
    border-color:rgba(14,165,233,.18);
}
.profile-grid{
    display:grid;
    grid-template-columns:1.15fr .85fr;
    gap:18px;
}
.profile-card{
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
    border-radius:24px;
    padding:20px;
    min-height:220px;
}
.profile-info-list{
    margin:0;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}
.profile-info-list div{
    padding:14px;
    border-radius:18px;
    background:rgba(255,255,255,.04);
    border:1px solid var(--line);
}
.profile-info-list dt{
    color:var(--muted);
    font-size:13px;
    margin-bottom:6px;
}
.profile-info-list dd{
    margin:0;
    font-weight:900;
}
.avatar-picker-card{
    display:flex;
    flex-direction:column;
    gap:14px;
}
.selected-avatar-preview{
    width:118px;
    height:118px;
    border-radius:34px;
    padding:4px;
    background:rgba(255,255,255,.08);
    border:1px solid var(--line);
}
.avatar-options{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
}
.avatar-option{
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
    color:var(--text);
    border-radius:18px;
    padding:10px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:8px;
    cursor:pointer;
    transition:.2s ease;
}
.avatar-option:hover,
.avatar-option.selected{
    border-color:rgba(102,217,255,.48);
    background:rgba(102,217,255,.10);
    transform:translateY(-2px);
}
.avatar-option svg{
    width:58px;
    height:58px;
    border-radius:18px;
}
.avatar-option small{font-weight:800}
.tiny-note{font-size:13px;line-height:1.8}
.profile-stats-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}
.profile-stats-grid div{
    padding:16px;
    border-radius:18px;
    background:linear-gradient(135deg,rgba(102,217,255,.10),rgba(139,152,255,.08));
    border:1px solid rgba(102,217,255,.15);
}
.profile-stats-grid strong{
    display:block;
    font-size:30px;
    margin-bottom:4px;
}
.profile-stats-grid span{color:var(--muted);font-size:13px}
.profile-focus-card{
    display:flex;
    flex-direction:column;
    gap:16px;
}
.profile-progress-line{
    display:grid;
    grid-template-columns:82px minmax(0,1fr) 52px;
    align-items:center;
    gap:12px;
}
.profile-progress-line div{
    height:12px;
    border-radius:999px;
    overflow:hidden;
    background:rgba(255,255,255,.07);
    border:1px solid var(--line);
}
.profile-progress-line b{
    display:block;
    height:100%;
    border-radius:999px;
    background:linear-gradient(90deg,var(--primary),var(--primary-2));
}
.profile-progress-line strong{text-align:left}

@media (max-width:1180px){
    .sticky-topbar{
        grid-template-columns:1fr;
        align-items:stretch;
    }
    .topbar-menu-zone,
    .topbar-planner,
    .topbar-controls{
        justify-content:space-between;
    }
}
@media (max-width:900px){
    .app-shell{
        grid-template-columns:1fr;
        padding:14px;
    }
    .sticky-topbar{
        top:8px;
        padding:12px;
    }
    .topbar-controls{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .topbar-controls .primary-btn,
    .topbar-theme{
        grid-column:span 2;
    }
    .profile-hero,
    .profile-grid{
        grid-template-columns:1fr;
    }
}
@media (max-width:560px){
    .topbar-menu-zone,
    .topbar-planner{
        flex-wrap:wrap;
    }
    .topbar-year-title{
        order:-1;
        width:100%;
    }
    .topbar-controls{
        grid-template-columns:1fr;
    }
    .topbar-controls .primary-btn,
    .topbar-theme{
        grid-column:auto;
    }
    .profile-info-list,
    .profile-stats-grid,
    .avatar-options{
        grid-template-columns:1fr;
    }
    .profile-hero-body h2{font-size:30px}
    .profile-avatar-large{width:132px;height:132px}
}


/* v9: cleaned sticky header + local calendar controls */
.calendar-title-button{
    width:min(560px,100%);
    border:1px solid rgba(255,255,255,.14);
    background:rgba(255,255,255,.045);
    color:var(--text);
    border-radius:20px;
    padding:10px 18px;
    cursor:pointer;
    text-align:center;
    font:inherit;
    transition:.2s ease;
}
.calendar-title-button:hover{
    transform:translateY(-1px);
    border-color:rgba(102,217,255,.38);
    background:rgba(102,217,255,.08);
}
.calendar-title-button h1{
    margin:2px 0 2px;
    font-size:22px;
    line-height:1.45;
}
.title-picker-hint{
    display:block;
    color:var(--muted);
    font-size:12px;
    font-weight:700;
}
.calendar-local-controls{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:18px;
    padding:14px;
    border:1px solid var(--line);
    border-radius:22px;
    background:linear-gradient(135deg,rgba(255,255,255,.055),rgba(255,255,255,.025));
}
.calendar-local-controls .inline-control{
    min-height:48px;
}
.calendar-local-controls #monthSelectWrap{
    display:none !important;
}
.local-controls-note{
    margin-inline-start:auto;
    color:var(--muted);
    font-size:13px;
    line-height:1.8;
}
.topbar-controls{
    justify-content:flex-end;
}
.topbar-planner{
    min-width:260px;
}
.modal{
    z-index:500;
}
.site-drawer{
    z-index:220;
}
.period-picker-card{
    width:min(760px,calc(100% - 24px));
}
.period-picker-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
}
.period-option{
    min-height:88px;
    border:1px solid var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.045);
    color:var(--text);
    padding:14px;
    cursor:pointer;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;
    gap:6px;
    font:inherit;
    transition:.2s ease;
}
.period-option strong{
    font-size:24px;
}
.period-option span{
    color:var(--muted);
    font-size:13px;
}
.period-option:hover,
.period-option.selected{
    transform:translateY(-2px);
    border-color:rgba(102,217,255,.45);
    background:linear-gradient(135deg,rgba(102,217,255,.16),rgba(139,152,255,.10));
}
.period-option.is-current{
    box-shadow:inset 0 0 0 1px rgba(34,197,94,.35);
}
.period-option.day-option{
    min-height:76px;
}
@media (max-width:1180px){
    .calendar-title-button{
        width:100%;
    }
}
@media (max-width:900px){
    .calendar-local-controls{
        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .calendar-local-controls .inline-control,
    .local-controls-note{
        width:100%;
    }
    .local-controls-note{
        grid-column:1/-1;
        margin-inline-start:0;
    }
    .period-picker-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
}
@media (max-width:560px){
    .calendar-local-controls,
    .period-picker-grid{
        grid-template-columns:1fr;
    }
    .calendar-title-button h1{
        font-size:18px;
    }
    .topbar-controls{
        grid-template-columns:1fr;
    }
}

/* v10: drag-scroll calendar UX + social friends page */
.week-columns,
.calendar-wrapper.monthly-mode .days-grid,
.timeline-scroll{
    scroll-behavior:smooth;
    scrollbar-width:thin;
    cursor:grab;
    user-select:none;
}
.week-columns{touch-action:pan-y;}
.calendar-wrapper.monthly-mode .days-grid,
.timeline-scroll{touch-action:pan-x;}
.week-columns.drag-scroll-active,
.calendar-wrapper.monthly-mode .days-grid.drag-scroll-active,
.timeline-scroll.drag-scroll-active{
    cursor:grabbing;
    scroll-behavior:auto;
}
.week-columns.drag-scroll-active * ,
.calendar-wrapper.monthly-mode .days-grid.drag-scroll-active *,
.timeline-scroll.drag-scroll-active *{
    pointer-events:none;
}
.calendar-wrapper.monthly-mode .days-grid{
    max-height:calc(100vh - 330px);
    min-height:520px;
    overflow-y:auto;
    padding-inline-end:6px;
    padding-bottom:8px;
    overscroll-behavior:contain;
    touch-action:pan-x;
}
.calendar-wrapper.monthly-mode .day-cell{
    user-select:none;
}
.week-columns{
    overscroll-behavior-inline:contain;
}
.timeline-scroll{
    overscroll-behavior-block:contain;
}

.friends-page{
    display:flex;
    flex-direction:column;
    gap:18px;
}
.friends-hero{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:22px;
    align-items:center;
    padding:26px;
    border:1px solid var(--line);
    border-radius:30px;
    background:
        radial-gradient(circle at 10% 20%, rgba(102,217,255,.22), transparent 35%),
        radial-gradient(circle at 85% 12%, rgba(236,72,153,.14), transparent 34%),
        linear-gradient(135deg,rgba(255,255,255,.075),rgba(255,255,255,.03));
    overflow:hidden;
}
.friends-hero h2{
    margin:6px 0 10px;
    font-size:34px;
    line-height:1.5;
}
.friends-hero-copy p{margin:0;line-height:1.9;max-width:760px}
.friends-stats{
    display:grid;
    grid-template-columns:repeat(2,minmax(110px,1fr));
    gap:12px;
    min-width:280px;
}
.friends-stats div{
    padding:16px;
    border:1px solid rgba(102,217,255,.18);
    border-radius:22px;
    background:rgba(102,217,255,.075);
    text-align:center;
}
.friends-stats strong{display:block;font-size:30px;margin-bottom:4px}
.friends-stats span{color:var(--muted);font-size:13px;font-weight:800}
.social-grid{
    display:grid;
    grid-template-columns:1.2fr .8fr;
    gap:18px;
}
.social-grid-wide{
    grid-template-columns:1fr 1fr;
}
.social-card{
    border:1px solid var(--line);
    border-radius:26px;
    padding:18px;
    background:rgba(255,255,255,.04);
    box-shadow:0 20px 55px rgba(0,0,0,.12);
}
.leaderboard-list,
.online-list,
.friend-search-results,
.social-feed,
.idea-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}
.leaderboard-row,
.friend-result-row,
.request-row,
.feed-row{
    display:grid;
    grid-template-columns:auto auto minmax(0,1fr) auto;
    align-items:center;
    gap:12px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.035);
}
.leader-rank{
    width:38px;
    height:38px;
    display:grid;
    place-items:center;
    border-radius:14px;
    background:rgba(255,255,255,.07);
    font-weight:900;
}
.leader-body strong,
.friend-result-row strong,
.request-row strong,
.friend-chat-row strong,
.online-user-pill strong{display:block;font-size:14px}
.leader-body small,
.friend-result-row small,
.request-row small,
.friend-chat-row small,
.online-user-pill small{display:block;color:var(--muted);font-size:12px;margin-top:4px;line-height:1.6}
.leader-track{
    height:8px;
    margin-top:8px;
    overflow:hidden;
    border-radius:999px;
    background:rgba(255,255,255,.07);
    border:1px solid var(--line);
}
.leader-track b{
    display:block;
    height:100%;
    border-radius:999px;
    background:linear-gradient(90deg,var(--primary),var(--primary-2));
}
.leader-score{font-size:24px;color:#aeeeff}
.generated-social-avatar{
    --h:210;
    display:grid;
    place-items:center;
    border-radius:16px;
    color:white;
    font-weight:950;
    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,.55), transparent 25%),
        linear-gradient(135deg,hsl(var(--h) 85% 58%),hsl(calc(var(--h) + 45) 85% 52%));
    border:1px solid rgba(255,255,255,.24);
    box-shadow:0 10px 22px rgba(0,0,0,.18);
}
.social-avatar{display:grid;place-items:center;flex:0 0 auto}
.online-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
}
.online-user-pill{
    position:relative;
    display:flex;
    align-items:center;
    gap:10px;
    padding:11px;
    border-radius:18px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.035);
}
.online-dot{
    width:10px;
    height:10px;
    border-radius:999px;
    background:#22c55e;
    box-shadow:0 0 0 5px rgba(34,197,94,.14);
}
.friend-search-box{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    margin-bottom:12px;
}
.friend-search-box input,
.chat-form input{
    width:100%;
    border:1px solid var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.045);
    color:var(--text);
    padding:13px 14px;
    outline:none;
    font:inherit;
}
.friend-result-row{grid-template-columns:auto minmax(0,1fr) auto}
.tiny-btn{padding:9px 12px;font-size:12px;min-height:auto;border-radius:14px}
.tiny-btn:disabled{opacity:.55;cursor:not-allowed;filter:saturate(.55)}
.requests-columns{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}
.requests-columns h4{margin:0 0 10px;font-size:15px}
.request-row{
    grid-template-columns:minmax(0,1fr) auto;
    margin-bottom:10px;
}
.request-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pending-pill,
.unread-badge{
    padding:7px 10px;
    border-radius:999px;
    background:rgba(245,158,11,.12);
    border:1px solid rgba(245,158,11,.2);
    color:#fcd34d;
    font-size:12px;
    font-weight:900;
}
.unread-badge{
    min-width:26px;
    text-align:center;
    background:rgba(102,217,255,.13);
    border-color:rgba(102,217,255,.24);
    color:#aeeeff;
}
.messenger-card{padding:0;overflow:hidden}
.messenger-card > .section-title-line{padding:18px 18px 0}
.messenger-layout{
    display:grid;
    grid-template-columns:320px minmax(0,1fr);
    min-height:520px;
}
.friends-list-panel{
    border-inline-end:1px solid var(--line);
    padding:18px;
    overflow:auto;
    max-height:620px;
}
.friend-chat-row{
    width:100%;
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    gap:10px;
    align-items:center;
    border:1px solid transparent;
    background:transparent;
    color:var(--text);
    padding:10px;
    border-radius:18px;
    cursor:pointer;
    text-align:right;
    font:inherit;
    transition:.2s ease;
}
.friend-chat-row:hover,
.friend-chat-row.active{
    background:rgba(102,217,255,.09);
    border-color:rgba(102,217,255,.24);
}
.chat-panel{
    display:flex;
    flex-direction:column;
    min-width:0;
}
.chat-head{
    display:flex;
    align-items:center;
    gap:12px;
    padding:16px 18px;
    border-bottom:1px solid var(--line);
    background:rgba(255,255,255,.025);
}
.chat-messages{
    flex:1;
    min-height:340px;
    max-height:460px;
    overflow:auto;
    padding:18px;
    display:flex;
    flex-direction:column;
    gap:10px;
}
.chat-bubble{
    max-width:min(72%,560px);
    padding:11px 13px;
    border-radius:18px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.055);
    line-height:1.9;
}
.chat-bubble p{margin:0;white-space:pre-wrap}
.chat-bubble small{display:block;color:var(--muted);font-size:11px;margin-top:4px}
.chat-bubble.mine{
    align-self:flex-start;
    background:linear-gradient(135deg,rgba(102,217,255,.18),rgba(139,152,255,.12));
    border-color:rgba(102,217,255,.28);
}
.chat-bubble.theirs{
    align-self:flex-end;
}
.chat-form{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    padding:16px 18px;
    border-top:1px solid var(--line);
}
.chat-empty{
    min-height:420px;
    display:grid;
    place-items:center;
    text-align:center;
    padding:30px;
}
.feed-row{
    grid-template-columns:auto minmax(0,1fr);
}
.feed-row > span{
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    border-radius:14px;
    background:rgba(34,197,94,.12);
    color:#86efac;
    border:1px solid rgba(34,197,94,.22);
    font-weight:950;
}
.feed-row p{margin:4px 0;color:var(--text);line-height:1.7}
.feed-row small{color:var(--muted);font-size:12px}
.idea-list div{
    padding:14px;
    border-radius:18px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.035);
}
.idea-list strong{display:block;margin-bottom:6px}
.idea-list p{margin:0;color:var(--muted);line-height:1.9}
html[data-theme="light"] .leader-score,
body[data-theme="light"] .leader-score,
html[data-theme="light"] .unread-badge,
body[data-theme="light"] .unread-badge{color:#075985}
html[data-theme="light"] .pending-pill,
body[data-theme="light"] .pending-pill{color:#92400e}

@media (max-width:1100px){
    .friends-hero,
    .social-grid,
    .social-grid-wide,
    .messenger-layout{grid-template-columns:1fr}
    .friends-list-panel{border-inline-end:0;border-bottom:1px solid var(--line);max-height:none}
}
@media (max-width:720px){
    .friends-stats,
    .online-list,
    .requests-columns{grid-template-columns:1fr}
    .leaderboard-row{grid-template-columns:auto auto minmax(0,1fr)}
    .leader-score{grid-column:1/-1;text-align:left}
    .friend-search-box,
    .chat-form{grid-template-columns:1fr}
    .chat-bubble{max-width:92%}
}

/* v11: messenger polish, reply UX, drag-scroll messages, and copy protection */
body{
    -webkit-user-select:none;
    user-select:none;
}
input,
textarea,
[contenteditable="true"]{
    -webkit-user-select:text;
    user-select:text;
}
.chat-head strong{
    display:block;
    line-height:1.6;
}
.chat-head small{
    display:block;
    margin-top:5px;
    color:var(--muted);
    line-height:1.7;
}
.chat-messages{
    cursor:grab;
    user-select:none;
    scrollbar-width:thin;
    overscroll-behavior:contain;
    touch-action:pan-x;
}
.chat-messages.drag-scroll-active{
    cursor:grabbing;
    scroll-behavior:auto;
}
.chat-messages.drag-scroll-active *{
    pointer-events:none;
}
.chat-bubble{
    position:relative;
}
.chat-bubble::after{
    content:'↩';
    position:absolute;
    top:8px;
    opacity:0;
    transform:translateY(-4px);
    color:var(--muted);
    font-weight:900;
    transition:.18s ease;
}
.chat-bubble.mine::after{right:-22px;}
.chat-bubble.theirs::after{left:-22px;}
.chat-bubble:hover::after{
    opacity:.65;
    transform:translateY(0);
}
.chat-quoted-block,
.chat-reply-preview{
    border:1px solid rgba(102,217,255,.22);
    border-inline-start:4px solid var(--primary);
    background:rgba(102,217,255,.09);
    border-radius:16px;
}
.chat-quoted-block{
    padding:9px 10px;
    margin-bottom:9px;
}
.chat-quoted-block span,
.chat-reply-preview span{
    display:block;
    color:#aeeeff;
    font-size:12px;
    font-weight:900;
    margin-bottom:4px;
}
.chat-quoted-block p,
.chat-reply-preview p{
    margin:0;
    color:var(--muted);
    font-size:12px;
    line-height:1.8;
}
.chat-reply-preview{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin:0 18px 12px;
    padding:10px 12px;
}
.reply-cancel-btn{
    width:32px;
    height:32px;
    border:1px solid var(--line);
    border-radius:12px;
    background:rgba(255,255,255,.06);
    color:var(--text);
    cursor:pointer;
    font-size:20px;
    line-height:1;
}
.chat-empty-landing{
    position:relative;
    overflow:hidden;
    gap:14px;
    background:
        radial-gradient(circle at 20% 20%, rgba(102,217,255,.13), transparent 32%),
        radial-gradient(circle at 82% 70%, rgba(139,152,255,.12), transparent 34%);
}
.chat-empty-landing::before{
    content:'';
    position:absolute;
    inset:28px;
    border:1px dashed rgba(255,255,255,.14);
    border-radius:32px;
    pointer-events:none;
}
.chat-empty-art{
    position:relative;
    width:118px;
    height:118px;
    display:grid;
    place-items:center;
    border-radius:34px;
    background:linear-gradient(135deg,rgba(102,217,255,.22),rgba(139,152,255,.14));
    border:1px solid rgba(255,255,255,.18);
    box-shadow:0 24px 50px rgba(0,0,0,.22);
}
.chat-empty-art span{
    font-size:46px;
    filter:drop-shadow(0 10px 20px rgba(0,0,0,.22));
}
.chat-empty-art i,
.chat-empty-art b{
    position:absolute;
    width:34px;
    height:34px;
    border-radius:14px;
    background:rgba(255,255,255,.14);
    border:1px solid rgba(255,255,255,.2);
}
.chat-empty-art i{right:-14px;top:18px;}
.chat-empty-art b{left:-10px;bottom:16px;}
.chat-empty-landing > strong{
    font-size:24px;
    position:relative;
    z-index:1;
}
.chat-empty-landing > p{
    max-width:560px;
    position:relative;
    z-index:1;
}
.chat-empty-tips{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    flex-wrap:wrap;
    position:relative;
    z-index:1;
}
.chat-empty-tips span{
    padding:8px 11px;
    border-radius:999px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.055);
    color:var(--muted);
    font-size:12px;
    font-weight:800;
}


/* v12: requested messenger fixes */
.messenger-layout{
    min-height:430px;
}
.friends-list-panel{
    max-height:500px;
}
.chat-messages{
    min-height:250px;
    max-height:340px;
    overflow-y:auto;
    overflow-x:hidden;
    touch-action:pan-y;
}
.chat-empty{
    min-height:330px;
}
.chat-empty-tips{
    display:none !important;
}
.chat-head small{
    word-spacing:4px;
}
.chat-bubble{
    padding-inline-end:42px;
}
.chat-bubble::after{
    content:none !important;
}
.chat-reply-action{
    position:absolute;
    top:8px;
    inset-inline-end:9px;
    width:28px;
    height:28px;
    display:grid;
    place-items:center;
    border:1px solid var(--line);
    border-radius:11px;
    background:rgba(255,255,255,.07);
    color:var(--muted);
    cursor:pointer;
    opacity:0;
    transform:translateY(-4px);
    transition:.18s ease;
    font:inherit;
    font-weight:900;
    z-index:2;
}
.chat-bubble:hover .chat-reply-action,
.chat-reply-action:focus-visible{
    opacity:.95;
    transform:translateY(0);
}
.chat-reply-action:hover{
    color:var(--text);
    border-color:rgba(102,217,255,.35);
    background:rgba(102,217,255,.13);
}
@media (max-width:720px){
    .messenger-layout{min-height:390px;}
    .chat-messages{max-height:300px;}
}

/* v13: telegram-like replies, reactions, contact search and group messenger */
.messenger-tabs{
    display:flex;
    gap:8px;
    padding:14px 18px 0;
    border-top:1px solid transparent;
}
.messenger-tab{
    border:1px solid var(--line);
    background:rgba(255,255,255,.045);
    color:var(--muted);
    border-radius:16px;
    padding:10px 18px;
    font:inherit;
    font-weight:900;
    cursor:pointer;
    transition:.18s ease;
}
.messenger-tab:hover,
.messenger-tab.active{
    color:var(--text);
    border-color:rgba(102,217,255,.32);
    background:linear-gradient(135deg,rgba(102,217,255,.16),rgba(139,152,255,.10));
}
.chat-contact-search{
    padding:14px;
    border-bottom:1px solid var(--line);
    position:sticky;
    top:0;
    z-index:2;
    background:rgba(13,20,35,.88);
    backdrop-filter:blur(14px);
}
.chat-contact-search input,
.group-create-box input,
.group-add-member-form select{
    width:100%;
    border:1px solid var(--line);
    background:rgba(255,255,255,.055);
    color:var(--text);
    border-radius:16px;
    padding:11px 13px;
    font:inherit;
    outline:none;
}
.chat-contact-list{display:grid;gap:8px;padding:10px}
.telegram-reply-block{
    position:relative;
    padding:8px 10px 8px 12px;
    margin-bottom:8px;
    border-radius:12px;
    background:rgba(0,0,0,.14);
    border:1px solid rgba(255,255,255,.08);
    overflow:hidden;
}
.telegram-reply-block::before,
.telegram-composer-reply::before{
    content:'';
    position:absolute;
    inset-block:8px;
    inset-inline-start:0;
    width:4px;
    border-radius:999px;
    background:linear-gradient(180deg,var(--primary),#8b98ff);
}
.telegram-reply-block span,
.telegram-composer-reply span{
    display:block;
    color:#9ee8ff;
    font-size:12px;
    font-weight:950;
    margin-bottom:3px;
}
.telegram-reply-block p,
.telegram-composer-reply p{
    margin:0;
    color:var(--muted);
    font-size:12px;
    line-height:1.65;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.telegram-composer-reply{
    position:relative;
    border-radius:16px;
    background:rgba(102,217,255,.08);
    border-color:rgba(102,217,255,.22);
    padding-inline-start:16px;
}
.reaction-picker{
    position:absolute;
    top:-42px;
    inset-inline-start:12px;
    display:flex;
    gap:4px;
    align-items:center;
    padding:6px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,.16);
    background:rgba(12,18,31,.92);
    box-shadow:0 18px 42px rgba(0,0,0,.28);
    opacity:0;
    transform:translateY(8px) scale(.96);
    pointer-events:none;
    transition:.16s ease;
    z-index:5;
    backdrop-filter:blur(16px);
}
.chat-bubble:hover .reaction-picker,
.reaction-picker:focus-within{
    opacity:1;
    transform:translateY(0) scale(1);
    pointer-events:auto;
}
.reaction-option,
.reaction-chip{
    border:1px solid transparent;
    background:transparent;
    color:var(--text);
    cursor:pointer;
    font:inherit;
}
.reaction-option{
    width:30px;
    height:30px;
    display:grid;
    place-items:center;
    border-radius:50%;
    font-size:17px;
    transition:.15s ease;
}
.reaction-option:hover,
.reaction-option.active{
    transform:translateY(-3px) scale(1.12);
    background:rgba(255,255,255,.12);
    border-color:rgba(255,255,255,.16);
}
.reaction-summary{
    display:flex;
    flex-wrap:wrap;
    gap:5px;
    margin-top:8px;
}
.reaction-chip{
    display:inline-flex;
    align-items:center;
    gap:4px;
    padding:3px 8px;
    border-radius:999px;
    background:rgba(255,255,255,.08);
    border-color:rgba(255,255,255,.12);
    font-size:12px;
}
.reaction-chip.mine{
    border-color:rgba(102,217,255,.38);
    background:rgba(102,217,255,.14);
}
.bubble-sender{
    display:block;
    font-size:12px;
    font-weight:950;
    color:#9ee8ff;
    margin-bottom:4px;
}
.chat-bubble.deleted{
    opacity:.65;
    font-style:italic;
}
.message-delete-inline{
    border:0;
    background:transparent;
    color:#fb7185;
    cursor:pointer;
    font:inherit;
    font-size:11px;
    margin-inline-start:8px;
}
.groups-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:14px 18px;
    border-top:1px solid var(--line);
    border-bottom:1px solid var(--line);
    flex-wrap:wrap;
}
.group-create-box{
    margin:14px 18px;
    padding:14px;
    border:1px solid var(--line);
    border-radius:22px;
    background:rgba(255,255,255,.035);
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr)) auto;
    gap:12px;
    align-items:end;
}
.group-create-box label,
.group-create-members strong{
    display:block;
    color:var(--muted);
    font-size:12px;
    font-weight:900;
    margin-bottom:6px;
}
.group-create-members{
    grid-column:1/-1;
}
.group-create-members > div{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.group-member-check{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:7px 10px;
    border-radius:999px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
    cursor:pointer;
}
.group-member-check input{accent-color:#66d9ff}
.groups-layout{border-top:1px solid var(--line)}
.group-generated-avatar{font-weight:950;font-size:20px}
.group-members-panel{
    border-bottom:1px solid var(--line);
    background:rgba(255,255,255,.025);
}
.group-members-panel details{padding:10px 18px}
.group-members-panel summary{
    cursor:pointer;
    font-weight:950;
    color:var(--text);
}
.group-members-list{
    display:grid;
    gap:8px;
    margin-top:12px;
    max-height:180px;
    overflow:auto;
    padding-inline-end:4px;
}
.group-member-row{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    padding:8px;
    border:1px solid var(--line);
    border-radius:16px;
    background:rgba(255,255,255,.035);
}
.group-member-row strong{display:block;font-size:13px}
.group-member-row small{display:block;color:var(--muted);font-size:11px;margin-top:2px}
.group-member-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.danger-text{color:#fb7185 !important}
.group-add-member-form{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    margin-top:10px;
}
.group-chat-head{background:linear-gradient(135deg,rgba(102,217,255,.07),rgba(139,152,255,.05))}
.group-empty-landing .chat-empty-art{background:linear-gradient(135deg,rgba(34,197,94,.18),rgba(102,217,255,.13))}
html[data-theme="light"] .chat-contact-search,
body[data-theme="light"] .chat-contact-search,
html[data-theme="light"] .reaction-picker,
body[data-theme="light"] .reaction-picker{
    background:rgba(255,255,255,.92);
}
html[data-theme="light"] .telegram-reply-block,
body[data-theme="light"] .telegram-reply-block{
    background:rgba(2,132,199,.07);
}
@media (max-width:900px){
    .group-create-box{grid-template-columns:1fr}
    .groups-toolbar{align-items:flex-start}
}
@media (max-width:720px){
    .messenger-tabs{padding-inline:12px}
    .messenger-tab{flex:1;padding-inline:10px}
    .reaction-picker{top:-38px;inset-inline-start:4px}
    .group-member-row{grid-template-columns:auto minmax(0,1fr)}
    .group-member-actions{grid-column:1/-1;justify-content:flex-start}
    .group-add-member-form{grid-template-columns:1fr}
}

/* v14: mobile message actions, online-list overflow and friends tab */
.online-list.online-list-scrollable{
    max-height:260px;
    overflow-y:auto;
    padding-inline-end:4px;
    scrollbar-width:thin;
    overscroll-behavior:contain;
}
.chat-bubble.message-actions-open .reaction-picker,
.chat-bubble.message-actions-open .reaction-picker:focus-within,
.chat-bubble.message-actions-open .chat-reply-action{
    opacity:1;
    transform:translateY(0) scale(1);
    pointer-events:auto;
}
.chat-bubble.message-actions-open .chat-reply-action{
    transform:translateY(0);
}
.chat-bubble.message-actions-open{
    border-color:rgba(102,217,255,.32);
    box-shadow:0 16px 36px rgba(0,0,0,.16);
}
.friends-explorer-layout{
    border-top:1px solid var(--line);
}
.friends-browser-panel .chat-contact-list{
    padding-top:10px;
}
.friend-profile-panel{
    min-height:0;
    padding:18px;
    justify-content:center;
}
.friend-profile-card{
    width:min(720px,100%);
    margin:auto;
    border:1px solid var(--line);
    border-radius:28px;
    padding:20px;
    background:
        radial-gradient(circle at 15% 15%, rgba(102,217,255,.12), transparent 30%),
        radial-gradient(circle at 85% 20%, rgba(139,152,255,.10), transparent 28%),
        rgba(255,255,255,.035);
    box-shadow:0 24px 60px rgba(0,0,0,.16);
}
.friend-profile-hero{
    display:flex;
    align-items:center;
    gap:16px;
    padding-bottom:16px;
    border-bottom:1px solid var(--line);
}
.friend-profile-hero strong{
    display:block;
    font-size:24px;
    margin-bottom:6px;
}
.friend-profile-hero span,
.friend-last-message span,
.friend-profile-meta small{
    display:block;
    color:var(--muted);
    font-size:12px;
    font-weight:900;
}
.friend-profile-meta{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
    margin:16px 0;
}
.friend-profile-meta div{
    padding:12px;
    border-radius:18px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
}
.friend-profile-meta b{
    display:block;
    margin-top:5px;
    font-size:14px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.friend-last-message{
    border:1px dashed rgba(102,217,255,.25);
    border-radius:20px;
    padding:13px 14px;
    background:rgba(102,217,255,.06);
}
.friend-last-message p{
    margin:6px 0 0;
    color:var(--text);
    line-height:1.8;
}
.friend-profile-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:16px;
}
.friend-profile-actions .primary-btn,
.friend-profile-actions .ghost-btn{
    min-height:42px;
}
.friend-insight-strip{
    display:flex;
    gap:10px;
    align-items:flex-start;
    margin-top:16px;
    padding:12px;
    border-radius:18px;
    border:1px solid rgba(255,255,255,.12);
    background:rgba(255,255,255,.04);
}
.friend-insight-strip span{font-size:22px;line-height:1.2}
.friend-insight-strip p{margin:0;color:var(--muted);line-height:1.8;font-size:13px}
.friend-empty-landing .chat-empty-art{
    background:linear-gradient(135deg,rgba(245,158,11,.20),rgba(102,217,255,.13));
}
@media (max-width:900px){
    .friend-profile-meta{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:720px){
    .friend-profile-panel{padding:12px;}
    .friend-profile-hero{align-items:flex-start;}
    .friend-profile-meta{grid-template-columns:1fr;}
    .friend-profile-actions{display:grid;grid-template-columns:1fr;}
    .online-list.online-list-scrollable{max-height:230px;}
}


/* v14.1: small social tab polish */
.friends-explorer-layout,
.groups-layout,
.groups-toolbar{
    border-top:0 !important;
}
.messenger-tabs + .friends-explorer-layout,
.messenger-tabs + .groups-toolbar{
    border-top:0 !important;
}

/* v15.0.1: live chat, shared work popup and shift view */
.shared-tasks-modal{
    position:fixed;
    inset:0;
    z-index:4000;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}
.shared-tasks-backdrop{
    position:absolute;
    inset:0;
    background:rgba(2,6,23,.68);
    backdrop-filter:blur(14px);
}
.shared-tasks-card{
    position:relative;
    width:min(960px,96vw);
    max-height:min(760px,86vh);
    overflow:hidden;
    border:1px solid var(--line);
    border-radius:30px;
    background:linear-gradient(145deg,rgba(15,23,42,.96),rgba(30,41,59,.94));
    box-shadow:0 32px 90px rgba(0,0,0,.38);
    padding:20px;
}
.theme-light .shared-tasks-card{
    background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(239,246,255,.94));
}
.shared-tasks-list{
    max-height:610px;
    overflow-y:auto;
    padding:8px 2px 2px;
    display:grid;
    gap:12px;
}
.shared-task-row{
    display:grid;
    grid-template-columns:auto 1fr auto;
    gap:12px;
    align-items:start;
    padding:14px;
    border-radius:22px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.045);
}
.shared-task-row.done{opacity:.72;}
.shared-task-row.done strong{text-decoration:line-through;}
.shared-task-check input{display:none;}
.shared-task-check span{
    width:26px;height:26px;border-radius:10px;border:1px solid var(--line);display:block;position:relative;background:rgba(255,255,255,.06);
}
.shared-task-check input:checked + span::after{
    content:'✓';position:absolute;inset:0;display:grid;place-items:center;font-weight:1000;color:var(--accent);
}
.shared-task-body{display:grid;gap:6px;min-width:0;}
.shared-task-body p{margin:0;color:var(--muted);line-height:1.75;}
.shared-task-body small{display:block;color:var(--muted);line-height:1.7;}
.shared-task-top{display:flex;align-items:center;gap:10px;justify-content:space-between;}
.shared-task-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.shift-view-grid{display:block;}
.shift-board{display:grid;gap:18px;}
.shift-hero{
    display:flex;justify-content:space-between;gap:18px;align-items:center;
    border:1px solid var(--line);border-radius:30px;padding:22px;
    background:radial-gradient(circle at 15% 25%,rgba(102,217,255,.14),transparent 30%),rgba(255,255,255,.04);
}
.shift-hero h2{margin:6px 0;font-size:28px;}
.shift-kpis{display:grid;grid-template-columns:repeat(4,minmax(90px,1fr));gap:10px;}
.shift-kpis div{
    padding:14px;border-radius:20px;border:1px solid var(--line);background:rgba(255,255,255,.055);text-align:center;
}
.shift-kpis strong{display:block;font-size:22px;}
.shift-kpis span{display:block;color:var(--muted);font-size:12px;margin-top:4px;}
.shift-layout{display:grid;grid-template-columns:340px 1fr;gap:18px;align-items:start;}
.shift-toolbox,.shift-calendar-panel{
    border:1px solid var(--line);border-radius:28px;padding:18px;background:rgba(255,255,255,.035);
}
.shift-type-form{display:grid;gap:10px;margin:12px 0 14px;}
.shift-type-form label,.shift-assign-form label{display:grid;gap:6px;color:var(--muted);font-weight:900;font-size:12px;}
.shift-type-form input,.shift-assign-form input,.shift-assign-form select{
    width:100%;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.07);color:var(--text);padding:11px 12px;outline:none;
}
.shift-type-list{display:grid;gap:8px;margin:12px 0 16px;}
.shift-type-pill{
    display:flex;align-items:center;gap:10px;padding:10px;border-radius:18px;border:1px solid var(--line);background:rgba(255,255,255,.045);
}
.shift-type-pill b{
    width:42px;height:42px;border-radius:16px;display:grid;place-items:center;background:var(--shift-color,#6c5ce7);color:white;box-shadow:0 10px 26px rgba(0,0,0,.18);
}
.shift-type-pill div{flex:1;min-width:0;}
.shift-type-pill strong,.shift-type-pill small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.shift-type-pill small{color:var(--muted);font-size:12px;margin-top:3px;}
.shift-selected-panel{border-top:1px solid var(--line);padding-top:14px;margin-top:14px;}
.shift-assign-form{display:grid;gap:10px;}
.shift-assign-actions{display:flex;gap:10px;flex-wrap:wrap;}
.shift-current-note{margin-top:12px;border:1px dashed rgba(102,217,255,.25);border-radius:18px;padding:10px;color:var(--muted);background:rgba(102,217,255,.06);}
.shift-weekdays,.shift-days-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;}
.shift-weekdays{margin:12px 0 8px;}
.shift-days-grid{align-items:stretch;}
.shift-day-cell{
    min-height:108px;border:1px solid var(--line);border-radius:20px;background:rgba(255,255,255,.045);color:var(--text);padding:10px;text-align:right;display:flex;flex-direction:column;gap:8px;cursor:pointer;transition:.18s ease;
}
button.shift-day-cell:hover{transform:translateY(-2px);border-color:rgba(102,217,255,.35);}
.shift-day-cell.empty{visibility:hidden;pointer-events:none;}
.shift-day-cell.selected{outline:2px solid rgba(102,217,255,.72);box-shadow:0 0 0 5px rgba(102,217,255,.10);}
.shift-day-cell.has-shift{background:linear-gradient(145deg,color-mix(in srgb,var(--shift-color,#6c5ce7) 18%,transparent),rgba(255,255,255,.045));}
.shift-day-cell b{display:inline-flex;align-items:center;justify-content:center;width:max-content;min-width:40px;height:34px;border-radius:14px;background:var(--shift-color,#6c5ce7);color:white;padding:0 10px;font-size:16px;}
.shift-day-cell small{color:var(--muted);line-height:1.6;}
.shift-day-number{font-weight:1000;font-size:18px;}
@media (max-width:980px){
    .shift-layout{grid-template-columns:1fr;}
    .shift-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:720px){
    .shared-task-row{grid-template-columns:auto 1fr;}
    .shared-task-actions{grid-column:1 / -1;justify-content:flex-start;}
    .shift-hero{display:grid;}
    .shift-days-grid,.shift-weekdays{gap:5px;}
    .shift-day-cell{min-height:84px;padding:8px;border-radius:16px;}
}

/* v16.0.0: shift editor, medical center, display settings and friend comparison */
.shift-quick-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.shift-quick-actions.hidden{display:none!important;}
.shift-tool-icon{width:44px;height:44px;font-size:18px;}
.shift-compare-note{margin:8px 0 0;color:var(--muted);}
.shift-type-pill{flex-wrap:wrap;}
.shift-type-pill .tiny-btn{padding:8px 10px;}
.shift-cell-badges{display:grid;gap:6px;margin-top:auto;}
.shift-cell-badge{display:grid;gap:4px;align-items:center;justify-items:start;padding:6px;border-radius:15px;background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.08);}
.shift-cell-badge.friend{border-style:dashed;background:rgba(102,217,255,.06);}
.shift-cell-badge span{font-size:10px;color:var(--muted);font-weight:900;}
.shift-cell-badge b{min-width:34px;height:30px;font-size:14px;border-radius:12px;}
.shift-cell-badge small,.shift-cell-badge em{font-size:11px;color:var(--muted);font-style:normal;line-height:1.35;}
.shift-modal .shared-tasks-card{z-index:1300;}
.shift-settings-card,.shift-people-card,.shift-edit-card{max-width:760px;}
.shift-settings-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0;border-bottom:1px solid var(--line);padding-bottom:10px;}
.shift-settings-tab{border:1px solid var(--line);background:rgba(255,255,255,.055);color:var(--text);border-radius:999px;padding:10px 14px;font-weight:900;cursor:pointer;}
.shift-settings-tab.active{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#07131d;border-color:transparent;}
.shift-settings-pane{display:none;gap:12px;}
.shift-settings-pane.active{display:grid;}
.shift-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid var(--line);border-radius:20px;padding:14px 16px;background:rgba(255,255,255,.04);font-weight:900;}
.shift-toggle-row input{display:none;}
.shift-toggle-row i{width:56px;height:30px;border-radius:999px;background:rgba(255,255,255,.12);position:relative;box-shadow:inset 0 0 0 1px var(--line);transition:.2s ease;}
.shift-toggle-row i::after{content:'';position:absolute;width:24px;height:24px;border-radius:50%;background:#fff;top:3px;right:3px;transition:.2s ease;box-shadow:0 6px 16px rgba(0,0,0,.24);}
.shift-toggle-row input:checked + i{background:linear-gradient(135deg,var(--accent),var(--accent-2));}
.shift-toggle-row input:checked + i::after{right:29px;}
.shift-people-form{display:grid;gap:14px;}
.shift-people-list{display:grid;gap:8px;max-height:340px;overflow-y:auto;padding-inline-end:4px;}
.shift-person-row{display:grid;grid-template-columns:auto auto 1fr;gap:10px;align-items:center;border:1px solid var(--line);border-radius:18px;padding:10px;background:rgba(255,255,255,.04);cursor:pointer;}
.shift-person-row.selected{outline:2px solid rgba(102,217,255,.55);background:rgba(102,217,255,.08);}
.shift-person-row strong,.shift-person-row small{display:block;}
.shift-person-row small{color:var(--muted);margin-top:3px;}
.shift-mode-choice{display:grid;gap:8px;border:1px dashed var(--line);border-radius:18px;padding:12px;}
.shift-mode-choice label{display:flex;gap:8px;align-items:center;color:var(--muted);font-weight:900;}
@media (max-width:720px){
    .shift-quick-actions{width:100%;}
    .shift-tool-icon{width:40px;height:40px;}
    .shift-cell-badge{padding:5px;}
    .shift-cell-badge span{display:none;}
}


/* v17.0.0: shift KPI details, lighter modal blur and polished shift popups */
.shift-kpi-card{
    appearance:none;
    border:1px solid var(--line);
    text-align:right;
    cursor:pointer;
    border-radius:20px;
    background:rgba(255,255,255,.06);
    padding:14px;
    color:var(--text);
    box-shadow:0 12px 30px rgba(0,0,0,.12);
    transition:transform .18s ease,border-color .18s ease,background .18s ease;
}
.shift-kpi-card:hover{transform:translateY(-2px);border-color:rgba(102,217,255,.42);background:rgba(102,217,255,.08);}
.shift-kpi-card.static{cursor:default;}
.shift-kpi-card.static:hover{transform:none;border-color:var(--line);background:rgba(255,255,255,.06);}
.shift-kpi-card strong{display:block;font-size:22px;}
.shift-kpi-card span{display:block;color:var(--muted);font-size:12px;margin-top:4px;}
.shift-kpis > div:not(.shift-kpi-card){display:none;}
.shift-modal .shared-tasks-backdrop{
    background:rgba(8,13,28,.08);
    backdrop-filter:blur(18px) saturate(150%);
    -webkit-backdrop-filter:blur(18px) saturate(150%);
}
.shift-modal .shared-tasks-card{
    animation:shiftModalPop .24s cubic-bezier(.2,.9,.22,1.08);
    transform-origin:center;
}
@keyframes shiftModalPop{
    from{opacity:0;transform:translateY(18px) scale(.96);filter:blur(4px);}
    to{opacity:1;transform:translateY(0) scale(1);filter:blur(0);}
}
.shift-stats-card{max-width:880px;}
.shift-stats-table-wrap{max-height:55vh;overflow:auto;border:1px solid var(--line);border-radius:20px;}
.shift-stats-table{width:100%;border-collapse:collapse;min-width:680px;}
.shift-stats-table th,.shift-stats-table td{padding:12px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap;}
.shift-stats-table th{color:var(--muted);font-size:12px;background:rgba(255,255,255,.045);}
.shift-table-code{display:inline-grid;place-items:center;min-width:38px;height:32px;padding:0 10px;border-radius:12px;background:var(--shift-color,#6c5ce7);color:#fff;font-weight:1000;}
.shift-stats-total{margin-top:14px;display:flex;justify-content:space-between;gap:12px;align-items:center;border:1px solid rgba(102,217,255,.24);background:rgba(102,217,255,.07);border-radius:18px;padding:14px 16px;font-weight:900;}
.shift-stats-total strong{font-size:20px;}
.shift-day-detail-list{display:grid;gap:10px;max-height:58vh;overflow-y:auto;padding:4px 2px 2px;padding-inline-end:6px;}
.shift-day-detail-row{border:1px solid var(--line);background:linear-gradient(145deg,rgba(255,255,255,.06),rgba(255,255,255,.025));border-radius:18px;padding:12px 14px;display:grid;gap:6px;}
.shift-day-detail-row strong{font-size:15px;}
.shift-day-detail-row span{font-weight:900;}
.shift-day-detail-row span b{display:inline-grid;place-items:center;min-width:32px;height:28px;margin-inline-end:6px;border-radius:10px;background:var(--shift-color,#6c5ce7);color:#fff;}
.shift-day-detail-row small{color:var(--muted);line-height:1.8;}
.shift-day-detail-list.empty-days .shift-day-detail-row{background:rgba(255,255,255,.035);}
html[data-theme="light"] .shift-modal .shared-tasks-backdrop,
body[data-theme="light"] .shift-modal .shared-tasks-backdrop{background:rgba(226,232,240,.18);}
@media (max-width:640px){
    .shift-stats-table{min-width:620px;}
    .shift-stats-total{display:grid;}
}

/* v18.0.0: compact shift calendar, pro settings, quick day assignment and today insight */
.shift-layout.shift-layout-full{grid-template-columns:1fr;}
.shift-calendar-panel-full{min-width:0;}
.shift-type-form-pro{grid-template-columns:repeat(2,minmax(0,1fr));align-items:end;}
.shift-type-form-pro label:nth-child(7){grid-column:auto;}
.shift-type-form-pro button{align-self:end;min-height:45px;}
.shift-settings-card-wide{max-width:980px;}
.shift-settings-grid{display:grid;grid-template-columns:minmax(280px,380px) 1fr;gap:16px;align-items:start;}
.shift-type-list.in-settings{max-height:440px;overflow-y:auto;padding-inline-end:4px;margin:12px 0 0;}
.shift-day-cell{position:relative;overflow:visible;}
.shift-day-cell.today{border-color:rgba(255,214,102,.85);box-shadow:0 0 0 4px rgba(255,214,102,.16),inset 0 0 0 1px rgba(255,214,102,.42);}
.shift-day-cell.today .shift-day-number::after{content:'امروز';display:inline-flex;margin-inline-start:6px;font-size:10px;border-radius:999px;padding:3px 7px;background:rgba(255,214,102,.18);color:var(--text);vertical-align:middle;}
.shift-quick-popover{position:absolute;right:8px;bottom:calc(100% + 10px);z-index:40;width:min(260px,84vw);border:1px solid rgba(102,217,255,.34);border-radius:22px;padding:12px;background:color-mix(in srgb,var(--card-bg,#111827) 88%,transparent);backdrop-filter:blur(22px) saturate(155%);-webkit-backdrop-filter:blur(22px) saturate(155%);box-shadow:0 24px 70px rgba(0,0,0,.32);animation:shiftQuickPop .18s cubic-bezier(.2,.9,.22,1.12);}
.shift-quick-popover::after{content:'';position:absolute;right:24px;bottom:-8px;width:16px;height:16px;border-inline-end:1px solid rgba(102,217,255,.34);border-bottom:1px solid rgba(102,217,255,.34);background:inherit;transform:rotate(45deg);}
.quick-pop-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;}
.quick-pop-head button{width:28px;height:28px;border:0;border-radius:999px;background:rgba(255,255,255,.08);color:var(--text);cursor:pointer;}
.shift-quick-popover form{display:grid;gap:10px;}
.shift-quick-popover select{width:100%;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.08);color:var(--text);padding:10px;outline:none;}
.quick-pop-actions{display:flex;gap:8px;flex-wrap:wrap;}
@keyframes shiftQuickPop{from{opacity:0;transform:translateY(10px) scale(.96);}to{opacity:1;transform:translateY(0) scale(1);}}
.shift-toggle-row{position:relative;overflow:hidden;}
.shift-toggle-row i{background:linear-gradient(135deg,rgba(255,99,132,.26),rgba(255,255,255,.10));border:1px solid rgba(255,99,132,.28);}
.shift-toggle-row input:checked + i{background:linear-gradient(135deg,#29d391,var(--accent));border-color:rgba(41,211,145,.65);box-shadow:0 0 0 4px rgba(41,211,145,.12),inset 0 0 0 1px rgba(255,255,255,.28);}
.shift-settings-tab{opacity:.72;box-shadow:none;}
.shift-settings-tab.active{opacity:1;box-shadow:0 12px 28px rgba(102,217,255,.22);transform:translateY(-1px);}
.shift-today-panel{border:1px solid var(--line);border-radius:28px;background:radial-gradient(circle at 80% 15%,rgba(102,217,255,.14),transparent 28%),rgba(255,255,255,.04);padding:18px;display:grid;grid-template-columns:1.2fr 1fr .8fr;gap:16px;align-items:center;}
.shift-today-panel h3{margin:6px 0;font-size:22px;}
.today-shift-visual{display:grid;gap:8px;}
.today-shift-visual span,.today-next-shift span{font-size:12px;color:var(--muted);font-weight:900;}
.today-progress{height:12px;border-radius:999px;background:rgba(255,255,255,.09);overflow:hidden;border:1px solid var(--line);}
.today-progress i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent),var(--accent-2));transition:width .25s ease;}
.today-next-shift{border:1px dashed rgba(102,217,255,.28);border-radius:20px;padding:14px;background:rgba(102,217,255,.06);display:grid;gap:6px;}
.today-next-shift strong{line-height:1.7;}
.muted-today-panel{grid-template-columns:1fr;}
.shift-day-detail-card{max-width:620px;}
.shift-day-big-detail{display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:start;border:1px solid var(--line);border-radius:22px;padding:16px;background:linear-gradient(145deg,rgba(255,255,255,.07),rgba(255,255,255,.025));}
.shift-day-big-detail h4{margin:0 0 8px;font-size:20px;}
.shift-day-big-detail p{margin:4px 0;color:var(--muted);line-height:1.7;}
@media (max-width:900px){
    .shift-settings-grid,.shift-today-panel{grid-template-columns:1fr;}
    .shift-type-form-pro{grid-template-columns:1fr;}
}
@media (max-width:640px){
    .shift-quick-popover{right:50%;transform:translateX(50%);}
    @keyframes shiftQuickPop{from{opacity:0;transform:translateX(50%) translateY(10px) scale(.96);}to{opacity:1;transform:translateX(50%) translateY(0) scale(1);}}
}

/* v18.1.0: shift UX polish, no-refresh display toggles, quick delete */
.shift-today-panel{
    position:relative;
    overflow:hidden;
    border:1px solid rgba(139,152,255,.28);
    background:
        radial-gradient(circle at 10% 0%,rgba(245,158,11,.20),transparent 30%),
        radial-gradient(circle at 90% 18%,rgba(102,217,255,.18),transparent 32%),
        linear-gradient(135deg,rgba(139,152,255,.10),rgba(255,255,255,.035));
    box-shadow:0 18px 55px rgba(8,13,28,.16);
}
.shift-today-panel::before{
    content:'';
    position:absolute;
    inset:0;
    background:linear-gradient(90deg,rgba(255,255,255,.06),transparent 38%,rgba(255,255,255,.035));
    pointer-events:none;
}
.shift-today-panel > *{position:relative;z-index:1;}
.shift-today-panel .eyebrow{color:#fbbf24;}
.today-shift-main h3{letter-spacing:-.02em;}
.today-progress{height:14px;background:rgba(255,255,255,.13);box-shadow:inset 0 0 0 1px rgba(255,255,255,.06);}
.today-progress i{background:linear-gradient(90deg,#fbbf24,#66d9ff,#8b98ff);}
.today-next-shift{border-color:rgba(251,191,36,.30);background:rgba(251,191,36,.07);}

.shift-quick-popover{
    color:var(--text);
    background:
        radial-gradient(circle at 15% 5%,rgba(102,217,255,.22),transparent 32%),
        linear-gradient(145deg,var(--panel-strong),rgba(13,23,43,.96));
    border-color:rgba(102,217,255,.48);
    box-shadow:0 28px 85px rgba(0,0,0,.42),0 0 0 1px rgba(255,255,255,.05) inset;
}
.shift-quick-popover::after{background:linear-gradient(145deg,var(--panel-strong),rgba(13,23,43,.96));}
.quick-pop-head strong{color:var(--text);font-size:14px;}
.shift-quick-popover select{
    background:rgba(255,255,255,.11);
    color:var(--text);
    border-color:rgba(255,255,255,.16);
    font-weight:800;
}
.shift-quick-popover select option{background:var(--bg-soft);color:var(--text);}
.quick-pop-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
.quick-pop-actions .tiny-btn{padding:9px 8px;min-height:36px;}
.quick-pop-actions .tiny-btn[disabled]{opacity:.45;cursor:not-allowed;filter:grayscale(.45);}
html[data-theme="light"] .shift-quick-popover,
body[data-theme="light"] .shift-quick-popover{
    background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(239,246,255,.96));
    box-shadow:0 28px 70px rgba(30,64,105,.22),0 0 0 1px rgba(255,255,255,.8) inset;
}
html[data-theme="light"] .shift-quick-popover::after,
body[data-theme="light"] .shift-quick-popover::after{background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(239,246,255,.96));}

.shift-toggle-row{
    transition:background .2s ease,border-color .2s ease,box-shadow .2s ease;
}
.shift-toggle-row.is-off{
    background:linear-gradient(135deg,rgba(251,113,133,.075),rgba(255,255,255,.025));
    border-color:rgba(251,113,133,.20);
}
.shift-toggle-row.is-on{
    background:linear-gradient(135deg,rgba(34,197,94,.13),rgba(102,217,255,.08));
    border-color:rgba(34,197,94,.35);
    box-shadow:0 12px 32px rgba(34,197,94,.08);
}
.shift-toggle-row i::before{
    content:'خاموش';
    position:absolute;
    inset-inline-start:8px;
    top:50%;
    transform:translateY(-50%);
    font-size:8px;
    font-weight:1000;
    color:rgba(255,255,255,.70);
    pointer-events:none;
}
.shift-toggle-row input:checked + i::before{
    content:'روشن';
    inset-inline-start:auto;
    inset-inline-end:8px;
    color:#062216;
}
.shift-settings-tabs{
    border-bottom:0;
    padding:8px;
    background:rgba(255,255,255,.035);
    border:1px solid var(--line);
    border-radius:22px;
}
.shift-settings-tab{
    position:relative;
    border-radius:18px;
    opacity:.62;
}
.shift-settings-tab.active{
    opacity:1;
    box-shadow:0 14px 34px rgba(102,217,255,.24);
}
.shift-settings-tab.active::after{
    content:'';
    position:absolute;
    right:18px;
    left:18px;
    bottom:-7px;
    height:4px;
    border-radius:999px;
    background:linear-gradient(90deg,#fbbf24,#66d9ff);
}

.shift-edit-card{
    max-width:720px;
    max-height:min(720px,88vh);
    overflow:hidden;
    display:flex;
    flex-direction:column;
    background:
        radial-gradient(circle at top right,rgba(102,217,255,.18),transparent 34%),
        radial-gradient(circle at bottom left,rgba(139,152,255,.15),transparent 38%),
        linear-gradient(145deg,var(--panel-strong),rgba(13,23,43,.96));
}
.shift-edit-card .modal-head{flex:0 0 auto;}
.shift-edit-form-pro{
    overflow-y:auto;
    padding:6px 4px 2px;
    margin:4px 0 0;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}
.shift-edit-form-pro label{
    border:1px solid var(--line);
    background:rgba(255,255,255,.035);
    border-radius:18px;
    padding:10px;
}
.shift-edit-form-pro .form-actions{grid-column:1 / -1;position:sticky;bottom:0;background:linear-gradient(180deg,transparent,var(--panel-strong) 22%);padding-top:12px;}
html[data-theme="light"] .shift-edit-card,
body[data-theme="light"] .shift-edit-card{background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(239,246,255,.96));}
@media (max-width:640px){
    .quick-pop-actions{grid-template-columns:1fr;}
    .shift-edit-form-pro{grid-template-columns:1fr;}
    .shift-edit-card{max-height:86vh;}
}

/* v20.0.0: rebuilt Persian digits, polished dropdowns, shift ranges, holidays, public shift link */
select,
.field select,
.inline-control select,
.theme-switcher select,
.shift-quick-popover select,
.shift-type-form select,
.shift-assign-form select,
.group-add-member-form select,
.mini-date-field select{
    appearance:none;
    -webkit-appearance:none;
    background-image:
        linear-gradient(45deg,transparent 50%,var(--text) 50%),
        linear-gradient(135deg,var(--text) 50%,transparent 50%),
        linear-gradient(135deg,rgba(102,217,255,.14),rgba(139,152,255,.08));
    background-position:18px calc(50% - 3px),12px calc(50% - 3px),0 0;
    background-size:6px 6px,6px 6px,100% 100%;
    background-repeat:no-repeat;
    border:1px solid rgba(102,217,255,.28);
    border-radius:16px;
    box-shadow:0 10px 28px rgba(2,8,23,.13),inset 0 1px 0 rgba(255,255,255,.07);
    cursor:pointer;
    padding-inline-end:14px;
    padding-inline-start:38px;
    transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease,background-color .2s ease;
}
select:hover,
.field select:hover,
.inline-control select:hover,
.theme-switcher select:hover,
.shift-quick-popover select:hover,
.shift-type-form select:hover,
.shift-assign-form select:hover{
    border-color:rgba(102,217,255,.55);
    box-shadow:0 14px 34px rgba(102,217,255,.12),inset 0 1px 0 rgba(255,255,255,.10);
}
select:focus,
.field select:focus,
.inline-control select:focus,
.theme-switcher select:focus,
.shift-quick-popover select:focus,
.shift-type-form select:focus,
.shift-assign-form select:focus{
    outline:none;
    border-color:var(--accent);
    box-shadow:0 0 0 4px rgba(102,217,255,.14),0 18px 40px rgba(102,217,255,.14);
}
select option{background:#0f172a;color:#f8fafc;}
html[data-theme="light"] select,
body[data-theme="light"] select{
    background-image:
        linear-gradient(45deg,transparent 50%,#1e293b 50%),
        linear-gradient(135deg,#1e293b 50%,transparent 50%),
        linear-gradient(135deg,rgba(102,217,255,.16),rgba(139,152,255,.09));
    background-color:rgba(255,255,255,.92);
    color:#0f172a;
    border-color:rgba(14,165,233,.25);
}
html[data-theme="light"] select option,
body[data-theme="light"] select option{background:#fff;color:#0f172a;}

.holiday-number,
.official-holiday .day-number,
.official-holiday .shift-day-number,
.week-day-column.official-holiday .week-day-head span{
    color:#ff5c7a!important;
    text-shadow:0 0 18px rgba(255,92,122,.22);
}
html[data-theme="light"] .holiday-number,
body[data-theme="light"] .holiday-number,
html[data-theme="light"] .official-holiday .day-number,
body[data-theme="light"] .official-holiday .day-number,
html[data-theme="light"] .official-holiday .shift-day-number,
body[data-theme="light"] .official-holiday .shift-day-number{
    color:#dc2626!important;
    text-shadow:0 0 12px rgba(220,38,38,.13);
}

.shift-calendar-title-line{align-items:stretch;gap:14px;flex-wrap:wrap;}
.shift-public-link-card{
    direction:ltr;
    flex:1 1 360px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    border:1px solid rgba(102,217,255,.24);
    border-radius:22px;
    padding:10px 12px;
    background:linear-gradient(135deg,rgba(102,217,255,.10),rgba(139,152,255,.07));
    box-shadow:0 14px 40px rgba(2,8,23,.12);
}
.shift-public-link-card div{min-width:0;text-align:right;direction:rtl;display:grid;gap:4px;}
.shift-public-link-card strong{font-size:13px;color:var(--text);}
.shift-public-link-card small{
    direction:ltr;
    color:var(--muted);
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    display:block;
    max-width:520px;
    font-size:11px;
}
.shift-calendar-dynamic{display:grid;gap:14px;}
.shift-year-calendar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;}
.shift-mini-month{border:1px solid var(--line);border-radius:22px;padding:12px;background:rgba(255,255,255,.035);display:grid;gap:10px;}
.shift-mini-month-head{display:flex;justify-content:space-between;align-items:center;gap:8px;color:var(--text);}
.shift-mini-month-head span{color:var(--muted);font-size:12px;}
.shift-weekdays.mini{gap:4px;font-size:11px;}
.shift-days-grid.mini-grid{gap:5px;}
.shift-day-cell.mini-cell{min-height:68px;border-radius:14px;padding:7px;}
.shift-day-cell.mini-cell .shift-cell-badges small{display:none;}
.shift-day-cell.mini-cell .shift-cell-badge{padding:5px;border-radius:10px;}
.shift-day-cell.mini-cell .shift-cell-badge b{font-size:13px;}
.shift-day-cell.mini-cell .shift-cell-badge small,
.shift-day-cell.mini-cell .shift-cell-badge em{display:none;}
.shift-week-calendar{display:grid;grid-template-columns:repeat(7,minmax(150px,1fr));gap:12px;overflow-x:auto;padding-bottom:8px;}
.shift-week-day-card{border:1px solid var(--line);border-radius:22px;background:rgba(255,255,255,.035);padding:10px;min-width:150px;display:grid;gap:10px;}
.shift-week-day-title{display:grid;gap:4px;}
.shift-week-day-title strong{color:var(--text);}
.shift-week-day-title span{color:var(--muted);font-size:12px;line-height:1.6;}
.shift-day-cell.week-cell{min-height:180px;}
@media (max-width:1050px){.shift-year-calendar{grid-template-columns:repeat(2,minmax(0,1fr));}.shift-week-calendar{grid-template-columns:repeat(7,180px);}}
@media (max-width:640px){.shift-year-calendar{grid-template-columns:1fr;}.shift-public-link-card{flex-direction:column;align-items:stretch}.shift-public-link-card .tiny-btn{width:100%;}.shift-week-calendar{grid-template-columns:repeat(7,170px);}}

/* v20.1.0: manual holiday control panel + shorter public shift links */
.holiday-admin-panel{display:grid;gap:16px;}
.holiday-form{border:1px solid var(--line);border-radius:22px;padding:14px;background:rgba(255,255,255,.035);}
.holiday-title-field{max-width:640px;}
.holiday-date-row{align-items:end;}
.holiday-table-wrap{max-height:360px;overflow:auto;border-radius:18px;}
.holiday-table-wrap .data-table td:first-child strong{white-space:nowrap;color:var(--text);}
.shift-public-link-card.short-link small{max-width:360px;}


/* v20.2.0: final requested fixes - native selects, styled option list, weekly shift drag/popover, compact yearly badges */
select,
.field select,
.inline-control select,
.theme-switcher select,
.shift-quick-popover select,
.shift-type-form select,
.shift-assign-form select,
.group-add-member-form select,
.mini-date-field select{
    appearance:auto;
    -webkit-appearance:menulist;
    background-image:none!important;
    box-shadow:none;
    cursor:pointer;
    transition:border-color .18s ease,background-color .18s ease,box-shadow .18s ease;
}
.inline-control select,
.theme-switcher select{
    border:0;
    background:transparent;
    padding:2px 4px;
    color:var(--text);
}
.field select,
.shift-quick-popover select,
.shift-type-form select,
.shift-assign-form select,
.group-add-member-form select,
.mini-date-field select{
    border:1px solid var(--line);
    border-radius:14px;
    background:var(--panel-strong);
    color:var(--text);
    padding:10px 12px;
}
select:focus,
.field select:focus,
.inline-control select:focus,
.theme-switcher select:focus,
.shift-quick-popover select:focus,
.shift-type-form select:focus,
.shift-assign-form select:focus{
    outline:none;
    border-color:rgba(102,217,255,.58);
    box-shadow:0 0 0 4px rgba(102,217,255,.12);
}
select option,
select optgroup{
    background:#111827;
    color:#f8fafc;
    padding:10px 12px;
}
select option:checked{background:#2563eb;color:#fff;}
html[data-theme="light"] select option,
body[data-theme="light"] select option,
html[data-theme="light"] select optgroup,
body[data-theme="light"] select optgroup{background:#ffffff;color:#0f172a;}
html[data-theme="light"] .field select,
body[data-theme="light"] .field select,
html[data-theme="light"] .shift-quick-popover select,
body[data-theme="light"] .shift-quick-popover select,
html[data-theme="light"] .shift-type-form select,
body[data-theme="light"] .shift-type-form select,
html[data-theme="light"] .shift-assign-form select,
body[data-theme="light"] .shift-assign-form select{background:#fff;color:#0f172a;}

.shift-week-calendar{
    cursor:grab;
    overscroll-behavior-x:contain;
    scrollbar-width:thin;
    padding-top:4px;
    position:relative;
}
.shift-week-calendar.drag-scroll-active{cursor:grabbing;}
.shift-week-calendar .shift-day-cell{overflow:visible;}
.shift-week-calendar .shift-quick-popover{
    top:calc(100% + 10px);
    bottom:auto;
    z-index:1200;
}
.shift-week-calendar .shift-quick-popover::after{
    bottom:auto;
    top:-8px;
    transform:rotate(225deg);
}
.shift-week-calendar .shift-week-day-card{
    overflow:visible;
}
.shift-week-calendar:has(.shift-quick-popover){padding-bottom:190px;}

.shift-day-cell.mini-cell{
    overflow:hidden;
    min-width:0;
}
.shift-day-cell.mini-cell .shift-cell-badges{
    display:grid;
    gap:3px;
    min-width:0;
    overflow:hidden;
}
.shift-day-cell.mini-cell .shift-cell-badge{
    width:100%;
    max-width:100%;
    min-width:0;
    overflow:hidden;
    padding:4px 5px;
    border-radius:9px;
    justify-content:center;
    align-items:center;
}
.shift-day-cell.mini-cell .shift-cell-badge b{
    display:block;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:11px;
    line-height:1.15;
    text-align:center;
}
.shift-day-cell.mini-cell .shift-cell-badge span,
.shift-day-cell.mini-cell .shift-cell-badge small,
.shift-day-cell.mini-cell .shift-cell-badge em{display:none!important;}
.local-controls-note{display:none!important;}

/* v20.3.0: shift weekly/year quick picker, header user card, public link polish */
.topbar-controls{
    position:relative;
    display:flex;
    align-items:center;
    gap:10px;
}
.topbar-user-menu{position:relative;display:inline-flex;align-items:center;z-index:90;}
.topbar-user-btn{
    width:44px;
    height:44px;
    display:inline-grid;
    place-items:center;
    border:1px solid rgba(102,217,255,.28);
    background:linear-gradient(135deg,rgba(102,217,255,.13),rgba(139,152,255,.10));
    box-shadow:0 12px 32px rgba(2,8,23,.14),inset 0 1px 0 rgba(255,255,255,.10);
}
.topbar-user-popover{
    position:absolute;
    top:calc(100% + 12px);
    left:0;
    width:min(310px,calc(100vw - 28px));
    border:1px solid rgba(102,217,255,.30);
    border-radius:24px;
    padding:14px;
    background:
        radial-gradient(circle at 16% 8%,rgba(102,217,255,.20),transparent 30%),
        linear-gradient(145deg,var(--panel-strong),rgba(13,23,43,.96));
    backdrop-filter:blur(22px) saturate(145%);
    -webkit-backdrop-filter:blur(22px) saturate(145%);
    box-shadow:0 24px 80px rgba(0,0,0,.34),0 0 0 1px rgba(255,255,255,.04) inset;
    animation:userPopoverIn .16s ease-out;
    z-index:1300;
}
.topbar-user-menu:hover .topbar-user-popover{display:block;}
.user-popover-head{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center;}
.user-popover-head strong{display:block;color:var(--text);font-size:16px;margin-bottom:4px;}
.user-popover-head small{display:block;color:var(--muted);font-size:12px;line-height:1.7;}
.user-popover-avatar{
    width:52px;
    height:52px;
    display:grid;
    place-items:center;
    border-radius:18px;
    background:linear-gradient(135deg,var(--accent),var(--accent-2));
    color:#07111f;
    font-weight:1000;
    font-size:22px;
    box-shadow:0 16px 34px rgba(102,217,255,.20);
}
.user-popover-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px;padding-top:12px;border-top:1px solid var(--line);}
.user-popover-actions .chip-link,.user-popover-actions .ghost-btn{flex:1 1 auto;text-align:center;justify-content:center;}
@keyframes userPopoverIn{from{opacity:0;transform:translateY(-6px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
html[data-theme="light"] .topbar-user-popover,
body[data-theme="light"] .topbar-user-popover{background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(239,246,255,.96));box-shadow:0 24px 64px rgba(30,64,105,.20),0 0 0 1px rgba(255,255,255,.75) inset;}

.shift-week-calendar,
.shift-week-day-card,
.shift-year-calendar,
.shift-mini-month,
.shift-days-grid.mini-grid{overflow:visible;}
.shift-calendar-panel,
.shift-calendar-dynamic{overflow:visible;}
.shift-week-calendar{padding-top:10px;padding-bottom:18px;}
.shift-week-calendar:has(.shift-quick-popover){padding-bottom:210px;}
.shift-week-day-card{position:relative;cursor:pointer;}
.shift-week-calendar .shift-day-cell.week-cell{cursor:pointer;}
.shift-week-calendar .shift-quick-popover{top:calc(100% + 10px);bottom:auto;z-index:2200;}
.shift-week-calendar .shift-quick-popover::after{bottom:auto;top:-8px;transform:rotate(225deg);}
.shift-year-calendar:has(.shift-quick-popover){padding-bottom:210px;}
.shift-mini-month:has(.shift-quick-popover){position:relative;z-index:25;}
.shift-day-cell.mini-cell:has(.shift-quick-popover){overflow:visible!important;z-index:40;}
.shift-day-cell.mini-cell .shift-quick-popover{right:0;bottom:auto;top:calc(100% + 8px);width:240px;z-index:2500;}
.shift-day-cell.mini-cell .shift-quick-popover::after{bottom:auto;top:-8px;transform:rotate(225deg);}
.shift-day-cell.mini-cell.today .shift-day-number::after{content:none!important;display:none!important;}
.shift-day-cell.mini-cell.today{box-shadow:0 0 0 2px rgba(255,214,102,.24),inset 0 0 0 1px rgba(255,214,102,.46);}

.shift-public-link-card small{direction:ltr;text-align:left;unicode-bidi:plaintext;}
.shift-public-link-card strong::after{content:' زنده';display:inline-flex;margin-inline-start:7px;padding:2px 7px;border-radius:999px;background:rgba(34,197,94,.13);color:#34d399;font-size:10px;vertical-align:middle;}
@media (max-width:720px){
    .topbar-controls{gap:7px;}
    .topbar-user-popover{left:auto;right:0;}
    .topbar-user-btn{width:40px;height:40px;}
}


/* v20.5.0: clean rebuild for shift weekly/year popovers and header user menu */
.topbar-controls{display:flex;align-items:center;gap:10px;}
.topbar-user-menu{position:relative;display:inline-flex;align-items:center;z-index:90;}
.topbar-user-popover{left:auto;right:0;padding-top:42px;}
.topbar-user-popover.hidden{display:none!important;}
.topbar-user-menu:hover .topbar-user-popover.hidden{display:none!important;}
.user-popover-close{
    position:absolute;
    inset-block-start:10px;
    inset-inline-start:10px;
    width:30px;
    height:30px;
    border:1px solid var(--line);
    border-radius:999px;
    background:rgba(255,255,255,.08);
    color:var(--text);
    font-size:18px;
    font-weight:900;
    cursor:pointer;
    display:grid;
    place-items:center;
    transition:transform .16s ease,background .16s ease,border-color .16s ease;
}
.user-popover-close:hover{transform:rotate(90deg);background:rgba(255,99,132,.15);border-color:rgba(255,99,132,.35);}

.shift-week-calendar{
    overflow-x:auto!important;
    overflow-y:hidden!important;
    cursor:grab;
    overscroll-behavior-x:contain;
    scrollbar-width:thin;
    padding-top:10px;
    padding-bottom:18px!important;
    position:relative;
}
.shift-week-calendar.drag-scroll-active{cursor:grabbing;user-select:none;}
.shift-week-calendar .shift-week-day-card{min-width:150px;position:relative;cursor:pointer;}
.shift-week-calendar .shift-day-cell.week-cell{cursor:pointer;overflow:hidden;}
.shift-week-calendar:has(.shift-quick-popover){padding-bottom:18px!important;}

.shift-floating-popover-holder{position:static!important;}
.shift-floating-popover{
    position:fixed!important;
    right:auto!important;
    bottom:auto!important;
    width:min(260px,84vw);
    z-index:5000!important;
    pointer-events:auto;
}
.shift-floating-popover.shift-floating-above::after{
    bottom:-8px!important;
    top:auto!important;
    transform:rotate(45deg)!important;
}
.shift-floating-popover.shift-floating-below::after{
    top:-8px!important;
    bottom:auto!important;
    transform:rotate(225deg)!important;
}
.shift-floating-popover-year{width:min(240px,84vw);}
.shift-year-calendar:has(.shift-quick-popover){padding-bottom:0!important;}
.shift-day-cell.mini-cell .shift-quick-popover{top:auto;bottom:auto;}
.shift-day-cell.mini-cell.today .shift-day-number::after{content:none!important;display:none!important;}
.shift-day-cell.mini-cell.today{box-shadow:0 0 0 2px rgba(255,214,102,.24),inset 0 0 0 1px rgba(255,214,102,.46);}

/* keep monthly quick popover visually solid; floating fix must not make it transparent */
.shift-days-grid:not(.mini-grid) .shift-day-cell > .shift-quick-popover{
    background:
        radial-gradient(circle at 15% 5%,rgba(102,217,255,.22),transparent 32%),
        linear-gradient(145deg,var(--panel-strong),rgba(13,23,43,.96));
}
html[data-theme="light"] .shift-days-grid:not(.mini-grid) .shift-day-cell > .shift-quick-popover,
body[data-theme="light"] .shift-days-grid:not(.mini-grid) .shift-day-cell > .shift-quick-popover{
    background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(239,246,255,.96));
}
@media (max-width:640px){
    .topbar-user-popover{right:auto;left:0;}
    .shift-week-calendar{grid-template-columns:repeat(7,170px);}
}


/* v20.6.0: final focused fixes for shift week/year popovers and header user card */
.topbar-user-popover{
    position:fixed!important;
    right:auto!important;
    overflow:auto;
    max-width:calc(100vw - 24px);
    will-change:transform,opacity;
    animation:userPopoverInFast .11s cubic-bezier(.2,.85,.2,1) both!important;
}
.topbar-user-menu:hover .topbar-user-popover{display:none;}
.topbar-user-menu:hover .topbar-user-popover:not(.hidden){display:block;}
@keyframes userPopoverInFast{from{opacity:0;transform:translateY(-3px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}

.shift-week-calendar .shift-week-day-card,
.shift-week-calendar .shift-day-cell.week-cell{touch-action:pan-x;cursor:pointer;}
.shift-week-calendar.drag-scroll-active .shift-week-day-card,
.shift-week-calendar.drag-scroll-active .shift-day-cell.week-cell{cursor:grabbing;}

.shift-floating-popover-year{
    width:min(220px,82vw)!important;
    max-height:min(260px,calc(100vh - 28px));
    overflow:auto;
}
.shift-floating-popover-year .quick-pop-actions{gap:6px;}
.shift-floating-popover-year .tiny-btn{padding:8px 10px;font-size:12px;}

/* v20.7.0: exact anchored quick-shift popover for weekly/yearly shift ranges */
.shift-floating-popover-holder[data-shift-floating-portal]{position:static!important;z-index:5000;}
.shift-floating-popover{
    position:fixed!important;
    right:auto!important;
    bottom:auto!important;
    max-height:none!important;
    overflow:visible!important;
    width:min(260px,84vw)!important;
}
.shift-floating-popover-year{
    width:min(260px,84vw)!important;
    max-height:none!important;
    overflow:visible!important;
}
.shift-floating-popover-year .quick-pop-actions{gap:8px;}
.shift-floating-popover-year .tiny-btn{padding:9px 8px;font-size:12px;}
.shift-floating-popover.shift-floating-above::after{bottom:-8px!important;top:auto!important;transform:rotate(45deg)!important;}
.shift-floating-popover.shift-floating-below::after{top:-8px!important;bottom:auto!important;transform:rotate(225deg)!important;}
.shift-week-calendar .shift-day-cell.week-cell{overflow:hidden;}
.shift-year-calendar:has(.shift-quick-popover){padding-bottom:0!important;}

/* v20.8.0: keep weekly shift scroll position and add anchored dialog pointer */
.shift-floating-popover::after{
    right:auto!important;
    left:var(--quick-arrow-left,50%)!important;
    margin-left:-8px;
    box-shadow:3px 3px 10px rgba(0,0,0,.12);
}
.shift-floating-popover.shift-floating-above::after{
    bottom:-8px!important;
    top:auto!important;
    transform:rotate(45deg)!important;
}
.shift-floating-popover.shift-floating-below::after{
    top:-8px!important;
    bottom:auto!important;
    transform:rotate(225deg)!important;
}
.shift-floating-popover.shift-floating-above{
    transform-origin:var(--quick-arrow-left,50%) calc(100% + 8px);
}
.shift-floating-popover.shift-floating-below{
    transform-origin:var(--quick-arrow-left,50%) -8px;
}


/* v20.9.0: keep quick picker pinned to the exact selected week/year day and close on outside click */
.shift-floating-popover{
    transform:none!important;
}
.shift-floating-popover::after{
    pointer-events:none;
}
.shift-floating-popover-week,
.shift-floating-popover-year{
    max-width:min(260px,84vw)!important;
}

/* v20.9.1: weekly quick-shift popover stays above selected day */

/* v21.0.0: compact public shift link and profile public username editor */
.shift-public-link-card{
    flex:0 1 480px!important;
    max-width:min(480px,100%);
}
.shift-public-link-card small{max-width:300px!important;}
.profile-username-card{position:relative;overflow:hidden;}
.profile-username-card::before{
    content:"";
    position:absolute;
    inset:auto -42px -54px auto;
    width:150px;
    height:150px;
    border-radius:999px;
    background:radial-gradient(circle,rgba(102,217,255,.18),transparent 68%);
    pointer-events:none;
}
.profile-username-form{display:grid;gap:12px;position:relative;z-index:1;}
.public-username-input{
    display:grid;
    grid-template-columns:auto 1fr;
    align-items:center;
    gap:8px;
    border:1px solid var(--line);
    border-radius:16px;
    background:rgba(255,255,255,.055);
    padding:5px 10px;
}
.public-username-input b{color:var(--accent);font-size:18px;line-height:1;}
.public-username-input input{
    border:0!important;
    background:transparent!important;
    padding:9px 4px!important;
    box-shadow:none!important;
    color:var(--text);
}
.profile-link-row{
    display:grid;
    grid-template-columns:82px minmax(0,1fr);
    gap:10px;
    align-items:center;
    padding:10px 12px;
    border:1px solid rgba(102,217,255,.16);
    border-radius:16px;
    background:rgba(102,217,255,.055);
}
.profile-link-row span{font-size:12px;color:var(--muted);font-weight:900;}
.profile-link-row code{
    direction:ltr;
    text-align:left;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:var(--text);
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
    font-size:12px;
}
@media (max-width:760px){
    .shift-public-link-card{flex:1 1 100%!important;max-width:100%;}
    .shift-public-link-card small{max-width:100%!important;}
    .profile-link-row{grid-template-columns:1fr;}
}

/* v21.1.0: clean public links, modal consistency, medical-center settings */
.shift-public-link-card{
    flex:0 1 390px!important;
    max-width:min(390px,100%)!important;
}
.shift-public-link-card small{max-width:240px!important;}

.shared-tasks-modal.shift-modal,
.shared-tasks-modal.app-modal-style{
    position:fixed!important;
    inset:0!important;
    z-index:9000!important;
    display:flex!important;
    align-items:flex-start!important;
    justify-content:center!important;
    padding:40px 12px!important;
    overflow:auto!important;
}
.shared-tasks-modal.shift-modal .shared-tasks-backdrop,
.shared-tasks-modal.app-modal-style .shared-tasks-backdrop{
    position:fixed!important;
    inset:0!important;
    background:rgba(3,8,15,.7)!important;
    backdrop-filter:blur(6px)!important;
    -webkit-backdrop-filter:blur(6px)!important;
}
.shared-tasks-modal.shift-modal .shared-tasks-card,
.shared-tasks-modal.app-modal-style .shared-tasks-card{
    position:relative!important;
    z-index:1!important;
    margin:0 auto!important;
    border-radius:28px!important;
    background:var(--panel-strong)!important;
    box-shadow:var(--shadow)!important;
    animation:modalCardIn .18s cubic-bezier(.2,.85,.2,1) both;
}
@keyframes modalCardIn{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
html[data-theme="light"] .shared-tasks-modal.shift-modal .shared-tasks-backdrop,
body[data-theme="light"] .shared-tasks-modal.shift-modal .shared-tasks-backdrop,
html[data-theme="light"] .shared-tasks-modal.app-modal-style .shared-tasks-backdrop,
body[data-theme="light"] .shared-tasks-modal.app-modal-style .shared-tasks-backdrop{background:rgba(148,163,184,.45)!important;}

.shift-type-form select,
.shift-type-form textarea,
.medical-center-form textarea{
    width:100%;
    border:1px solid var(--line);
    border-radius:16px;
    background:rgba(255,255,255,.07);
    color:var(--text);
    padding:11px 12px;
    outline:none;
    resize:vertical;
}
.shift-type-form select option{background:var(--bg-soft);color:var(--text);}
.medical-center-settings-grid{grid-template-columns:minmax(280px,380px) 1fr;}
.medical-centers-list{display:grid;gap:10px;align-content:start;max-height:520px;overflow:auto;padding-inline-end:4px;}
.medical-center-pill{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:20px;
    background:rgba(255,255,255,.045);
}
.medical-center-pill strong{display:block;color:var(--text);}
.medical-center-pill small{display:block;color:var(--muted);font-size:12px;line-height:1.7;margin-top:4px;}
.medical-center-pill .pill-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.shift-settings-card-wide{width:min(980px,calc(100vw - 24px))!important;max-height:calc(100vh - 80px)!important;overflow:auto!important;}
.shift-edit-card{width:min(680px,calc(100vw - 24px))!important;max-height:calc(100vh - 80px)!important;overflow:auto!important;}
@media(max-width:760px){
    .shift-public-link-card{flex:1 1 100%!important;max-width:100%!important;}
    .shift-public-link-card small{max-width:100%!important;}
    .medical-center-settings-grid{grid-template-columns:1fr;}
    .medical-center-pill{align-items:flex-start;display:grid;}
}

/* v21.1.1: every app popup uses the same centered layer behavior as the task modal */
.shared-tasks-modal{
    position:fixed!important;
    inset:0!important;
    z-index:9000!important;
    display:flex!important;
    align-items:flex-start!important;
    justify-content:center!important;
    padding:40px 12px!important;
    overflow:auto!important;
}
.shared-tasks-backdrop{
    position:fixed!important;
    inset:0!important;
    background:rgba(3,8,15,.7)!important;
    backdrop-filter:blur(6px)!important;
    -webkit-backdrop-filter:blur(6px)!important;
}
.shared-tasks-card{
    position:relative!important;
    z-index:1!important;
    margin:0 auto!important;
    border-radius:28px!important;
    background:var(--panel-strong)!important;
    box-shadow:var(--shadow)!important;
    animation:modalCardIn .18s cubic-bezier(.2,.85,.2,1) both;
}
html[data-theme="light"] .shared-tasks-backdrop,
body[data-theme="light"] .shared-tasks-backdrop{background:rgba(148,163,184,.45)!important;}

/* v21.2.0: refined medical-center personnel manager, shift day history and public routes */
.shift-public-link-card{flex:0 1 330px!important;max-width:min(330px,100%)!important;padding:10px 12px!important;}
.shift-public-link-card small{max-width:190px!important;font-size:11px!important;}
.pro-medical-center-grid{grid-template-columns:minmax(320px,480px) 1fr!important;gap:16px!important;}
.pro-medical-center-form{border:1px solid var(--line);border-radius:24px;padding:14px;background:linear-gradient(145deg,rgba(255,255,255,.07),rgba(255,255,255,.025));box-shadow:0 18px 50px rgba(0,0,0,.14);}
.medical-form-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;padding:12px;border-radius:20px;background:linear-gradient(135deg,rgba(102,217,255,.13),rgba(139,152,255,.10));border:1px solid rgba(102,217,255,.16);}
.medical-form-head strong{display:block;color:var(--text);font-size:15px}.medical-form-head small{display:block;color:var(--muted);font-size:12px;margin-top:4px}.form-two-col{display:grid;grid-template-columns:1fr 1fr;gap:10px}.personnel-builder{border:1px solid var(--line);border-radius:22px;padding:12px;background:rgba(255,255,255,.035);display:grid;gap:8px}.personnel-builder-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.personnel-builder-head span{font-weight:1000;color:var(--text)}.add-person-btn{border-color:rgba(102,217,255,.28)!important;background:rgba(102,217,255,.08)!important}.personnel-grid-head,.medical-personnel-row{display:grid;grid-template-columns:42px minmax(130px,1.25fr) minmax(95px,1fr) minmax(96px,.9fr) minmax(90px,.9fr) 38px;gap:8px;align-items:center}.personnel-grid-head{font-size:11px;color:var(--muted);font-weight:900;padding:0 4px}.medical-personnel-row{padding:8px;border-radius:18px;background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.06);transition:.18s ease}.medical-personnel-row:focus-within{border-color:rgba(102,217,255,.42);box-shadow:0 0 0 4px rgba(102,217,255,.08)}.personnel-index{width:30px;height:30px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(135deg,var(--accent),#8b98ff);color:#06111f;font-weight:1000}.medical-personnel-row input{min-width:0;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.07);color:var(--text);padding:10px 9px;outline:none}.pro-medical-centers-list{max-height:620px!important;gap:12px!important}.medical-center-card{border:1px solid var(--line);border-radius:24px;background:rgba(255,255,255,.04);overflow:hidden;box-shadow:0 16px 40px rgba(0,0,0,.10)}.medical-center-summary{width:100%;border:0;background:transparent;color:var(--text);padding:14px;display:flex;align-items:center;gap:12px;text-align:right;cursor:pointer}.medical-center-summary strong{display:block;font-size:15px}.medical-center-summary small{display:block;margin-top:5px;color:var(--muted);font-size:12px;line-height:1.7}.medical-center-chevron{width:32px;height:32px;border-radius:13px;display:grid;place-items:center;background:rgba(102,217,255,.10);color:var(--accent);font-weight:1000;transition:.2s ease}.medical-center-card.open .medical-center-chevron{transform:rotate(180deg)}.medical-center-accordion{display:none;padding:0 14px 14px}.medical-center-card.open .medical-center-accordion{display:grid;gap:10px;animation:softDrop .18s ease both}@keyframes softDrop{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.medical-center-meta{display:flex;gap:8px;flex-wrap:wrap}.medical-center-meta span{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:6px 10px;background:rgba(255,255,255,.035)}.medical-center-actions{display:flex;gap:8px;flex-wrap:wrap}.medical-person-list{display:grid;gap:8px;max-height:330px;overflow:auto;padding-inline-end:3px}.medical-person-card{display:grid;grid-template-columns:32px minmax(120px,1.2fr) minmax(100px,1fr) minmax(90px,.9fr) auto;gap:8px;align-items:center;border:1px solid rgba(255,255,255,.075);border-radius:18px;padding:10px;background:rgba(255,255,255,.045)}.medical-person-card>b{width:28px;height:28px;border-radius:11px;display:grid;place-items:center;background:rgba(139,152,255,.14);color:#9aa7ff}.medical-person-card strong{display:block}.medical-person-card small,.medical-person-card span{color:var(--muted);font-size:12px}.person-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.shift-day-history-box{margin-top:14px;border:1px solid var(--line);border-radius:22px;padding:12px;background:rgba(255,255,255,.04)}.section-title-line.compact{margin:0 0 10px}.section-title-line.compact h3{font-size:15px}.shift-day-history-form{display:grid;grid-template-columns:minmax(110px,.6fr) minmax(110px,.55fr) 1fr auto;gap:8px;align-items:center}.shift-day-history-form select,.shift-day-history-form input{border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.07);color:var(--text);padding:11px 10px;min-width:0}.shift-day-history-list{display:grid;gap:8px;margin-top:10px;max-height:240px;overflow:auto}.shift-history-row{display:grid;grid-template-columns:90px 1fr auto auto;gap:8px;align-items:center;border:1px solid rgba(255,255,255,.07);border-radius:16px;padding:10px;background:rgba(255,255,255,.04)}.shift-history-row b{color:var(--accent)}.shift-history-row.pass b{color:#fbbf24}.shift-history-row span{color:var(--text)}.shift-history-row small,.shift-history-row time{color:var(--muted);font-size:12px}
@media(max-width:900px){.pro-medical-center-grid{grid-template-columns:1fr!important}.personnel-grid-head{display:none}.medical-personnel-row{grid-template-columns:34px 1fr 1fr}.medical-personnel-row input{grid-column:auto}.medical-personnel-row .icon-btn{grid-column:3}.medical-person-card{grid-template-columns:30px 1fr}.medical-person-card span,.medical-person-card .person-actions{grid-column:2}.shift-day-history-form{grid-template-columns:1fr}.form-two-col{grid-template-columns:1fr}.shift-public-link-card{flex:1 1 100%!important;max-width:100%!important}.shift-public-link-card small{max-width:100%!important}}

/* v21.3.0: shift medical-center accordion, day leave form, assignment center and note marker */
.medical-center-settings-stack.pro-medical-center-grid{display:grid!important;grid-template-columns:1fr!important;gap:16px!important;align-items:start;}
.medical-form-accordion-card{border:1px solid var(--line);border-radius:26px;background:linear-gradient(145deg,rgba(102,217,255,.075),rgba(139,152,255,.045));box-shadow:0 18px 50px rgba(0,0,0,.12);overflow:hidden;}
.medical-form-accordion-head{width:100%;border:0;background:transparent;color:var(--text);padding:16px;display:flex;align-items:center;gap:12px;text-align:right;cursor:pointer;}
.medical-form-accordion-head strong{display:block;font-size:16px;}
.medical-form-accordion-head small{display:block;color:var(--muted);font-size:12px;margin-top:5px;line-height:1.7;}
.medical-form-accordion-card .pro-medical-center-form{display:none;border:0!important;border-top:1px solid var(--line);border-radius:0!important;margin:0;background:rgba(255,255,255,.025)!important;box-shadow:none!important;}
.medical-form-accordion-card.open .pro-medical-center-form{display:grid;animation:softDrop .18s ease both;}
.medical-form-accordion-card.open .medical-center-chevron{transform:rotate(180deg);}
.pro-medical-centers-list{max-height:560px!important;overflow:auto;border:1px solid var(--line);border-radius:26px;padding:12px;background:rgba(255,255,255,.025);}
.shift-note-marker{position:absolute;top:9px;left:9px;z-index:3;width:25px;height:25px;display:grid;place-items:center;border-radius:10px;background:linear-gradient(135deg,rgba(102,217,255,.96),rgba(139,152,255,.92));color:#06111f;font-weight:1000;font-size:13px;box-shadow:0 10px 24px rgba(102,217,255,.22);}
.shift-day-cell.mini-cell .shift-note-marker{width:18px;height:18px;border-radius:7px;font-size:10px;top:5px;left:5px;}
.shift-week-calendar .shift-note-marker{top:12px;left:12px;}
.shift-assign-form{grid-template-columns:repeat(2,minmax(0,1fr));}
.shift-assign-form label:last-of-type{grid-column:1/-1;}
.shift-assign-actions{grid-column:1/-1;}
.leave-register-box{background:linear-gradient(145deg,rgba(139,152,255,.08),rgba(102,217,255,.045))!important;}
.leave-register-form{grid-template-columns:minmax(130px,.7fr) minmax(130px,.7fr) minmax(130px,.7fr) 1fr auto!important;}
.leave-register-form [hidden]{display:none!important;}
.shift-history-row.leave b{color:#a78bfa;}
.shift-history-row.leave{border-color:rgba(167,139,250,.22);background:rgba(167,139,250,.06);}
.shift-quick-popover form{display:grid;gap:10px;}
.shift-quick-popover select[name="medical_center_id"]{border-color:rgba(139,152,255,.28);}
@media(max-width:900px){
  .leave-register-form{grid-template-columns:1fr!important;}
  .shift-assign-form{grid-template-columns:1fr!important;}
  .pro-medical-centers-list{max-height:none!important;}
}

/* v21.4.0: AJAX leave register, selected shift personnel and wider shift workspace */
.app-shell.content-only-mode .main-content{grid-column:1/-1;}
.calendar-wrapper.shift-mode{min-height:calc(100vh - 118px);}
.shift-settings-card-wide{width:min(1080px,calc(100vw - 24px))!important;}
.shared-tasks-modal:not([data-shift-floating-portal]){z-index:12000!important;}
.shared-tasks-modal .shared-tasks-card{max-height:calc(100vh - 72px);overflow:auto;}
.shift-day-history-box.leave-register-box{
    border:1px solid rgba(102,217,255,.16);
    background:linear-gradient(145deg,rgba(102,217,255,.075),rgba(139,152,255,.045) 48%,rgba(255,255,255,.035));
    box-shadow:0 18px 42px rgba(0,0,0,.12);
}
.shift-day-history-form.leave-register-form{
    grid-template-columns:minmax(140px,.7fr) minmax(120px,.55fr) 1fr auto;
    padding:10px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:20px;
    background:rgba(0,0,0,.08);
}
.shift-day-history-list{
    gap:10px!important;
    margin-top:12px!important;
}
.shift-history-item{
    display:grid;
    grid-template-columns:42px minmax(0,1fr) auto;
    gap:10px;
    align-items:center;
    border:1px solid rgba(255,255,255,.08);
    border-radius:20px;
    padding:12px;
    background:linear-gradient(135deg,rgba(255,255,255,.07),rgba(255,255,255,.035));
    box-shadow:0 12px 30px rgba(0,0,0,.10);
}
.shift-history-item.pass{border-color:rgba(251,191,36,.24);}
.shift-history-item.leave{border-color:rgba(167,139,250,.25);}
.history-kind-badge{
    width:38px;height:38px;border-radius:15px;display:grid;place-items:center;
    background:rgba(102,217,255,.12);border:1px solid rgba(102,217,255,.16);font-size:18px;
}
.shift-history-item.pass .history-kind-badge{background:rgba(251,191,36,.13);border-color:rgba(251,191,36,.22);}
.shift-history-item.leave .history-kind-badge{background:rgba(167,139,250,.14);border-color:rgba(167,139,250,.25);}
.history-main strong{display:block;color:var(--text);font-weight:1000;}
.history-main p{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.8;}
.history-meta{display:grid;justify-items:end;gap:4px;white-space:nowrap;}
.history-meta span{font-weight:900;color:var(--accent);font-size:12px;}
.history-meta time{color:var(--muted);font-size:11px;}
.polished-empty{border:1px dashed rgba(102,217,255,.22);background:rgba(102,217,255,.045);border-radius:18px;}
.shift-personnel-box{
    margin-top:14px;
    border:1px solid rgba(139,152,255,.18);
    border-radius:24px;
    overflow:hidden;
    background:linear-gradient(145deg,rgba(139,152,255,.08),rgba(102,217,255,.035));
    box-shadow:0 16px 36px rgba(0,0,0,.10);
}
.shift-personnel-head{
    width:100%;border:0;background:transparent;color:var(--text);padding:14px 16px;
    display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:right;cursor:pointer;
}
.shift-personnel-head strong{display:block;font-size:15px;}
.shift-personnel-head small{display:block;color:var(--muted);font-size:12px;margin-top:5px;}
.shift-personnel-head i{width:34px;height:34px;border-radius:14px;display:grid;place-items:center;background:rgba(102,217,255,.10);color:var(--accent);font-style:normal;font-weight:1000;transition:.18s ease;}
.shift-personnel-box.open .shift-personnel-head i{transform:rotate(180deg);}
.shift-personnel-body{display:none;padding:0 14px 14px;gap:12px;}
.shift-personnel-box.open .shift-personnel-body{display:grid;animation:softDrop .18s ease both;}
.shift-personnel-choices{display:flex;flex-wrap:wrap;gap:8px;max-height:190px;overflow:auto;padding:4px;}
.shift-personnel-choice{
    border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.045);color:var(--text);
    padding:10px 12px;text-align:right;cursor:pointer;min-width:160px;transition:.16s ease;
}
.shift-personnel-choice strong{display:block;font-size:13px;}
.shift-personnel-choice small{display:block;color:var(--muted);font-size:11px;margin-top:4px;}
.shift-personnel-choice:hover{transform:translateY(-1px);border-color:rgba(102,217,255,.28);}
.shift-personnel-choice.selected{border-color:var(--accent);box-shadow:0 0 0 3px rgba(102,217,255,.12);background:rgba(102,217,255,.10);}
.compact-actions{margin-top:0!important;}
.selected-shift-personnel-list{display:grid;gap:8px;}
.selected-shift-person-row{
    display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:8px;
    padding:9px 10px;border:1px solid rgba(255,255,255,.07);border-radius:16px;background:rgba(255,255,255,.04);
}
.selected-shift-person-row b{width:28px;height:28px;display:grid;place-items:center;border-radius:11px;background:rgba(139,152,255,.16);color:#aeb7ff;}
.selected-shift-person-row span{font-weight:900;color:var(--text);}
.selected-shift-person-row small{color:var(--muted);font-size:12px;}
@media(max-width:760px){
    .shift-day-history-form.leave-register-form{grid-template-columns:1fr;}
    .shift-history-item{grid-template-columns:38px 1fr;}
    .history-meta{grid-column:2;justify-items:start;}
    .shift-personnel-choice{min-width:100%;}
    .selected-shift-person-row{grid-template-columns:30px 1fr;}
    .selected-shift-person-row small{grid-column:2;}
}

/* v21.5.0: shift settings polish, true modal layering, editable leave records */
.modal,
.shared-tasks-modal,
.shared-tasks-modal.shift-modal,
.shared-tasks-modal.app-modal-style{
    z-index:60000!important;
}
.modal-backdrop,
.shared-tasks-backdrop{
    z-index:0!important;
    background:rgba(3,8,15,.72)!important;
    backdrop-filter:blur(8px) saturate(135%)!important;
    -webkit-backdrop-filter:blur(8px) saturate(135%)!important;
}
.modal-card,
.shared-tasks-card{
    z-index:1!important;
}
.shared-tasks-modal.shift-modal,
.shared-tasks-modal.app-modal-style,
.shared-tasks-modal{
    align-items:flex-start!important;
    justify-content:center!important;
    padding:42px 14px!important;
}
.shared-tasks-card.shift-settings-card,
.shared-tasks-card.shift-settings-card-wide{
    background:
        radial-gradient(circle at 8% 4%,rgba(102,217,255,.14),transparent 28%),
        radial-gradient(circle at 92% 0%,rgba(139,152,255,.13),transparent 25%),
        linear-gradient(145deg,rgba(15,23,42,.98),rgba(21,31,48,.96))!important;
    border-color:rgba(102,217,255,.16)!important;
    box-shadow:0 34px 100px rgba(0,0,0,.42)!important;
}
html[data-theme="light"] .shared-tasks-card.shift-settings-card,
body[data-theme="light"] .shared-tasks-card.shift-settings-card,
html[data-theme="light"] .shared-tasks-card.shift-settings-card-wide,
body[data-theme="light"] .shared-tasks-card.shift-settings-card-wide{
    background:
        radial-gradient(circle at 8% 4%,rgba(14,165,233,.12),transparent 30%),
        radial-gradient(circle at 92% 0%,rgba(99,102,241,.10),transparent 26%),
        linear-gradient(145deg,#ffffff,#f8fbff)!important;
    box-shadow:0 34px 85px rgba(15,23,42,.20)!important;
}
.shift-settings-card .modal-head{
    padding:14px 14px 12px;
    border:1px solid rgba(102,217,255,.14);
    border-radius:24px;
    background:linear-gradient(135deg,rgba(102,217,255,.09),rgba(139,152,255,.055));
}
.shift-settings-tabs{
    padding:10px!important;
    border:1px solid rgba(255,255,255,.08)!important;
    border-radius:22px!important;
    background:rgba(0,0,0,.08)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.045);
}
.shift-settings-tab{
    background:rgba(255,255,255,.055)!important;
    border-color:rgba(255,255,255,.09)!important;
    box-shadow:none!important;
}
.shift-settings-tab.active{
    background:linear-gradient(135deg,var(--accent),var(--accent-2))!important;
    color:#06111f!important;
    box-shadow:0 14px 32px rgba(102,217,255,.18)!important;
}
.shift-settings-pane.active{
    animation:softPaneIn .16s ease both;
}
@keyframes softPaneIn{from{opacity:.65;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
.shift-day-overview-card{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:14px;
    padding:16px;
    border:1px solid rgba(102,217,255,.16);
    border-radius:26px;
    background:linear-gradient(135deg,color-mix(in srgb,var(--shift-color,#6c5ce7) 15%,transparent),rgba(255,255,255,.045));
    box-shadow:0 18px 45px rgba(0,0,0,.13);
    margin-bottom:12px;
}
.shift-day-overview-icon{
    width:56px;
    height:56px;
    border-radius:20px;
    display:grid;
    place-items:center;
    background:var(--shift-color,#6c5ce7);
    color:#fff;
    font-weight:1000;
    font-size:20px;
    box-shadow:0 18px 36px color-mix(in srgb,var(--shift-color,#6c5ce7) 24%,transparent);
}
.shift-day-overview-text small{display:block;color:var(--muted);font-weight:900;margin-bottom:4px;}
.shift-day-overview-text h4{margin:0;font-size:20px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.shift-day-overview-text h4 span{display:inline-grid;place-items:center;min-width:34px;height:28px;border-radius:11px;background:var(--shift-color,#6c5ce7);color:#fff;font-size:13px;padding:0 8px;}
.shift-day-overview-text p{margin:7px 0 0;color:var(--muted);line-height:1.85;}
.shift-day-overview-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.shift-assign-form-collapsed{
    border:1px solid rgba(102,217,255,.14);
    border-radius:24px;
    padding:14px;
    background:rgba(255,255,255,.035);
    margin-bottom:12px;
}
.shift-assign-form-collapsed[hidden]{display:none!important;}
.shift-day-history-box.leave-register-box{
    background:linear-gradient(145deg,rgba(102,217,255,.055),rgba(139,152,255,.035))!important;
    border-color:rgba(102,217,255,.14)!important;
}
.shift-day-history-form.leave-register-form{
    background:transparent!important;
    border:0!important;
    padding:0!important;
    box-shadow:none!important;
    grid-template-columns:minmax(140px,.6fr) minmax(130px,.55fr) minmax(130px,.55fr) minmax(180px,1fr) auto auto!important;
}
.shift-day-history-form.leave-register-form select,
.shift-day-history-form.leave-register-form input{
    background:rgba(255,255,255,.055)!important;
    border-color:rgba(255,255,255,.10)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}
html[data-theme="light"] .shift-day-history-form.leave-register-form select,
body[data-theme="light"] .shift-day-history-form.leave-register-form select,
html[data-theme="light"] .shift-day-history-form.leave-register-form input,
body[data-theme="light"] .shift-day-history-form.leave-register-form input{
    background:#fff!important;
    border-color:rgba(15,23,42,.12)!important;
}
.shift-history-item{
    grid-template-columns:42px minmax(0,1fr) auto auto!important;
    border-radius:22px!important;
}
.history-actions{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.shift-personnel-box{
    padding:14px;
}
.shift-personnel-title-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:4px 2px 12px;
}
.shift-personnel-title-row strong{display:block;font-size:15px;color:var(--text);}
.shift-personnel-title-row small{display:block;margin-top:5px;color:var(--muted);font-size:12px;}
.shift-personnel-box .selected-shift-personnel-list.always-visible{
    margin-bottom:10px;
}
.shift-personnel-head.selector-head{
    border:1px solid rgba(102,217,255,.14)!important;
    border-radius:18px!important;
    background:rgba(102,217,255,.055)!important;
    padding:12px 14px!important;
}
.shift-personnel-body{
    padding:12px 0 0!important;
}
@media(max-width:860px){
    .shift-day-overview-card{grid-template-columns:1fr;}
    .shift-day-overview-actions{justify-content:flex-start;}
    .shift-day-history-form.leave-register-form{grid-template-columns:1fr!important;}
    .shift-history-item{grid-template-columns:38px 1fr!important;}
    .history-meta,.history-actions{grid-column:2;justify-items:start;justify-content:flex-start;}
}


/* v21.5.1: keep sticky header below modal layer, clamp monthly quick picker, equalize yearly shift cells */
body.modal-layer-open .sticky-topbar{
    filter:blur(7px) saturate(.85);
    opacity:.38;
    pointer-events:none;
    transition:filter .16s ease,opacity .16s ease;
}
.shift-days-grid:not(.mini-grid) .shift-day-cell > .shift-quick-popover{
    max-width:min(260px,calc(100vw - 24px));
}
.shift-days-grid:not(.mini-grid) .shift-day-cell > .shift-quick-popover::after{
    right:auto!important;
    left:var(--quick-arrow-left,calc(100% - 32px))!important;
    margin-left:-8px;
}
.shift-days-grid.mini-grid{
    grid-auto-rows:58px;
    align-items:stretch;
}
.shift-days-grid.mini-grid .shift-day-cell{
    height:58px!important;
    min-height:58px!important;
    max-height:58px!important;
    padding:6px!important;
    overflow:hidden;
}
.shift-days-grid.mini-grid .shift-day-cell.empty{
    height:58px!important;
    min-height:58px!important;
}
.shift-days-grid.mini-grid .shift-cell-badges{
    min-height:20px;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
}
.shift-days-grid.mini-grid .shift-cell-badge{
    max-width:100%;
    overflow:hidden;
}


/* v21.6.1: verified rebuild — true modal priority, roomier yearly shift calendar, multi-shift badges */
body.modal-layer-open .sticky-topbar,
body.modal-layer-open .site-drawer,
body.modal-layer-open .topbar-user-popover{
    z-index:0!important;
    filter:blur(8px) saturate(.78)!important;
    opacity:.30!important;
    pointer-events:none!important;
}
body.modal-layer-open .modal:not(.hidden),
body.modal-layer-open .shared-tasks-modal,
body.modal-layer-open .shared-tasks-modal.shift-modal,
body.modal-layer-open .shared-tasks-modal.app-modal-style{
    position:fixed!important;
    inset:0!important;
    z-index:2147483000!important;
    isolation:isolate!important;
}
body.modal-layer-open .modal:not(.hidden) .modal-backdrop,
body.modal-layer-open .shared-tasks-modal .shared-tasks-backdrop{
    position:fixed!important;
    inset:0!important;
    z-index:0!important;
}
body.modal-layer-open .modal:not(.hidden) .modal-card,
body.modal-layer-open .shared-tasks-modal .shared-tasks-card{
    position:relative!important;
    z-index:2!important;
}
.shift-days-grid.mini-grid{
    grid-auto-rows:90px!important;
    align-items:stretch!important;
}
.shift-days-grid.mini-grid .shift-day-cell,
.shift-days-grid.mini-grid .shift-day-cell.empty{
    height:90px!important;
    min-height:90px!important;
    max-height:90px!important;
    padding:7px!important;
    overflow:hidden!important;
}
.shift-days-grid.mini-grid .shift-cell-badges{
    min-height:48px!important;
    max-height:54px!important;
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
    gap:4px!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
}
.shift-days-grid.mini-grid .shift-cell-badge{
    width:100%!important;
    min-width:0!important;
    justify-content:center!important;
    padding:5px 4px!important;
}
.shift-days-grid.mini-grid .shift-cell-badge b{font-size:13px!important;line-height:1!important;}
.shift-cell-badges{display:flex;flex-direction:column;gap:5px;}
.shift-cell-badge + .shift-cell-badge{margin-top:2px;}
.shift-day-detail-list{display:grid;gap:10px;}
@media (max-width:1050px){.shift-days-grid.mini-grid{grid-auto-rows:86px!important}.shift-days-grid.mini-grid .shift-day-cell,.shift-days-grid.mini-grid .shift-day-cell.empty{height:86px!important;min-height:86px!important;max-height:86px!important;}}


/* v21.6.2: center every modal/popup in the visible viewport and keep scrolling inside the card */
body.modal-layer-open{
    overflow:hidden!important;
}
@supports selector(:has(*)){
    html:has(body.modal-layer-open){overflow:hidden!important;}
}
.modal:not(.hidden),
.shared-tasks-modal:not([data-shift-floating-portal]),
.shared-tasks-modal.shift-modal,
.shared-tasks-modal.app-modal-style{
    position:fixed!important;
    inset:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:16px!important;
    overflow:hidden!important;
    min-height:100dvh!important;
}
.modal:not(.hidden) .modal-backdrop,
.shared-tasks-modal:not([data-shift-floating-portal]) .shared-tasks-backdrop{
    position:fixed!important;
    inset:0!important;
}
.modal:not(.hidden) .modal-card,
.shared-tasks-modal:not([data-shift-floating-portal]) .shared-tasks-card{
    margin:0!important;
    max-height:calc(100dvh - 32px)!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable both-edges;
}
.shared-tasks-modal:not([data-shift-floating-portal]) .shift-settings-card,
.shared-tasks-modal:not([data-shift-floating-portal]) .shift-settings-card-wide{
    max-height:calc(100dvh - 32px)!important;
}
@supports not (height:100dvh){
    .modal:not(.hidden),
    .shared-tasks-modal:not([data-shift-floating-portal]),
    .shared-tasks-modal.shift-modal,
    .shared-tasks-modal.app-modal-style{min-height:100vh!important;}
    .modal:not(.hidden) .modal-card,
    .shared-tasks-modal:not([data-shift-floating-portal]) .shared-tasks-card{max-height:calc(100vh - 32px)!important;}
}
@media(max-width:640px){
    .modal:not(.hidden),
    .shared-tasks-modal:not([data-shift-floating-portal]),
    .shared-tasks-modal.shift-modal,
    .shared-tasks-modal.app-modal-style{padding:10px!important;}
    .modal:not(.hidden) .modal-card,
    .shared-tasks-modal:not([data-shift-floating-portal]) .shared-tasks-card{max-height:calc(100dvh - 20px)!important;width:calc(100vw - 20px)!important;}
}

/* v21.6.3: keep the page scrollable while shift modals are open
   هدف: وقتی پاپ‌آپ‌های شیفت باز هستند، بک‌دراپ و کارت باقی بمانند اما اسکرول صفحه قفل نشود.
   پاپ‌آپ ثبت سریع شیفت با کلاس .shift-quick-popover عمداً دست‌نخورده مانده است. */
body.modal-layer-open{
    overflow-y:auto!important;
    overflow-x:hidden!important;
    position:static!important;
    touch-action:auto!important;
}
@supports selector(:has(*)){
    html:has(body.modal-layer-open){
        overflow-y:auto!important;
        overflow-x:hidden!important;
        touch-action:auto!important;
    }
}
body.modal-layer-open .shared-tasks-modal.shift-modal,
body.modal-layer-open .shared-tasks-modal.app-modal-style{
    pointer-events:none!important;
    overscroll-behavior:auto!important;
    touch-action:pan-y!important;
}
body.modal-layer-open .shared-tasks-modal.shift-modal .shared-tasks-backdrop,
body.modal-layer-open .shared-tasks-modal.app-modal-style .shared-tasks-backdrop{
    pointer-events:none!important;
    touch-action:pan-y!important;
}
body.modal-layer-open .shared-tasks-modal.shift-modal .shared-tasks-card,
body.modal-layer-open .shared-tasks-modal.app-modal-style .shared-tasks-card{
    pointer-events:auto!important;
    touch-action:auto!important;
}

/* v21.6.4: shift modal portal — keep settings/details/compare boxes inside the current viewport.
   ثبت سریع شیفت (.shift-quick-popover) عمداً دست‌نخورده است. */
#shiftModalRoot{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:var(--shift-modal-vh,100vh)!important;
    z-index:2147483600!important;
    pointer-events:none!important;
    isolation:isolate!important;
}
#shiftModalRoot:empty{display:none!important;}
#shiftModalRoot.is-open{display:block!important;}
#shiftModalRoot .shared-tasks-modal,
#shiftModalRoot .shared-tasks-modal.shift-modal,
#shiftModalRoot .shared-tasks-modal.app-modal-style{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:var(--shift-modal-vh,100vh)!important;
    min-height:0!important;
    max-height:none!important;
    display:grid!important;
    place-items:center!important;
    align-items:center!important;
    justify-content:center!important;
    padding:16px!important;
    margin:0!important;
    overflow:hidden!important;
    z-index:2147483600!important;
    pointer-events:auto!important;
    touch-action:auto!important;
    transform:none!important;
}
#shiftModalRoot .shared-tasks-backdrop{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:var(--shift-modal-vh,100vh)!important;
    z-index:0!important;
    pointer-events:auto!important;
    background:rgba(3,8,15,.72)!important;
    backdrop-filter:blur(10px) saturate(135%)!important;
    -webkit-backdrop-filter:blur(10px) saturate(135%)!important;
}
#shiftModalRoot .shared-tasks-card,
#shiftModalRoot .modal-card{
    position:relative!important;
    z-index:2!important;
    width:min(980px,calc(100vw - 32px))!important;
    max-width:calc(100vw - 32px)!important;
    max-height:calc(var(--shift-modal-vh,100vh) - 32px)!important;
    margin:0!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable both-edges;
    transform:none!important;
    pointer-events:auto!important;
    touch-action:auto!important;
}
#shiftModalRoot .shared-tasks-card.shift-settings-card,
#shiftModalRoot .shared-tasks-card.shift-settings-card-wide,
#shiftModalRoot .modal-card.shift-settings-card,
#shiftModalRoot .modal-card.shift-settings-card-wide{
    width:min(980px,calc(100vw - 32px))!important;
    max-height:calc(var(--shift-modal-vh,100vh) - 32px)!important;
}
#shiftModalRoot .shift-people-card,
#shiftModalRoot .shift-edit-card{
    width:min(760px,calc(100vw - 32px))!important;
    max-height:calc(var(--shift-modal-vh,100vh) - 32px)!important;
}
#shiftModalRoot .shift-day-detail-list,
#shiftModalRoot .shift-stats-table-wrap,
#shiftModalRoot .shift-people-list,
#shiftModalRoot .shift-type-list.in-settings,
#shiftModalRoot .medical-centers-list,
#shiftModalRoot .pro-medical-centers-list{
    max-height:min(58vh,calc(var(--shift-modal-vh,100vh) - 220px))!important;
}
body.modal-layer-open #shiftModalRoot .shared-tasks-modal.shift-modal,
body.modal-layer-open #shiftModalRoot .shared-tasks-modal.app-modal-style{
    pointer-events:auto!important;
    touch-action:auto!important;
}
body.modal-layer-open #shiftModalRoot .shared-tasks-backdrop{
    pointer-events:auto!important;
    touch-action:auto!important;
}
body.modal-layer-open #shiftModalRoot .shared-tasks-card,
body.modal-layer-open #shiftModalRoot .modal-card{
    pointer-events:auto!important;
    touch-action:auto!important;
}
@media(max-width:640px){
    #shiftModalRoot .shared-tasks-modal,
    #shiftModalRoot .shared-tasks-modal.shift-modal,
    #shiftModalRoot .shared-tasks-modal.app-modal-style{
        padding:10px!important;
    }
    #shiftModalRoot .shared-tasks-card,
    #shiftModalRoot .modal-card,
    #shiftModalRoot .shared-tasks-card.shift-settings-card,
    #shiftModalRoot .shared-tasks-card.shift-settings-card-wide,
    #shiftModalRoot .modal-card.shift-settings-card,
    #shiftModalRoot .modal-card.shift-settings-card-wide,
    #shiftModalRoot .shift-people-card,
    #shiftModalRoot .shift-edit-card{
        width:calc(100vw - 20px)!important;
        max-width:calc(100vw - 20px)!important;
        max-height:calc(var(--shift-modal-vh,100vh) - 20px)!important;
        border-radius:24px!important;
    }
}


/* v21.6.5: test shift settings with the same card class as the period picker.
   فقط مودال تنظیمات تقویم شیفت تغییر کرده؛ ثبت سریع شیفت دست‌نخورده است. */
#shiftModalRoot .modal-card.period-picker-card.shift-settings-card{
    width:min(980px,calc(100vw - 32px))!important;
    max-width:calc(100vw - 32px)!important;
    max-height:calc(var(--shift-modal-vh,100vh) - 32px)!important;
    margin:0!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable both-edges;
    padding:22px!important;
    border-radius:28px!important;
    z-index:2!important;
    pointer-events:auto!important;
    touch-action:auto!important;
    background:
        radial-gradient(circle at 8% 4%,rgba(102,217,255,.14),transparent 28%),
        radial-gradient(circle at 92% 0%,rgba(139,152,255,.13),transparent 25%),
        linear-gradient(145deg,rgba(15,23,42,.98),rgba(21,31,48,.96))!important;
    border:1px solid rgba(102,217,255,.16)!important;
    box-shadow:0 34px 100px rgba(0,0,0,.42)!important;
}
html[data-theme="light"] #shiftModalRoot .modal-card.period-picker-card.shift-settings-card,
body[data-theme="light"] #shiftModalRoot .modal-card.period-picker-card.shift-settings-card{
    background:
        radial-gradient(circle at 8% 4%,rgba(14,165,233,.12),transparent 30%),
        radial-gradient(circle at 92% 0%,rgba(99,102,241,.10),transparent 26%),
        linear-gradient(145deg,#ffffff,#f8fbff)!important;
    box-shadow:0 34px 85px rgba(15,23,42,.20)!important;
}
@media(max-width:640px){
    #shiftModalRoot .modal-card.period-picker-card.shift-settings-card{
        width:calc(100vw - 20px)!important;
        max-width:calc(100vw - 20px)!important;
        max-height:calc(var(--shift-modal-vh,100vh) - 20px)!important;
        border-radius:24px!important;
        padding:18px!important;
    }
}

/* v21.6.6: use the exact period-picker modal classes for shift dialogs.
   Applies to shift settings, day details, compare/friends, stats and edit dialogs only.
   Quick shift popover is not touched. */
#shiftModalRoot .modal.period-picker-modal.shift-modal{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:var(--shift-modal-vh,100vh)!important;
    min-height:0!important;
    max-height:none!important;
    display:grid!important;
    place-items:center!important;
    align-items:center!important;
    justify-content:center!important;
    padding:16px!important;
    margin:0!important;
    overflow:hidden!important;
    z-index:2147483600!important;
    isolation:isolate!important;
    pointer-events:auto!important;
    touch-action:auto!important;
    transform:none!important;
}
#shiftModalRoot .modal.period-picker-modal.shift-modal .modal-backdrop{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:var(--shift-modal-vh,100vh)!important;
    z-index:0!important;
    pointer-events:auto!important;
    background:rgba(3,8,15,.7)!important;
    backdrop-filter:blur(6px)!important;
    -webkit-backdrop-filter:blur(6px)!important;
}
#shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card{
    position:relative!important;
    z-index:2!important;
    width:min(760px,calc(100vw - 32px))!important;
    max-width:calc(100vw - 32px)!important;
    max-height:calc(var(--shift-modal-vh,100vh) - 32px)!important;
    margin:0!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable both-edges;
    transform:none!important;
    pointer-events:auto!important;
    touch-action:auto!important;
}
#shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-settings-card,
#shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-settings-card-wide{
    width:min(980px,calc(100vw - 32px))!important;
}
#shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-people-card,
#shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-stats-card,
#shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-edit-card,
#shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-day-detail-card{
    width:min(760px,calc(100vw - 32px))!important;
}
#shiftModalRoot .modal.period-picker-modal.shift-modal .shift-day-detail-list,
#shiftModalRoot .modal.period-picker-modal.shift-modal .shift-stats-table-wrap,
#shiftModalRoot .modal.period-picker-modal.shift-modal .shift-people-list,
#shiftModalRoot .modal.period-picker-modal.shift-modal .shift-type-list.in-settings,
#shiftModalRoot .modal.period-picker-modal.shift-modal .medical-centers-list,
#shiftModalRoot .modal.period-picker-modal.shift-modal .pro-medical-centers-list{
    max-height:min(58vh,calc(var(--shift-modal-vh,100vh) - 220px))!important;
    overflow:auto!important;
}
html[data-theme="light"] #shiftModalRoot .modal.period-picker-modal.shift-modal .modal-backdrop,
body[data-theme="light"] #shiftModalRoot .modal.period-picker-modal.shift-modal .modal-backdrop{
    background:rgba(148,163,184,.45)!important;
}
body.modal-layer-open #shiftModalRoot .modal.period-picker-modal.shift-modal,
body.modal-layer-open #shiftModalRoot .modal.period-picker-modal.shift-modal .modal-backdrop,
body.modal-layer-open #shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card{
    pointer-events:auto!important;
    touch-action:auto!important;
}
@media(max-width:640px){
    #shiftModalRoot .modal.period-picker-modal.shift-modal{
        padding:10px!important;
    }
    #shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card,
    #shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-settings-card,
    #shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-settings-card-wide,
    #shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-people-card,
    #shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-stats-card,
    #shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-edit-card,
    #shiftModalRoot .modal.period-picker-modal.shift-modal .modal-card.period-picker-card.shift-day-detail-card{
        width:calc(100vw - 20px)!important;
        max-width:calc(100vw - 20px)!important;
        max-height:calc(var(--shift-modal-vh,100vh) - 20px)!important;
        border-radius:24px!important;
    }
}

/* v12: Shift dialogs now use the same coding classes as the period picker.
   Target dialogs: settings, day details, shift compare/friends, stats, edit.
   Quick shift popover is intentionally untouched. */
#shiftModalRoot{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100vh!important;
    z-index:2147483600!important;
    pointer-events:none!important;
    isolation:isolate!important;
}
#shiftModalRoot:empty{display:none!important;}
#shiftModalRoot .modal.period-picker-modal[data-shift-period-modal]{
    position:fixed!important;
    inset:0!important;
    z-index:2147483600!important;
    width:100vw!important;
    height:100vh!important;
    min-height:100vh!important;
    display:block!important;
    padding:0!important;
    margin:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    pointer-events:auto!important;
    touch-action:auto!important;
    transform:none!important;
}
#shiftModalRoot .modal.period-picker-modal[data-shift-period-modal] .modal-backdrop{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100vh!important;
    z-index:0!important;
    pointer-events:auto!important;
    background:rgba(3,8,15,.7)!important;
    backdrop-filter:blur(6px)!important;
    -webkit-backdrop-filter:blur(6px)!important;
}
#shiftModalRoot .modal.period-picker-modal[data-shift-period-modal] .modal-card.period-picker-card{
    position:relative!important;
    z-index:1!important;
    width:min(760px,calc(100% - 24px))!important;
    max-width:calc(100% - 24px)!important;
    min-height:0!important;
    max-height:none!important;
    height:auto!important;
    margin:40px auto!important;
    padding:22px!important;
    overflow:visible!important;
    border-radius:28px!important;
    border:1px solid var(--line)!important;
    background:var(--panel-strong)!important;
    box-shadow:var(--shadow)!important;
    transform:none!important;
    pointer-events:auto!important;
    touch-action:auto!important;
}
/* Settings has more fields, but keeps the period-picker card class and visual system. */
#shiftModalRoot .modal.period-picker-modal[data-shift-period-modal="settings"] .modal-card.period-picker-card{
    width:min(760px,calc(100% - 24px))!important;
}
#shiftModalRoot .modal.period-picker-modal[data-shift-period-modal] .modal-head{
    display:flex!important;
    align-items:flex-start!important;
    justify-content:space-between!important;
    gap:12px!important;
    margin-bottom:16px!important;
}
#shiftModalRoot .modal.period-picker-modal[data-shift-period-modal] .modal-head h3{
    margin:4px 0 0!important;
    font-size:28px!important;
}
html[data-theme="light"] #shiftModalRoot .modal.period-picker-modal[data-shift-period-modal] .modal-backdrop,
body[data-theme="light"] #shiftModalRoot .modal.period-picker-modal[data-shift-period-modal] .modal-backdrop{
    background:rgba(148,163,184,.45)!important;
}
@media(max-width:640px){
    #shiftModalRoot .modal.period-picker-modal[data-shift-period-modal] .modal-card.period-picker-card{
        width:calc(100% - 20px)!important;
        max-width:calc(100% - 20px)!important;
        margin:10px auto!important;
        border-radius:24px!important;
    }
}

/* v22.0.0: unified popup/modal system — every interactive popup now shares the task modal shell. */
.modal.hidden,
.shared-tasks-modal.hidden,
.topbar-user-popover.hidden{
    display:none!important;
}
.modal:not(.hidden),
.shared-tasks-modal:not(.hidden){
    position:fixed!important;
    inset:0!important;
    z-index:2147483600!important;
    display:grid!important;
    place-items:center!important;
    align-items:center!important;
    justify-content:center!important;
    width:100vw!important;
    min-height:100vh!important;
    min-height:100dvh!important;
    padding:16px!important;
    margin:0!important;
    overflow:hidden!important;
    isolation:isolate!important;
    pointer-events:auto!important;
}
.modal-backdrop,
.shared-tasks-backdrop,
.modal:not(.hidden) > .modal-backdrop,
.shared-tasks-modal:not(.hidden) > .modal-backdrop{
    position:fixed!important;
    inset:0!important;
    z-index:0!important;
    background:rgba(3,8,15,.70)!important;
    backdrop-filter:blur(6px) saturate(135%)!important;
    -webkit-backdrop-filter:blur(6px) saturate(135%)!important;
    pointer-events:auto!important;
}
.modal-card,
.shared-tasks-card,
.modal:not(.hidden) > .modal-card,
.shared-tasks-modal:not(.hidden) > .modal-card{
    position:relative!important;
    z-index:2!important;
    width:min(640px,calc(100vw - 24px))!important;
    max-width:calc(100vw - 24px)!important;
    max-height:calc(100dvh - 32px)!important;
    margin:0!important;
    padding:22px!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable both-edges;
    border-radius:28px!important;
    border:1px solid var(--line)!important;
    background:var(--panel-strong)!important;
    box-shadow:var(--shadow)!important;
    animation:modalCardIn .18s cubic-bezier(.2,.85,.2,1) both!important;
    pointer-events:auto!important;
}
.modal-head,
.modal-card .modal-head,
.shared-tasks-card .modal-head{
    display:flex!important;
    align-items:flex-start!important;
    justify-content:space-between!important;
    gap:12px!important;
    margin-bottom:16px!important;
}
.modal-head h3,
.modal-card .modal-head h3,
.shared-tasks-card .modal-head h3{
    margin:4px 0 0!important;
    font-size:28px!important;
    line-height:1.25!important;
}
.modal-subtitle,
.modal-head .muted{
    margin:7px 0 0!important;
    line-height:1.75!important;
}
.modal-card-wide,
.day-modal .modal-card{
    width:min(960px,calc(100vw - 24px))!important;
}
.period-picker-card,
.period-picker-modal .modal-card{
    width:min(720px,calc(100vw - 24px))!important;
}
.shared-tasks-card{
    width:min(760px,calc(100vw - 24px))!important;
}
.topbar-user-card{
    width:min(430px,calc(100vw - 24px))!important;
}
.shift-day-detail-card,
.shift-people-card,
.shift-stats-card,
.shift-edit-card{
    width:min(760px,calc(100vw - 24px))!important;
}
.shift-settings-card,
.shift-settings-card-wide{
    width:min(980px,calc(100vw - 24px))!important;
}
#shiftModalRoot{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100vh!important;
    height:100dvh!important;
    z-index:2147483600!important;
    pointer-events:none!important;
    isolation:isolate!important;
}
#shiftModalRoot:empty,
#shiftModalRoot:not(.is-open){
    display:none!important;
}
#shiftModalRoot.is-open{
    display:block!important;
    pointer-events:auto!important;
}
#shiftModalRoot .modal.app-unified-modal{
    z-index:2147483600!important;
    min-height:var(--shift-modal-vh,100dvh)!important;
}
#shiftModalRoot .modal.app-unified-modal .modal-card{
    max-height:calc(var(--shift-modal-vh,100dvh) - 32px)!important;
}
#shiftModalRoot .shift-day-detail-list,
#shiftModalRoot .shift-stats-table-wrap,
#shiftModalRoot .shift-people-list,
#shiftModalRoot .shift-type-list.in-settings,
#shiftModalRoot .medical-centers-list,
#shiftModalRoot .pro-medical-centers-list{
    max-height:min(58vh,calc(var(--shift-modal-vh,100dvh) - 220px))!important;
    overflow:auto!important;
}
.shift-modal .field select,
.shift-modal .field input,
.shift-modal .field textarea{
    width:100%;
}
.modal.topbar-user-popover:not(.hidden){
    top:0!important;
    left:0!important;
    right:auto!important;
    width:100vw!important;
    max-width:none!important;
    max-height:none!important;
    padding:16px!important;
    overflow:hidden!important;
    filter:none!important;
    opacity:1!important;
    pointer-events:auto!important;
}
.modal.topbar-user-popover .modal-backdrop{
    background:rgba(3,8,15,.70)!important;
}
.modal.topbar-user-popover .user-popover-head{
    margin-top:2px;
}
.modal.topbar-user-popover .user-popover-actions{
    margin-top:16px;
}
body.modal-layer-open .modal.topbar-user-popover,
body.modal-layer-open #shiftModalRoot,
body.modal-layer-open .modal:not(.hidden),
body.modal-layer-open .shared-tasks-modal:not(.hidden){
    filter:none!important;
    opacity:1!important;
    pointer-events:auto!important;
}
html[data-theme="light"] .modal-backdrop,
body[data-theme="light"] .modal-backdrop,
html[data-theme="light"] .shared-tasks-backdrop,
body[data-theme="light"] .shared-tasks-backdrop{
    background:rgba(148,163,184,.45)!important;
}
html[data-theme="light"] .modal-card,
body[data-theme="light"] .modal-card,
html[data-theme="light"] .shared-tasks-card,
body[data-theme="light"] .shared-tasks-card{
    background:var(--panel-strong)!important;
}
@media(max-width:640px){
    .modal:not(.hidden),
    .shared-tasks-modal:not(.hidden),
    .modal.topbar-user-popover:not(.hidden){
        padding:10px!important;
    }
    .modal-card,
    .shared-tasks-card,
    .modal-card-wide,
    .day-modal .modal-card,
    .period-picker-card,
    .period-picker-modal .modal-card,
    .shared-tasks-card,
    .topbar-user-card,
    .shift-day-detail-card,
    .shift-people-card,
    .shift-stats-card,
    .shift-edit-card,
    .shift-settings-card,
    .shift-settings-card-wide{
        width:calc(100vw - 20px)!important;
        max-width:calc(100vw - 20px)!important;
        max-height:calc(100dvh - 20px)!important;
        border-radius:24px!important;
    }
}
.modal.topbar-user-popover{
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
}
.drawer-backdrop{
    background:rgba(3,8,15,.70)!important;
    backdrop-filter:blur(6px) saturate(135%)!important;
    -webkit-backdrop-filter:blur(6px) saturate(135%)!important;
}
html[data-theme="light"] .drawer-backdrop,
body[data-theme="light"] .drawer-backdrop{
    background:rgba(148,163,184,.45)!important;
}

/* v24.0.0: unified list/calendar mode, modern theme toggle, shift timeline blocks and multi-shift gradients */
.theme-toggle-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    min-height:48px;
    padding:9px 14px;
    border-radius:18px;
    border:1px solid rgba(102,217,255,.24);
    color:var(--text);
    background:
        radial-gradient(circle at 82% 18%,rgba(102,217,255,.20),transparent 34%),
        linear-gradient(135deg,rgba(255,255,255,.075),rgba(255,255,255,.028));
    box-shadow:0 14px 34px rgba(2,8,23,.14),inset 0 1px 0 rgba(255,255,255,.08);
    cursor:pointer;
    font:inherit;
    font-weight:900;
    transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease,background .2s ease;
}
.theme-toggle-btn.compact{min-height:42px;padding:7px 11px;font-size:13px;border-radius:15px;}
.theme-toggle-btn:hover{transform:translateY(-1px);border-color:rgba(102,217,255,.52);box-shadow:0 18px 42px rgba(102,217,255,.14),inset 0 1px 0 rgba(255,255,255,.10);}
.theme-toggle-btn:focus-visible{outline:none;box-shadow:0 0 0 4px rgba(102,217,255,.16),0 18px 42px rgba(102,217,255,.14);}
.theme-toggle-orb{
    width:30px;
    height:30px;
    display:inline-grid;
    place-items:center;
    border-radius:12px;
    background:linear-gradient(135deg,var(--accent),var(--accent-2));
    color:#06111d;
    box-shadow:0 10px 24px rgba(102,217,255,.20);
}
.theme-toggle-btn.compact .theme-toggle-orb{width:26px;height:26px;border-radius:10px;}
.theme-toggle-btn.is-light .theme-toggle-orb{background:linear-gradient(135deg,#ffd166,#ff9f43);}
html[data-theme="light"] .theme-toggle-btn,
body[data-theme="light"] .theme-toggle-btn{
    background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(232,246,255,.82));
    border-color:rgba(15,23,42,.12);
    box-shadow:0 14px 34px rgba(15,23,42,.08),inset 0 1px 0 rgba(255,255,255,.9);
}

.task-list-view-grid{display:block!important;}
.task-list-board{display:grid;gap:16px;width:100%;}
.task-list-hero{margin-bottom:0;}
.task-list-stack{display:grid;gap:14px;}
.task-list-day-section{
    border:1px solid var(--line);
    border-radius:24px;
    padding:14px;
    background:linear-gradient(135deg,rgba(255,255,255,.05),rgba(255,255,255,.025));
    box-shadow:0 18px 44px rgba(0,0,0,.12);
}
.task-list-day-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:12px;
    padding-bottom:10px;
    border-bottom:1px solid var(--line);
}
.task-list-day-head strong{display:block;font-size:16px;}
.task-list-day-head span{display:block;color:var(--muted);font-size:12px;margin-top:2px;}
.task-list-day-items{display:grid;gap:10px;}
.task-list-empty{min-height:220px;display:grid;place-items:center;}
html[data-theme="light"] .task-list-day-section,
body[data-theme="light"] .task-list-day-section{background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(239,246,255,.82));}

.timeline-task.timeline-shift{
    border-color:color-mix(in srgb,var(--shift-color,#6c5ce7) 52%,rgba(255,255,255,.16));
    background:
        linear-gradient(135deg,color-mix(in srgb,var(--shift-color,#6c5ce7) 28%,rgba(15,23,42,.78)),rgba(255,255,255,.055)),
        linear-gradient(135deg,rgba(255,255,255,.06),rgba(255,255,255,.02));
    box-shadow:0 18px 48px color-mix(in srgb,var(--shift-color,#6c5ce7) 22%,transparent),0 14px 34px rgba(0,0,0,.18);
}
.timeline-task.timeline-shift::before{
    content:'';
    position:absolute;
    inset:10px auto 10px 10px;
    width:5px;
    border-radius:999px;
    background:var(--shift-color,#6c5ce7);
    box-shadow:0 0 22px color-mix(in srgb,var(--shift-color,#6c5ce7) 55%,transparent);
}
.timeline-shift-code{
    display:inline-grid;
    place-items:center;
    min-width:42px;
    height:34px;
    padding:0 10px;
    border-radius:14px;
    color:#fff;
    background:var(--shift-color,#6c5ce7);
    font-weight:1000;
    box-shadow:0 12px 28px color-mix(in srgb,var(--shift-color,#6c5ce7) 25%,transparent);
}
html[data-theme="light"] .timeline-task.timeline-shift,
body[data-theme="light"] .timeline-task.timeline-shift{background:linear-gradient(135deg,color-mix(in srgb,var(--shift-color,#6c5ce7) 18%,#fff),rgba(255,255,255,.88));}

.timeline-task-time{white-space:nowrap;}
.timeline-task.timeline-shift{
    grid-template-columns:minmax(118px,max-content) minmax(0,1fr) auto;
    gap:14px;
}
.timeline-task.timeline-shift .timeline-task-time{
    justify-self:start;
    min-width:108px;
    text-align:center;
}
.timeline-task.timeline-shift > div:nth-child(2){min-width:0;padding-inline-start:2px;}
@media (max-width:560px){
    .timeline-task.timeline-shift{grid-template-columns:1fr;}
    .timeline-task.timeline-shift .timeline-task-time{justify-self:stretch;min-width:0;}
}

.shift-day-cell.has-multiple-shifts{
    --shift-color-1:var(--shift-color,#6c5ce7);
    --shift-color-2:#00cec9;
    background:
        linear-gradient(135deg,
            color-mix(in srgb,var(--shift-color-1) 28%,rgba(255,255,255,.055)) 0%,
            color-mix(in srgb,var(--shift-color-1) 16%,rgba(255,255,255,.04)) 42%,
            color-mix(in srgb,var(--shift-color-2) 16%,rgba(255,255,255,.04)) 58%,
            color-mix(in srgb,var(--shift-color-2) 28%,rgba(255,255,255,.055)) 100%),
        radial-gradient(circle at 18% 18%,color-mix(in srgb,var(--shift-color-1) 36%,transparent),transparent 34%),
        radial-gradient(circle at 82% 82%,color-mix(in srgb,var(--shift-color-2) 36%,transparent),transparent 34%);
    border-color:color-mix(in srgb,var(--shift-color-1) 30%,var(--shift-color-2));
}
.shift-day-cell.has-multiple-shifts::before{
    content:'';
    position:absolute;
    inset:1px;
    border-radius:inherit;
    pointer-events:none;
    background:linear-gradient(135deg,transparent 47%,rgba(255,255,255,.28) 50%,transparent 53%);
    opacity:.45;
}
.shift-day-cell.has-multiple-shifts .shift-cell-badge{background:rgba(2,8,23,.20);backdrop-filter:blur(10px);}
html[data-theme="light"] .shift-day-cell.has-multiple-shifts,
body[data-theme="light"] .shift-day-cell.has-multiple-shifts{
    background:
        linear-gradient(135deg,
            color-mix(in srgb,var(--shift-color-1) 24%,#fff) 0%,
            color-mix(in srgb,var(--shift-color-1) 12%,#fff) 42%,
            color-mix(in srgb,var(--shift-color-2) 12%,#fff) 58%,
            color-mix(in srgb,var(--shift-color-2) 24%,#fff) 100%);
}

@media (max-width:720px){
    .task-list-day-head{align-items:flex-start;flex-direction:column;}
    .theme-toggle-btn{width:100%;}
    .calendar-local-controls .theme-toggle-btn{width:auto;}
}

/* v26.0.0: refined theme switch, reliable monthly quick shift and flexible 24h shift timing */
.theme-toggle-switch{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:0;
    min-height:46px;
    padding:7px;
    border-radius:999px;
    border:1px solid rgba(102,217,255,.24);
    color:var(--text);
    background:linear-gradient(135deg,rgba(255,255,255,.075),rgba(255,255,255,.03));
    box-shadow:0 14px 34px rgba(2,8,23,.14),inset 0 1px 0 rgba(255,255,255,.08);
    cursor:pointer;
    font:inherit;
    font-weight:900;
    transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease,background .2s ease;
}
.theme-toggle-switch.compact{min-height:40px;padding:5px;font-size:13px;}
.theme-toggle-switch:hover{transform:translateY(-1px);border-color:rgba(102,217,255,.52);box-shadow:0 18px 42px rgba(102,217,255,.14),inset 0 1px 0 rgba(255,255,255,.10);}
.theme-toggle-switch:focus-visible{outline:none;box-shadow:0 0 0 4px rgba(102,217,255,.16),0 18px 42px rgba(102,217,255,.14);}
.theme-switch-track{
    width:58px;
    height:32px;
    border-radius:999px;
    position:relative;
    display:inline-flex;
    align-items:center;
    padding:3px;
    background:linear-gradient(135deg,#172554,#0f172a);
    border:1px solid rgba(255,255,255,.12);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.05),0 10px 24px rgba(2,8,23,.22);
    transition:.22s ease;
}
.theme-switch-track::before,
.theme-switch-track::after{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    font-size:11px;
    line-height:1;
    opacity:.72;
    pointer-events:none;
}
.theme-switch-track::before{content:'☀';left:9px;}
.theme-switch-track::after{content:'☾';right:9px;color:#dbeafe;}
.theme-switch-thumb{
    width:26px;
    height:26px;
    border-radius:50%;
    display:grid;
    place-items:center;
    position:relative;
    z-index:1;
    color:#08111f;
    background:linear-gradient(135deg,var(--accent),var(--accent-2));
    box-shadow:0 8px 20px rgba(102,217,255,.28);
    transform:translateX(0);
    transition:transform .22s cubic-bezier(.2,.8,.2,1),background .22s ease,box-shadow .22s ease;
}
.theme-toggle-switch.is-light .theme-switch-track,
html[data-theme="light"] .theme-toggle-switch .theme-switch-track,
body[data-theme="light"] .theme-toggle-switch .theme-switch-track{
    background:linear-gradient(135deg,#e2e8f0,#ffffff);
    border-color:rgba(15,23,42,.12);
}
.theme-toggle-switch.is-light .theme-switch-thumb,
html[data-theme="light"] .theme-toggle-switch .theme-switch-thumb,
body[data-theme="light"] .theme-toggle-switch .theme-switch-thumb{
    transform:translateX(-26px);
    color:#0f172a;
    background:linear-gradient(135deg,#ffffff,#f8fafc);
    box-shadow:0 8px 20px rgba(15,23,42,.14),inset 0 0 0 1px rgba(15,23,42,.08);
}
html[data-theme="light"] .theme-toggle-switch,
body[data-theme="light"] .theme-toggle-switch{
    background:linear-gradient(135deg,rgba(255,255,255,.94),rgba(232,246,255,.84));
    border-color:rgba(15,23,42,.12);
    box-shadow:0 14px 34px rgba(15,23,42,.08),inset 0 1px 0 rgba(255,255,255,.9);
}

.shift-24-toggle{
    grid-column:1/-1;
    display:flex!important;
    align-items:center;
    justify-content:flex-start;
    gap:10px!important;
    padding:12px 14px;
    border:1px solid rgba(102,217,255,.18);
    border-radius:18px;
    background:linear-gradient(135deg,rgba(102,217,255,.075),rgba(255,255,255,.035));
    color:var(--text)!important;
    cursor:pointer;
    user-select:none;
}
.shift-24-toggle input{display:none!important;}
.shift-24-toggle i{
    width:52px;
    height:28px;
    border-radius:999px;
    position:relative;
    flex:0 0 auto;
    background:rgba(255,255,255,.10);
    border:1px solid var(--line);
    transition:.2s ease;
}
.shift-24-toggle i::after{
    content:'';
    position:absolute;
    top:3px;
    right:3px;
    width:22px;
    height:22px;
    border-radius:50%;
    background:#fff;
    box-shadow:0 8px 18px rgba(0,0,0,.24);
    transition:.2s ease;
}
.shift-24-toggle input:checked + i{
    background:linear-gradient(135deg,var(--accent),var(--accent-2));
    border-color:rgba(102,217,255,.65);
    box-shadow:0 0 0 4px rgba(102,217,255,.12);
}
.shift-24-toggle input:checked + i::after{right:25px;}
.shift-type-form.is-24h-shift input[name="end_time"],
.shift-type-form.is-24h-shift input[name="hours"]{
    opacity:.72;
    cursor:not-allowed;
    background:rgba(102,217,255,.08)!important;
}
.shift-type-form.is-24h-shift input[name="start_time"]{
    opacity:1;
    cursor:pointer;
    background:rgba(255,255,255,.07)!important;
    border-color:rgba(102,217,255,.38)!important;
    box-shadow:0 0 0 3px rgba(102,217,255,.08);
}
.shift-floating-popover-month{width:min(270px,84vw);}
@media (max-width:720px){
    .theme-toggle-switch{width:100%;}
    .calendar-local-controls .theme-toggle-switch{width:auto;}
    .theme-switch-track{width:54px;height:30px;}
    .theme-switch-thumb{width:24px;height:24px;}
    .theme-toggle-switch.is-light .theme-switch-thumb,
    html[data-theme="light"] .theme-toggle-switch .theme-switch-thumb,
    body[data-theme="light"] .theme-toggle-switch .theme-switch-thumb{transform:translateX(-24px);}
}

/* v29: remove the old undated-task sidebar and let the planner breathe full-width. */
.app-shell{
    grid-template-columns:minmax(0,1fr);
}
.app-shell .sidebar{
    display:none;
}
.app-shell .main-content{
    grid-column:1/-1;
}

.category-picker-box{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:12px;
    align-items:end;
    padding:12px;
    border:1px solid var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.035);
}
.category-add-btn{white-space:nowrap}
.category-modal-card{max-width:520px}
.category-preview-list{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    min-height:42px;
    padding:10px;
    border:1px dashed var(--line);
    border-radius:16px;
    background:rgba(255,255,255,.025);
}
.category-preview-pill{
    display:inline-flex;
    align-items:center;
    gap:7px;
    padding:7px 10px;
    border-radius:999px;
    border:1px solid color-mix(in srgb, var(--cat-color, #66d9ff) 45%, transparent);
    background:color-mix(in srgb, var(--cat-color, #66d9ff) 14%, transparent);
    font-weight:800;
    font-size:12px;
}
.category-preview-pill i,
.category-dot{
    width:10px;
    height:10px;
    border-radius:999px;
    background:var(--cat-color, #66d9ff);
    box-shadow:0 0 0 4px color-mix(in srgb, var(--cat-color, #66d9ff) 16%, transparent);
    flex:0 0 auto;
}
.category-task-view-grid,
.goals-list-view-grid{
    display:block;
}
.category-task-board,
.goals-placeholder-board{
    display:flex;
    flex-direction:column;
    gap:16px;
}
.category-task-hero{
    align-items:center;
}
.category-hero-actions{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}
.category-task-stack{
    display:flex;
    flex-direction:column;
    gap:14px;
}
.category-task-section{
    border:1px solid color-mix(in srgb, var(--cat-color, #66d9ff) 28%, var(--line));
    border-radius:24px;
    padding:14px;
    background:
        radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--cat-color, #66d9ff) 18%, transparent), transparent 32%),
        rgba(255,255,255,.035);
    box-shadow:0 18px 45px rgba(0,0,0,.12);
}
.category-task-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding-bottom:12px;
    border-bottom:1px solid var(--line);
    margin-bottom:12px;
}
.category-title-row{
    display:flex;
    align-items:center;
    gap:12px;
}
.category-title-row strong{display:block;font-size:18px}
.category-title-row span:not(.category-dot){display:block;color:var(--muted);font-size:12px;margin-top:2px}
.category-task-items{
    display:flex;
    flex-direction:column;
    gap:10px;
}
.goals-empty-shell{
    min-height:360px;
}

@media (max-width: 720px){
    .category-picker-box{
        grid-template-columns:1fr;
    }
    .category-task-head,
    .category-task-hero{
        align-items:stretch;
        flex-direction:column;
    }
    .category-hero-actions{
        width:100%;
    }
    .category-hero-actions .primary-btn,
    .category-hero-actions .ghost-btn,
    .category-task-head .ghost-btn{
        width:100%;
    }
}

/* v30: category manager, subtasks, and compact categorized task list */
.category-modal-card{max-width:620px;}
.category-manager-list{
    display:flex;
    flex-direction:column;
    gap:10px;
    max-height:280px;
    overflow:auto;
    padding:10px;
    border:1px dashed var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.025);
}
.category-manager-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:10px;
    border:1px solid color-mix(in srgb, var(--cat-color, #66d9ff) 24%, var(--line));
    border-radius:16px;
    background:linear-gradient(135deg, color-mix(in srgb, var(--cat-color, #66d9ff) 12%, transparent), rgba(255,255,255,.028));
}
.category-manager-item.is-editing{
    border-color:color-mix(in srgb, var(--cat-color, #66d9ff) 70%, var(--line));
    box-shadow:0 0 0 3px color-mix(in srgb, var(--cat-color, #66d9ff) 14%, transparent);
}
.category-manager-title,
.category-manager-actions{
    display:flex;
    align-items:center;
    gap:10px;
}
.category-manager-title i{
    width:12px;
    height:12px;
    border-radius:999px;
    background:var(--cat-color, #66d9ff);
    box-shadow:0 0 0 5px color-mix(in srgb, var(--cat-color, #66d9ff) 16%, transparent);
    flex:0 0 auto;
}
.category-manager-title strong{display:block;font-size:14px;}
.category-manager-title span{display:block;color:var(--muted);font-size:11px;margin-top:2px;}
.tiny-action{
    min-height:0;
    padding:6px 10px;
    border-radius:12px;
    font-size:12px;
}
.subtask-box{
    display:flex;
    flex-direction:column;
    gap:10px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.032);
}
.subtask-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.subtask-head strong{display:block;font-size:15px;}
.subtask-head span{display:block;font-size:12px;margin-top:3px;}
.subtask-add-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
}
.subtask-add-row input,
.subtask-item input[type="text"]{
    width:100%;
    border:1px solid var(--line);
    border-radius:14px;
    background:rgba(255,255,255,.06);
    color:var(--text);
    padding:10px 12px;
    outline:none;
}
.subtask-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}
.subtask-item{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    gap:8px;
    align-items:center;
    padding:8px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:16px;
    background:rgba(0,0,0,.10);
}
.subtask-item.is-completed input[type="text"]{
    text-decoration:line-through;
    opacity:.68;
}
.subtask-check{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:30px;
    height:30px;
    border-radius:12px;
    cursor:pointer;
    background:rgba(255,255,255,.05);
}
.subtask-check input{width:18px;height:18px;accent-color:var(--primary);}
.subtask-remove{width:34px;height:34px;min-width:34px;}
.day-subtask-preview{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:6px;
    margin-top:10px;
}
.day-subtask-preview strong,
.day-subtask-preview span{
    display:inline-flex;
    align-items:center;
    min-height:24px;
    padding:4px 8px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.05);
    font-size:11px;
    color:var(--muted);
}
.day-subtask-preview strong{
    color:var(--text);
    border-color:rgba(102,217,255,.22);
    background:rgba(102,217,255,.09);
}
.day-subtask-preview span.is-done{
    text-decoration:line-through;
    opacity:.62;
}
.category-density-control{
    min-width:170px;
}
.category-task-board.is-compact .category-task-section{
    padding:12px;
    border-radius:20px;
}
.category-task-board.is-compact .category-task-items{
    gap:7px;
}
.compact-category-task{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto auto;
    gap:10px;
    align-items:center;
    padding:9px 10px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:16px;
    background:rgba(255,255,255,.032);
    transition:transform .18s ease,border-color .18s ease,background .18s ease;
}
.compact-category-task:hover{
    transform:translateY(-1px);
    border-color:rgba(102,217,255,.26);
    background:rgba(255,255,255,.052);
}
.compact-category-task.is-completed .compact-category-main strong{
    text-decoration:line-through;
    opacity:.62;
}
.compact-category-check{
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
}
.compact-category-check input{width:18px;height:18px;accent-color:var(--primary);}
.compact-category-main{min-width:0;}
.compact-category-main strong{
    display:block;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:14px;
}
.compact-category-main small{
    display:block;
    color:var(--muted);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    margin-top:2px;
    font-size:11px;
}
html[data-theme="light"] .category-manager-item,
body[data-theme="light"] .category-manager-item,
html[data-theme="light"] .subtask-box,
body[data-theme="light"] .subtask-box,
html[data-theme="light"] .subtask-item,
body[data-theme="light"] .subtask-item,
html[data-theme="light"] .compact-category-task,
body[data-theme="light"] .compact-category-task{
    background:rgba(255,255,255,.72);
    border-color:rgba(15,23,42,.10);
}
html[data-theme="light"] .subtask-add-row input,
body[data-theme="light"] .subtask-add-row input,
html[data-theme="light"] .subtask-item input[type="text"],
body[data-theme="light"] .subtask-item input[type="text"]{
    background:rgba(255,255,255,.82);
    border-color:rgba(15,23,42,.12);
}
@media (max-width:720px){
    .category-manager-item,
    .subtask-add-row,
    .compact-category-task{
        grid-template-columns:1fr;
    }
    .category-manager-item,
    .category-manager-actions{
        align-items:stretch;
        flex-direction:column;
    }
    .category-manager-actions .ghost-btn,
    .subtask-add-row .ghost-btn,
    .category-density-control{
        width:100%;
    }
    .compact-category-task{
        align-items:stretch;
    }
}

/* v31: personal categories, priority manager, and cleaner task date UI */
.priority-picker-box,
.category-picker-box{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:12px;
    align-items:end;
}
.priority-manage-btn,
.category-add-btn{white-space:nowrap;}
.date-choice-box .date-fields{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    width:100%;
}
.date-fields-main{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
}
.due-time-field{
    max-width:260px;
}
.priority-modal-card{max-width:620px;}
.priority-manager-list{
    display:flex;
    flex-direction:column;
    gap:10px;
    max-height:280px;
    overflow:auto;
    padding:4px;
}
.priority-manager-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.04);
}
.priority-manager-item.is-editing{
    border-color:rgba(102,217,255,.45);
    box-shadow:0 16px 38px rgba(102,217,255,.12);
}
.priority-manager-title,
.priority-manager-actions{
    display:flex;
    align-items:center;
    gap:10px;
}
.priority-manager-title b{
    width:34px;
    height:34px;
    border-radius:12px;
    display:grid;
    place-items:center;
    color:#fff;
    background:linear-gradient(135deg, rgba(102,217,255,.85), rgba(124,92,255,.8));
    box-shadow:0 10px 22px rgba(102,217,255,.16);
}
.priority-manager-title strong{display:block;font-size:14px;}
.priority-manager-title span{display:block;color:var(--muted);font-size:11px;margin-top:2px;}
.priority-custom{color:var(--primary);}
html[data-theme="light"] .priority-manager-item,
body[data-theme="light"] .priority-manager-item{
    background:rgba(255,255,255,.78);
}
@media (max-width:720px){
    .priority-picker-box,
    .category-picker-box{grid-template-columns:1fr;}
    .priority-manage-btn,
    .category-add-btn{width:100%;}
    .date-fields-main{grid-template-columns:1fr;}
    .due-time-field{max-width:none;}
    .priority-manager-item,
    .priority-manager-actions{align-items:stretch;}
    .priority-manager-item{flex-direction:column;}
    .priority-manager-actions .ghost-btn{width:100%;}
}

/* v32: sortable priorities, better color pickers, subtask accordions, and draggable task list */
input[type="color"]{
    width:100%;
    min-height:46px;
    border:1px solid var(--line);
    border-radius:16px;
    padding:5px;
    background:linear-gradient(135deg,rgba(255,255,255,.075),rgba(255,255,255,.035));
    box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 10px 24px rgba(0,0,0,.08);
    cursor:pointer;
    overflow:hidden;
}
input[type="color"]::-webkit-color-swatch-wrapper{padding:0;border-radius:12px;}
input[type="color"]::-webkit-color-swatch{border:0;border-radius:12px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.55);}
input[type="color"]::-moz-color-swatch{border:0;border-radius:12px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.55);}
html[data-theme="light"] input[type="color"],
body[data-theme="light"] input[type="color"]{background:rgba(255,255,255,.86);border-color:rgba(15,23,42,.14);}

.priority-sort-hint{line-height:1.9;}
.priority-sortable-list{gap:8px;}
.priority-manager-item{
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    cursor:grab;
}
.priority-manager-item.is-dragging,
.undated-task-draggable.is-dragging,
.task-subtask-row.is-dragging,
.subtask-item.is-dragging{opacity:.55;transform:scale(.985);}
.priority-manager-drag,
.subtask-drag-handle{
    width:28px;
    height:34px;
    display:grid;
    place-items:center;
    border-radius:12px;
    border:1px solid rgba(102,217,255,.16);
    background:rgba(102,217,255,.07);
    color:var(--accent);
    font-weight:1000;
    letter-spacing:-3px;
    cursor:grab;
    user-select:none;
}
.priority-manager-main{display:grid;gap:8px;min-width:0;}
.priority-manager-weight-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:8px 10px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:14px;
    background:rgba(255,255,255,.035);
}
.priority-manager-weight-row span{color:var(--muted);font-size:12px;font-weight:900;}
.priority-manager-weight-row strong{
    min-width:32px;
    min-height:28px;
    display:grid;
    place-items:center;
    border-radius:11px;
    background:linear-gradient(135deg,rgba(102,217,255,.20),rgba(139,152,255,.14));
    color:var(--text);
}
.priority-manager-item.drag-over{border-color:rgba(102,217,255,.50);box-shadow:0 0 0 4px rgba(102,217,255,.10);}

.subtask-list{
    max-height:520px;
    overflow-y:auto;
    padding-inline-end:3px;
}
.subtask-item{grid-template-columns:auto auto minmax(0,1fr) auto;}
.subtask-item .subtask-drag-handle{height:30px;width:26px;}

.task-subtask-accordion{
    margin-top:10px;
    border:1px solid rgba(102,217,255,.14);
    border-radius:16px;
    background:rgba(102,217,255,.045);
    overflow:hidden;
}
.task-subtask-accordion.is-compact{
    grid-column:1/-1;
    margin-top:2px;
}
.task-subtask-toggle{
    width:100%;
    border:0;
    background:transparent;
    color:var(--text);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:9px 11px;
    cursor:pointer;
    font:inherit;
    font-weight:950;
}
.task-subtask-toggle b{
    color:var(--accent);
    border:1px solid rgba(102,217,255,.20);
    border-radius:999px;
    padding:3px 9px;
    background:rgba(102,217,255,.08);
    margin-inline-start:auto;
}
.task-subtask-toggle i{font-style:normal;transition:transform .18s ease;}
.task-subtask-accordion.open .task-subtask-toggle i{transform:rotate(180deg);}
.task-subtask-panel{
    display:grid;
    gap:7px;
    padding:0 10px 10px;
}
.task-subtask-panel.hidden{display:none!important;}
.task-subtask-row{
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    gap:8px;
    align-items:center;
    padding:8px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:14px;
    background:rgba(0,0,0,.08);
    cursor:grab;
}
.task-subtask-check{
    display:flex;
    align-items:center;
    gap:9px;
    min-width:0;
    cursor:pointer;
    color:var(--text);
}
.task-subtask-check input{width:17px;height:17px;accent-color:var(--primary);}
.task-subtask-check span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.task-subtask-row.is-completed .task-subtask-check span{text-decoration:line-through;opacity:.64;}
.undated-task-draggable{cursor:grab;}
.undated-task-draggable::before{
    content:'⋮⋮';
    color:var(--accent);
    opacity:.85;
    align-self:center;
    font-weight:1000;
    letter-spacing:-3px;
}
.day-task-row.undated-task-draggable{grid-template-columns:auto auto minmax(0,1fr) auto;}
.compact-category-task.undated-task-draggable{grid-template-columns:auto auto minmax(0,1fr) auto auto;}
.category-hero-actions{align-items:center;}

html[data-theme="light"] .priority-manager-weight-row,
body[data-theme="light"] .priority-manager-weight-row,
html[data-theme="light"] .task-subtask-row,
body[data-theme="light"] .task-subtask-row,
html[data-theme="light"] .task-subtask-accordion,
body[data-theme="light"] .task-subtask-accordion{
    background:rgba(255,255,255,.70);
    border-color:rgba(15,23,42,.10);
}
@media (max-width:720px){
    .priority-manager-item{grid-template-columns:1fr!important;align-items:stretch;}
    .priority-manager-drag{width:100%;height:26px;}
    .subtask-item{grid-template-columns:auto minmax(0,1fr) auto;}
    .subtask-item .subtask-drag-handle{grid-column:1/-1;width:100%;height:26px;}
    .day-task-row.undated-task-draggable,
    .compact-category-task.undated-task-draggable{grid-template-columns:1fr;}
    .undated-task-draggable::before{display:none;}
}

/* v33: priority normalization polish, date hint spacing, and steadier subtask accordions */
.date-choice-box .hint-box{
    margin-top:14px;
    line-height:1.9;
    box-shadow:0 12px 28px rgba(102,217,255,.08);
}

.priority-manager-weight-row strong{
    min-width:40px;
}

.task-subtask-accordion.is-detail{
    grid-column:1/-1;
    width:100%;
    margin-top:2px;
}
.day-task-body .task-subtask-accordion.is-detail{
    margin-top:10px;
}
.task-subtask-accordion.is-compact{
    border-radius:13px;
    margin-top:0;
}
.task-subtask-accordion.is-compact .task-subtask-toggle{
    min-height:34px;
    padding:5px 8px;
    font-size:12px;
    gap:6px;
}
.task-subtask-accordion.is-compact .task-subtask-toggle b{
    padding:2px 7px;
    font-size:11px;
}
.task-subtask-accordion.is-compact .task-subtask-panel{
    gap:5px;
    padding:0 7px 7px;
}
.task-subtask-accordion.is-compact .task-subtask-row{
    padding:6px;
    border-radius:12px;
}
.task-subtask-accordion.is-compact .subtask-drag-handle{
    width:24px;
    height:28px;
}
.category-task-board.is-compact .compact-category-task{
    gap:8px;
}
.category-task-board.is-compact .task-subtask-accordion.is-compact{
    align-self:stretch;
}

@media (max-width:720px){
    .task-subtask-accordion.is-detail{grid-column:1/-1;}
}

/* v34: priority colors, dated subtasks, and category order manager */
.task-priority[style*="--priority-color"]{
    background:color-mix(in srgb, var(--priority-color) 18%, transparent)!important;
    color:color-mix(in srgb, var(--priority-color) 76%, #ffffff)!important;
    border:1px solid color-mix(in srgb, var(--priority-color) 28%, transparent);
    box-shadow:0 8px 18px color-mix(in srgb, var(--priority-color) 9%, transparent);
}
.priority-row[style*="--priority-color"] div b{
    background:linear-gradient(90deg, var(--priority-color), color-mix(in srgb, var(--priority-color) 55%, var(--accent)));
}
.priority-color-dot{
    width:16px;
    height:16px;
    border-radius:999px;
    background:var(--priority-color, #66d9ff);
    box-shadow:0 0 0 5px color-mix(in srgb, var(--priority-color, #66d9ff) 16%, transparent);
    flex:0 0 auto;
}
.priority-manager-item{
    border-color:color-mix(in srgb, var(--priority-color, #66d9ff) 18%, var(--line));
    background:
        radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--priority-color, #66d9ff) 10%, transparent), transparent 34%),
        rgba(255,255,255,.04);
}
.priority-manager-title b{
    background:linear-gradient(135deg, var(--priority-color, #66d9ff), color-mix(in srgb, var(--priority-color, #66d9ff) 55%, #7c5cff));
}

.category-task-head-actions{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.category-order-modal-card{max-width:560px;}
.category-order-list{
    display:flex;
    flex-direction:column;
    gap:9px;
    max-height:380px;
    overflow:auto;
    padding:10px;
    border:1px dashed var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.025);
}
.category-order-item{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    padding:10px;
    border:1px solid rgba(102,217,255,.14);
    border-radius:16px;
    background:rgba(255,255,255,.04);
    cursor:grab;
}
.category-order-item strong{
    font-size:14px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.category-order-actions{
    display:flex;
    align-items:center;
    gap:6px;
}
.category-order-actions .icon-btn{
    width:32px;
    height:32px;
    min-width:32px;
    font-size:15px;
}
.category-order-actions .icon-btn:disabled{
    opacity:.35;
    cursor:not-allowed;
}
.category-order-item.is-dragging{opacity:.55;transform:scale(.985);}
.category-order-hint{line-height:1.9;}

.subtask-edit-main{
    display:grid;
    gap:8px;
    min-width:0;
}
.subtask-date-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,130px) auto;
    gap:8px;
    align-items:end;
}
.subtask-date-row label{
    display:grid;
    gap:4px;
    min-width:0;
    color:var(--muted);
    font-size:11px;
    font-weight:900;
}
.subtask-date-row input{
    width:100%;
    border:1px solid var(--line);
    border-radius:12px;
    background:rgba(255,255,255,.055);
    color:var(--text);
    padding:8px 9px;
    min-height:38px;
    outline:none;
}
.subtask-date-row small{
    color:var(--muted);
    white-space:nowrap;
    font-size:11px;
    padding-bottom:9px;
}
.subtask-item.has-date{
    border-color:rgba(102,217,255,.18);
    background:rgba(102,217,255,.045);
}
.subtask-list.is-scrollable{
    max-height:520px;
    overflow-y:auto;
}
.task-subtask-row{
    grid-template-columns:auto minmax(0,1fr) auto;
}
.task-subtask-row.has-date{
    cursor:default;
    border-color:rgba(102,217,255,.18);
    background:rgba(102,217,255,.055);
}
.subtask-date-lock{
    width:28px;
    height:34px;
    display:grid;
    place-items:center;
    border-radius:12px;
    border:1px solid rgba(102,217,255,.16);
    background:rgba(102,217,255,.07);
    color:var(--accent);
    font-size:14px;
    flex:0 0 auto;
}
.task-subtask-meta{
    color:var(--muted);
    font-size:11px;
    white-space:nowrap;
    justify-self:end;
}
.task-subtask-row.has-date .task-subtask-meta{
    color:var(--accent);
}
.task-subtask-row.is-completed .task-subtask-meta{opacity:.6;}

html[data-theme="light"] .category-order-item,
body[data-theme="light"] .category-order-item,
html[data-theme="light"] .subtask-date-row input,
body[data-theme="light"] .subtask-date-row input,
html[data-theme="light"] .subtask-item.has-date,
body[data-theme="light"] .subtask-item.has-date,
html[data-theme="light"] .task-subtask-row.has-date,
body[data-theme="light"] .task-subtask-row.has-date{
    background:rgba(255,255,255,.76);
    border-color:rgba(15,23,42,.11);
}

@media (max-width:720px){
    .category-task-head-actions,
    .category-task-head-actions .ghost-btn{width:100%;}
    .category-task-head-actions{justify-content:stretch;}
    .category-order-item{grid-template-columns:1fr;}
    .category-order-drag{width:100%;height:26px;}
    .category-order-actions .icon-btn{flex:1;}
    .subtask-date-row{grid-template-columns:1fr;}
    .subtask-date-row small{padding-bottom:0;}
    .task-subtask-row{grid-template-columns:auto minmax(0,1fr);}
    .task-subtask-meta{grid-column:1/-1;justify-self:start;padding-inline-start:38px;}
}
.task-subtask-row.has-date.is-subtask-draggable{cursor:grab;}

/* v35: category pseudo-order, cleaner subtask scheduling, subtask timeline */
.category-inline-order-hint{line-height:1.9;margin-top:2px;}
.category-manager-item{
    cursor:grab;
}
.category-manager-item.is-dragging{opacity:.55;transform:scale(.985);}
.category-manager-item.is-uncategorized,
.category-order-item.is-uncategorized{
    --cat-color:#94a3b8;
    border-style:dashed;
    background:linear-gradient(135deg,rgba(148,163,184,.12),rgba(255,255,255,.028));
}
.category-manager-item .category-order-drag{
    flex:0 0 auto;
}
.tiny-muted{
    display:inline-flex;
    align-items:center;
    min-height:28px;
    border:1px solid var(--line);
    border-radius:999px;
    padding:3px 9px;
    color:var(--muted);
    font-size:11px;
    font-weight:900;
    background:rgba(255,255,255,.04);
}

.subtask-item{
    align-items:start;
}
.subtask-item .subtask-check{margin-top:8px;}
.subtask-item > .subtask-drag-handle,
.subtask-item > .subtask-date-lock{margin-top:8px;}
.subtask-date-box{
    display:grid;
    gap:8px;
    padding:8px;
    border:1px solid rgba(102,217,255,.12);
    border-radius:15px;
    background:rgba(255,255,255,.025);
}
.subtask-date-topline{
    display:grid;
    grid-template-columns:minmax(0,220px) minmax(0,1fr);
    gap:8px;
    align-items:end;
}
.subtask-date-topline small{
    display:flex;
    align-items:center;
    min-height:42px;
    border:1px solid rgba(102,217,255,.16);
    border-radius:13px;
    padding:8px 10px;
    color:var(--muted);
    background:rgba(102,217,255,.05);
    font-size:11px;
    font-weight:800;
}
.subtask-date-fields{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr)) minmax(0,150px);
    gap:8px;
    align-items:end;
    padding-top:2px;
}
.subtask-date-fields.hidden{display:none!important;}
.subtask-date-fields .field,
.subtask-date-mode-field{margin:0;}
.subtask-date-fields input,
.subtask-date-fields select,
.subtask-date-mode-field select{
    min-height:40px;
    padding:9px 10px;
}
.subtask-time-field{grid-column:auto;}
.subtask-item.has-date .subtask-date-box{
    border-color:rgba(102,217,255,.22);
    background:linear-gradient(135deg,rgba(102,217,255,.075),rgba(139,152,255,.035));
}
.timeline-task.timeline-subtask{
    border-color:rgba(139,152,255,.30);
    background:linear-gradient(135deg,rgba(139,152,255,.16),rgba(102,217,255,.08));
}
.timeline-task.timeline-subtask h4::before{
    content:'زیرکار • ';
    color:var(--accent);
    font-size:11px;
    font-weight:1000;
}
html[data-theme="light"] .subtask-date-box,
body[data-theme="light"] .subtask-date-box,
html[data-theme="light"] .subtask-date-topline small,
body[data-theme="light"] .subtask-date-topline small{
    background:rgba(255,255,255,.74);
    border-color:rgba(15,23,42,.10);
}
@media (max-width:720px){
    .subtask-date-topline,
    .subtask-date-fields{grid-template-columns:1fr;}
    .subtask-item{grid-template-columns:auto minmax(0,1fr) auto;}
    .category-manager-item{display:grid;grid-template-columns:auto minmax(0,1fr);}
    .category-manager-actions{grid-column:1/-1;}
}

/* v36 category sharing */
.category-share-modal-card { max-width: min(860px, calc(100vw - 24px)); }
.share-tabs {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    margin: 2px 0 14px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(15, 23, 42, .32);
    border-radius: 18px;
}
.share-tab {
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 14px;
    padding: 9px 18px;
    font: inherit;
    cursor: pointer;
    transition: .18s ease;
}
.share-tab.active {
    color: var(--text);
    background: linear-gradient(135deg, rgba(102, 217, 255, .22), rgba(167, 139, 250, .18));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.category-share-body { min-height: 160px; }
.share-members-list { display: grid; gap: 10px; max-height: 48vh; overflow: auto; padding-inline-end: 4px; }
.share-member-row {
    display: grid;
    grid-template-columns: auto 1fr minmax(130px, 170px);
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .18);
    background: rgba(255, 255, 255, .045);
    border-radius: 18px;
    transition: .18s ease;
}
.share-member-row.readonly { grid-template-columns: 1fr auto; }
.share-member-row.selected {
    border-color: rgba(102, 217, 255, .42);
    background: linear-gradient(135deg, rgba(102, 217, 255, .11), rgba(167, 139, 250, .08));
}
.share-member-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.share-member-person, .share-member-row.readonly > div { display: grid; gap: 3px; min-width: 0; }
.share-member-person strong, .share-member-row.readonly strong { color: var(--text); }
.share-member-person span, .share-member-row.readonly span { color: var(--muted); font-size: .82rem; }
.share-member-row select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(15, 23, 42, .55);
    color: var(--text);
    padding: 9px 10px;
}
.share-modal-actions { margin-top: 12px; }
.category-share-status { min-width: 92px; }
.category-share-status.is-shared {
    border-color: rgba(34, 197, 94, .34);
    background: rgba(34, 197, 94, .1);
}
.share-task-create-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 22px;
    background: rgba(255,255,255,.045);
    margin-bottom: 14px;
}
.share-task-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-managed-list { display: grid; gap: 10px; max-height: 38vh; overflow: auto; padding-inline-end: 4px; }
.share-managed-task {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, .16);
    background: rgba(15, 23, 42, .22);
}
.share-managed-task.done { opacity: .72; }
.share-managed-task.done strong { text-decoration: line-through; }
.share-managed-task div { display: grid; gap: 4px; min-width: 0; }
.share-managed-task span { color: var(--muted); font-size: .82rem; }
.share-managed-check { display: inline-grid; place-items: center; }
.share-managed-check input { width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 720px) {
    .share-member-row { grid-template-columns: auto 1fr; }
    .share-member-row select { grid-column: 2; }
    .share-task-date-grid { grid-template-columns: 1fr; }
    .share-managed-task { grid-template-columns: auto 1fr; }
    .share-managed-task .tiny-action { grid-column: 2; justify-self: start; }
}

/* v37 category share UX polish */
.category-share-modal-card { max-width: min(940px, calc(100vw - 24px)); }
.share-members-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.share-members-section,
.share-managed-section { display: grid; gap: 10px; min-width: 0; }
.share-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.share-section-head h4 { margin: 0; font-size: 1rem; color: var(--text); }
.share-section-head span { color: var(--muted); font-size: .82rem; }
.share-current-members-list,
.share-add-members-list { display: grid; gap: 10px; max-height: 44vh; overflow: auto; padding-inline-end: 4px; }
.share-current-member-row,
.share-add-member-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(120px, 150px) auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid rgba(148, 163, 184, .17); background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.025)); border-radius: 18px; box-shadow: 0 10px 30px rgba(15,23,42,.12); }
.share-current-member-row.readonly { grid-template-columns: auto minmax(0, 1fr) auto; }
.share-member-avatar { width: 42px; height: 42px; border-radius: 15px; overflow: hidden; display: grid; place-items: center; background: rgba(255,255,255,.06); }
.share-current-member-row select,
.share-add-member-row select { width: 100%; border-radius: 14px; border: 1px solid rgba(148,163,184,.22); background: rgba(15,23,42,.55); color: var(--text); padding: 9px 10px; }
body.light .share-current-member-row select,
body.light .share-add-member-row select { background: rgba(255,255,255,.9); }
.share-type-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 82px; border-radius: 999px; padding: 7px 10px; font-size: .78rem; border: 1px solid rgba(148,163,184,.22); background: rgba(255,255,255,.06); color: var(--text); }
.share-type-pill.is-subordinate { border-color: rgba(251, 146, 60, .34); background: rgba(251,146,60,.1); }
.share-type-pill.is-coworker { border-color: rgba(102,217,255,.34); background: rgba(102,217,255,.1); }
.share-friend-search { margin-bottom: 8px; }
.share-form-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 18px; background: rgba(102,217,255,.08); border: 1px solid rgba(102,217,255,.16); }
.share-form-title strong { display: block; color: var(--text); }
.share-form-title span { display: block; color: var(--muted); font-size: .84rem; margin-top: 3px; }
.share-task-date-box { margin-top: 0; }
.share-task-date-fields { grid-template-columns: repeat(4, minmax(92px, 1fr)); align-items: end; }
.share-task-date-hint { margin-top: 10px; }
.share-managed-list { display: grid; gap: 12px; max-height: 42vh; overflow: auto; padding-inline-end: 4px; }
.share-managed-task { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; padding: 14px; border-radius: 22px; background: linear-gradient(135deg, rgba(15,23,42,.28), rgba(15,23,42,.12)); }
body.light .share-managed-task { background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(248,250,252,.76)); }
.share-managed-main { display: grid; gap: 4px; min-width: 0; }
.share-managed-main strong { color: var(--text); }
.share-managed-main span,
.share-managed-main small { color: var(--muted); font-size: .82rem; }
.share-managed-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.share-workflow-wrap { grid-column: 1 / -1; margin-top: 2px; }
.share-workflow-panel { display: grid; gap: 8px; padding: 12px; border-radius: 18px; border: 1px solid rgba(148,163,184,.17); background: rgba(255,255,255,.045); }
.share-workflow-step { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; }
.share-workflow-step > span { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; border: 2px solid rgba(148,163,184,.55); background: rgba(255,255,255,.08); }
.share-workflow-step.done > span { border-color: rgba(34,197,94,.7); background: rgba(34,197,94,.45); box-shadow: 0 0 0 4px rgba(34,197,94,.1); }
.share-workflow-step.pending > span { border-color: rgba(251,191,36,.7); background: rgba(251,191,36,.35); box-shadow: 0 0 0 4px rgba(251,191,36,.08); }
.share-workflow-step strong { display: block; color: var(--text); font-size: .9rem; }
.share-workflow-step small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
@media (max-width: 820px) {
    .share-members-layout { grid-template-columns: 1fr; }
    .share-current-member-row,
    .share-add-member-row { grid-template-columns: auto minmax(0, 1fr); }
    .share-current-member-row select,
    .share-add-member-row select,
    .share-current-member-row .tiny-action,
    .share-add-member-row .tiny-btn { grid-column: 2; justify-self: start; min-width: 140px; }
    .share-task-date-fields { grid-template-columns: 1fr; }
    .share-managed-task { grid-template-columns: auto minmax(0, 1fr); }
    .share-managed-actions,
    .share-workflow-wrap { grid-column: 1 / -1; justify-content: flex-start; }
}
.share-managed-task .share-managed-main { display: grid; gap: 4px; min-width: 0; }
.share-managed-task .share-managed-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 0; }
.share-managed-task .share-workflow-panel { display: grid; gap: 8px; }
.share-managed-task .share-workflow-step { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; }

/* v38 share modal polish */
.category-share-modal-card{max-width:min(980px,calc(100vw - 24px));}
.share-tabs{background:linear-gradient(135deg,rgba(102,217,255,.10),rgba(139,152,255,.08));border:1px solid rgba(102,217,255,.18);padding:6px;border-radius:20px;gap:6px;}
.share-tab{background:transparent;border:1px solid transparent;color:var(--muted);box-shadow:none;}
.share-tab.active{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#07131d;border-color:transparent;box-shadow:0 12px 30px rgba(102,217,255,.18);}
.share-members-layout{display:grid!important;grid-template-columns:1fr!important;gap:16px;}
.share-members-section,.share-managed-section,.share-access-section{border:1px solid rgba(102,217,255,.14);background:linear-gradient(135deg,rgba(102,217,255,.06),rgba(139,152,255,.045));border-radius:24px;padding:14px;}
.share-current-members-list,.share-add-members-list{max-height:unset;}
.share-current-member-row,.share-add-member-row{background:linear-gradient(135deg,rgba(102,217,255,.08),rgba(139,152,255,.055));border-color:rgba(102,217,255,.16);}
body.light .share-current-member-row,body.light .share-add-member-row{background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(234,247,255,.78));}
.share-current-member-row select,.share-add-member-row select{background:rgba(4,20,32,.62);border-color:rgba(102,217,255,.24);}
.share-task-create-form{background:linear-gradient(135deg,rgba(102,217,255,.07),rgba(139,152,255,.045));border-color:rgba(102,217,255,.15);}
.share-task-date-box{display:grid;gap:12px;}
.share-task-date-mode-line{max-width:260px;}
.share-task-date-fields{display:grid!important;grid-template-columns:1fr!important;gap:10px;}
.share-task-date-fields.hidden{display:none!important;}
.share-date-grid{display:grid;grid-template-columns:repeat(3,minmax(92px,1fr));gap:10px;}
.share-time-line{max-width:230px;}
.share-task-date-hint{margin-top:0!important;background:rgba(59,130,246,.12);border-color:rgba(96,165,250,.24);}
.share-managed-task{background:linear-gradient(135deg,rgba(102,217,255,.08),rgba(139,152,255,.05));border-color:rgba(102,217,255,.16);}
body.light .share-managed-task{background:linear-gradient(135deg,rgba(255,255,255,.98),rgba(234,247,255,.82));}
.share-managed-subtasks{list-style:none;margin:8px 0 0;padding:8px;border-radius:16px;background:rgba(102,217,255,.065);display:grid;gap:6px;}
.share-managed-subtasks li{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid rgba(102,217,255,.12);border-radius:12px;padding:7px 9px;background:rgba(255,255,255,.035);}
.share-managed-subtasks li.done span{text-decoration:line-through;opacity:.72;}
.share-managed-subtasks small{font-size:.78rem;color:var(--muted);}
.share-subtask-box{display:grid;gap:10px;border:1px solid rgba(102,217,255,.14);border-radius:20px;padding:12px;background:rgba(102,217,255,.055);}
.share-subtask-add-row,.share-subtask-row{display:grid;grid-template-columns:minmax(160px,1fr) minmax(140px,180px) auto;gap:8px;align-items:center;}
.share-subtask-row{grid-template-columns:34px minmax(160px,1fr) minmax(140px,180px) auto;padding:8px;border:1px solid rgba(102,217,255,.12);border-radius:16px;background:rgba(255,255,255,.045);}
.share-subtask-add-row input,.share-subtask-add-row select,.share-subtask-row input,.share-subtask-row select{border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.07);color:var(--text);padding:10px;min-width:0;}
body.light .share-subtask-add-row input,body.light .share-subtask-add-row select,body.light .share-subtask-row input,body.light .share-subtask-row select{background:rgba(255,255,255,.95);}
.share-subtask-bullet{width:28px;height:28px;display:grid;place-items:center;border-radius:11px;background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#07131d;font-weight:1000;}
.share-access-list{display:grid;gap:12px;}
.share-access-card{display:grid;gap:10px;border:1px solid rgba(102,217,255,.16);border-radius:22px;padding:13px;background:linear-gradient(135deg,rgba(102,217,255,.07),rgba(139,152,255,.045));}
.share-access-person{display:flex;align-items:center;gap:10px;}
.share-access-person strong{display:block;color:var(--text);}.share-access-person span{display:block;color:var(--muted);font-size:.82rem;margin-top:2px;}
.share-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid rgba(102,217,255,.12);border-radius:18px;padding:10px 12px;background:rgba(255,255,255,.035);}
.share-toggle-row b{display:block;color:var(--text);}.share-toggle-row small{display:block;color:var(--muted);font-size:.78rem;line-height:1.7;margin-top:2px;}.share-toggle-row input{width:46px;height:26px;accent-color:var(--accent);}
.category-owner-label{display:block;margin-top:3px;color:var(--muted);font-size:.78rem;}
@media(max-width:720px){.share-date-grid{grid-template-columns:1fr}.share-subtask-add-row,.share-subtask-row{grid-template-columns:1fr}.share-subtask-row .icon-btn{justify-self:start}.share-toggle-row{align-items:flex-start;flex-direction:column}.share-current-member-row,.share-add-member-row{grid-template-columns:auto minmax(0,1fr)!important}.share-current-member-row select,.share-add-member-row select,.share-current-member-row .tiny-action,.share-add-member-row .tiny-btn{grid-column:2;justify-self:start}}

/* v39 share modal final polish */
.category-title-row span .category-owner-inline{color:var(--muted);}
.category-share-modal-card{max-width:min(980px,calc(100vw - 24px));}
.share-tabs{
    background:linear-gradient(135deg,rgba(102,217,255,.14),rgba(167,139,250,.12));
    border:1px solid rgba(102,217,255,.24);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 16px 42px rgba(15,23,42,.16);
}
.share-tab{
    color:var(--text);
    border-radius:16px;
    background:rgba(255,255,255,.045);
}
.share-tab:hover{background:rgba(102,217,255,.12);}
.share-tab.active{
    background:linear-gradient(135deg,#66d9ff,#a78bfa);
    color:#07131d;
    box-shadow:0 14px 34px rgba(102,217,255,.22);
}
.share-members-layout{display:grid!important;grid-template-columns:1fr!important;gap:16px!important;}
.share-members-section,
.share-managed-section,
.share-access-section{
    border-color:rgba(102,217,255,.22)!important;
    background:linear-gradient(135deg,rgba(102,217,255,.075),rgba(167,139,250,.055))!important;
    box-shadow:0 18px 50px rgba(15,23,42,.12);
}
.share-current-members-list,.share-add-members-list{display:grid;gap:10px;max-height:44vh;overflow:auto;padding-inline-end:4px;}
.share-current-member-row,
.share-add-member-row{
    grid-template-columns:auto minmax(0,1fr)!important;
    align-items:center;
    background:linear-gradient(135deg,rgba(102,217,255,.09),rgba(167,139,250,.06))!important;
    border-color:rgba(102,217,255,.22)!important;
}
.share-current-member-row select,
.share-add-member-row select{
    grid-column:2;
    max-width:220px;
    background:rgba(5,24,38,.78)!important;
    border-color:rgba(102,217,255,.30)!important;
}
.share-current-member-row .tiny-action,
.share-add-member-row .tiny-btn{grid-column:2;justify-self:start;}
html[data-theme="light"] .share-current-member-row,
html[data-theme="light"] .share-add-member-row,
body[data-theme="light"] .share-current-member-row,
body[data-theme="light"] .share-add-member-row{
    background:linear-gradient(135deg,rgba(255,255,255,.98),rgba(235,248,255,.88))!important;
}
html[data-theme="light"] .share-current-member-row select,
html[data-theme="light"] .share-add-member-row select,
body[data-theme="light"] .share-current-member-row select,
body[data-theme="light"] .share-add-member-row select{background:#fff!important;}
.share-managed-list{display:grid;gap:12px;}
.share-managed-task{
    background:linear-gradient(135deg,rgba(102,217,255,.10),rgba(167,139,250,.07))!important;
    border:1px solid rgba(102,217,255,.22)!important;
    box-shadow:0 12px 34px rgba(15,23,42,.10);
}
html[data-theme="light"] .share-managed-task,
body[data-theme="light"] .share-managed-task{background:linear-gradient(135deg,#fff,rgba(235,248,255,.92))!important;}
.share-access-section{display:grid;gap:12px;}
.share-access-list{display:grid;gap:14px;}
.share-access-card{
    display:grid;
    gap:14px;
    padding:16px;
    border-radius:26px;
    border:1px solid rgba(102,217,255,.24)!important;
    background:linear-gradient(135deg,rgba(7,24,40,.55),rgba(62,34,110,.22))!important;
}
html[data-theme="light"] .share-access-card,
body[data-theme="light"] .share-access-card{background:linear-gradient(135deg,#fff,rgba(240,249,255,.94))!important;}
.share-access-person{display:flex;align-items:center;gap:12px;padding-bottom:10px;border-bottom:1px dashed rgba(102,217,255,.18);}
.share-access-settings{display:grid;gap:10px;}
.share-access-setting{
    display:grid;
    grid-template-columns:42px minmax(0,1fr) auto;
    align-items:center;
    gap:12px;
    padding:12px;
    border-radius:20px;
    border:1px solid rgba(102,217,255,.18);
    background:rgba(255,255,255,.045);
}
html[data-theme="light"] .share-access-setting,
body[data-theme="light"] .share-access-setting{background:rgba(14,165,233,.055);}
.share-access-icon{width:42px;height:42px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,rgba(102,217,255,.24),rgba(167,139,250,.20));font-size:1.05rem;}
.share-access-copy b{display:block;color:var(--text);font-size:.95rem;}
.share-access-copy small{display:block;color:var(--muted);font-size:.8rem;line-height:1.75;margin-top:3px;}
.share-switch{position:relative;display:inline-grid;place-items:center;width:54px;height:30px;cursor:pointer;flex:0 0 auto;}
.share-switch input{position:absolute;inset:0;opacity:0;cursor:pointer;}
.share-switch-ui{width:54px;height:30px;border-radius:999px;border:1px solid rgba(148,163,184,.34);background:rgba(148,163,184,.24);transition:.2s ease;box-shadow:inset 0 2px 6px rgba(15,23,42,.2);}
.share-switch-ui::after{content:"";position:absolute;top:4px;right:4px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 6px 16px rgba(15,23,42,.24);transition:.2s ease;}
.share-switch input:checked + .share-switch-ui{background:linear-gradient(135deg,#66d9ff,#a78bfa);border-color:transparent;}
.share-switch input:checked + .share-switch-ui::after{right:28px;}
.share-toggle-row input{width:auto;height:auto;}
.share-task-date-box .form-row{align-items:flex-start;}
.share-task-date-mode-line{max-width:260px;}
.share-task-date-fields{display:grid!important;grid-template-columns:1fr!important;gap:10px;min-width:min(100%,520px);}
.share-task-date-fields.hidden{display:none!important;}
.share-date-grid{display:grid;grid-template-columns:repeat(3,minmax(92px,1fr));gap:10px;}
.share-time-line{max-width:230px;}
.share-task-date-hint{margin-top:10px!important;}
.share-subtask-box.subtask-box{border-color:rgba(102,217,255,.18);background:linear-gradient(135deg,rgba(102,217,255,.06),rgba(167,139,250,.04));}
.share-subtask-add-row{grid-template-columns:minmax(0,1fr) minmax(150px,210px) auto!important;}
.share-subtask-row.subtask-item{grid-template-columns:34px minmax(0,1fr) auto!important;padding:10px!important;border-color:rgba(102,217,255,.16);}
.share-subtask-edit-main{display:grid;gap:8px;}
.share-subtask-title-assignee{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,220px);gap:8px;align-items:end;}
.share-subtask-title-assignee input,
.share-subtask-title-assignee select,
.share-subtask-add-row select{border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.07);color:var(--text);padding:10px;min-width:0;}
.share-subtask-date-box{background:rgba(255,255,255,.035);}
.share-subtask-date-box .subtask-date-fields{grid-template-columns:repeat(4,minmax(92px,1fr));}
@media(max-width:720px){
    .share-current-member-row select,.share-add-member-row select,.share-current-member-row .tiny-action,.share-add-member-row .tiny-btn{grid-column:1 / -1;max-width:none;width:100%;}
    .share-date-grid,.share-subtask-date-box .subtask-date-fields,.share-subtask-title-assignee,.share-subtask-add-row{grid-template-columns:1fr!important;}
    .share-access-setting{grid-template-columns:38px minmax(0,1fr);}
    .share-access-setting .share-switch{grid-column:1 / -1;justify-self:start;}
}
.share-switch-ui{display:block;position:relative;}
.share-switch-ui::after{position:absolute;}

/* v40 category share members/access/date refinements */
.share-members-layout{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:16px!important;
}
.share-add-section{order:1;}
.share-current-section{order:2;}
.share-current-member-row.is-list-row{
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr) minmax(110px,auto) auto!important;
    align-items:center;
    gap:12px;
    padding:12px 14px!important;
}
.share-current-member-row.is-list-row .share-member-person{
    display:grid;
    gap:3px;
}
.share-current-role{display:flex;align-items:center;gap:8px;min-width:0;}
.share-current-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap;}
.share-member-role-edit{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}
.share-member-role-edit select{
    max-width:170px!important;
    grid-column:auto!important;
}
.share-add-member-row{
    grid-template-columns:auto minmax(0,1fr) minmax(130px,170px) auto!important;
}
.share-add-member-row select{grid-column:auto!important;max-width:none!important;}
.share-add-member-row .tiny-btn{grid-column:auto!important;justify-self:end!important;}
.share-task-date-box .form-row{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
    width:100%;
}
.share-task-date-mode-line{width:min(100%,260px);max-width:260px;}
.share-task-date-fields{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow:hidden;
    border-radius:18px;
}
.share-task-date-fields .date-fields-main,
.share-date-grid{
    width:100%;
    min-width:0;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
.share-task-date-fields .field,
.share-date-grid .field{min-width:0;}
.share-time-line{width:min(100%,230px);max-width:230px;}
.share-access-card{
    padding:0!important;
    overflow:hidden;
}
.share-access-accordion-head{
    width:100%;
    border:0;
    background:transparent;
    color:inherit;
    font:inherit;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:14px 16px;
    cursor:pointer;
    text-align:initial;
}
.share-access-accordion-head:hover{background:rgba(102,217,255,.075);}
.share-access-card.is-open .share-access-accordion-head{background:linear-gradient(135deg,rgba(102,217,255,.10),rgba(167,139,250,.07));}
.share-access-person{
    padding-bottom:0!important;
    border-bottom:0!important;
    min-width:0;
}
.share-access-summary{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
    color:var(--muted);
    font-size:.8rem;
}
.share-access-summary b{
    color:#07131d;
    background:linear-gradient(135deg,#66d9ff,#a78bfa);
    border-radius:999px;
    padding:7px 10px;
    font-size:.78rem;
    white-space:nowrap;
}
.share-access-settings{
    padding:0 14px 14px;
}
.share-access-settings.hidden{display:none!important;}
@media(max-width:720px){
    .share-current-member-row.is-list-row,
    .share-add-member-row{
        grid-template-columns:auto minmax(0,1fr)!important;
    }
    .share-current-role,
    .share-current-actions,
    .share-add-member-row select,
    .share-add-member-row .tiny-btn{
        grid-column:1 / -1!important;
        justify-self:stretch!important;
        width:100%;
        max-width:none!important;
    }
    .share-current-actions{justify-content:flex-start;}
    .share-member-role-edit,.share-member-role-edit select{width:100%;max-width:none!important;}
    .share-access-accordion-head{align-items:flex-start;flex-direction:column;}
    .share-access-summary{justify-content:flex-start;}
    .share-date-grid{grid-template-columns:1fr!important;}
    .share-time-line{max-width:none;width:100%;}
}

/* v41: ultra-compact task list, work filters, category accordions, display settings */
.task-list-settings-card{max-width:540px;}
.settings-question-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:14px;
    border:1px solid rgba(102,217,255,.18);
    border-radius:20px;
    background:linear-gradient(135deg,rgba(102,217,255,.09),rgba(139,152,255,.07));
}
.settings-question-card strong{display:block;font-size:15px;}
.settings-question-card small{display:block;color:var(--muted);font-size:12px;margin-top:4px;line-height:1.8;}
.pretty-toggle{display:inline-flex;align-items:center;cursor:pointer;}
.pretty-toggle input{position:absolute;opacity:0;pointer-events:none;}
.pretty-toggle span{
    width:52px;height:30px;border-radius:999px;position:relative;display:inline-block;
    border:1px solid rgba(255,255,255,.16);
    background:rgba(255,255,255,.12);
    transition:background .18s ease,border-color .18s ease;
}
.pretty-toggle span::after{
    content:'';position:absolute;top:4px;right:4px;width:20px;height:20px;border-radius:999px;
    background:#fff;box-shadow:0 6px 16px rgba(0,0,0,.22);transition:transform .18s ease;
}
.pretty-toggle input:checked + span{background:linear-gradient(135deg,var(--primary),var(--primary-2));border-color:rgba(102,217,255,.38);}
.pretty-toggle input:checked + span::after{transform:translateX(-22px);}
.category-task-head{cursor:pointer;}
.category-task-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.category-collapse-btn{
    width:34px;height:34px;min-width:34px;border-radius:14px;border:1px solid rgba(102,217,255,.20);
    background:rgba(102,217,255,.08);color:var(--text);cursor:pointer;font-weight:1000;transition:transform .18s ease,background .18s ease;
}
.category-task-section.is-collapsed .category-collapse-btn{transform:rotate(90deg);}
.category-task-section.is-collapsed .category-task-head{padding-bottom:0;border-bottom:0;margin-bottom:0;}
.category-task-board.is-ultra .view-hero{padding:16px;}
.category-task-board.is-ultra .category-task-section{
    padding:9px 10px;border-radius:18px;background:linear-gradient(135deg,color-mix(in srgb,var(--cat-color,#66d9ff) 12%,transparent),rgba(255,255,255,.025));
}
.category-task-board.is-ultra .category-task-head{
    min-height:38px;padding-bottom:7px;margin-bottom:7px;gap:8px;
}
.category-task-board.is-ultra .category-title-row{gap:8px;}
.category-task-board.is-ultra .category-title-row strong{font-size:14px;}
.category-task-board.is-ultra .category-dot{width:8px;height:8px;box-shadow:0 0 0 3px color-mix(in srgb,var(--cat-color,#66d9ff) 14%,transparent);}
.category-task-board.is-ultra .category-collapse-btn{
    width:26px;height:26px;min-width:26px;border-radius:10px;font-size:12px;background:rgba(255,255,255,.05);
}
.category-task-board.is-ultra .category-task-items{gap:4px;}
.ultra-category-task{
    padding:5px 8px;border-radius:11px;background:rgba(255,255,255,.026);border:1px solid rgba(255,255,255,.055);
}
.ultra-category-task strong{
    display:block;font-size:13px;font-weight:850;line-height:1.65;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.ultra-category-task.is-completed strong{text-decoration:line-through;opacity:.62;}
.ultra-category-task ul{margin:3px 14px 0 0;padding:0;display:grid;gap:1px;}
.ultra-category-task li{font-size:12px;line-height:1.55;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
html[data-theme="light"] .settings-question-card,
body[data-theme="light"] .settings-question-card,
html[data-theme="light"] .ultra-category-task,
body[data-theme="light"] .ultra-category-task{
    background:rgba(255,255,255,.74);border-color:rgba(15,23,42,.10);
}
@media(max-width:720px){
    .settings-question-card{align-items:stretch;flex-direction:column;}
    .category-task-head-actions{width:100%;}
    .category-task-head-actions .ghost-btn{width:100%;}
}
.category-task-board.is-ultra .category-collapse-btn{display:none;}
.category-task-board.is-ultra .category-task-head::after{
    content:'⌄';font-weight:1000;color:var(--muted);transition:transform .18s ease;margin-inline-start:auto;
}
.category-task-board.is-ultra .category-task-section.is-collapsed .category-task-head::after{transform:rotate(90deg);}

/* v42: polished category accordion actions and display settings modal */
.category-task-head{
    position:relative;
}
.category-head-left{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
    flex:0 0 auto;
    margin-inline-start:auto;
}
.category-head-left .category-task-head-actions{
    order:1;
    justify-content:flex-start;
}
.category-head-left .category-collapse-btn{
    order:2;
}
.category-collapse-btn{
    position:relative;
    display:inline-grid;
    place-items:center;
    width:42px;
    height:42px;
    min-width:42px;
    border-radius:16px;
    border:1px solid color-mix(in srgb, var(--cat-color, #66d9ff) 42%, rgba(255,255,255,.16));
    background:
        radial-gradient(circle at 30% 18%, rgba(255,255,255,.22), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--cat-color, #66d9ff) 28%, rgba(255,255,255,.08)), rgba(124,92,255,.16));
    color:#fff;
    box-shadow:0 12px 28px color-mix(in srgb, var(--cat-color, #66d9ff) 18%, transparent), inset 0 1px 0 rgba(255,255,255,.16);
    cursor:pointer;
    transition:transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.category-collapse-btn:hover{
    transform:translateY(-1px);
    box-shadow:0 16px 34px color-mix(in srgb, var(--cat-color, #66d9ff) 26%, transparent), inset 0 1px 0 rgba(255,255,255,.20);
}
.category-collapse-btn:active{transform:translateY(0) scale(.98);}
.category-collapse-btn span{
    width:18px;
    height:18px;
    position:relative;
    display:block;
}
.category-collapse-btn span::before,
.category-collapse-btn span::after{
    content:'';
    position:absolute;
    top:8px;
    width:10px;
    height:2.5px;
    border-radius:999px;
    background:currentColor;
    transition:transform .18s ease;
}
.category-collapse-btn span::before{right:2px;transform:rotate(38deg);}
.category-collapse-btn span::after{left:2px;transform:rotate(-38deg);}
.category-task-section.is-collapsed .category-collapse-btn{transform:none;}
.category-task-section.is-collapsed .category-collapse-btn:hover{transform:translateY(-1px);}
.category-task-section.is-collapsed .category-collapse-btn span::before{transform:rotate(-38deg);}
.category-task-section.is-collapsed .category-collapse-btn span::after{transform:rotate(38deg);}
html[data-theme="light"] .category-collapse-btn,
body[data-theme="light"] .category-collapse-btn{
    color:#0f172a;
    background:
        radial-gradient(circle at 30% 18%, rgba(255,255,255,.86), transparent 36%),
        linear-gradient(135deg, color-mix(in srgb, var(--cat-color, #66d9ff) 20%, #ffffff), #eef2ff);
    border-color:color-mix(in srgb, var(--cat-color, #66d9ff) 32%, rgba(15,23,42,.12));
}
.task-list-settings-card{max-width:600px;}
.task-list-settings-panel{
    display:flex;
    flex-direction:column;
    gap:14px;
    padding:6px 0 2px;
}
.settings-toggle-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:16px;
    border:1px solid rgba(102,217,255,.22);
    border-radius:24px;
    background:
        radial-gradient(circle at 96% 0%, rgba(102,217,255,.18), transparent 32%),
        linear-gradient(135deg, rgba(102,217,255,.10), rgba(124,92,255,.09));
    box-shadow:0 16px 36px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.08);
}
.settings-toggle-copy{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
}
.settings-icon-bubble{
    width:38px;
    height:38px;
    border-radius:15px;
    display:grid;
    place-items:center;
    flex:0 0 auto;
    font-weight:1000;
    color:#fff;
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    box-shadow:0 12px 24px rgba(102,217,255,.18);
}
.settings-toggle-copy strong{display:block;font-size:15px;line-height:1.8;}
.settings-toggle-copy small{display:block;color:var(--muted);font-size:12px;line-height:1.8;margin-top:2px;}
.settings-switch span{
    width:58px;
    height:32px;
    border-radius:999px;
    background:rgba(255,255,255,.10);
    border-color:rgba(255,255,255,.18);
}
.settings-switch span::after{
    width:22px;
    height:22px;
    top:4px;
    right:4px;
}
.settings-switch input:checked + span::after{transform:translateX(-26px);}
.settings-select-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}
.settings-select-card{
    padding:13px;
    border:1px solid rgba(102,217,255,.16);
    border-radius:20px;
    background:rgba(255,255,255,.035);
}
.settings-select-card > span{
    margin-bottom:8px;
}
html[data-theme="light"] .settings-toggle-card,
body[data-theme="light"] .settings-toggle-card,
html[data-theme="light"] .settings-select-card,
body[data-theme="light"] .settings-select-card{
    background:rgba(255,255,255,.82);
    border-color:rgba(15,23,42,.10);
}
.category-task-board.is-ultra .category-head-left{
    margin-inline-start:auto;
}
.category-task-board.is-ultra .category-collapse-btn{display:none;}
@media(max-width:720px){
    .category-task-head{
        align-items:stretch;
    }
    .category-head-left{
        width:100%;
        justify-content:flex-start;
        align-items:center;
        flex-wrap:wrap;
    }
    .category-head-left .category-task-head-actions{
        width:auto;
        flex:1 1 auto;
    }
    .category-head-left .category-task-head-actions .ghost-btn{
        width:auto;
        flex:1 1 auto;
    }
    .category-head-left .category-collapse-btn{
        flex:0 0 auto;
    }
    .settings-toggle-card{
        align-items:stretch;
        flex-direction:column;
    }
    .settings-select-grid{
        grid-template-columns:1fr;
    }
}

/* v43: advanced live search for categorized task list */
.category-search-toggle{
    width:42px;
    height:42px;
    border-radius:16px;
    font-size:22px;
    font-weight:1000;
    background:
        radial-gradient(circle at 30% 16%, rgba(255,255,255,.24), transparent 34%),
        linear-gradient(135deg, rgba(102,217,255,.18), rgba(124,92,255,.16));
    border:1px solid rgba(102,217,255,.26);
    color:var(--text);
    box-shadow:0 12px 28px rgba(102,217,255,.10), inset 0 1px 0 rgba(255,255,255,.12);
}
.category-search-toggle:hover{transform:translateY(-1px);box-shadow:0 16px 34px rgba(102,217,255,.16), inset 0 1px 0 rgba(255,255,255,.18);}
.category-search-toggle.is-active{
    color:#fff;
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    border-color:rgba(255,255,255,.22);
}
.task-list-search-panel{
    overflow:hidden;
    border:1px solid rgba(102,217,255,.24);
    border-radius:26px;
    padding:16px;
    background:
        radial-gradient(circle at 96% 0%, rgba(102,217,255,.18), transparent 30%),
        radial-gradient(circle at 0% 100%, rgba(124,92,255,.15), transparent 34%),
        rgba(255,255,255,.045);
    box-shadow:0 22px 54px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.08);
    animation:taskSearchOpen .22s ease both;
}
@keyframes taskSearchOpen{from{opacity:0;transform:translateY(-8px);max-height:0;padding-top:0;padding-bottom:0;}to{opacity:1;transform:none;max-height:940px;}}
.task-list-search-panel.hidden{display:none!important;}
.task-list-search-panel.is-active{border-color:rgba(102,217,255,.42);}
.task-search-summary-bar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:12px 13px;
    margin-bottom:14px;
    border-radius:20px;
    background:linear-gradient(135deg,rgba(102,217,255,.12),rgba(124,92,255,.09));
    border:1px solid rgba(102,217,255,.18);
}
.task-search-summary-bar strong{display:block;font-size:15px;line-height:1.7;}
.task-search-summary-bar span{display:block;color:var(--muted);font-size:12px;line-height:1.8;}
.task-search-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
}
.task-search-wide{grid-column:span 2;}
.task-search-grid .field,
.task-search-date-card,
.task-search-toggle-card{
    min-width:0;
    padding:12px;
    border:1px solid rgba(102,217,255,.15);
    border-radius:20px;
    background:rgba(255,255,255,.035);
}
.task-search-grid .field > span,
.task-search-date-card > strong{margin-bottom:8px;font-size:12px;color:var(--muted);}
.task-search-grid select[multiple]{
    min-height:112px;
    border-radius:16px;
    padding:8px;
    background:rgba(8,15,28,.56);
}
.task-search-grid select[multiple] option{
    padding:8px 10px;
    border-radius:10px;
    margin:2px 0;
}
.task-search-date-card{display:flex;flex-direction:column;gap:8px;}
.task-search-date-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.task-search-date-row .field{padding:0;border:0;background:transparent;border-radius:0;}
.task-search-toggle-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.task-search-toggle-card strong{display:block;font-size:13px;line-height:1.7;}
.task-search-toggle-card small{display:block;color:var(--muted);font-size:11px;line-height:1.7;}
.field-hint{display:block;color:var(--muted);font-size:11px;line-height:1.8;margin-top:6px;}
html[data-theme="light"] .category-search-toggle,
body[data-theme="light"] .category-search-toggle,
html[data-theme="light"] .task-list-search-panel,
body[data-theme="light"] .task-list-search-panel,
html[data-theme="light"] .task-search-summary-bar,
body[data-theme="light"] .task-search-summary-bar,
html[data-theme="light"] .task-search-grid .field,
body[data-theme="light"] .task-search-grid .field,
html[data-theme="light"] .task-search-date-card,
body[data-theme="light"] .task-search-date-card,
html[data-theme="light"] .task-search-toggle-card,
body[data-theme="light"] .task-search-toggle-card{
    background:rgba(255,255,255,.82);
    border-color:rgba(15,23,42,.10);
}
html[data-theme="light"] .task-search-grid select[multiple],
body[data-theme="light"] .task-search-grid select[multiple]{background:#fff;}
@media(max-width:980px){
    .task-search-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:720px){
    .category-search-toggle{width:100%;}
    .task-search-grid{grid-template-columns:1fr;}
    .task-search-wide{grid-column:span 1;}
    .task-search-date-row{grid-template-columns:1fr;}
    .task-search-summary-bar{align-items:stretch;flex-direction:column;}
    .task-search-summary-bar .ghost-btn{width:100%;}
}

/* v44: refined advanced search UI and clear toggle states */
.pretty-toggle span,
.settings-switch span{
    background:linear-gradient(135deg, rgba(100,116,139,.55), rgba(51,65,85,.72))!important;
    border-color:rgba(148,163,184,.38)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.10), 0 8px 18px rgba(15,23,42,.16);
}
.pretty-toggle span::after,
.settings-switch span::after{
    background:#f8fafc!important;
    box-shadow:0 5px 16px rgba(0,0,0,.28);
}
.pretty-toggle input:checked + span,
.settings-switch input:checked + span{
    background:linear-gradient(135deg, #23d3a4, var(--primary))!important;
    border-color:rgba(35,211,164,.55)!important;
    box-shadow:0 12px 24px rgba(35,211,164,.16), inset 0 1px 0 rgba(255,255,255,.24);
}
html[data-theme="light"] .pretty-toggle span,
body[data-theme="light"] .pretty-toggle span,
html[data-theme="light"] .settings-switch span,
body[data-theme="light"] .settings-switch span{
    background:linear-gradient(135deg,#e2e8f0,#cbd5e1)!important;
    border-color:rgba(100,116,139,.32)!important;
}
html[data-theme="light"] .pretty-toggle input:checked + span,
body[data-theme="light"] .pretty-toggle input:checked + span,
html[data-theme="light"] .settings-switch input:checked + span,
body[data-theme="light"] .settings-switch input:checked + span{
    background:linear-gradient(135deg,#14b8a6,#3b82f6)!important;
    border-color:rgba(20,184,166,.45)!important;
}
.category-search-toggle{
    display:inline-grid!important;
    place-items:center;
    flex:0 0 auto;
    line-height:1;
    opacity:1!important;
    visibility:visible!important;
    z-index:2;
}
.category-hero-actions{align-items:center;}
.refined-task-search-grid{
    grid-template-columns:repeat(6,minmax(0,1fr));
    align-items:start;
}
.refined-task-search-grid .task-search-wide{grid-column:span 3;}
.task-search-main-query{grid-column:span 6!important;}
.task-search-mini-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(220px,.75fr);
    gap:12px;
    align-items:stretch;
}
.task-search-mini-row .field,
.task-search-mini-row .task-search-toggle-card{height:100%;}
.task-search-overdue-card{
    padding:10px 12px!important;
    min-height:74px;
}
.task-search-overdue-card small{font-size:10.5px!important;}
.task-search-picker{
    min-width:0;
    padding:12px;
    border:1px solid rgba(102,217,255,.16);
    border-radius:22px;
    background:rgba(255,255,255,.035);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}
.task-search-picker .task-search-picker-select{
    padding:0;
    border:0;
    background:transparent;
    border-radius:0;
}
.task-search-chip-list{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:10px;
    min-height:36px;
}
.task-search-chip{
    display:inline-flex;
    align-items:center;
    gap:7px;
    max-width:100%;
    padding:7px 9px;
    border-radius:999px;
    color:var(--text);
    background:linear-gradient(135deg,rgba(102,217,255,.14),rgba(124,92,255,.12));
    border:1px solid rgba(102,217,255,.20);
}
.task-search-chip b{font-size:12px;font-weight:900;line-height:1.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;}
.task-search-chip small{font-size:10.5px;color:var(--muted);}
.task-search-chip button{
    width:20px;height:20px;border:0;border-radius:999px;cursor:pointer;
    display:grid;place-items:center;background:rgba(255,255,255,.12);color:var(--text);font-weight:1000;
}
.task-search-chip button:hover{background:rgba(255,107,107,.18);color:#ff8b8b;}
.task-search-chip-empty{font-size:12px;color:var(--muted);padding:8px 0;}
.task-search-date-card{
    grid-column:span 3;
    padding:13px!important;
    border-radius:22px!important;
}
.task-search-date-card-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.task-search-date-card-head strong{display:block;font-size:13px;line-height:1.7;}
.task-search-date-card-head small{display:block;color:var(--muted);font-size:11px;line-height:1.7;}
.task-search-date-card-head select{max-width:210px;}
.task-search-jdate-fields{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:12px;
    padding-top:12px;
    border-top:1px dashed rgba(102,217,255,.20);
}
.task-search-jdate-row{
    display:grid;
    grid-template-columns:76px minmax(84px,.8fr) minmax(118px,1fr) minmax(92px,.8fr);
    gap:8px;
    align-items:end;
}
.task-search-date-label{
    align-self:center;
    color:var(--muted);
    font-size:12px;
    font-weight:800;
}
.task-search-jdate-row .field{
    padding:0!important;
    border:0!important;
    background:transparent!important;
    border-radius:0!important;
}
.task-search-conditional-note{
    min-width:0;
    padding:14px;
    border-radius:22px;
    border:1px dashed rgba(102,217,255,.22);
    background:rgba(102,217,255,.045);
}
.task-search-conditional-note strong{display:block;font-size:13px;line-height:1.8;}
.task-search-conditional-note span{display:block;color:var(--muted);font-size:12px;line-height:1.9;}
html[data-theme="light"] .task-search-picker,
body[data-theme="light"] .task-search-picker,
html[data-theme="light"] .task-search-conditional-note,
body[data-theme="light"] .task-search-conditional-note{
    background:rgba(255,255,255,.86);
    border-color:rgba(15,23,42,.10);
}
html[data-theme="light"] .task-search-chip,
body[data-theme="light"] .task-search-chip{
    background:linear-gradient(135deg,rgba(14,165,233,.11),rgba(99,102,241,.10));
    border-color:rgba(37,99,235,.16);
}
html[data-theme="light"] .task-search-chip button,
body[data-theme="light"] .task-search-chip button{background:rgba(15,23,42,.06);}
@media(max-width:1100px){
    .refined-task-search-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
    .task-search-main-query,.refined-task-search-grid .task-search-wide,.task-search-date-card{grid-column:span 2!important;}
    .task-search-mini-row{grid-template-columns:1fr 1fr;}
    .task-search-overdue-card{grid-column:span 2;}
}
@media(max-width:720px){
    .refined-task-search-grid{grid-template-columns:1fr;}
    .task-search-main-query,.refined-task-search-grid .task-search-wide,.task-search-date-card{grid-column:span 1!important;}
    .task-search-mini-row{grid-template-columns:1fr;}
    .task-search-overdue-card{grid-column:span 1;}
    .task-search-date-card-head{align-items:stretch;flex-direction:column;}
    .task-search-date-card-head select{max-width:none;}
    .task-search-jdate-row{grid-template-columns:1fr;}
    .task-search-date-label{align-self:start;}
}

/* v45: cleaner advanced search layout + reliable shared people picker */
.refined-task-search-grid{
    grid-template-columns:repeat(12,minmax(0,1fr));
    grid-auto-flow:dense;
    align-items:stretch;
    gap:12px;
}
.task-search-main-query{grid-column:1 / -1!important;}
.task-search-mini-row{
    grid-column:1 / -1!important;
    grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) minmax(170px,.72fr);
}
.refined-task-search-grid .task-search-picker{grid-column:span 6;}
.refined-task-search-grid .task-search-date-card{grid-column:span 6!important;}
.refined-task-search-grid .task-search-picker[data-task-search-picker="people"]{grid-column:1 / -1;}
.task-search-picker,
.task-search-date-card,
.task-search-mini-row .field,
.task-search-toggle-card{
    height:100%;
}
.task-search-picker{
    display:flex;
    flex-direction:column;
    justify-content:flex-start;
}
.task-search-picker .task-search-chip-list{
    flex:1;
    align-content:flex-start;
}
.task-search-date-card{
    min-height:0;
}
.task-search-date-card-head{
    min-height:54px;
}
.task-search-jdate-fields{
    flex:1;
}
.task-search-overdue-card{
    min-height:0;
    display:flex;
    align-items:center;
}
.task-search-overdue-card span:first-child{min-width:0;}
.task-search-overdue-card strong,
.task-search-overdue-card small{white-space:normal;}
.task-search-conditional-note{display:none!important;}
@media(max-width:1100px){
    .refined-task-search-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
    .task-search-main-query,.task-search-mini-row,.refined-task-search-grid .task-search-picker,.refined-task-search-grid .task-search-date-card,.refined-task-search-grid .task-search-picker[data-task-search-picker="people"]{grid-column:1 / -1!important;}
    .task-search-mini-row{grid-template-columns:1fr 1fr;}
    .task-search-overdue-card{grid-column:span 2;}
}
@media(max-width:720px){
    .refined-task-search-grid{grid-template-columns:1fr;}
    .task-search-main-query,.task-search-mini-row,.refined-task-search-grid .task-search-picker,.refined-task-search-grid .task-search-date-card,.refined-task-search-grid .task-search-picker[data-task-search-picker="people"]{grid-column:1 / -1!important;}
    .task-search-mini-row{grid-template-columns:1fr;}
    .task-search-overdue-card{grid-column:span 1;}
}

/* v48-v49: compact advanced-search header + database-backed user preferences + inline controls */
.task-search-quickbar{
    display:grid;
    grid-template-columns:minmax(220px,1fr) auto auto;
    gap:12px;
    align-items:stretch;
}
.task-search-query-shell{
    min-width:0;
    padding:12px 13px!important;
    border:1px solid rgba(102,217,255,.18)!important;
    border-radius:22px!important;
    background:rgba(255,255,255,.045)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}
.task-search-query-shell input{min-height:42px;}
.task-search-clear-btn{
    min-height:68px;
    align-self:stretch;
    padding-inline:18px!important;
    border-radius:20px!important;
    white-space:nowrap;
}
.task-search-advanced-toggle{
    min-height:68px;
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 13px;
    border-radius:20px;
    cursor:pointer;
    user-select:none;
    border:1px solid rgba(102,217,255,.18);
    background:linear-gradient(135deg,rgba(255,255,255,.055),rgba(102,217,255,.045));
    box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
    white-space:nowrap;
}
.task-search-advanced-toggle input{position:absolute;opacity:0;pointer-events:none;}
.task-search-advanced-toggle b{font-size:12.5px;font-weight:1000;color:var(--text);}
.task-search-advanced-track{
    width:48px;
    height:28px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    padding:3px;
    background:linear-gradient(135deg,rgba(100,116,139,.55),rgba(51,65,85,.72));
    border:1px solid rgba(148,163,184,.36);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.10),0 8px 18px rgba(15,23,42,.14);
    transition:.18s ease;
}
.task-search-advanced-track i{
    width:20px;
    height:20px;
    border-radius:50%;
    background:#f8fafc;
    box-shadow:0 5px 16px rgba(0,0,0,.28);
    transform:translateX(0);
    transition:.18s ease;
}
.task-search-advanced-toggle input:checked + .task-search-advanced-track{
    background:linear-gradient(135deg,#14b8a6,var(--primary));
    border-color:rgba(20,184,166,.55);
    box-shadow:0 12px 24px rgba(35,211,164,.16), inset 0 1px 0 rgba(255,255,255,.24);
}
.task-search-advanced-toggle input:checked + .task-search-advanced-track i{transform:translateX(-20px);}
.task-search-advanced-body{
    margin-top:14px;
    padding-top:14px;
    border-top:1px dashed rgba(102,217,255,.20);
    animation:taskSearchOpen .2s ease both;
}
.task-list-search-panel.advanced-is-closed{
    padding:14px;
}
.task-list-search-panel.advanced-is-closed .task-search-quickbar{align-items:center;}
html[data-theme="light"] .task-search-query-shell,
body[data-theme="light"] .task-search-query-shell,
html[data-theme="light"] .task-search-advanced-toggle,
body[data-theme="light"] .task-search-advanced-toggle{
    background:rgba(255,255,255,.88)!important;
    border-color:rgba(15,23,42,.10)!important;
}
html[data-theme="light"] .task-search-advanced-track,
body[data-theme="light"] .task-search-advanced-track{
    background:linear-gradient(135deg,#e2e8f0,#cbd5e1);
    border-color:rgba(100,116,139,.32);
}
@media(max-width:880px){
    .task-search-quickbar{grid-template-columns:1fr 1fr;}
    .task-search-query-shell{grid-column:1 / -1;}
    .task-search-clear-btn,.task-search-advanced-toggle{min-height:56px;}
}
@media(max-width:560px){
    .task-search-quickbar{grid-template-columns:1fr;}
    .task-search-clear-btn{width:100%;}
    .task-search-advanced-toggle{justify-content:space-between;}
}

/* v49: search inline controls + sturdier search icon */
.category-hero-actions .category-search-toggle{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:0 0 42px!important;
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    opacity:1!important;
    visibility:visible!important;
    transform:none;
}
.category-search-toggle span{display:block;line-height:1;}
.task-search-quickbar{
    display:block!important;
}
.task-search-query-shell{
    display:grid!important;
    grid-template-columns:minmax(180px,1fr) auto!important;
    gap:12px!important;
    align-items:end!important;
    padding:12px!important;
}
.task-search-query-field{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:7px;
}
.task-search-query-field span{
    font-size:12px;
    font-weight:900;
    color:var(--muted);
}
.task-search-query-field input{
    width:100%;
    min-height:42px;
}
.task-search-inline-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
    flex-wrap:wrap;
}
.task-search-clear-btn,
.task-search-advanced-toggle{
    min-height:42px!important;
    align-self:auto!important;
}
.task-search-clear-btn{
    padding-inline:14px!important;
}
.task-search-advanced-toggle{
    padding:7px 10px!important;
}
.task-search-advanced-toggle b{white-space:nowrap;}
@media(max-width:780px){
    .task-search-query-shell{grid-template-columns:1fr!important;}
    .task-search-inline-actions{justify-content:stretch;}
    .task-search-inline-actions .task-search-clear-btn,
    .task-search-inline-actions .task-search-advanced-toggle{flex:1 1 auto;justify-content:center;}
}

/* v50: rounded inline search, stable magnifier, no-refresh drag polish, loading buttons */
.category-search-toggle svg.category-search-icon{
    width:21px!important;
    height:21px!important;
    display:block!important;
    flex:0 0 21px;
    fill:currentColor!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:none;
}
.category-search-toggle,
.category-search-toggle.is-active{
    color:var(--text)!important;
}
.category-search-toggle.is-active{
    color:#fff!important;
}
.category-hero-actions .category-search-toggle *{
    opacity:1!important;
    visibility:visible!important;
}
.task-search-query-shell{
    border-radius:24px!important;
}
.task-search-query-field input[data-task-search-query]{
    min-height:44px!important;
    border-radius:18px!important;
    padding:10px 14px!important;
    color:var(--text)!important;
    background:linear-gradient(135deg,rgba(255,255,255,.075),rgba(102,217,255,.045))!important;
    border:1px solid rgba(102,217,255,.24)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(0,0,0,.08)!important;
    outline:none!important;
    transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.task-search-query-field input[data-task-search-query]:focus{
    border-color:rgba(102,217,255,.56)!important;
    box-shadow:0 0 0 4px rgba(102,217,255,.13), inset 0 1px 0 rgba(255,255,255,.12)!important;
}
.task-search-query-field input[data-task-search-query]::placeholder{color:rgba(148,163,184,.78);}
html[data-theme="light"] .task-search-query-field input[data-task-search-query],
body[data-theme="light"] .task-search-query-field input[data-task-search-query]{
    background:linear-gradient(135deg,#fff,rgba(239,246,255,.96))!important;
    border-color:rgba(37,99,235,.17)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.75), 0 10px 24px rgba(15,23,42,.06)!important;
}
.undated-task-draggable.is-dragging,
.task-subtask-row.is-dragging{
    opacity:.72;
    transform:scale(.992);
    box-shadow:0 20px 44px rgba(0,0,0,.18)!important;
}
button.is-loading,
.primary-btn.is-loading,
.ghost-btn.is-loading{
    position:relative;
    cursor:progress!important;
    opacity:.88;
    pointer-events:none;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:8px!important;
}
.btn-loading-spinner{
    width:16px;
    height:16px;
    border-radius:50%;
    border:2px solid rgba(255,255,255,.38);
    border-top-color:#fff;
    animation:buttonSpin .78s linear infinite;
    flex:0 0 16px;
}
.ghost-btn.is-loading .btn-loading-spinner{
    border-color:rgba(102,217,255,.24);
    border-top-color:var(--primary);
}
@keyframes buttonSpin{to{transform:rotate(360deg);}}
@media(max-width:780px){
    .task-search-query-field input[data-task-search-query]{border-radius:16px!important;}
}

/* v51: keep the task-list search magnifier visible in light theme when filters make it active */
html[data-theme="light"] .category-hero-actions .category-search-toggle.is-active,
body[data-theme="light"] .category-hero-actions .category-search-toggle.is-active,
.category-hero-actions .category-search-toggle.is-active{
    background:
        radial-gradient(circle at 30% 16%, rgba(255,255,255,.28), transparent 34%),
        linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
    border-color: rgba(255,255,255,.28) !important;
    color: #fff !important;
    box-shadow: 0 16px 34px rgba(102,217,255,.22), inset 0 1px 0 rgba(255,255,255,.22) !important;
}
html[data-theme="light"] .category-hero-actions .category-search-toggle.is-active svg,
body[data-theme="light"] .category-hero-actions .category-search-toggle.is-active svg,
.category-hero-actions .category-search-toggle.is-active svg,
html[data-theme="light"] .category-hero-actions .category-search-toggle.is-active svg path,
body[data-theme="light"] .category-hero-actions .category-search-toggle.is-active svg path,
.category-hero-actions .category-search-toggle.is-active svg path{
    display:block !important;
    opacity:1 !important;
    visibility:visible !important;
    fill:currentColor !important;
    color:#fff !important;
}
html[data-theme="light"] .category-hero-actions .category-search-toggle:not(.is-active),
body[data-theme="light"] .category-hero-actions .category-search-toggle:not(.is-active){
    color:#0f172a !important;
}


/* v52: final hard-fix for the task-list magnifier.
   The icon is drawn with CSS pseudo-elements instead of relying on the inline SVG,
   so re-rendering/filter state changes cannot make it invisible. */
.category-hero-actions button.category-search-toggle[data-toggle-task-list-search]{
    position:relative!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:0 0 44px!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    padding:0!important;
    overflow:visible!important;
    opacity:1!important;
    visibility:visible!important;
    color:#0f172a!important;
    isolation:isolate;
}
.category-hero-actions button.category-search-toggle[data-toggle-task-list-search].is-active{
    color:#fff!important;
    background:
        radial-gradient(circle at 30% 16%, rgba(255,255,255,.28), transparent 34%),
        linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
    border-color:rgba(255,255,255,.28)!important;
}
html:not([data-theme="light"]) .category-hero-actions button.category-search-toggle[data-toggle-task-list-search]:not(.is-active),
body:not([data-theme="light"]) .category-hero-actions button.category-search-toggle[data-toggle-task-list-search]:not(.is-active){
    color:var(--text)!important;
}
.category-hero-actions button.category-search-toggle[data-toggle-task-list-search] svg.category-search-icon{
    display:none!important;
}
.category-hero-actions button.category-search-toggle[data-toggle-task-list-search]::before,
.category-hero-actions button.category-search-toggle[data-toggle-task-list-search]::after{
    content:""!important;
    position:absolute!important;
    display:block!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:none!important;
    z-index:2!important;
}
.category-hero-actions button.category-search-toggle[data-toggle-task-list-search]::before{
    width:14px!important;
    height:14px!important;
    border:2.3px solid currentColor!important;
    border-radius:999px!important;
    left:50%!important;
    top:50%!important;
    transform:translate(-62%,-62%)!important;
    box-sizing:border-box!important;
}
.category-hero-actions button.category-search-toggle[data-toggle-task-list-search]::after{
    width:10px!important;
    height:2.6px!important;
    border-radius:999px!important;
    background:currentColor!important;
    left:50%!important;
    top:50%!important;
    transform:translate(3px,5px) rotate(45deg)!important;
    transform-origin:left center!important;
}
.category-hero-actions button.category-search-toggle[data-toggle-task-list-search]:hover::before,
.category-hero-actions button.category-search-toggle[data-toggle-task-list-search]:hover::after{
    opacity:1!important;
}
@media(max-width:720px){
    .category-hero-actions button.category-search-toggle[data-toggle-task-list-search]{
        flex:0 0 44px!important;
        width:44px!important;
        min-width:44px!important;
        max-width:44px!important;
    }
}

/* v53: goals list, goal categories, steps, progress and countdown */
.goals-list-view-grid{display:block;}
.goals-board{display:flex;flex-direction:column;gap:16px;}
.goals-hero{
    align-items:center;
    background:
        radial-gradient(circle at 12% 18%, rgba(139,152,255,.20), transparent 32%),
        radial-gradient(circle at 88% 0%, rgba(102,217,255,.16), transparent 34%),
        rgba(255,255,255,.035);
}
.goals-category-stack{display:flex;flex-direction:column;gap:14px;}
.goal-category-section{
    border:1px solid color-mix(in srgb, var(--goal-cat-color, #8b98ff) 30%, var(--line));
    border-radius:26px;
    padding:14px;
    background:
        radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--goal-cat-color, #8b98ff) 17%, transparent), transparent 32%),
        rgba(255,255,255,.035);
    box-shadow:0 20px 55px rgba(0,0,0,.13);
}
.goal-category-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding-bottom:12px;
    margin-bottom:12px;
    border-bottom:1px solid var(--line);
}
.goals-card-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
    gap:12px;
}
.goal-card{
    position:relative;
    display:flex;
    flex-direction:column;
    gap:12px;
    min-width:0;
    padding:15px;
    border:1px solid color-mix(in srgb, var(--goal-cat-color, #8b98ff) 20%, var(--line));
    border-radius:24px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--goal-cat-color, #8b98ff) 12%, transparent), rgba(255,255,255,.035)),
        rgba(255,255,255,.035);
    box-shadow:0 14px 35px rgba(0,0,0,.13);
    overflow:hidden;
}
.goal-card::before{
    content:'';
    position:absolute;
    inset:auto 16px -26px auto;
    width:96px;height:96px;border-radius:999px;
    background:color-mix(in srgb, var(--goal-cat-color, #8b98ff) 16%, transparent);
    filter:blur(18px);
    pointer-events:none;
}
.goal-card.is-completed{opacity:.82;}
.goal-card.is-completed h3{text-decoration:line-through;text-decoration-thickness:2px;}
.goal-card-top,
.goal-card-actions,
.goal-progress-label{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}
.goal-card h3{margin:0;font-size:18px;line-height:1.55;}
.goal-desc{margin:0;line-height:1.9;}
.goal-badge{
    display:inline-flex;
    align-items:center;
    min-height:28px;
    padding:4px 10px;
    border-radius:999px;
    border:1px solid color-mix(in srgb, var(--goal-cat-color, #8b98ff) 32%, transparent);
    background:color-mix(in srgb, var(--goal-cat-color, #8b98ff) 13%, transparent);
    font-size:11px;
    font-weight:1000;
    color:var(--text);
}
.goal-progress-block,
.goal-time-block{
    display:grid;
    gap:7px;
    padding:10px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:18px;
    background:rgba(0,0,0,.10);
}
.goal-progress-label span{color:var(--muted);font-size:12px;font-weight:900;}
.goal-progress-label strong{font-size:13px;}
.goal-progress-bar,
.goal-time-bar{
    height:10px;
    border-radius:999px;
    background:rgba(255,255,255,.09);
    border:1px solid rgba(255,255,255,.06);
    overflow:hidden;
}
.goal-progress-bar i,
.goal-time-bar i{
    display:block;
    height:100%;
    border-radius:inherit;
    background:linear-gradient(90deg,var(--goal-cat-color, #8b98ff),var(--accent, #66d9ff));
    transition:width .25s ease;
}
.goal-time-bar i{background:linear-gradient(90deg,#66d9ff,#8b98ff,#c084fc);}
.goal-time-block.is-soon .goal-time-bar i{background:linear-gradient(90deg,#f59e0b,#66d9ff);}
.goal-time-block.is-overdue .goal-time-bar i{background:linear-gradient(90deg,#ef4444,#f59e0b);}
.goal-progress-block small,
.goal-time-block small{color:var(--muted);font-size:11px;line-height:1.8;}
.goal-steps-preview{display:flex;flex-direction:column;gap:7px;}
.goal-step-preview{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:8px;
    padding:8px 9px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:15px;
    background:rgba(255,255,255,.035);
    cursor:pointer;
}
.goal-step-preview input{width:17px;height:17px;accent-color:var(--accent);}
.goal-step-preview span{font-weight:900;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.goal-step-preview small{color:var(--muted);font-size:11px;white-space:nowrap;}
.goal-step-preview.is-done span{text-decoration:line-through;opacity:.62;}
.goal-step-empty,
.goal-complete-toggle{
    display:flex;
    align-items:center;
    gap:8px;
    padding:9px 10px;
    border:1px dashed var(--line);
    border-radius:15px;
    color:var(--muted);
    background:rgba(255,255,255,.025);
    font-size:12px;
    font-weight:900;
}
.goal-complete-toggle input{width:17px;height:17px;accent-color:var(--accent);}
.goal-modal-card{max-width:min(820px,calc(100vw - 24px));}
.goal-category-modal-card{max-width:620px;}
.goal-category-picker-box{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:12px;
    align-items:end;
}
.goal-date-box,
.goal-step-box{
    display:flex;
    flex-direction:column;
    gap:10px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:20px;
    background:rgba(255,255,255,.032);
}
.goal-date-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}
.goal-date-panel{
    display:grid;
    gap:8px;
    min-width:0;
    padding:10px;
    border:1px solid rgba(102,217,255,.12);
    border-radius:17px;
    background:rgba(102,217,255,.035);
}
.goal-date-fields-main{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
}
.goal-step-list{
    display:flex;
    flex-direction:column;
    gap:9px;
    max-height:520px;
    overflow:auto;
    padding-inline-end:2px;
}
.goal-step-editor-item{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    gap:8px;
    align-items:start;
    padding:9px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:17px;
    background:rgba(0,0,0,.10);
}
.goal-step-editor-item.is-completed input[type="text"]{text-decoration:line-through;opacity:.65;}
.goal-step-editor-main{display:grid;gap:8px;min-width:0;}
.goal-step-editor-main > input{
    width:100%;
    border:1px solid var(--line);
    border-radius:14px;
    background:rgba(255,255,255,.055);
    color:var(--text);
    padding:10px 12px;
    outline:none;
}
.goal-step-date-box{
    display:grid;
    gap:8px;
    padding:8px;
    border:1px solid rgba(139,152,255,.14);
    border-radius:15px;
    background:rgba(139,152,255,.045);
}
.goal-step-range-fields{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
}
.goal-step-date-fields{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px;
    align-items:end;
    padding:8px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:14px;
    background:rgba(255,255,255,.035);
}
.goal-step-date-caption{
    grid-column:1/-1;
    color:var(--muted);
    font-weight:1000;
    font-size:11px;
}
.goal-category-list{
    display:flex;
    flex-direction:column;
    gap:10px;
    max-height:320px;
    overflow:auto;
    padding:10px;
    border:1px dashed var(--line);
    border-radius:18px;
    background:rgba(255,255,255,.025);
}
.goal-category-manager-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:10px;
    border:1px solid color-mix(in srgb, var(--goal-cat-color, #8b98ff) 25%, var(--line));
    border-radius:16px;
    background:linear-gradient(135deg,color-mix(in srgb, var(--goal-cat-color, #8b98ff) 12%, transparent),rgba(255,255,255,.028));
}
.goal-category-manager-item.is-editing{
    border-color:color-mix(in srgb, var(--goal-cat-color, #8b98ff) 70%, var(--line));
    box-shadow:0 0 0 3px color-mix(in srgb, var(--goal-cat-color, #8b98ff) 15%, transparent);
}
.goal-category-manager-item .category-manager-title i{
    background:var(--goal-cat-color, #8b98ff);
    box-shadow:0 0 0 5px color-mix(in srgb, var(--goal-cat-color, #8b98ff) 16%, transparent);
}
.link-btn.danger,
.ghost-btn.danger{color:#fb7185;}

html[data-theme="light"] .goal-card,
body[data-theme="light"] .goal-card,
html[data-theme="light"] .goal-date-box,
body[data-theme="light"] .goal-date-box,
html[data-theme="light"] .goal-step-box,
body[data-theme="light"] .goal-step-box,
html[data-theme="light"] .goal-progress-block,
body[data-theme="light"] .goal-progress-block,
html[data-theme="light"] .goal-time-block,
body[data-theme="light"] .goal-time-block,
html[data-theme="light"] .goal-step-editor-item,
body[data-theme="light"] .goal-step-editor-item,
html[data-theme="light"] .goal-step-preview,
body[data-theme="light"] .goal-step-preview,
html[data-theme="light"] .goal-category-manager-item,
body[data-theme="light"] .goal-category-manager-item{
    background:rgba(255,255,255,.76);
    border-color:rgba(15,23,42,.10);
}
html[data-theme="light"] .goal-date-panel,
body[data-theme="light"] .goal-date-panel,
html[data-theme="light"] .goal-step-date-box,
body[data-theme="light"] .goal-step-date-box,
html[data-theme="light"] .goal-step-date-fields,
body[data-theme="light"] .goal-step-date-fields{
    background:rgba(255,255,255,.68);
    border-color:rgba(15,23,42,.10);
}
html[data-theme="light"] .goal-step-editor-main > input,
body[data-theme="light"] .goal-step-editor-main > input{
    background:rgba(255,255,255,.86);
    border-color:rgba(15,23,42,.12);
}

@media (max-width:720px){
    .goal-category-head,
    .goals-hero{align-items:stretch;flex-direction:column;}
    .goal-category-picker-box,
    .goal-date-grid,
    .goal-date-fields-main,
    .goal-step-range-fields,
    .goal-step-date-fields,
    .goal-step-editor-item{grid-template-columns:1fr;}
    .category-hero-actions .primary-btn,
    .category-hero-actions .ghost-btn,
    .goal-category-head .ghost-btn{width:100%;}
    .goal-category-manager-item{align-items:stretch;flex-direction:column;}
    .category-manager-actions{justify-content:stretch;}
    .category-manager-actions .ghost-btn{flex:1;}
}

/* v53.1: link tasks to goals */
.task-goal-picker-box{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:12px;
    align-items:end;
    padding:12px;
    border:1px solid color-mix(in srgb, #8b98ff 28%, var(--line));
    border-radius:18px;
    background:radial-gradient(circle at 96% 0%, rgba(139,152,255,.14), transparent 34%), rgba(255,255,255,.035);
}
.task-goal-add-btn{white-space:nowrap;}
.task-goal-picker-card{max-width:min(680px, calc(100vw - 24px));}
.task-goal-quick-form{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:12px;
    align-items:end;
    padding:12px;
    border:1px solid rgba(139,152,255,.22);
    border-radius:20px;
    background:rgba(255,255,255,.035);
    margin-bottom:12px;
}
.task-goal-picker-list{
    display:flex;
    flex-direction:column;
    gap:10px;
    max-height:340px;
    overflow:auto;
    padding:4px;
}
.task-goal-picker-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px;
    border:1px solid color-mix(in srgb, var(--goal-cat-color, #8b98ff) 24%, var(--line));
    border-radius:18px;
    background:linear-gradient(135deg, color-mix(in srgb, var(--goal-cat-color, #8b98ff) 10%, transparent), rgba(255,255,255,.035));
}
.task-goal-picker-item.is-selected{
    border-color:color-mix(in srgb, var(--goal-cat-color, #8b98ff) 55%, transparent);
    box-shadow:0 16px 36px color-mix(in srgb, var(--goal-cat-color, #8b98ff) 18%, transparent);
}
.task-goal-picker-main{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
}
.task-goal-picker-main i{
    width:34px;
    height:34px;
    border-radius:13px;
    background:linear-gradient(135deg, var(--goal-cat-color, #8b98ff), var(--primary));
    box-shadow:0 12px 24px color-mix(in srgb, var(--goal-cat-color, #8b98ff) 22%, transparent);
    flex:0 0 auto;
}
.task-goal-picker-main strong{
    display:block;
    font-size:14px;
    line-height:1.7;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.task-goal-picker-main span{
    display:block;
    color:var(--muted);
    font-size:11px;
    line-height:1.7;
}
.task-goal-badge-wrap{margin-top:8px;}
.task-goal-badge{
    display:inline-flex;
    align-items:center;
    width:max-content;
    max-width:100%;
    min-height:28px;
    padding:4px 10px;
    border-radius:999px;
    border:1px solid color-mix(in srgb, var(--goal-cat-color, #8b98ff) 38%, transparent);
    background:color-mix(in srgb, var(--goal-cat-color, #8b98ff) 14%, transparent);
    color:var(--text);
    font-size:11px;
    font-weight:1000;
    line-height:1.5;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.task-goal-badge::before{
    content:'◎';
    margin-left:6px;
    color:var(--goal-cat-color, #8b98ff);
}
.task-goal-badge.is-compact{
    min-height:24px;
    padding:3px 8px;
    font-size:10px;
    margin-top:5px;
}
html[data-theme="light"] .task-goal-picker-box,
body[data-theme="light"] .task-goal-picker-box,
html[data-theme="light"] .task-goal-quick-form,
body[data-theme="light"] .task-goal-quick-form,
html[data-theme="light"] .task-goal-picker-item,
body[data-theme="light"] .task-goal-picker-item{
    background:rgba(255,255,255,.82);
    border-color:rgba(15,23,42,.10);
}
@media(max-width:720px){
    .task-goal-picker-box,
    .task-goal-quick-form{grid-template-columns:1fr;}
    .task-goal-add-btn,
    .task-goal-quick-form .primary-btn{width:100%;}
    .task-goal-picker-item{align-items:stretch;flex-direction:column;}
    .task-goal-picker-item .ghost-btn{width:100%;}
}

/* v53.2: compact task-list search rows + category/goal task linking */
.category-goal-link-field select{min-height:44px;}
.category-goal-link-hint{border-color:rgba(139,152,255,.22);background:rgba(139,152,255,.06);}
.refined-task-search-grid .task-search-picker[data-task-search-picker="categories"],
.refined-task-search-grid .task-search-picker[data-task-search-picker="goals"],
.refined-task-search-grid .task-search-picker[data-task-search-picker="priorities"]{grid-column:span 4!important;}
.refined-task-search-grid .task-search-date-card{grid-column:span 6!important;}
.goal-card-actions{flex-wrap:wrap;justify-content:flex-end;}
.goal-card-actions .tiny-action{min-height:31px;padding:6px 10px;border-radius:11px;}
.goal-related-tasks-btn{border-color:rgba(139,152,255,.24)!important;}
.goal-related-tasks-btn.has-related-tasks{background:linear-gradient(135deg,rgba(139,152,255,.15),rgba(102,217,255,.10));}
.goal-tasks-modal-card{max-width:min(780px, calc(100vw - 24px));}
.goal-related-task-list{display:flex;flex-direction:column;gap:10px;max-height:58vh;overflow:auto;padding:4px;}
.goal-related-task-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid rgba(139,152,255,.20);border-radius:18px;background:linear-gradient(135deg,rgba(139,152,255,.09),rgba(255,255,255,.035));}
.goal-related-task-item.is-completed{opacity:.72;}
.goal-related-task-main{display:flex;align-items:flex-start;gap:10px;min-width:0;}
.goal-related-task-status{width:28px;height:28px;border-radius:999px;display:grid;place-items:center;flex:0 0 auto;background:rgba(139,152,255,.14);border:1px solid rgba(139,152,255,.22);font-weight:1000;}
.goal-related-task-main strong{display:block;font-size:14px;line-height:1.7;}
.goal-related-task-main p{margin:2px 0 0;color:var(--muted);font-size:12px;line-height:1.9;}
.goal-related-task-main small{display:block;margin-top:3px;color:var(--muted);font-size:11px;line-height:1.8;}
.goal-related-task-subtasks{display:inline-flex;margin-top:7px;padding:4px 8px;border-radius:999px;background:rgba(102,217,255,.09);border:1px solid rgba(102,217,255,.16);font-size:10.5px;font-weight:900;color:var(--text);}
html[data-theme="light"] .goal-related-task-item,
body[data-theme="light"] .goal-related-task-item{background:rgba(255,255,255,.88);border-color:rgba(15,23,42,.10);}
@media(max-width:1100px){
    .refined-task-search-grid .task-search-picker[data-task-search-picker="categories"],
    .refined-task-search-grid .task-search-picker[data-task-search-picker="goals"],
    .refined-task-search-grid .task-search-picker[data-task-search-picker="priorities"],
    .refined-task-search-grid .task-search-date-card{grid-column:1 / -1!important;}
}
@media(max-width:720px){
    .goal-related-task-item{align-items:stretch;flex-direction:column;}
    .goal-related-task-item .tiny-action{width:100%;}
}


/* v54.1: prominent category-goal badges and goal relation modals */
.category-linked-goal-badge{
    display:inline-flex;
    align-items:center;
    gap:7px;
    width:max-content;
    max-width:100%;
    margin-top:8px;
    padding:6px 10px;
    border-radius:999px;
    border:1px solid color-mix(in srgb, var(--goal-cat-color, #8b98ff) 52%, rgba(255,255,255,.16));
    background:linear-gradient(135deg,color-mix(in srgb,var(--goal-cat-color,#8b98ff) 28%, transparent),rgba(102,217,255,.09));
    box-shadow:0 12px 30px color-mix(in srgb,var(--goal-cat-color,#8b98ff) 18%, transparent), inset 0 1px 0 rgba(255,255,255,.10);
    color:var(--text);
    font-size:11px;
    font-weight:1000;
    line-height:1.5;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.category-linked-goal-badge::before{
    content:'◎';
    display:grid;
    place-items:center;
    width:20px;
    height:20px;
    border-radius:999px;
    background:color-mix(in srgb,var(--goal-cat-color,#8b98ff) 28%, rgba(255,255,255,.10));
    color:var(--goal-cat-color,#8b98ff);
    flex:0 0 auto;
}
.category-linked-goal-badge b{font-size:10px;color:color-mix(in srgb,var(--goal-cat-color,#8b98ff) 82%, var(--text));}
.category-linked-goal-badge span{min-width:0;overflow:hidden;text-overflow:ellipsis;}
.goal-related-categories-btn{border-color:rgba(102,217,255,.24)!important;}
.goal-related-categories-btn.has-related-categories{background:linear-gradient(135deg,rgba(102,217,255,.14),rgba(139,152,255,.10));}
.goal-categories-modal-card{max-width:min(720px, calc(100vw - 24px));}
.goal-linked-category-list{display:flex;flex-direction:column;gap:10px;max-height:56vh;overflow:auto;padding:4px;}
.goal-linked-category-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid color-mix(in srgb,var(--cat-color,#66d9ff) 24%, var(--line));border-radius:18px;background:linear-gradient(135deg,color-mix(in srgb,var(--cat-color,#66d9ff) 11%, transparent),rgba(255,255,255,.035));}
.goal-linked-category-main{display:flex;align-items:center;gap:10px;min-width:0;}
.goal-linked-category-main i{width:34px;height:34px;border-radius:13px;background:linear-gradient(135deg,var(--cat-color,#66d9ff),var(--primary));box-shadow:0 12px 24px color-mix(in srgb,var(--cat-color,#66d9ff) 20%, transparent);flex:0 0 auto;}
.goal-linked-category-main strong{display:block;font-size:14px;line-height:1.7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.goal-linked-category-main small{display:block;color:var(--muted);font-size:11px;line-height:1.8;}
.goal-related-task-item{align-items:flex-start;}
.goal-related-task-main{flex:1;}
.goal-related-task-text{min-width:0;flex:1;}
.goal-related-task-check{width:30px;height:30px;display:inline-grid;place-items:center;flex:0 0 auto;cursor:pointer;}
.goal-related-task-check input{position:absolute;opacity:0;pointer-events:none;}
.goal-related-task-check span{width:28px;height:28px;border-radius:999px;border:1px solid rgba(139,152,255,.28);background:rgba(139,152,255,.12);display:grid;place-items:center;transition:.18s ease;}
.goal-related-task-check span::after{content:'○';font-weight:1000;color:var(--muted);}
.goal-related-task-check input:checked + span{background:linear-gradient(135deg,#23d3a4,var(--primary));border-color:rgba(35,211,164,.50);box-shadow:0 12px 22px rgba(35,211,164,.16);}
.goal-related-task-check input:checked + span::after{content:'✓';color:white;}
.goal-related-subtasks-accordion{margin-top:9px;border:1px dashed rgba(102,217,255,.18);border-radius:16px;background:rgba(255,255,255,.028);overflow:hidden;}
.goal-related-subtasks-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border:0;background:transparent;color:var(--text);font:inherit;font-weight:1000;cursor:pointer;}
.goal-related-subtasks-toggle b{font-size:11px;color:var(--muted);}
.goal-related-subtasks-toggle i{transition:.18s ease;}
.goal-related-subtasks-accordion.open .goal-related-subtasks-toggle i{transform:rotate(180deg);}
.goal-related-subtasks-panel{display:flex;flex-direction:column;gap:6px;padding:0 8px 9px;}
.goal-related-subtask-row{display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px 9px;align-items:start;padding:8px;border-radius:12px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.07);cursor:pointer;}
.goal-related-subtask-row input{margin-top:4px;accent-color:var(--primary);}
.goal-related-subtask-row span{font-size:12px;font-weight:900;line-height:1.7;}
.goal-related-subtask-row small{grid-column:2;color:var(--muted);font-size:10.5px;line-height:1.6;}
.goal-related-subtask-row.is-completed span{text-decoration:line-through;color:var(--muted);}
html[data-theme="light"] .category-linked-goal-badge,
body[data-theme="light"] .category-linked-goal-badge,
html[data-theme="light"] .goal-linked-category-item,
body[data-theme="light"] .goal-linked-category-item,
html[data-theme="light"] .goal-related-subtasks-accordion,
body[data-theme="light"] .goal-related-subtasks-accordion,
html[data-theme="light"] .goal-related-subtask-row,
body[data-theme="light"] .goal-related-subtask-row{background:rgba(255,255,255,.82);border-color:rgba(15,23,42,.10);}
@media(max-width:720px){
    .goal-linked-category-item{align-items:stretch;flex-direction:column;}
    .goal-linked-category-item .tiny-action{width:100%;}
}

/* v56: verified goal-linked categories, exact advanced-search rows, and related-task checklist UI */
.refined-task-search-grid{
    grid-template-columns:repeat(12,minmax(0,1fr))!important;
    align-items:stretch!important;
}
.refined-task-search-grid > .task-search-mini-row{
    grid-column:1 / -1!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
.refined-task-search-grid .task-search-picker[data-task-search-picker="goals"],
.refined-task-search-grid .task-search-picker[data-task-search-picker="categories"],
.refined-task-search-grid .task-search-picker[data-task-search-picker="priorities"]{
    grid-column:span 4!important;
}
.refined-task-search-grid > .task-search-date-card{
    grid-column:span 6!important;
}
.refined-task-search-grid .task-search-picker[data-task-search-picker="people"]{
    grid-column:1 / -1!important;
}
.category-task-section.is-goal-linked-category{
    border-color:color-mix(in srgb,var(--cat-color,#66d9ff) 34%, rgba(139,152,255,.28));
    box-shadow:0 18px 48px color-mix(in srgb,var(--cat-color,#66d9ff) 10%, transparent), inset 0 1px 0 rgba(255,255,255,.08);
}
.category-task-section.is-goal-linked-category .category-task-head{
    background:
        radial-gradient(circle at 8% 0%, color-mix(in srgb,var(--goal-cat-color,#8b98ff) 16%, transparent), transparent 36%),
        linear-gradient(135deg,color-mix(in srgb,var(--cat-color,#66d9ff) 10%, transparent),rgba(255,255,255,.025));
}
.category-linked-goal-badge{
    min-height:36px!important;
    padding:7px 12px!important;
    border-width:2px!important;
    border-radius:16px!important;
    background:
        radial-gradient(circle at 14% 10%, rgba(255,255,255,.20), transparent 34%),
        linear-gradient(135deg,color-mix(in srgb,var(--goal-cat-color,#8b98ff) 36%, transparent),rgba(102,217,255,.12))!important;
    box-shadow:0 18px 38px color-mix(in srgb,var(--goal-cat-color,#8b98ff) 22%, transparent), inset 0 1px 0 rgba(255,255,255,.15)!important;
    font-size:12px!important;
}
.category-linked-goal-badge::before{
    content:'★'!important;
    width:24px!important;
    height:24px!important;
    background:color-mix(in srgb,var(--goal-cat-color,#8b98ff) 35%, rgba(255,255,255,.15))!important;
    color:#fff!important;
    box-shadow:0 8px 18px color-mix(in srgb,var(--goal-cat-color,#8b98ff) 28%, transparent);
}
.category-linked-goal-badge b{
    padding:2px 7px;
    border-radius:999px;
    background:rgba(255,255,255,.11);
    color:#fff!important;
    font-size:10.5px!important;
}
.task-goal-badge{
    opacity:.92;
    box-shadow:none!important;
}
.goal-card-actions{
    gap:7px!important;
}
.goal-card-actions .tiny-action{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    border-radius:12px!important;
}
.goal-related-tasks-btn.has-related-tasks,
.goal-related-categories-btn.has-related-categories{
    font-weight:1000;
    box-shadow:0 10px 24px rgba(102,217,255,.08);
}
.goal-related-task-item{
    align-items:flex-start!important;
}
.goal-related-task-text{
    min-width:0;
    flex:1 1 auto;
}
.goal-related-task-check span{
    user-select:none;
}
.goal-related-subtasks-toggle{
    text-align:right;
}
.goal-related-subtasks-panel.hidden{
    display:none!important;
}
@media(max-width:1100px){
    .refined-task-search-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
    .refined-task-search-grid > .task-search-mini-row,
    .refined-task-search-grid .task-search-picker[data-task-search-picker="goals"],
    .refined-task-search-grid .task-search-picker[data-task-search-picker="categories"],
    .refined-task-search-grid .task-search-picker[data-task-search-picker="priorities"],
    .refined-task-search-grid > .task-search-date-card,
    .refined-task-search-grid .task-search-picker[data-task-search-picker="people"]{grid-column:1 / -1!important;}
    .refined-task-search-grid > .task-search-mini-row{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@media(max-width:720px){
    .refined-task-search-grid{grid-template-columns:1fr!important;}
    .refined-task-search-grid > .task-search-mini-row{grid-template-columns:1fr!important;}
    .category-linked-goal-badge{width:100%;justify-content:flex-start;}
}

/* v57: final UI polish for goal-linked category badge and category manager list */
.category-heading-line{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    min-width:0;
}
.category-title-content{
    min-width:0;
}
.category-title-content > span{
    display:block;
    margin-top:2px;
}
.category-heading-line .category-linked-goal-badge{
    margin-top:0!important;
    min-height:24px!important;
    padding:3px 8px!important;
    gap:5px!important;
    border-width:1px!important;
    border-radius:999px!important;
    background:color-mix(in srgb, var(--goal-cat-color, #8b98ff) 14%, transparent)!important;
    box-shadow:none!important;
    font-size:10px!important;
    line-height:1.45!important;
    max-width:min(260px, 46vw)!important;
    color:var(--text)!important;
}
.category-heading-line .category-linked-goal-badge::before{
    content:'◎'!important;
    width:auto!important;
    height:auto!important;
    margin-left:5px!important;
    background:transparent!important;
    box-shadow:none!important;
    color:var(--goal-cat-color,#8b98ff)!important;
}
.category-heading-line .category-linked-goal-badge span{
    display:inline!important;
    margin:0!important;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
}
.category-heading-line .category-linked-goal-badge b{
    display:none!important;
}
.category-manager-title{
    align-items:flex-start!important;
}
.category-manager-title i{
    margin-top:5px;
}
.category-manager-title strong{
    line-height:1.55;
}
.category-heading-line .category-linked-goal-badge{
    width:max-content!important;
    flex:0 1 auto;
}
@media(max-width:720px){
    .category-heading-line .category-linked-goal-badge{width:max-content!important;max-width:100%!important;}
}


/* v58: slimmer inline goal badge, preserve category gradients, and align category modal rows */
.category-task-section.is-goal-linked-category{
    border-color:color-mix(in srgb, var(--cat-color, #66d9ff) 28%, var(--line))!important;
    background:
        radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--cat-color, #66d9ff) 18%, transparent), transparent 32%),
        rgba(255,255,255,.035)!important;
    box-shadow:0 18px 45px rgba(0,0,0,.12)!important;
}
.category-task-section.is-goal-linked-category .category-task-head{
    background:transparent!important;
}
.category-heading-line{
    display:flex;
    align-items:center;
    gap:7px;
    flex-wrap:wrap;
}
.category-heading-line .category-linked-goal-badge{
    direction:rtl;
    display:inline-flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    width:auto!important;
    min-width:0!important;
    max-width:min(220px, 44vw)!important;
    min-height:22px!important;
    margin:0!important;
    padding:2px 7px!important;
    gap:4px!important;
    border-width:1px!important;
    border-radius:999px!important;
    background:color-mix(in srgb, var(--goal-cat-color, #8b98ff) 12%, transparent)!important;
    box-shadow:none!important;
    color:var(--text)!important;
    font-size:10px!important;
    font-weight:1000!important;
    line-height:1.45!important;
    vertical-align:middle!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
}
.category-heading-line .category-linked-goal-badge::before{
    content:'◎'!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:auto!important;
    height:auto!important;
    margin:0!important;
    background:transparent!important;
    box-shadow:none!important;
    color:var(--goal-cat-color,#8b98ff)!important;
    font-size:10px!important;
    line-height:1!important;
    flex:0 0 auto!important;
}
.category-heading-line .category-linked-goal-badge span{
    display:inline-block!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    line-height:1.45!important;
}
.category-heading-line .category-linked-goal-badge b{display:none!important;}
.category-manager-item{
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr) auto!important;
    align-items:center!important;
}
.category-manager-title{
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
    min-width:0!important;
}
.category-manager-title i,
.goal-category-manager-item .category-manager-title i{
    margin-top:0!important;
    align-self:center!important;
}
.category-manager-title > div{min-width:0!important;}
.category-manager-title strong{line-height:1.55!important;}
.category-manager-title span{line-height:1.55!important;}
.category-manager-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:8px!important;
}
.goal-category-manager-item{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
}
.goal-category-manager-item .category-manager-title{
    display:flex!important;
    align-items:center!important;
    min-width:0!important;
}
@media(max-width:720px){
    .category-manager-item,
    .goal-category-manager-item{grid-template-columns:1fr!important;}
    .category-manager-actions{justify-content:stretch!important;flex-wrap:wrap!important;}
    .category-manager-actions .ghost-btn{flex:1 1 auto;}
    .category-heading-line .category-linked-goal-badge{max-width:100%!important;}
}

/* Diary page - v59 */
.diary-shell{
    display:flex;
    flex-direction:column;
    gap:20px;
}
.diary-hero{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:18px;
    align-items:center;
    padding:22px;
    border:1px solid rgba(102,217,255,.18);
    border-radius:28px;
    background:
        radial-gradient(circle at 12% 0%, rgba(102,217,255,.12), transparent 36%),
        linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
}
.diary-hero h2{margin:6px 0 8px;font-size:32px;}
.diary-hero p{margin:0;max-width:780px;line-height:1.9;}
.diary-stats{
    display:grid;
    grid-template-columns:repeat(3, minmax(94px,1fr));
    gap:10px;
    min-width:320px;
}
.diary-stats span{
    display:flex;
    flex-direction:column;
    gap:4px;
    align-items:center;
    justify-content:center;
    min-height:76px;
    padding:12px;
    border-radius:20px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.045);
    color:var(--muted);
    text-align:center;
}
.diary-stats strong{font-size:22px;color:var(--text);}
.diary-toolbar{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    flex-wrap:wrap;
}
.diary-year-pill{
    min-width:130px;
    text-align:center;
    padding:12px 18px;
    border-radius:18px;
    border:1px solid rgba(102,217,255,.22);
    background:rgba(102,217,255,.08);
    font-weight:900;
    color:#dff8ff;
}
.diary-loading{
    padding:14px 16px;
    border-radius:18px;
    border:1px dashed rgba(102,217,255,.3);
    background:rgba(102,217,255,.08);
    color:#dff8ff;
    text-align:center;
}
.diary-book-stage{
    position:relative;
    display:grid;
    grid-template-columns:auto minmax(0, 940px) auto;
    gap:16px;
    justify-content:center;
    align-items:center;
    perspective:1800px;
    padding:10px 0;
}
.diary-turn-btn{
    width:54px;
    height:74px;
    border:none;
    border-radius:22px;
    display:grid;
    place-items:center;
    cursor:pointer;
    font-size:48px;
    color:#07121d;
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    box-shadow:0 16px 35px rgba(0,0,0,.2);
    transition:.2s ease;
}
.diary-turn-btn:hover:not(:disabled){transform:translateY(-2px) scale(1.02);filter:brightness(1.04);}
.diary-turn-btn:disabled{opacity:.35;cursor:not-allowed;filter:grayscale(.7);}
.diary-book{
    position:relative;
    min-height:650px;
    padding:22px 26px 22px 34px;
    border-radius:34px;
    transform-style:preserve-3d;
    background:
        linear-gradient(90deg, rgba(11,18,32,.55), transparent 8%, transparent 92%, rgba(11,18,32,.35)),
        linear-gradient(135deg, rgba(93,64,55,.38), rgba(174,119,62,.2));
    border:1px solid rgba(255,255,255,.14);
    box-shadow:0 30px 90px rgba(0,0,0,.38), inset 0 0 0 1px rgba(255,255,255,.04);
}
.diary-book.turning-next .diary-paper{animation:diaryFlipNext .46s cubic-bezier(.2,.85,.2,1);}
.diary-book.turning-prev .diary-paper{animation:diaryFlipPrev .46s cubic-bezier(.2,.85,.2,1);}
.diary-book-spine{
    position:absolute;
    top:22px;
    bottom:22px;
    right:18px;
    width:32px;
    border-radius:20px;
    background:
        repeating-linear-gradient(180deg, rgba(255,255,255,.18) 0 12px, rgba(0,0,0,.15) 12px 22px),
        linear-gradient(180deg, rgba(102,217,255,.18), rgba(139,152,255,.16));
    box-shadow:inset 8px 0 20px rgba(0,0,0,.22);
    opacity:.85;
}
.diary-paper{
    position:relative;
    z-index:2;
    min-height:606px;
    margin-right:28px;
    padding:30px 34px 26px;
    border-radius:26px 18px 18px 26px;
    color:#243244;
    background:
        linear-gradient(90deg, rgba(255,255,255,.9) 0 94%, rgba(220,190,140,.32) 100%),
        repeating-linear-gradient(180deg, rgba(255,255,255,0) 0 31px, rgba(72,96,128,.18) 32px, rgba(255,255,255,0) 33px),
        #fff9eb;
    box-shadow:inset 0 0 0 1px rgba(115,77,38,.12), 0 24px 60px rgba(0,0,0,.22);
    transform-origin:right center;
    overflow:hidden;
}
.diary-paper::before{
    content:"";
    position:absolute;
    inset:0 auto 0 28px;
    width:2px;
    background:rgba(244,63,94,.25);
}
.diary-paper::after{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    background:radial-gradient(circle at 12% 10%, rgba(139,92,246,.08), transparent 20%), linear-gradient(180deg, rgba(255,255,255,.5), transparent 35%);
    mix-blend-mode:multiply;
}
.diary-paper-head,
.diary-written-preview,
.diary-entry-form{position:relative;z-index:2;}
.diary-paper-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    padding-bottom:16px;
    border-bottom:1px dashed rgba(36,50,68,.25);
}
.diary-date-large{font-size:30px;font-weight:900;color:#1f2937;}
.diary-paper-head .muted{color:#64748b;}
.diary-date-stamp{
    direction:ltr;
    font-weight:900;
    padding:8px 12px;
    border-radius:999px;
    color:#2563eb;
    background:rgba(37,99,235,.09);
    border:1px solid rgba(37,99,235,.14);
}
.diary-written-preview{
    min-height:128px;
    margin-top:18px;
    padding:16px 18px;
    border-radius:20px;
    background:rgba(255,255,255,.44);
    border:1px solid rgba(36,50,68,.12);
}
.diary-preview-title{font-weight:900;margin-bottom:8px;color:#475569;}
.diary-written-preview p{margin:0;line-height:2.05;white-space:normal;color:#243244;}
.diary-written-preview .muted{color:#718096;}
.diary-entry-form{margin-top:16px;display:flex;flex-direction:column;gap:12px;}
.diary-text-field span{color:#334155;font-weight:900;}
.diary-text-field textarea{
    min-height:210px;
    border-radius:22px;
    border:1px solid rgba(36,50,68,.16);
    background:rgba(255,255,255,.58);
    color:#1f2937;
    line-height:2;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
}
.diary-text-field textarea:focus{
    border-color:rgba(37,99,235,.34);
    box-shadow:0 0 0 4px rgba(37,99,235,.1);
}
.diary-form-actions{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
}
.diary-form-actions .muted{color:#64748b;}
.diary-form-buttons{display:flex;gap:10px;flex-wrap:wrap;}
.diary-entry-form .ghost-btn{background:rgba(15,23,42,.04);border-color:rgba(15,23,42,.12);color:#334155;}
.diary-month-strip,
.diary-year-strip{
    border:1px solid var(--line);
    background:rgba(255,255,255,.035);
    border-radius:24px;
}
.diary-month-strip{padding:16px;display:flex;flex-direction:column;gap:12px;}
.diary-strip-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.diary-day-dots{display:flex;gap:8px;flex-wrap:wrap;}
.diary-day-dot{
    width:38px;
    height:38px;
    border-radius:14px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
    color:var(--text);
    cursor:pointer;
    font:inherit;
    transition:.2s ease;
}
.diary-day-dot.has-entry{border-color:rgba(34,197,94,.42);background:rgba(34,197,94,.12);}
.diary-day-dot.active{background:linear-gradient(135deg,var(--primary),var(--primary-2));color:#07121d;font-weight:900;}
.diary-year-strip{
    display:grid;
    grid-template-columns:repeat(73, minmax(4px,1fr));
    gap:4px;
    padding:14px;
    overflow:hidden;
}
.diary-year-tick{
    height:9px;
    border:none;
    border-radius:999px;
    background:rgba(255,255,255,.14);
    cursor:pointer;
    padding:0;
    transition:.2s ease;
}
.diary-year-tick.has-entry{background:rgba(34,197,94,.72);}
.diary-year-tick.active{background:linear-gradient(135deg,var(--primary),var(--primary-2));box-shadow:0 0 0 2px rgba(102,217,255,.18);transform:scaleY(1.5);}
html[data-theme="light"] .diary-hero,
body[data-theme="light"] .diary-hero{
    background:linear-gradient(135deg, rgba(14,165,233,.08), rgba(99,102,241,.06));
}
html[data-theme="light"] .diary-year-pill,
body[data-theme="light"] .diary-year-pill{color:#075985;background:rgba(14,165,233,.08);}
html[data-theme="light"] .diary-book,
body[data-theme="light"] .diary-book{box-shadow:0 26px 74px rgba(30,64,105,.16);}
html[data-theme="light"] .diary-year-tick,
body[data-theme="light"] .diary-year-tick{background:rgba(15,23,42,.14);}
html[data-theme="light"] .diary-year-tick.has-entry,
body[data-theme="light"] .diary-year-tick.has-entry{background:rgba(34,197,94,.72);}
@keyframes diaryFlipNext{
    0%{transform:rotateY(0deg) translateZ(0);filter:brightness(1);}
    45%{transform:rotateY(-18deg) translateZ(16px);filter:brightness(.92);}
    100%{transform:rotateY(0deg) translateZ(0);filter:brightness(1);}
}
@keyframes diaryFlipPrev{
    0%{transform:rotateY(0deg) translateZ(0);filter:brightness(1);}
    45%{transform:rotateY(16deg) translateZ(16px);filter:brightness(.94);}
    100%{transform:rotateY(0deg) translateZ(0);filter:brightness(1);}
}
@media (max-width: 980px){
    .diary-hero{grid-template-columns:1fr;}
    .diary-stats{min-width:0;grid-template-columns:repeat(3,1fr);}
    .diary-book-stage{grid-template-columns:1fr;}
    .diary-turn-btn{position:static;width:100%;height:48px;font-size:32px;}
    .diary-book{padding:16px;min-height:auto;}
    .diary-book-spine{display:none;}
    .diary-paper{margin-right:0;padding:24px 20px;}
    .diary-year-strip{grid-template-columns:repeat(37, minmax(4px,1fr));}
}
@media (max-width: 640px){
    .diary-hero h2{font-size:25px;}
    .diary-stats{grid-template-columns:1fr;}
    .diary-paper-head{flex-direction:column;}
    .diary-date-large{font-size:24px;}
    .diary-form-actions{align-items:stretch;}
    .diary-form-buttons{width:100%;}
    .diary-form-buttons .ghost-btn,
    .diary-form-buttons .primary-btn{flex:1 1 100%;}
    .diary-day-dot{width:34px;height:34px;}
    .diary-year-strip{grid-template-columns:repeat(25, minmax(4px,1fr));}
}

/* v60.0.0: smart shift swap assistant, structured personnel roles/gender, shift colleagues */
.shift-smart-panels{display:grid;grid-template-columns:1fr;gap:16px;margin-top:18px;}
.shift-smart-panels .shift-today-panel{margin-top:0;}
.shift-colleagues-panel,.shift-swap-assistant-card{border:1px solid var(--line);border-radius:28px;background:radial-gradient(circle at 12% 12%,rgba(139,152,255,.13),transparent 30%),rgba(255,255,255,.045);padding:16px;box-shadow:0 18px 50px rgba(0,0,0,.12);}
.shift-colleague-list{display:flex;flex-wrap:wrap;gap:10px;align-items:stretch;}
.shift-colleague-chip{min-width:190px;display:grid;gap:4px;border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:11px 12px;background:linear-gradient(145deg,rgba(255,255,255,.075),rgba(255,255,255,.025));}
.shift-colleague-chip b{color:var(--text);font-size:14px;}
.shift-colleague-chip span{color:var(--text);font-size:12px;}
.shift-colleague-chip small{color:var(--muted);font-size:11px;}
.swap-assistant-hero{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:14px;}
.swap-assistant-hero h3{margin:5px 0;font-size:21px;color:var(--text);}
.swap-assistant-icon{width:58px;height:58px;border-radius:22px;display:grid;place-items:center;background:linear-gradient(135deg,var(--accent),#8b98ff);color:#06111f;font-size:28px;font-weight:1000;box-shadow:0 18px 45px rgba(102,217,255,.16);}
.shift-swap-form{display:grid;gap:12px;}
.swap-question-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
.swap-question-grid label,.swap-scope-box>label{display:grid;gap:6px;color:var(--muted);font-size:12px;font-weight:800;}
.swap-question-grid select,.swap-question-grid input,.swap-scope-box select{border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.07);color:var(--text);padding:11px 12px;outline:none;min-width:0;}
.swap-role-box{display:flex;flex-wrap:wrap;gap:8px;align-items:center;border:1px solid rgba(255,255,255,.07);border-radius:20px;padding:10px;background:rgba(255,255,255,.035);}
.swap-role-box>span{font-weight:1000;color:var(--text);margin-inline-end:4px;}
.swap-role-box label,.swap-person-check{display:flex;align-items:center;gap:7px;border:1px solid rgba(255,255,255,.08);border-radius:999px;padding:7px 10px;background:rgba(255,255,255,.04);color:var(--text);font-size:12px;cursor:pointer;}
.swap-scope-box{display:grid;grid-template-columns:minmax(190px,.35fr) 1fr;gap:10px;align-items:start;}
.swap-person-checks{display:flex;flex-wrap:wrap;gap:8px;max-height:160px;overflow:auto;padding:4px;border:1px solid rgba(255,255,255,.07);border-radius:20px;background:rgba(255,255,255,.028);}
.swap-person-check{border-radius:16px;min-width:210px;justify-content:flex-start;}
.swap-person-check span{display:grid;gap:2px;}
.swap-person-check strong{font-size:12px;}
.swap-person-check small{font-size:10px;color:var(--muted);}
.swap-two-way-details{border:1px solid rgba(102,217,255,.13);border-radius:22px;background:rgba(102,217,255,.035);padding:10px;}
.swap-two-way-details summary{cursor:pointer;font-weight:1000;color:var(--text);margin-bottom:10px;}
.compact-weekdays label{font-size:11px;padding:6px 9px;}
.swap-actions{justify-content:flex-start!important;}
.shift-swap-result{margin-top:12px;display:grid;gap:12px;}
.swap-result-head{border:1px solid rgba(102,217,255,.18);border-radius:20px;padding:12px;background:rgba(102,217,255,.06);}
.swap-result-head strong{display:block;color:var(--text);}
.swap-result-head span{display:block;color:var(--muted);font-size:12px;margin-top:4px;}
.swap-result-columns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.swap-result-columns section{border:1px solid rgba(255,255,255,.075);border-radius:22px;background:rgba(255,255,255,.032);padding:10px;display:grid;gap:8px;align-content:start;}
.swap-result-columns h4{margin:0;color:var(--text);font-size:14px;}
.swap-result-person{display:grid;grid-template-columns:42px 1fr;gap:10px;align-items:start;border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:10px;background:rgba(255,255,255,.04);}
.swap-person-score{width:38px;height:38px;border-radius:15px;display:grid;place-items:center;font-weight:1000;background:rgba(255,255,255,.08);color:var(--text);}
.swap-result-person.recommended{border-color:rgba(34,197,94,.28);background:rgba(34,197,94,.07);}
.swap-result-person.recommended .swap-person-score{background:rgba(34,197,94,.18);color:#86efac;}
.swap-result-person.caution{border-color:rgba(251,191,36,.28);background:rgba(251,191,36,.06);}
.swap-result-person.caution .swap-person-score{background:rgba(251,191,36,.17);color:#fde68a;}
.swap-result-person.blocked{border-color:rgba(248,113,113,.2);background:rgba(248,113,113,.045);}
.swap-result-person.blocked .swap-person-score{background:rgba(248,113,113,.13);color:#fecaca;}
.swap-result-person strong{display:block;color:var(--text);}
.swap-result-person p{margin:3px 0;color:var(--muted);font-size:12px;}
.swap-result-person small{display:block;color:var(--muted);font-size:11px;line-height:1.8;}
.swap-return-options{display:flex;flex-wrap:wrap;gap:6px;margin:7px 0;}
.swap-return-options strong{flex:1 1 100%;font-size:11px;color:var(--accent);}
.swap-return-options span{border:1px solid rgba(102,217,255,.18);border-radius:999px;padding:5px 8px;background:rgba(102,217,255,.06);font-size:11px;color:var(--text);}
.personnel-grid-head,.medical-personnel-row{grid-template-columns:38px minmax(130px,1.2fr) minmax(95px,.95fr) minmax(105px,.8fr) minmax(88px,.7fr) minmax(90px,.75fr) minmax(90px,.75fr) 38px!important;}
.medical-personnel-row select{min-width:0;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.07);color:var(--text);padding:10px 9px;outline:none;}
.medical-person-card{grid-template-columns:32px minmax(130px,1.2fr) minmax(110px,.8fr) minmax(130px,.9fr) auto!important;}
.shift-type-form-pro{grid-template-columns:repeat(3,minmax(0,1fr));}
.shift-edit-form-pro{grid-template-columns:repeat(3,minmax(0,1fr));}
.shift-type-form-pro .primary-btn,.shift-edit-form-pro .form-actions{grid-column:1/-1;}
@media(max-width:1100px){.swap-question-grid,.swap-result-columns{grid-template-columns:1fr 1fr}.swap-scope-box{grid-template-columns:1fr}.shift-type-form-pro,.shift-edit-form-pro{grid-template-columns:1fr 1fr}.personnel-grid-head{display:none!important}.medical-personnel-row{grid-template-columns:34px 1fr 1fr!important}.medical-personnel-row .icon-btn{grid-column:3}}
@media(max-width:720px){.swap-question-grid,.swap-result-columns,.shift-type-form-pro,.shift-edit-form-pro{grid-template-columns:1fr}.swap-assistant-hero{align-items:flex-start}.swap-assistant-icon{width:46px;height:46px;border-radius:17px;font-size:22px}.swap-person-check{min-width:100%}.shift-colleague-chip{min-width:100%}}

/* v61.0.0: polished shift-swap assistant UX with compact popups */
.shift-swap-assistant-card.is-modern{position:relative;overflow:hidden;background:linear-gradient(145deg,rgba(255,255,255,.055),rgba(255,255,255,.025)),radial-gradient(circle at 12% 0%,rgba(102,217,255,.14),transparent 34%),radial-gradient(circle at 88% 12%,rgba(139,152,255,.16),transparent 36%);border-color:rgba(255,255,255,.095);box-shadow:0 24px 70px rgba(0,0,0,.18)}
.shift-swap-assistant-card.is-modern:before{content:"";position:absolute;inset:0 0 auto 0;height:1px;background:linear-gradient(90deg,transparent,rgba(102,217,255,.4),transparent);pointer-events:none}.modern-swap-form{gap:14px}.swap-modern-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.swap-modern-grid.top-grid{grid-template-columns:minmax(260px,1.35fr) minmax(190px,.85fr) minmax(175px,.8fr) minmax(150px,.7fr)}.swap-modern-grid.two-way-grid{grid-template-columns:minmax(190px,.75fr) minmax(250px,1fr) minmax(250px,1fr)}.swap-field-card{display:grid;gap:8px;border:1px solid rgba(255,255,255,.085);border-radius:22px;padding:12px;background:rgba(8,16,30,.22);box-shadow:inset 0 1px 0 rgba(255,255,255,.035)}.swap-field-card.full-card{grid-column:1/-1}.swap-field-label{font-weight:1000;color:var(--text);font-size:12px;letter-spacing:-.01em}.swap-field-card small,.swap-scope-header small{display:block;color:var(--muted);font-size:11px;line-height:1.7}.swap-field-card select,.swap-field-card input[type="text"],.swap-field-card input[type="number"]{border:1px solid rgba(255,255,255,.095);border-radius:16px;background:rgba(255,255,255,.065);color:var(--text);padding:11px 12px;outline:none;min-width:0;transition:.18s ease}.swap-field-card select:focus,.swap-field-card input:focus{border-color:rgba(102,217,255,.42);box-shadow:0 0 0 4px rgba(102,217,255,.08)}.swap-picker-button{width:100%;border:1px solid rgba(102,217,255,.20);border-radius:18px;background:linear-gradient(145deg,rgba(102,217,255,.11),rgba(139,152,255,.08));color:var(--text);padding:12px;text-align:right;display:grid;gap:4px;cursor:pointer;transition:.18s ease}.swap-picker-button:hover{transform:translateY(-1px);border-color:rgba(102,217,255,.38);box-shadow:0 16px 34px rgba(102,217,255,.08)}.swap-picker-button b{font-size:13px;color:var(--text)}.swap-picker-button small{color:var(--muted)}.swap-segmented{display:flex;gap:7px;flex-wrap:wrap}.swap-segmented label,.modern-role-box label,.swap-chip-check{position:relative;display:inline-flex;align-items:center;gap:7px;border:1px solid rgba(255,255,255,.09);border-radius:999px;background:rgba(255,255,255,.045);color:var(--muted);padding:8px 11px;cursor:pointer;font-weight:900;font-size:12px;transition:.18s ease}.swap-segmented input,.modern-role-box input,.swap-chip-check input,.swap-compensation-cards input{position:absolute;opacity:0;pointer-events:none}.swap-segmented label.is-selected,.modern-role-box label.is-selected,.swap-chip-check.is-selected{border-color:rgba(102,217,255,.36);background:linear-gradient(135deg,rgba(102,217,255,.16),rgba(139,152,255,.12));color:var(--text);box-shadow:0 10px 24px rgba(102,217,255,.07)}.modern-role-box{border:0;padding:0;background:transparent;gap:8px}.modern-role-box label:before,.swap-chip-check:before,.swap-segmented label:before{content:"";width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.24);box-shadow:0 0 0 3px rgba(255,255,255,.035)}.modern-role-box label.is-selected:before,.swap-chip-check.is-selected:before,.swap-segmented label.is-selected:before{background:var(--accent);box-shadow:0 0 0 4px rgba(102,217,255,.13)}.swap-scope-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.swap-scope-summary{border:1px dashed rgba(102,217,255,.18);border-radius:16px;background:rgba(102,217,255,.045);color:var(--muted);padding:9px 11px;font-size:12px}.modern-two-way{border:1px solid rgba(102,217,255,.18);border-radius:26px;padding:14px;background:linear-gradient(145deg,rgba(102,217,255,.075),rgba(139,152,255,.035));display:grid;gap:12px}.modern-two-way[hidden],.swap-mini-modal[hidden]{display:none!important}.swap-help-strip{border:1px solid rgba(251,191,36,.20);border-radius:17px;background:rgba(251,191,36,.055);color:var(--muted);padding:10px 12px;font-size:12px;line-height:1.8}.swap-compensation-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.swap-compensation-cards label{position:relative;border:1px solid rgba(255,255,255,.085);border-radius:20px;padding:12px;background:rgba(255,255,255,.04);cursor:pointer;transition:.18s ease}.swap-compensation-cards label.is-selected{border-color:rgba(102,217,255,.34);background:linear-gradient(145deg,rgba(102,217,255,.13),rgba(139,152,255,.08));box-shadow:0 12px 30px rgba(102,217,255,.08)}.swap-compensation-cards b{display:block;color:var(--text);font-size:13px}.swap-compensation-cards small{display:block;color:var(--muted);font-size:11px;line-height:1.8;margin-top:4px}.swap-choice-section{display:grid;gap:8px;border:1px solid rgba(255,255,255,.075);border-radius:20px;padding:12px;background:rgba(255,255,255,.032);transition:.18s ease}.swap-choice-section>span{font-size:12px;font-weight:1000;color:var(--text)}.swap-chip-grid{display:flex;gap:8px;flex-wrap:wrap}.swap-chip-check{padding:8px 10px;background:rgba(255,255,255,.04)}.is-muted{opacity:.45}.swap-date-input.is-muted input{pointer-events:none}.swap-actions{gap:8px}.swap-mini-modal{position:fixed;inset:0;z-index:9500;display:grid;place-items:center;padding:18px}.swap-mini-modal-backdrop{position:absolute;inset:0;background:rgba(3,8,18,.58);backdrop-filter:blur(10px)}.swap-mini-panel{position:relative;width:min(760px,96vw);max-height:min(82vh,760px);overflow:auto;border:1px solid rgba(255,255,255,.13);border-radius:28px;background:linear-gradient(145deg,rgba(25,34,58,.97),rgba(12,18,34,.98));box-shadow:0 28px 90px rgba(0,0,0,.45);padding:14px}.swap-mini-panel.target-panel{width:min(720px,96vw)}.swap-mini-panel.personnel-panel{width:min(840px,96vw)}.swap-mini-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.swap-mini-head strong{display:block;color:var(--text);font-size:16px}.swap-mini-head small{display:block;color:var(--muted);font-size:12px;line-height:1.8;margin-top:3px}.swap-mini-weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin-bottom:7px}.swap-mini-weekdays span{border:1px solid rgba(255,255,255,.07);border-radius:12px;background:rgba(255,255,255,.035);color:var(--muted);font-size:11px;text-align:center;padding:6px}.swap-mini-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px}.swap-mini-day{min-height:86px;border:1px solid rgba(255,255,255,.075);border-radius:16px;padding:7px;background:rgba(255,255,255,.035);display:grid;align-content:start;gap:6px}.swap-mini-day.empty{opacity:.25}.swap-mini-day>strong{width:24px;height:24px;border-radius:9px;background:rgba(255,255,255,.055);display:grid;place-items:center;color:var(--text);font-size:12px}.swap-mini-day>div{display:grid;gap:5px}.swap-mini-day small{color:rgba(255,255,255,.22);font-size:12px}.swap-mini-shift{border:1px solid rgba(102,217,255,.16);border-radius:12px;background:rgba(102,217,255,.065);color:var(--text);padding:6px 7px;display:flex;align-items:center;gap:6px;text-align:right;cursor:pointer;transition:.18s ease;min-width:0}.swap-mini-shift:hover,.swap-mini-shift.selected{border-color:rgba(102,217,255,.44);background:linear-gradient(135deg,rgba(102,217,255,.18),rgba(139,152,255,.12));transform:translateY(-1px)}.swap-mini-shift b{min-width:24px;height:24px;border-radius:9px;display:grid;place-items:center;background:rgba(255,255,255,.10);font-size:11px}.swap-mini-shift span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px}.swap-person-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}.swap-person-toolbar span{margin-inline-start:auto;color:var(--muted);font-size:12px}.modern-person-checks{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;max-height:56vh!important;overflow:auto!important;padding:6px!important;border:1px solid rgba(255,255,255,.08)!important;border-radius:20px!important;background:rgba(255,255,255,.025)!important}.modern-person-checks .swap-person-check{min-width:0!important;border-radius:18px;padding:10px;background:rgba(255,255,255,.045)}.modern-person-checks .swap-person-check.is-selected{border-color:rgba(102,217,255,.33);background:rgba(102,217,255,.10)}.modern-person-checks .swap-person-check span{min-width:0}.modern-person-checks .swap-person-check strong{font-size:13px;color:var(--text)}.modern-person-checks .swap-person-check small{font-size:11px;line-height:1.7}.shift-swap-result{position:relative}.shift-swap-result .polished-empty{border-radius:22px;background:rgba(255,255,255,.035)}
@media(max-width:1180px){.swap-modern-grid.top-grid,.swap-modern-grid.two-way-grid{grid-template-columns:1fr 1fr}.swap-compensation-cards{grid-template-columns:1fr}.swap-target-field{grid-column:1/-1}}
@media(max-width:720px){.swap-modern-grid.top-grid,.swap-modern-grid.two-way-grid{grid-template-columns:1fr}.swap-scope-header{align-items:stretch;flex-direction:column}.swap-mini-calendar{grid-template-columns:repeat(7,minmax(42px,1fr));overflow:auto}.swap-mini-day{min-height:74px;padding:5px}.swap-mini-panel{border-radius:22px;padding:12px}.swap-mini-modal{padding:10px}.swap-compensation-cards{grid-template-columns:1fr}.swap-segmented{display:grid;grid-template-columns:1fr}.swap-chip-grid{gap:6px}.swap-chip-check{flex:1 1 calc(50% - 6px);justify-content:center}.swap-assistant-hero{align-items:flex-start}.swap-assistant-icon{width:48px;height:48px;border-radius:18px;font-size:22px}}

/* v62.0.0: align shift-swap popups with site modals and improve assistant contrast */
.shift-swap-assistant-card.is-modern{
    background:
        radial-gradient(circle at 10% 0%,rgba(102,217,255,.16),transparent 32%),
        radial-gradient(circle at 92% 8%,rgba(139,152,255,.15),transparent 34%),
        linear-gradient(145deg,rgba(13,25,45,.94),rgba(15,24,43,.88))!important;
    border-color:rgba(102,217,255,.16)!important;
}
.swap-field-card,
.swap-choice-section,
.swap-compensation-cards label{
    background:linear-gradient(145deg,rgba(102,217,255,.08),rgba(139,152,255,.055))!important;
    border-color:rgba(102,217,255,.16)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.055),0 12px 28px rgba(0,0,0,.08)!important;
}
.swap-field-card:hover,
.swap-choice-section:hover,
.swap-compensation-cards label:hover{
    border-color:rgba(102,217,255,.24)!important;
    background:linear-gradient(145deg,rgba(102,217,255,.105),rgba(139,152,255,.07))!important;
}
.swap-field-label,
.swap-compensation-cards b,
.swap-choice-section>span{
    color:var(--text)!important;
}
.swap-field-card small,
.swap-scope-header small,
.swap-compensation-cards small{
    color:color-mix(in srgb,var(--muted) 82%,var(--text) 18%)!important;
}
.swap-field-card select,
.swap-field-card input[type="text"],
.swap-field-card input[type="number"]{
    background:linear-gradient(145deg,rgba(255,255,255,.10),rgba(102,217,255,.045))!important;
    border-color:rgba(102,217,255,.18)!important;
    color:var(--text)!important;
}
.swap-field-card select option{
    background:#101a2e;
    color:#f4f8ff;
}
.swap-segmented label,
.modern-role-box label,
.swap-chip-check{
    background:rgba(102,217,255,.07)!important;
    border-color:rgba(102,217,255,.16)!important;
    color:color-mix(in srgb,var(--text) 82%,var(--muted) 18%)!important;
}
.swap-segmented label.is-selected,
.modern-role-box label.is-selected,
.swap-chip-check.is-selected,
.swap-compensation-cards label.is-selected{
    border-color:rgba(102,217,255,.46)!important;
    background:linear-gradient(135deg,rgba(102,217,255,.22),rgba(139,152,255,.14))!important;
    color:var(--text)!important;
    box-shadow:0 14px 32px rgba(102,217,255,.10)!important;
}
.swap-scope-summary,
.swap-help-strip{
    background:linear-gradient(135deg,rgba(102,217,255,.085),rgba(139,152,255,.055))!important;
    border-color:rgba(102,217,255,.18)!important;
    color:color-mix(in srgb,var(--muted) 72%,var(--text) 28%)!important;
}
.modern-two-way{
    background:linear-gradient(145deg,rgba(102,217,255,.08),rgba(139,152,255,.05))!important;
    border-color:rgba(102,217,255,.20)!important;
}
.modal.swap-mini-modal.hidden{display:none!important;}
.modal.swap-mini-modal:not(.hidden){
    position:fixed!important;
    inset:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:16px!important;
    overflow:hidden!important;
    z-index:2147483000!important;
}
.modal.swap-mini-modal .modal-backdrop{
    position:fixed!important;
    inset:0!important;
    background:rgba(3,8,15,.72)!important;
    backdrop-filter:blur(8px) saturate(135%)!important;
    -webkit-backdrop-filter:blur(8px) saturate(135%)!important;
}
.modal.swap-mini-modal .modal-card.swap-mini-panel{
    position:relative!important;
    z-index:2!important;
    width:min(760px,96vw)!important;
    max-height:calc(100dvh - 32px)!important;
    margin:0!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    border-radius:28px!important;
    border:1px solid rgba(102,217,255,.18)!important;
    background:
        radial-gradient(circle at 8% 4%,rgba(102,217,255,.14),transparent 30%),
        radial-gradient(circle at 92% 0%,rgba(139,152,255,.12),transparent 28%),
        linear-gradient(145deg,rgba(15,23,42,.98),rgba(21,31,48,.96))!important;
    box-shadow:0 34px 100px rgba(0,0,0,.42)!important;
    padding:16px!important;
}
.modal.swap-mini-modal .modal-card.target-panel{width:min(720px,96vw)!important;}
.modal.swap-mini-modal .modal-card.personnel-panel{width:min(840px,96vw)!important;}
.swap-mini-head{
    padding:12px!important;
    border:1px solid rgba(102,217,255,.14)!important;
    border-radius:22px!important;
    background:linear-gradient(135deg,rgba(102,217,255,.09),rgba(139,152,255,.055))!important;
}
.swap-mini-head strong{color:var(--text)!important;}
.swap-mini-head small{color:color-mix(in srgb,var(--muted) 78%,var(--text) 22%)!important;}
.swap-mini-calendar,
.modern-person-checks{
    background:rgba(102,217,255,.035)!important;
    border-color:rgba(102,217,255,.12)!important;
}
.swap-mini-day,
.modern-person-checks .swap-person-check{
    background:linear-gradient(145deg,rgba(102,217,255,.065),rgba(139,152,255,.04))!important;
    border-color:rgba(102,217,255,.13)!important;
}
.swap-mini-weekdays span,
.swap-mini-day>strong{
    background:rgba(102,217,255,.09)!important;
    border-color:rgba(102,217,255,.16)!important;
    color:var(--text)!important;
}
html[data-theme="light"] .shift-swap-assistant-card.is-modern,
body[data-theme="light"] .shift-swap-assistant-card.is-modern{
    background:
        radial-gradient(circle at 10% 0%,rgba(14,165,233,.13),transparent 33%),
        radial-gradient(circle at 92% 8%,rgba(99,102,241,.10),transparent 34%),
        linear-gradient(145deg,#ffffff,#f7fbff)!important;
}
html[data-theme="light"] .swap-field-card,
body[data-theme="light"] .swap-field-card,
html[data-theme="light"] .swap-choice-section,
body[data-theme="light"] .swap-choice-section,
html[data-theme="light"] .swap-compensation-cards label,
body[data-theme="light"] .swap-compensation-cards label{
    background:linear-gradient(145deg,rgba(14,165,233,.07),rgba(99,102,241,.045))!important;
    border-color:rgba(14,165,233,.16)!important;
    box-shadow:0 12px 28px rgba(15,23,42,.06)!important;
}
html[data-theme="light"] .swap-field-card select,
body[data-theme="light"] .swap-field-card select,
html[data-theme="light"] .swap-field-card input[type="text"],
body[data-theme="light"] .swap-field-card input[type="text"],
html[data-theme="light"] .swap-field-card input[type="number"],
body[data-theme="light"] .swap-field-card input[type="number"]{
    background:#fff!important;
    color:var(--text)!important;
}
html[data-theme="light"] .swap-field-card select option,
body[data-theme="light"] .swap-field-card select option{
    background:#fff;
    color:#102033;
}
html[data-theme="light"] .modal.swap-mini-modal .modal-card.swap-mini-panel,
body[data-theme="light"] .modal.swap-mini-modal .modal-card.swap-mini-panel{
    background:
        radial-gradient(circle at 8% 4%,rgba(14,165,233,.12),transparent 30%),
        radial-gradient(circle at 92% 0%,rgba(99,102,241,.09),transparent 28%),
        linear-gradient(145deg,#ffffff,#f8fbff)!important;
    box-shadow:0 34px 85px rgba(15,23,42,.20)!important;
}
@media(max-width:720px){
    .modal.swap-mini-modal:not(.hidden){padding:10px!important;}
    .modal.swap-mini-modal .modal-card.swap-mini-panel{border-radius:22px!important;padding:12px!important;}
}

/* v63.0.0: rebuild shift-swap assistant popups on the same modal shell used across the site */
.modal:not(.hidden) > .modal-card.shift-swap-target-modal-card,
.modal:not(.hidden) > .modal-card.shift-swap-scope-modal-card,
.modal-card.shift-swap-target-modal-card,
.modal-card.shift-swap-scope-modal-card{
    width:min(760px,calc(100vw - 24px))!important;
}
.modal:not(.hidden) > .modal-card.shift-swap-scope-modal-card,
.modal-card.shift-swap-scope-modal-card{
    width:min(840px,calc(100vw - 24px))!important;
}
.shift-swap-target-modal-card .swap-mini-weekdays,
.shift-swap-scope-modal-card .swap-person-toolbar{
    margin-top:4px;
}
.shift-swap-target-modal-card .swap-mini-calendar,
.shift-swap-scope-modal-card .modern-person-checks{
    margin-top:10px;
}
.shift-swap-target-modal-card .form-actions,
.shift-swap-scope-modal-card .form-actions{
    margin-top:14px;
}
.shift-swap-target-modal-card .swap-mini-weekdays span{
    background:var(--chip)!important;
    border-color:var(--line)!important;
    color:var(--muted)!important;
}
.shift-swap-target-modal-card .swap-mini-day,
.shift-swap-scope-modal-card .modern-person-checks .swap-person-check{
    background:var(--glass)!important;
    border-color:var(--line)!important;
}
.shift-swap-target-modal-card .swap-mini-day>strong{
    background:var(--chip)!important;
    border-color:var(--line)!important;
    color:var(--text)!important;
}
.shift-swap-scope-modal-card .modern-person-checks{
    background:var(--glass)!important;
    border-color:var(--line)!important;
}
@media(max-width:720px){
    .modal:not(.hidden) > .modal-card.shift-swap-target-modal-card,
    .modal:not(.hidden) > .modal-card.shift-swap-scope-modal-card,
    .modal-card.shift-swap-target-modal-card,
    .modal-card.shift-swap-scope-modal-card{
        width:min(100%,calc(100vw - 20px))!important;
    }
}


/* v64.0.0: shift-swap popups now use the exact same modal shell as the Add Task modal */
#shiftSwapTargetModal > .modal-backdrop,
#shiftSwapScopeModal > .modal-backdrop{
    background:rgba(3,8,15,.7);
    backdrop-filter:blur(6px);
}
#shiftSwapTargetModal > .modal-card,
#shiftSwapScopeModal > .modal-card{
    width:min(640px,calc(100% - 24px));
    margin:40px auto;
    border-radius:28px;
    border:1px solid var(--line);
    background:var(--panel-strong);
    box-shadow:var(--shadow);
    padding:22px;
}
#shiftSwapTargetModal .swap-mini-calendar{
    max-height:52vh;
    overflow:auto;
    padding-inline-end:2px;
}
#shiftSwapScopeModal .modern-person-checks{
    max-height:52vh!important;
}
@media(max-width:720px){
    #shiftSwapTargetModal > .modal-card,
    #shiftSwapScopeModal > .modal-card{
        width:min(100%,calc(100% - 20px));
        margin:18px auto;
        border-radius:22px;
        padding:16px;
    }
    #shiftSwapTargetModal .swap-mini-calendar{
        max-height:48vh;
    }
}

/* v65.0.0: make shift-swap assistant modals open exactly like the Add Task modal: fixed, centered in viewport, independent of page scroll */
#shiftSwapTargetModal.modal:not(.hidden),
#shiftSwapScopeModal.modal:not(.hidden){
    position:fixed!important;
    inset:0!important;
    top:0!important;
    right:0!important;
    bottom:0!important;
    left:0!important;
    z-index:2147483600!important;
    display:grid!important;
    place-items:center!important;
    align-items:center!important;
    justify-content:center!important;
    width:100vw!important;
    height:100vh!important;
    height:100dvh!important;
    min-height:100vh!important;
    min-height:100dvh!important;
    margin:0!important;
    padding:16px!important;
    overflow:hidden!important;
    isolation:isolate!important;
    transform:none!important;
}
#shiftSwapTargetModal.modal:not(.hidden) > .modal-backdrop,
#shiftSwapScopeModal.modal:not(.hidden) > .modal-backdrop{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100vh!important;
    height:100dvh!important;
    z-index:0!important;
}
#shiftSwapTargetModal.modal:not(.hidden) > .modal-card,
#shiftSwapScopeModal.modal:not(.hidden) > .modal-card{
    position:relative!important;
    z-index:2!important;
    margin:0!important;
    transform:none!important;
    max-height:calc(100dvh - 32px)!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
}
#shiftSwapTargetModal.modal:not(.hidden){
    scroll-margin:0!important;
}
@media(max-width:640px){
    #shiftSwapTargetModal.modal:not(.hidden),
    #shiftSwapScopeModal.modal:not(.hidden){
        padding:10px!important;
    }
    #shiftSwapTargetModal.modal:not(.hidden) > .modal-card,
    #shiftSwapScopeModal.modal:not(.hidden) > .modal-card{
        max-height:calc(100dvh - 20px)!important;
        width:calc(100vw - 20px)!important;
    }
}

/* v67.0.0: shift swap assistant behavior fixes and calendar date picker */
.swap-compensation-cards label{user-select:none;}
.swap-compensation-cards label input{pointer-events:none;}
.swap-compensation-cards label.is-selected{transform:translateY(-1px);}
.swap-field-card.is-muted,
.swap-choice-section.is-muted{opacity:.48;filter:saturate(.78);}
.swap-choice-section.is-muted{pointer-events:none;}
.swap-date-input.is-muted .swap-date-picker-row{pointer-events:none;}
.swap-date-input.is-muted button,
.swap-date-input.is-muted input,
.swap-return-units-field.is-muted input{cursor:not-allowed;}
.swap-date-picker-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;}
.swap-date-picker-row input[readonly]{cursor:pointer;}
.swap-date-picker-row button:disabled{opacity:.55;cursor:not-allowed;}
.swap-mini-shift{--swap-shift-color:var(--shift-color,#6c5ce7);justify-content:center;border-color:color-mix(in srgb,var(--swap-shift-color) 62%,transparent);background:color-mix(in srgb,var(--swap-shift-color) 16%,transparent);box-shadow:inset 0 1px 0 rgba(255,255,255,.05);padding:5px;min-height:34px;}
.swap-mini-shift:hover,.swap-mini-shift.selected{border-color:color-mix(in srgb,var(--swap-shift-color) 86%,white 8%);background:linear-gradient(135deg,color-mix(in srgb,var(--swap-shift-color) 26%,transparent),rgba(255,255,255,.055));box-shadow:0 10px 22px color-mix(in srgb,var(--swap-shift-color) 18%,transparent);}
.swap-mini-shift b{min-width:32px;width:auto;padding:0 7px;border-radius:10px;border:1px solid color-mix(in srgb,var(--swap-shift-color) 78%,white 7%);background:color-mix(in srgb,var(--swap-shift-color) 22%,rgba(255,255,255,.08));color:color-mix(in srgb,var(--swap-shift-color) 22%,white);font-weight:1000;font-size:12px;letter-spacing:.02em;}
.swap-dates-calendar{align-items:stretch;}
.swap-date-day{min-height:70px;border:1px solid rgba(255,255,255,.075);border-radius:16px;background:rgba(255,255,255,.035);color:var(--text);display:grid;align-content:center;justify-items:center;gap:5px;cursor:pointer;transition:.18s ease;}
.swap-date-day:hover{transform:translateY(-1px);border-color:rgba(102,217,255,.30);background:rgba(102,217,255,.075);}
.swap-date-day.selected{border-color:rgba(102,217,255,.52);background:linear-gradient(135deg,rgba(102,217,255,.18),rgba(139,152,255,.12));box-shadow:0 12px 30px rgba(102,217,255,.10);}
.swap-date-day strong{width:30px;height:30px;border-radius:12px;display:grid;place-items:center;background:rgba(255,255,255,.08);font-size:13px;}
.swap-date-day.selected strong{background:var(--accent);color:#061018;}
.swap-date-day small{font-size:10px;color:var(--muted);direction:ltr;}
.swap-date-picked-preview{margin-top:10px;border:1px dashed rgba(102,217,255,.22);border-radius:16px;background:rgba(102,217,255,.055);color:var(--muted);padding:10px 12px;font-size:12px;line-height:1.8;}
html[data-theme="light"] .swap-date-day,
body[data-theme="light"] .swap-date-day{background:rgba(255,255,255,.82);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .swap-date-picked-preview,
body[data-theme="light"] .swap-date-picked-preview{background:rgba(8,145,178,.055);border-color:rgba(8,145,178,.22);}
@media(max-width:720px){.swap-date-picker-row{grid-template-columns:1fr}.swap-date-day{min-height:58px;border-radius:13px}.swap-date-day small{display:none}.swap-mini-shift b{min-width:28px}}

/* v68.0.0: clearer shift-swap compensation states, Jalali date picker, locked same-kind behavior */
.swap-compensation-cards label{
    opacity:.52!important;
    filter:saturate(.45) brightness(.88)!important;
    transform:none!important;
    border-color:rgba(255,255,255,.08)!important;
    background:linear-gradient(145deg,rgba(255,255,255,.035),rgba(255,255,255,.018))!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.035)!important;
}
.swap-compensation-cards label:not(.is-selected):hover{
    opacity:.72!important;
    filter:saturate(.65) brightness(.94)!important;
}
.swap-compensation-cards label.is-selected{
    opacity:1!important;
    filter:saturate(1.2) brightness(1.06)!important;
    transform:translateY(-2px)!important;
    border-color:rgba(102,217,255,.62)!important;
    background:linear-gradient(145deg,rgba(102,217,255,.24),rgba(139,152,255,.16))!important;
    box-shadow:0 18px 38px rgba(102,217,255,.16), inset 0 1px 0 rgba(255,255,255,.12)!important;
}
.swap-compensation-cards label.is-selected:after{
    content:"✓";
    position:absolute;
    inset-inline-end:12px;
    top:10px;
    width:22px;
    height:22px;
    border-radius:999px;
    display:grid;
    place-items:center;
    background:var(--accent);
    color:#061018;
    font-weight:1000;
    font-size:12px;
    box-shadow:0 8px 20px rgba(102,217,255,.22);
}
.swap-compensation-cards label:not(.is-selected) b,
.swap-compensation-cards label:not(.is-selected) small{color:color-mix(in srgb,var(--muted) 85%,var(--text) 15%)!important;}
.swap-choice-section.is-locked{
    border-color:rgba(102,217,255,.26)!important;
    background:linear-gradient(145deg,rgba(102,217,255,.10),rgba(139,152,255,.055))!important;
}
.swap-choice-section.is-locked [data-return-kind-help]{
    color:color-mix(in srgb,var(--accent) 70%,var(--text) 30%)!important;
    font-weight:800;
}
.swap-chip-check:has(input:disabled){
    cursor:not-allowed!important;
    opacity:.42!important;
    filter:saturate(.55)!important;
}
.swap-chip-check.is-selected:has(input:disabled){
    opacity:1!important;
    filter:none!important;
    border-color:rgba(102,217,255,.52)!important;
    background:linear-gradient(135deg,rgba(102,217,255,.23),rgba(139,152,255,.13))!important;
}
.swap-date-picker-row input[data-available-dates-display]{
    direction:rtl;
    text-align:right;
}
.swap-date-picker-row input[type="hidden"]{display:none!important;}
.swap-date-day small{
    direction:rtl!important;
    font-size:10px!important;
    letter-spacing:0!important;
}
.shift-type-form [name="smart_kind"]{
    font-weight:900;
}
html[data-theme="light"] .swap-compensation-cards label,
body[data-theme="light"] .swap-compensation-cards label{
    background:linear-gradient(145deg,rgba(255,255,255,.72),rgba(239,246,255,.66))!important;
    border-color:rgba(15,23,42,.09)!important;
}
html[data-theme="light"] .swap-compensation-cards label.is-selected,
body[data-theme="light"] .swap-compensation-cards label.is-selected{
    background:linear-gradient(145deg,rgba(14,165,233,.20),rgba(99,102,241,.11))!important;
    border-color:rgba(8,145,178,.42)!important;
    box-shadow:0 18px 36px rgba(8,145,178,.14)!important;
}

/* v69.0.0: fixed shift units and automatic night-off rules */
.shift-unit-preview input[readonly]{
    cursor:not-allowed!important;
    opacity:.92;
    background:linear-gradient(135deg,rgba(102,217,255,.12),rgba(139,152,255,.08))!important;
    border-color:rgba(102,217,255,.28)!important;
    color:var(--text)!important;
    font-weight:1000;
}
.shift-unit-preview small{
    display:block;
    color:var(--muted);
    font-size:11px;
    line-height:1.7;
}

/* v70.0.0: cleaner shift type form, Persian display digits, and collapsed shift-swap assistant */
.shift-type-form-pro,
.shift-edit-form-pro{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:12px!important;
    align-items:end!important;
}
.shift-type-form-pro label,
.shift-edit-form-pro label{
    min-width:0;
}
.shift-type-form-pro label span,
.shift-edit-form-pro label span{
    min-height:18px;
}
.shift-type-form-pro input,
.shift-type-form-pro select,
.shift-edit-form-pro input,
.shift-edit-form-pro select{
    min-height:46px;
}
.shift-type-form-pro .shift-unit-preview,
.shift-edit-form-pro .shift-unit-preview{
    grid-column:auto!important;
}
.shift-unit-preview input[readonly]{
    text-align:center!important;
    direction:rtl!important;
    font-size:16px!important;
    letter-spacing:0!important;
    font-variant-numeric:normal!important;
}
.shift-type-form-pro .shift-24-toggle,
.shift-edit-form-pro .shift-24-toggle{
    align-self:stretch!important;
    min-height:72px;
    justify-content:center;
    border-radius:18px;
}
.shift-type-form-pro .primary-btn{
    grid-column:1/-1!important;
    width:100%;
    min-height:48px;
}
.shift-edit-form-pro .form-actions{
    grid-column:1/-1!important;
}
.shift-type-form-pro .tiny-note{
    grid-column:1/-1!important;
}
.shift-swap-assistant-card.is-modern{
    padding:0!important;
}
.swap-assistant-toggle{
    width:100%;
    border:0;
    background:transparent;
    color:inherit;
    cursor:pointer;
    text-align:right;
    padding:16px;
    border-radius:28px;
}
.swap-assistant-toggle:hover{
    background:linear-gradient(135deg,rgba(102,217,255,.055),rgba(139,152,255,.035));
}
.shift-swap-assistant-card.is-open .swap-assistant-toggle{
    border-bottom:1px solid rgba(255,255,255,.075);
    border-end-start-radius:0;
    border-end-end-radius:0;
}
.shift-swap-accordion-body{
    display:grid;
    gap:14px;
    padding:16px;
    animation:swapAccordionOpen .22s ease both;
}
.shift-swap-accordion-body[hidden]{display:none!important;}
.swap-assistant-open-hint{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin-inline-start:auto;
    border:1px solid rgba(102,217,255,.24);
    background:linear-gradient(135deg,rgba(102,217,255,.13),rgba(139,152,255,.08));
    color:var(--text);
    padding:9px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:1000;
    white-space:nowrap;
}
.swap-assistant-open-hint i{
    width:22px;
    height:22px;
    display:grid;
    place-items:center;
    border-radius:999px;
    background:rgba(255,255,255,.10);
    transition:transform .18s ease;
    font-style:normal;
}
.shift-swap-assistant-card.is-open .swap-assistant-open-hint i{transform:rotate(180deg);}
.shift-swap-assistant-card.is-collapsed .swap-assistant-icon{opacity:.82;}
@keyframes swapAccordionOpen{
    from{opacity:0;transform:translateY(-6px);}
    to{opacity:1;transform:translateY(0);}
}
#shiftSwapTargetModal.modal:not(.hidden),
#shiftSwapScopeModal.modal:not(.hidden),
#shiftSwapDatesModal.modal:not(.hidden){
    position:fixed!important;
    inset:0!important;
    z-index:2147483600!important;
    display:grid!important;
    place-items:center!important;
    width:100vw!important;
    height:100vh!important;
    height:100dvh!important;
    padding:16px!important;
    overflow:hidden!important;
    isolation:isolate!important;
    margin:0!important;
}
#shiftSwapTargetModal.modal:not(.hidden) > .modal-backdrop,
#shiftSwapScopeModal.modal:not(.hidden) > .modal-backdrop,
#shiftSwapDatesModal.modal:not(.hidden) > .modal-backdrop{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100vh!important;
    height:100dvh!important;
    z-index:0!important;
}
#shiftSwapTargetModal.modal:not(.hidden) > .modal-card,
#shiftSwapScopeModal.modal:not(.hidden) > .modal-card,
#shiftSwapDatesModal.modal:not(.hidden) > .modal-card{
    position:relative!important;
    z-index:2!important;
    margin:0!important;
    max-height:calc(100dvh - 32px)!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
}
#shiftSwapDatesModal > .modal-card{width:min(640px,calc(100% - 24px));}
@media(max-width:980px){
    .shift-type-form-pro,
    .shift-edit-form-pro{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:720px){
    .shift-type-form-pro,
    .shift-edit-form-pro{grid-template-columns:1fr!important;}
    .swap-assistant-toggle{grid-template-columns:1fr!important;}
    .swap-assistant-open-hint{justify-self:start;margin-inline-start:0;}
    .shift-swap-accordion-body{padding:12px;}
}

/* v70.0.1: use the last row of the shift type form without empty columns */
.shift-type-form-pro .primary-btn{
    grid-column:span 2!important;
    align-self:end!important;
}
.shift-edit-form-pro .form-actions{
    grid-column:span 2!important;
    align-self:end!important;
    position:static!important;
    padding-top:0!important;
    background:transparent!important;
}
.shift-edit-form-pro .form-actions .primary-btn{width:100%;min-height:48px;}
@media(max-width:980px){
    .shift-type-form-pro .primary-btn,
    .shift-edit-form-pro .form-actions{grid-column:1/-1!important;}
}

/* v71.0.0: polished shift type form layout */
.shift-type-form-pro,
.shift-edit-form-pro{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:12px!important;
    align-items:stretch!important;
}
.shift-type-form-pro > label,
.shift-edit-form-pro > label{
    min-width:0!important;
    height:100%;
}
.shift-type-form-pro > label span,
.shift-edit-form-pro > label span{
    min-height:auto!important;
    line-height:1.4;
}
.shift-type-form-pro input,
.shift-type-form-pro select,
.shift-edit-form-pro input,
.shift-edit-form-pro select{
    min-height:46px!important;
}
.shift-type-form-pro .shift-unit-preview,
.shift-edit-form-pro .shift-unit-preview{
    grid-column:auto!important;
}
.shift-unit-preview small{display:none!important;}
.shift-unit-preview input[readonly]{
    height:46px!important;
    padding-top:11px!important;
    padding-bottom:11px!important;
}
.shift-type-form-pro .shift-24-toggle,
.shift-edit-form-pro .shift-24-toggle{
    grid-column:1/-1!important;
    min-height:58px!important;
    align-self:stretch!important;
    justify-content:flex-start!important;
    padding:12px 16px!important;
    margin-top:2px;
}
.shift-time-row{
    grid-column:1/-1;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    align-items:stretch;
}
.shift-time-row label,
.shift-final-row label{
    display:grid;
    gap:6px;
    color:var(--muted);
    font-weight:900;
    font-size:12px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.035);
    border-radius:18px;
    padding:10px;
    min-width:0;
}
.shift-final-row{
    grid-column:1/-1;
    display:grid;
    grid-template-columns:minmax(140px,1fr) minmax(220px,2fr);
    gap:12px;
    align-items:end;
}
.shift-final-row .primary-btn,
.shift-final-row .form-actions{
    grid-column:auto!important;
    width:100%!important;
    align-self:stretch!important;
}
.shift-final-row .form-actions{
    position:static!important;
    padding-top:0!important;
    background:transparent!important;
    display:grid;
}
.shift-final-row .primary-btn{
    min-height:66px!important;
    height:100%!important;
}
.shift-color-field input[type="color"]{
    padding:4px!important;
    cursor:pointer;
}
@media(max-width:980px){
    .shift-type-form-pro,
    .shift-edit-form-pro{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
    .shift-time-row,
    .shift-final-row{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:720px){
    .shift-type-form-pro,
    .shift-edit-form-pro,
    .shift-time-row,
    .shift-final-row{grid-template-columns:1fr!important;}
    .shift-final-row .primary-btn{min-height:50px!important;}
}

/* v72.0.0: place shift color next to time fields and slim save button */
.shift-time-row{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
.shift-final-row{
    grid-template-columns:1fr!important;
    align-items:stretch!important;
}
.shift-final-row .primary-btn{
    min-height:48px!important;
    height:auto!important;
    padding-top:11px!important;
    padding-bottom:11px!important;
    border-radius:16px!important;
}
.shift-final-row .form-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
}
.shift-color-field input[type="color"]{
    width:100%!important;
    height:46px!important;
}
@media(max-width:980px){
    .shift-time-row{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
    .shift-final-row{grid-template-columns:1fr!important;}
}
@media(max-width:720px){
    .shift-time-row{grid-template-columns:1fr!important;}
    .shift-final-row .primary-btn{min-height:46px!important;}
}

/* v73 - Shift request assistant */
.shift-request-assistant-card{margin-top:0;}
.shift-request-assistant-card .request-assistant-icon{background:linear-gradient(135deg,#fbbf24,var(--accent));}
.request-top-grid{grid-template-columns:minmax(210px,1fr) minmax(260px,1.2fr) minmax(260px,1.2fr)!important;}
.request-date-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
.request-choice-section .is-soft-disabled{opacity:.45;filter:grayscale(.45);cursor:not-allowed;}
.request-choice-section .is-soft-disabled span:after{content:"";}
.request-kind-chip.is-muted{opacity:.38;filter:grayscale(.45);}
.shift-request-result{display:grid;gap:12px;}
.shift-request-models{display:grid;gap:14px;}
.request-result-head{border:1px solid rgba(102,217,255,.16);border-radius:22px;background:rgba(102,217,255,.055);padding:12px 14px;display:flex;justify-content:space-between;gap:12px;align-items:center;}
.request-result-head strong{display:block;color:var(--text);font-size:15px;}
.request-result-head span{display:block;color:var(--muted);font-size:12px;margin-top:4px;}
.shift-request-model-card{border:1px solid rgba(255,255,255,.09);border-radius:24px;background:linear-gradient(145deg,rgba(255,255,255,.045),rgba(255,255,255,.025));padding:14px;display:grid;gap:10px;box-shadow:0 16px 45px rgba(0,0,0,.10);}
.shift-request-model-card.is-partial{border-color:rgba(251,191,36,.24);background:linear-gradient(145deg,rgba(251,191,36,.06),rgba(255,255,255,.025));}
.request-model-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;}
.request-model-head h4{margin:0 0 4px;color:var(--text);font-size:16px;}
.request-model-head p{margin:0;color:var(--muted);font-size:12px;line-height:1.7;}
.request-weekdays{margin-bottom:0;}
.shift-request-mini-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;}
.request-model-day{min-height:58px;border:1px solid rgba(255,255,255,.075);border-radius:15px;background:rgba(255,255,255,.032);display:grid;align-content:start;gap:5px;padding:6px;}
.request-model-day.empty{opacity:.22;}
.request-model-day>strong{width:25px;height:25px;border-radius:10px;background:rgba(255,255,255,.06);color:var(--text);font-size:12px;display:grid;place-items:center;}
.request-model-day.has-request{border-color:color-mix(in srgb,var(--request-shift-color) 55%,transparent);background:color-mix(in srgb,var(--request-shift-color) 14%,rgba(255,255,255,.032));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--request-shift-color) 16%,transparent);}
.request-model-day.has-request>strong{background:color-mix(in srgb,var(--request-shift-color) 28%,rgba(255,255,255,.08));}
.request-model-day span{justify-self:start;border:1px solid color-mix(in srgb,var(--request-shift-color) 55%,transparent);border-radius:999px;color:var(--text);background:color-mix(in srgb,var(--request-shift-color) 20%,rgba(255,255,255,.05));font-size:11px;font-weight:1000;padding:3px 8px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.request-model-summary{display:block;color:var(--muted);line-height:1.8;font-size:11px;}
html[data-theme="light"] .shift-request-model-card,
body[data-theme="light"] .shift-request-model-card{background:rgba(255,255,255,.84);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .request-result-head,
body[data-theme="light"] .request-result-head{background:rgba(8,145,178,.06);border-color:rgba(8,145,178,.16);}
html[data-theme="light"] .request-model-day,
body[data-theme="light"] .request-model-day{background:rgba(255,255,255,.72);border-color:rgba(15,23,42,.08);}
@media(max-width:720px){.request-top-grid,.request-date-grid{grid-template-columns:1fr!important}.request-model-head{flex-direction:column}.shift-request-mini-calendar{grid-template-columns:repeat(7,minmax(38px,1fr));overflow:auto}.request-model-day{min-height:48px;border-radius:12px;padding:4px}.request-model-day span{font-size:10px;padding:2px 6px}.request-model-summary{display:none}}

/* v74 - Shift request assistant exact combinations + slider */
.shift-request-models.request-model-slider{display:grid;gap:14px;overflow:hidden;}
.request-slider-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.request-slider-actions b{min-width:76px;text-align:center;border:1px solid rgba(255,255,255,.10);border-radius:999px;padding:6px 10px;color:var(--text);background:rgba(255,255,255,.045);font-size:12px;}
.request-capped-note{display:inline-flex!important;margin-top:6px;color:#fbbf24!important;font-weight:800;}
.request-slider-viewport{overflow:hidden;border-radius:24px;direction:ltr;}
.request-slider-track{display:flex;transition:transform .32s cubic-bezier(.22,.9,.25,1);will-change:transform;}
.request-slider-track .shift-request-model-card{min-width:100%;direction:rtl;margin:0;}
.request-slider-dots{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;}
.request-slider-dots button{width:8px;height:8px;border-radius:999px;border:0;background:rgba(255,255,255,.22);padding:0;cursor:pointer;transition:width .2s ease,background .2s ease,opacity .2s ease;}
.request-slider-dots button.active{width:24px;background:var(--accent);}
.shift-request-impossible-card{border:1px solid rgba(251,191,36,.25);border-radius:24px;background:linear-gradient(135deg,rgba(251,191,36,.10),rgba(255,255,255,.035));padding:16px;display:flex;align-items:center;gap:12px;box-shadow:0 18px 50px rgba(0,0,0,.12);}
.request-impossible-icon{width:42px;height:42px;border-radius:16px;display:grid;place-items:center;background:rgba(251,191,36,.18);border:1px solid rgba(251,191,36,.32);color:#fbbf24;font-size:24px;font-weight:1000;flex:0 0 auto;}
.shift-request-impossible-card strong{display:block;color:var(--text);font-size:15px;margin-bottom:4px;}
.shift-request-impossible-card p{margin:0;color:var(--muted);font-size:13px;line-height:1.9;}
.shift-request-impossible-card .primary-btn{margin-inline-start:auto;white-space:nowrap;}
html[data-theme="light"] .request-slider-actions b,
body[data-theme="light"] .request-slider-actions b{background:rgba(255,255,255,.85);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .shift-request-impossible-card,
body[data-theme="light"] .shift-request-impossible-card{background:linear-gradient(135deg,rgba(245,158,11,.10),rgba(255,255,255,.82));border-color:rgba(245,158,11,.26);}
html[data-theme="light"] .request-slider-dots button,
body[data-theme="light"] .request-slider-dots button{background:rgba(15,23,42,.18);}
html[data-theme="light"] .request-slider-dots button.active,
body[data-theme="light"] .request-slider-dots button.active{background:var(--accent);}
@media(max-width:720px){.request-result-head{align-items:flex-start;flex-direction:column}.request-slider-actions{width:100%;justify-content:space-between}.shift-request-impossible-card{align-items:flex-start;flex-direction:column}.shift-request-impossible-card .primary-btn{margin-inline-start:0;width:100%;}.request-slider-viewport{border-radius:18px}}

/* v75 - Multi-center shift request assistant */
.request-center-toolbar{display:grid;grid-template-columns:minmax(260px,1fr) minmax(280px,1.4fr);gap:12px;align-items:stretch;}
.request-center-select small{line-height:1.7;}
.request-center-summary{border:1px solid rgba(102,217,255,.14);border-radius:22px;background:rgba(102,217,255,.045);padding:12px 14px;display:grid;gap:10px;align-content:start;}
.request-center-summary>span{font-weight:900;color:var(--text);font-size:13px;}
.request-center-summary>div{display:flex;flex-wrap:wrap;gap:8px;}
.request-center-pill{display:inline-flex;align-items:center;gap:7px;border:1px solid rgba(255,255,255,.10);border-radius:999px;background:rgba(255,255,255,.04);color:var(--muted);font-size:12px;font-weight:800;padding:6px 9px;}
.request-center-pill b{min-width:22px;height:22px;border-radius:999px;display:grid;place-items:center;background:rgba(255,255,255,.08);color:var(--text);font-size:11px;}
.request-center-pill.is-active{border-color:rgba(102,217,255,.38);background:rgba(102,217,255,.12);color:var(--text);}
.request-center-pill.is-active b{background:var(--accent);color:#061018;}
.request-rule-grid{grid-template-columns:minmax(260px,1fr) minmax(260px,1fr)!important;}
.request-special-rules-card p{margin:0;color:var(--muted);font-size:12px;line-height:1.8;}
.request-rule-layout{display:grid;grid-template-columns:minmax(360px,1.2fr) minmax(260px,.8fr);gap:14px;align-items:start;}
.request-rule-editor{border:1px solid rgba(255,255,255,.10);border-radius:22px;background:rgba(255,255,255,.045);padding:13px;display:grid;gap:12px;position:sticky;top:10px;}
.request-rule-editor>strong{color:var(--text);font-size:15px;}
.request-rule-editor label{display:grid;gap:6px;color:var(--text);font-weight:800;font-size:12px;}
.request-rule-editor select{width:100%;}
.request-rule-actions{justify-content:flex-start;margin-top:0;}
.request-rule-kind-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
.request-rule-day.has-rule{border-color:rgba(251,191,36,.44);background:rgba(251,191,36,.14);box-shadow:inset 0 0 0 1px rgba(251,191,36,.18);}
.request-rule-day.selected{outline:2px solid var(--accent);outline-offset:2px;}
.saved-request-panel{display:grid;gap:10px;margin-top:14px;border-top:1px solid rgba(255,255,255,.08);padding-top:14px;}
.saved-request-list{display:grid;gap:8px;}
.saved-request-row{border:1px solid rgba(255,255,255,.09);border-radius:18px;background:rgba(255,255,255,.035);padding:10px;display:flex;justify-content:space-between;align-items:center;gap:12px;}
.saved-request-row strong{display:block;color:var(--text);font-size:13px;margin-bottom:3px;}
.saved-request-row small{display:block;color:var(--muted);font-size:11px;}
.saved-request-row>div:last-child{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;}
.request-model-day.has-multi-request{background:linear-gradient(145deg,color-mix(in srgb,var(--request-shift-color) 13%,rgba(255,255,255,.032)),rgba(255,255,255,.05));}
.request-model-day span{display:inline-grid;grid-auto-flow:column;align-items:center;gap:5px;margin-inline-end:4px;margin-bottom:3px;}
.request-model-day span em{font-style:normal;font-size:9px;font-weight:800;color:var(--muted);max-width:56px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.request-model-day.has-multi-request span{font-size:10px;padding:3px 6px;}
html[data-theme="light"] .request-center-summary,
body[data-theme="light"] .request-center-summary{background:rgba(8,145,178,.06);border-color:rgba(8,145,178,.14);}
html[data-theme="light"] .request-center-pill,
body[data-theme="light"] .request-center-pill,
html[data-theme="light"] .request-rule-editor,
body[data-theme="light"] .request-rule-editor,
html[data-theme="light"] .saved-request-row,
body[data-theme="light"] .saved-request-row{background:rgba(255,255,255,.76);border-color:rgba(15,23,42,.09);}
@media(max-width:820px){
    .request-center-toolbar,.request-rule-grid,.request-rule-layout{grid-template-columns:1fr!important;}
    .request-rule-editor{position:static;}
    .saved-request-row{align-items:flex-start;flex-direction:column;}
    .saved-request-row>div:last-child{justify-content:flex-start;}
}

/* v76 - Shift request assistant polish */
[data-request-rules-modal] .modal-card{
    width:min(980px,calc(100vw - 36px));
    max-width:min(980px,calc(100vw - 36px));
}
[data-request-rules-modal] .request-rule-layout{
    grid-template-columns:minmax(0,1.15fr) minmax(260px,.85fr);
}
[data-request-rules-modal] .swap-mini-calendar{
    min-width:0;
}
.shift-request-empty-center{
    text-align:right;
    padding:18px;
}
.shift-request-empty-center strong{
    display:block;
    color:var(--text);
    font-size:15px;
    margin-bottom:6px;
}
.shift-request-empty-center p{
    margin:0;
    color:var(--muted);
    line-height:1.9;
}
.saved-request-row [data-delete-request-model],
.saved-request-row .danger-btn{
    cursor:pointer;
}
.saved-request-row [data-delete-request-model]:hover{
    filter:brightness(1.08);
    transform:translateY(-1px);
}
@media(max-width:820px){
    [data-request-rules-modal] .modal-card{
        width:min(94vw,calc(100vw - 20px));
        max-width:min(94vw,calc(100vw - 20px));
    }
    [data-request-rules-modal] .request-rule-layout{
        grid-template-columns:1fr;
    }
}


/* v77 - Shift request build loading + unified delete confirm */
.shift-request-building-card{
    border:1px solid rgba(102,217,255,.22);
    border-radius:22px;
    background:linear-gradient(135deg,rgba(102,217,255,.12),rgba(255,255,255,.035));
    padding:16px;
    display:flex;
    align-items:center;
    gap:12px;
    box-shadow:0 18px 50px rgba(0,0,0,.10);
}
.shift-request-building-card .btn-loading-spinner{
    width:28px;
    height:28px;
    border-width:3px;
    flex:0 0 auto;
}
.shift-request-building-card strong{
    display:block;
    color:var(--text);
    font-size:15px;
    margin-bottom:4px;
}
.shift-request-building-card p{
    margin:0;
    color:var(--muted);
    font-size:12px;
    line-height:1.8;
}
.request-delete-confirm-body{
    border:1px solid rgba(239,68,68,.18);
    border-radius:22px;
    background:rgba(239,68,68,.055);
    padding:14px;
    display:grid;
    gap:8px;
}
.request-delete-confirm-body strong{
    color:var(--text);
    font-size:15px;
}
.request-delete-confirm-body p{
    margin:0;
    color:var(--muted);
    line-height:1.9;
    font-size:13px;
}
html[data-theme="light"] .shift-request-building-card,
body[data-theme="light"] .shift-request-building-card{
    background:linear-gradient(135deg,rgba(8,145,178,.10),rgba(255,255,255,.86));
    border-color:rgba(8,145,178,.18);
}
html[data-theme="light"] .request-delete-confirm-body,
body[data-theme="light"] .request-delete-confirm-body{
    background:rgba(239,68,68,.06);
    border-color:rgba(239,68,68,.18);
}

/* v78 - Runtime performance optimization: version-gated DB migrations, lighter rendering/localization, async shift-request generation. */

/* v80 - Shift request assistant UI cleanup + persisted preferences */
.request-center-tabs-wrap{
    grid-template-columns:1fr!important;
    border:1px solid rgba(102,217,255,.14);
    border-radius:24px;
    background:rgba(102,217,255,.045);
    padding:13px;
}
.request-center-tabs-head{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px;}
.request-center-tabs-head small{color:var(--muted);font-size:12px;line-height:1.7;}
.request-center-tabs{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.request-center-tab{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.045);color:var(--text);border-radius:16px;padding:9px 12px;display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:900;cursor:pointer;transition:transform .18s ease,border-color .18s ease,background .18s ease,box-shadow .18s ease;}
.request-center-tab:hover{transform:translateY(-1px);border-color:rgba(102,217,255,.34);background:rgba(102,217,255,.08);}
.request-center-tab.is-active{border-color:rgba(102,217,255,.56);background:linear-gradient(135deg,rgba(102,217,255,.20),rgba(255,255,255,.055));box-shadow:0 12px 32px rgba(102,217,255,.10),inset 0 0 0 1px rgba(102,217,255,.10);}
.request-center-tab b{min-width:22px;height:22px;border-radius:999px;display:grid;place-items:center;background:rgba(255,255,255,.09);font-size:11px;color:var(--text);}
.request-center-tab.is-active b{background:var(--accent);color:#061018;}
.request-center-tab.compact{padding:7px 10px;border-radius:999px;}
.request-unusual-section{border-color:rgba(251,191,36,.20)!important;background:linear-gradient(135deg,rgba(251,191,36,.075),rgba(255,255,255,.03));}
.request-unusual-section.hidden{display:none!important;}
.request-unusual-section .request-center-tabs{margin-top:10px;margin-bottom:10px;}
.request-unusual-kind-grid{margin-top:8px;}
.shift-request-model-card{gap:12px;}
html[data-theme="light"] .request-center-tabs-wrap,
body[data-theme="light"] .request-center-tabs-wrap{background:rgba(8,145,178,.06);border-color:rgba(8,145,178,.14);}
html[data-theme="light"] .request-center-tab,
body[data-theme="light"] .request-center-tab{background:rgba(255,255,255,.76);border-color:rgba(15,23,42,.09);}
html[data-theme="light"] .request-center-tab.is-active,
body[data-theme="light"] .request-center-tab.is-active{background:linear-gradient(135deg,rgba(8,145,178,.14),rgba(255,255,255,.86));border-color:rgba(8,145,178,.30);}
@media(max-width:720px){.request-center-tabs-head{align-items:flex-start;flex-direction:column}.request-center-tab{width:100%;justify-content:space-between}.request-center-tab.compact{width:auto;}}

/* v81 - advanced shift request rules */
.request-date-options-grid{grid-template-columns:1fr!important;}
.request-date-options-grid .hidden,
.request-weekday-section.hidden,
.request-date-input.hidden{display:none!important;}
.request-rules-pro-modal{width:min(1180px,calc(100vw - 32px));max-width:1180px;}
.request-rule-layout-pro{grid-template-columns:minmax(360px,.95fr) minmax(420px,1.05fr);gap:16px;}
.request-rule-calendar-panel{display:grid;gap:10px;align-content:start;min-width:0;}
.request-rule-help-card{display:grid;gap:4px;border:1px solid rgba(102,217,255,.16);background:linear-gradient(135deg,rgba(102,217,255,.10),rgba(255,255,255,.035));border-radius:18px;padding:12px 14px;color:var(--text);}
.request-rule-help-card span{color:var(--muted);font-size:12px;line-height:1.8;}
.request-rule-editor-pro{gap:12px;}
.rule-off-toggle{display:flex!important;align-items:flex-start;gap:10px;border:1px solid rgba(248,113,113,.22);background:rgba(248,113,113,.08);border-radius:18px;padding:12px;cursor:pointer;}
.rule-off-toggle input{margin-top:4px;accent-color:#fb7185;}
.rule-off-toggle span{display:grid;gap:3px;}
.rule-off-toggle b{font-size:13px;color:var(--text);}
.rule-off-toggle small{font-size:11px;color:var(--muted);line-height:1.7;}
.request-rule-pro-card{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.045);border-radius:20px;padding:12px;display:grid;gap:10px;}
.request-rule-pro-card>div:first-child{display:grid;gap:3px;}
.request-rule-pro-card b{font-size:13px;color:var(--text);}
.request-rule-pro-card small{font-size:11px;color:var(--muted);line-height:1.7;}
.request-rule-summary{border:1px solid rgba(102,217,255,.18);background:rgba(102,217,255,.08);border-radius:16px;padding:10px 12px;color:var(--text);font-size:12px;font-weight:800;line-height:1.8;}
.request-rule-editor-pro [disabled]{opacity:.48;cursor:not-allowed;}
.request-rule-day.has-rule small{font-size:9px;line-height:1.2;}
.request-model-day span em{display:none!important;}
html[data-theme="light"] .request-rule-help-card,
body[data-theme="light"] .request-rule-help-card{background:rgba(8,145,178,.07);border-color:rgba(8,145,178,.16);}
html[data-theme="light"] .request-rule-pro-card,
body[data-theme="light"] .request-rule-pro-card{background:rgba(255,255,255,.72);border-color:rgba(15,23,42,.09);}
html[data-theme="light"] .request-rule-summary,
body[data-theme="light"] .request-rule-summary{background:rgba(8,145,178,.08);border-color:rgba(8,145,178,.18);}
html[data-theme="light"] .rule-off-toggle,
body[data-theme="light"] .rule-off-toggle{background:rgba(244,63,94,.06);border-color:rgba(244,63,94,.16);}
@media(max-width:900px){.request-rules-pro-modal{width:min(96vw,760px)}.request-rule-layout-pro{grid-template-columns:1fr;}.request-rule-editor-pro{position:static;}}

/* v82: polished daily request-rule editor */
.rule-switch-toggle{display:block!important;position:relative;border:1px solid rgba(255,255,255,.10);background:linear-gradient(135deg,rgba(255,255,255,.055),rgba(255,255,255,.025));border-radius:22px;padding:0;cursor:pointer;overflow:hidden;transition:.18s ease;}
.rule-switch-toggle input{position:absolute;opacity:0;pointer-events:none;}
.rule-switch-ui{display:grid!important;grid-template-columns:auto 1fr;grid-template-areas:"knob title" "knob desc";column-gap:12px;align-items:center;padding:13px 14px;}
.rule-switch-ui i{grid-area:knob;width:46px;height:26px;border-radius:999px;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.12);position:relative;transition:.18s ease;box-shadow:inset 0 2px 8px rgba(0,0,0,.18);}
.rule-switch-ui i:before{content:"";position:absolute;top:3px;right:3px;width:18px;height:18px;border-radius:50%;background:rgba(255,255,255,.78);transition:.18s ease;box-shadow:0 4px 12px rgba(0,0,0,.22);}
.rule-switch-ui b{grid-area:title;font-size:13px;color:var(--text);}
.rule-switch-ui small{grid-area:desc;font-size:11px;color:var(--muted);line-height:1.7;}
.rule-switch-toggle.is-active{border-color:rgba(248,113,113,.42);background:linear-gradient(135deg,rgba(248,113,113,.18),rgba(251,191,36,.07));box-shadow:0 14px 35px rgba(248,113,113,.08);}
.rule-switch-toggle.is-active .rule-switch-ui i{background:#fb7185;border-color:rgba(255,255,255,.18);}
.rule-switch-toggle.is-active .rule-switch-ui i:before{right:23px;background:#fff;}
.rule-modern-card{position:relative;overflow:hidden;}
.rule-modern-card:before{content:"";position:absolute;inset:0 0 auto 0;height:1px;background:linear-gradient(90deg,transparent,rgba(102,217,255,.25),transparent);pointer-events:none;}
.rule-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;}
.rule-option-block{display:grid;gap:8px;}
.rule-choice-grid{display:flex;gap:8px;flex-wrap:wrap;}
.rule-choice-pill{position:relative;display:inline-flex;align-items:center;gap:7px;border:1px solid rgba(255,255,255,.10);border-radius:999px;background:rgba(255,255,255,.045);color:var(--muted);font-size:12px;font-weight:900;padding:8px 11px;cursor:pointer;transition:.18s ease;}
.rule-choice-pill input{position:absolute;opacity:0;pointer-events:none;}
.rule-choice-pill:before{content:"";width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.25);box-shadow:0 0 0 3px rgba(255,255,255,.035);}
.rule-choice-pill.is-selected{border-color:rgba(102,217,255,.42);background:linear-gradient(135deg,rgba(102,217,255,.16),rgba(139,152,255,.11));color:var(--text);box-shadow:0 12px 26px rgba(102,217,255,.08);}
.rule-choice-pill.is-selected:before{background:var(--accent);box-shadow:0 0 0 4px rgba(102,217,255,.14);}
.rule-choice-pill.is-disabled{opacity:.48;cursor:not-allowed;}
.rule-expand-toggle{width:100%;border:1px dashed rgba(102,217,255,.22);border-radius:16px;background:rgba(102,217,255,.055);color:var(--text);display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;font-weight:1000;font-size:12px;cursor:pointer;transition:.18s ease;}
.rule-expand-toggle:hover{border-color:rgba(102,217,255,.38);background:rgba(102,217,255,.09);}
.rule-expand-toggle i{transition:.18s ease;}
.rule-expand-toggle.is-active{border-style:solid;background:linear-gradient(135deg,rgba(102,217,255,.15),rgba(139,152,255,.09));box-shadow:0 12px 28px rgba(102,217,255,.07);}
.rule-expand-toggle.is-active i{transform:rotate(180deg);}
.rule-expand-toggle:disabled{opacity:.5;cursor:not-allowed;}
.rule-kind-panel{display:grid;gap:8px;border:1px solid rgba(255,255,255,.075);border-radius:16px;background:rgba(255,255,255,.032);padding:10px;animation:rulePanelIn .18s ease both;}
.rule-kind-panel[hidden]{display:none!important;}
@keyframes rulePanelIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
.request-rule-pro-card.is-disabled{opacity:.48;filter:saturate(.75);}
.request-rule-pro-card.is-disabled .rule-choice-pill,.request-rule-pro-card.is-disabled .swap-chip-check{cursor:not-allowed;}
html[data-theme="light"] .rule-switch-toggle,body[data-theme="light"] .rule-switch-toggle{background:rgba(255,255,255,.78);border-color:rgba(15,23,42,.09);}
html[data-theme="light"] .rule-choice-pill,body[data-theme="light"] .rule-choice-pill{background:rgba(255,255,255,.75);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .rule-expand-toggle,body[data-theme="light"] .rule-expand-toggle{background:rgba(8,145,178,.06);border-color:rgba(8,145,178,.18);}
@media(max-width:720px){.rule-choice-grid{display:grid;grid-template-columns:1fr 1fr}.rule-choice-pill{justify-content:center}.rule-switch-ui{grid-template-columns:1fr;grid-template-areas:"title" "desc" "knob";gap:8px}.rule-switch-ui i{justify-self:start}}

/* v83: request daily-rules modal polish */
.rule-card-copy{display:grid!important;gap:4px;min-width:0;line-height:1.6;}
.rule-card-copy b,.rule-card-copy small{display:block!important;white-space:normal!important;}
.rule-card-copy small{margin-top:2px;}
.rule-kind-empty{display:block;color:var(--muted);font-size:11px;line-height:1.8;border:1px dashed rgba(251,191,36,.22);border-radius:14px;background:rgba(251,191,36,.055);padding:8px 10px;}
.rule-kind-empty[hidden],.rule-kind-chip[hidden],.rule-kind-chip.hidden{display:none!important;}
@media(max-width:720px){
  .request-rule-day.has-rule small{display:block!important;color:#fbbf24!important;font-size:9px!important;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:rtl;line-height:1.2;}
  .request-rule-day.has-rule{position:relative;box-shadow:inset 0 0 0 1px rgba(251,191,36,.30),0 0 0 1px rgba(251,191,36,.10);}
  .request-rule-day.has-rule:after{content:"";position:absolute;top:6px;left:6px;width:7px;height:7px;border-radius:999px;background:#fbbf24;box-shadow:0 0 0 3px rgba(251,191,36,.16);}
  [data-request-rules-modal] .swap-mini-calendar{grid-template-columns:repeat(7,minmax(48px,1fr));overflow-x:auto;padding:2px 2px 6px;}
  [data-request-rules-modal] .swap-date-day{min-height:64px;gap:4px;padding:5px 3px;}
}

/* v84: shift-request priority rules, saved-model filters, grouped settings */
.request-config-group{
    border:1px solid rgba(255,255,255,.095);
    border-radius:26px;
    background:linear-gradient(135deg,rgba(255,255,255,.050),rgba(255,255,255,.022));
    padding:14px;
    display:grid;
    gap:12px;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.025);
}
.request-center-settings-group{border-color:rgba(102,217,255,.16);background:linear-gradient(135deg,rgba(102,217,255,.075),rgba(255,255,255,.026));}
.request-global-settings-group{border-color:rgba(139,152,255,.18);background:linear-gradient(135deg,rgba(139,152,255,.080),rgba(255,255,255,.026));}
.request-config-group-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;border-bottom:1px solid rgba(255,255,255,.075);padding-bottom:10px;}
.request-config-group-head>div{display:grid;gap:3px;}
.request-config-group-head span{color:var(--text);font-size:13px;font-weight:1000;}
.request-config-group-head small{color:var(--muted);font-size:11px;line-height:1.7;}
.request-config-group-head>b{border:1px solid rgba(102,217,255,.20);background:rgba(102,217,255,.10);color:var(--text);border-radius:999px;padding:6px 10px;font-size:11px;font-weight:1000;}
.saved-request-header{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap;border:1px solid rgba(102,217,255,.13);background:rgba(102,217,255,.045);border-radius:20px;padding:12px 14px;}
.saved-request-header h3{margin:0;color:var(--text);font-size:15px;}
.saved-request-header small{display:block;color:var(--muted);font-size:11px;line-height:1.8;margin-top:2px;}
.saved-request-filters{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.saved-request-filters select{min-width:118px;height:38px;border-radius:14px;font-size:12px;font-weight:900;}
.saved-request-list-compact{gap:7px;}
.saved-request-list-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;padding:9px 10px;border-radius:16px;background:rgba(255,255,255,.030);}
.saved-request-main{min-width:0;}
.saved-request-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end;}
.saved-request-actions .tiny-btn{padding:6px 9px;}
html[data-theme="light"] .request-config-group,
body[data-theme="light"] .request-config-group,
html[data-theme="light"] .saved-request-header,
body[data-theme="light"] .saved-request-header{background:rgba(255,255,255,.72);border-color:rgba(15,23,42,.09);}
html[data-theme="light"] .request-center-settings-group,
body[data-theme="light"] .request-center-settings-group{background:rgba(8,145,178,.055);border-color:rgba(8,145,178,.14);}
html[data-theme="light"] .request-global-settings-group,
body[data-theme="light"] .request-global-settings-group{background:rgba(99,102,241,.055);border-color:rgba(99,102,241,.13);}
@media(max-width:720px){
    .request-config-group{padding:11px;border-radius:22px;}
    .request-config-group-head{align-items:flex-start;flex-direction:column;}
    .saved-request-header{align-items:flex-start;flex-direction:column;}
    .saved-request-filters{width:100%;display:grid;grid-template-columns:1fr 1fr;}
    .saved-request-filters select{width:100%;min-width:0;}
    .saved-request-list-row{grid-template-columns:1fr;align-items:start;}
    .saved-request-actions{justify-content:flex-start;margin-top:8px;}
}

/* v85.0.0: medical-center colors, filtered shift types and dependent quick assignment */
.medical-center-color-dot{width:34px;height:34px;border-radius:14px;display:inline-grid;place-items:center;flex:0 0 auto;background:linear-gradient(135deg,var(--center-color,#6c5ce7),color-mix(in srgb,var(--center-color,#6c5ce7) 45%,#ffffff));box-shadow:0 0 0 4px color-mix(in srgb,var(--center-color,#6c5ce7) 18%,transparent),0 10px 24px color-mix(in srgb,var(--center-color,#6c5ce7) 22%,transparent);border:1px solid color-mix(in srgb,var(--center-color,#6c5ce7) 65%,#fff)}
.medical-center-color-dot::after{content:' ';width:10px;height:10px;border-radius:999px;background:rgba(255,255,255,.88);box-shadow:0 0 0 2px rgba(0,0,0,.08)}
.medical-center-color-field input[type="color"],.shift-color-field input[type="color"]{min-height:44px;padding:5px;cursor:pointer}
.pro-medical-center-form .form-two-col{grid-template-columns:1fr 1fr minmax(120px,.5fr)}
.shift-type-list-wrap{display:grid;gap:10px;min-width:0}
.shift-type-filter-tabs{display:flex;gap:8px;flex-wrap:wrap;align-items:center;padding:6px;border:1px solid var(--line);border-radius:20px;background:rgba(255,255,255,.035);margin-top:12px}
.shift-type-filter-tab{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.045);color:var(--muted);border-radius:999px;padding:8px 12px;font-weight:950;font-size:12px;display:inline-flex;align-items:center;gap:7px;cursor:pointer;transition:.18s ease}
.shift-type-filter-tab span{min-width:24px;height:24px;border-radius:999px;display:grid;place-items:center;background:rgba(255,255,255,.07);color:var(--text);font-size:11px}
.shift-type-filter-tab:hover{color:var(--text);border-color:color-mix(in srgb,var(--center-color,var(--accent)) 35%,var(--line));transform:translateY(-1px)}
.shift-type-filter-tab.active{background:linear-gradient(135deg,color-mix(in srgb,var(--center-color,var(--accent)) 22%,transparent),rgba(139,152,255,.12));color:var(--text);border-color:color-mix(in srgb,var(--center-color,var(--accent)) 58%,var(--line));box-shadow:0 12px 26px color-mix(in srgb,var(--center-color,var(--accent)) 15%,transparent)}
.shift-settings-card,.shift-edit-card{width:min(1120px,96vw)}
.shift-edit-card{max-width:min(860px,96vw)}
.shift-time-row{min-width:0;grid-template-columns:repeat(3,minmax(0,1fr))!important;align-items:end}
.shift-time-row label,.shift-time-row input,.shift-time-row select,.shift-type-form-pro label,.shift-type-form-pro input,.shift-type-form-pro select{min-width:0;max-width:100%}
.shift-quick-popover{width:min(300px,88vw)}
.quick-pop-field{display:grid;gap:5px;font-size:11px;font-weight:900;color:var(--muted)}
.quick-pop-field span{padding-inline:2px}
.shift-quick-popover select:disabled,.shift-assign-form select:disabled{opacity:.58;cursor:not-allowed}
@media(max-width:900px){.pro-medical-center-form .form-two-col{grid-template-columns:1fr}.shift-type-filter-tabs{overflow:auto;flex-wrap:nowrap}.shift-type-filter-tab{white-space:nowrap}.shift-time-row{grid-template-columns:1fr!important}.shift-settings-card,.shift-edit-card{width:min(96vw,720px)}}


/* v86 shift modal inline management */
.shift-detail-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0 10px;flex-wrap:wrap}
.shift-detail-section-head h4{margin:0;font-size:1rem;color:var(--text)}
.shift-detail-rich-row{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:flex-start}
.shift-detail-rich-main h4{margin:0 0 6px}
.shift-detail-personnel-row{display:grid;gap:6px;margin-top:8px}
.shift-detail-personnel-row>div{display:flex;flex-wrap:wrap;gap:6px}
.shift-person-chip{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(108,92,231,.18);background:rgba(108,92,231,.08);border-radius:999px;padding:5px 9px;font-size:.78rem}
.shift-person-chip b{display:grid;place-items:center;width:18px;height:18px;border-radius:999px;background:rgba(108,92,231,.14)}
.shift-detail-row-actions{display:flex;flex-direction:column;gap:6px;align-items:stretch}
.shift-detail-inline-add{margin:12px 0;padding:12px;border:1px solid rgba(108,92,231,.14);background:rgba(255,255,255,.66);border-radius:18px}
.inline-shift-add-form{display:grid;grid-template-columns:minmax(150px,1fr) minmax(180px,1.3fr) auto;gap:10px;align-items:end;margin-top:8px}
.inline-shift-add-form label{display:grid;gap:6px;font-size:.8rem;color:var(--muted)}
.inline-shift-add-form select{width:100%;min-width:0;border:1px solid rgba(108,92,231,.16);border-radius:12px;padding:9px 10px;background:#fff;color:var(--text)}
.inline-shift-add-form.is-disabled{opacity:.72}
.grouped-shift-day-row{display:grid;gap:10px;align-items:stretch!important}
.grouped-shift-date{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.grouped-shift-items{display:grid;gap:8px;width:100%}
.grouped-shift-item{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;padding:9px;border:1px solid rgba(108,92,231,.12);border-radius:14px;background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(255,255,255,.7));border-right:4px solid var(--shift-color,#6c5ce7)}
.grouped-shift-item div{display:grid;gap:2px;min-width:0}
.grouped-shift-item small{color:var(--muted)}
.empty-day-add-row{display:grid;gap:10px!important;align-items:stretch!important}
.empty-day-add-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.detail-history-list .history-actions{display:flex;gap:6px;flex-wrap:wrap}
@media (max-width: 720px){
  .shift-detail-rich-row,.grouped-shift-item{grid-template-columns:1fr;}
  .shift-detail-row-actions{flex-direction:row;flex-wrap:wrap}
  .inline-shift-add-form{grid-template-columns:1fr;}
}

/* v87: per-assignment personnel management in selected day */
.shift-day-personnel-panel{
  margin-top:14px;
  border:1px solid rgba(102,217,255,.14);
  border-radius:24px;
  padding:14px;
  background:linear-gradient(145deg,rgba(102,217,255,.06),rgba(139,152,255,.045));
  box-shadow:0 14px 34px rgba(0,0,0,.08);
}
.shift-day-personnel-grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));}
.shift-personnel-assignment-card{
  border:1px solid color-mix(in srgb,var(--shift-color,#6c5ce7) 26%,rgba(255,255,255,.14));
  border-radius:22px;
  padding:12px;
  background:linear-gradient(135deg,color-mix(in srgb,var(--shift-color,#6c5ce7) 10%,transparent),rgba(255,255,255,.05));
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.035);
}
.shift-personnel-assignment-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;margin-bottom:10px;}
.shift-personnel-assignment-head .shift-table-code{border-color:color-mix(in srgb,var(--shift-color,#6c5ce7) 42%,var(--line));background:color-mix(in srgb,var(--shift-color,#6c5ce7) 15%,transparent);}
.shift-personnel-assignment-head strong{display:block;color:var(--text);font-weight:1000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.shift-personnel-assignment-head small{display:block;color:var(--muted);font-size:12px;margin-top:4px;}
.shift-personnel-assignment-head em{font-style:normal;font-size:11px;font-weight:950;color:var(--muted);border:1px solid rgba(255,255,255,.10);border-radius:999px;padding:6px 9px;background:rgba(255,255,255,.04);white-space:nowrap;}
.shift-personnel-assignment-card .shift-personnel-box{margin-top:0;box-shadow:none;background:rgba(255,255,255,.035);border-radius:18px;}
@media(max-width:720px){
  .shift-day-personnel-grid{grid-template-columns:1fr;}
  .shift-personnel-assignment-head{grid-template-columns:auto 1fr;}
  .shift-personnel-assignment-head em{grid-column:2;justify-self:start;}
}

/* v88: professional hours modal and non-refresh empty-day inline add */
.shift-stats-card{max-width:min(1080px,96vw)}
.shift-hour-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px}
.shift-hour-summary-card{border:1px solid rgba(255,255,255,.12);border-radius:18px;padding:14px 16px;background:linear-gradient(145deg,rgba(255,255,255,.07),rgba(255,255,255,.025));display:grid;gap:7px;box-shadow:0 12px 28px rgba(0,0,0,.08)}
.shift-hour-summary-card span{color:var(--muted);font-size:.82rem;font-weight:850}
.shift-hour-summary-card strong{font-size:1.22rem;color:var(--text)}
.shift-hour-summary-card.accent{border-color:rgba(102,217,255,.24);background:linear-gradient(135deg,rgba(102,217,255,.13),rgba(139,152,255,.08))}
.shift-hour-professional-layout{display:grid;gap:16px;max-height:62vh;overflow:auto;padding-inline-end:4px}
.shift-hour-block{display:grid;gap:10px}
.shift-hour-center-card{border:1px solid color-mix(in srgb,var(--center-color,#6c5ce7) 24%,var(--line));border-radius:22px;padding:14px;background:linear-gradient(145deg,color-mix(in srgb,var(--center-color,#6c5ce7) 10%,transparent),rgba(255,255,255,.035));box-shadow:0 14px 34px rgba(0,0,0,.08)}
.shift-hour-center-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.shift-hour-center-head .medical-center-color-dot{width:16px;height:16px;border-radius:999px;background:var(--center-color,#6c5ce7);box-shadow:0 0 0 6px color-mix(in srgb,var(--center-color,#6c5ce7) 15%,transparent)}
.shift-hour-center-head strong{display:block;font-size:1rem}
.shift-hour-center-head small{color:var(--muted);font-weight:850}
.compact-hours-table{max-height:280px;margin-bottom:10px}
.shift-hour-day-list{display:flex;flex-wrap:wrap;gap:8px}
.shift-hour-day-chip{display:inline-grid;gap:2px;border:1px solid color-mix(in srgb,var(--center-color,#6c5ce7) 18%,var(--line));background:rgba(255,255,255,.05);border-radius:14px;padding:8px 10px;min-width:120px}
.shift-hour-day-chip b{font-size:.78rem}.shift-hour-day-chip small{color:var(--muted);font-size:.74rem}
.shift-pass-hour-list{display:grid;gap:8px}
.shift-pass-hour-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid rgba(255,193,7,.18);border-radius:16px;padding:10px 12px;background:linear-gradient(135deg,rgba(255,193,7,.10),rgba(255,255,255,.035))}
.shift-pass-hour-row p{margin:3px 0 0;color:var(--muted);font-size:.8rem}.shift-pass-hour-row span{font-weight:1000;color:var(--text);white-space:nowrap}
.empty-day-add-row .empty-day-add-head span{color:var(--muted);font-weight:850}
@media(max-width:760px){.shift-hour-summary-grid{grid-template-columns:1fr}.shift-hour-professional-layout{max-height:68vh}.shift-pass-hour-row{align-items:flex-start;flex-direction:column}.compact-hours-table .shift-stats-table{min-width:520px}}

/* v89: shift empty-day previews + staff monthly schedule */
.empty-day-added-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin: 10px 0 2px;
}
.empty-day-added-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
    border: 1px solid color-mix(in srgb, var(--shift-color, #6c5ce7) 34%, rgba(255,255,255,.8));
    box-shadow: 0 10px 24px rgba(38, 26, 82, .08);
}
.empty-day-added-chip .shift-table-code {
    flex: 0 0 auto;
}
.empty-day-added-chip div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.empty-day-added-chip strong {
    font-size: .92rem;
    color: var(--text-color, #19162b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.empty-day-added-chip small {
    color: var(--muted-color, #736f85);
    font-size: .78rem;
}
.shift-hour-center-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: 15px;
    background: color-mix(in srgb, var(--center-color, #6c5ce7) 12%, rgba(255,255,255,.92));
    border: 1px solid color-mix(in srgb, var(--center-color, #6c5ce7) 24%, rgba(255,255,255,.75));
}
.shift-hour-center-total span {
    color: var(--muted-color, #736f85);
    font-size: .84rem;
}
.shift-hour-center-total strong {
    color: var(--text-color, #19162b);
    font-size: .96rem;
}
.shift-staff-schedule-panel {
    display: grid;
    gap: 14px;
}
.staff-schedule-center-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.shift-center-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(110, 95, 170, .2);
    background: rgba(255,255,255,.75);
    color: var(--text-color, #19162b);
    border-radius: 999px;
    padding: 8px 13px;
    cursor: pointer;
    font-weight: 800;
    transition: .18s ease;
}
.shift-center-tab span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--center-color, #6c5ce7);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--center-color, #6c5ce7) 16%, transparent);
}
.shift-center-tab:hover,
.shift-center-tab.active {
    border-color: color-mix(in srgb, var(--center-color, #6c5ce7) 55%, #fff);
    background: color-mix(in srgb, var(--center-color, #6c5ce7) 13%, #fff);
    transform: translateY(-1px);
}
.staff-schedule-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(110, 95, 170, .14);
    background: rgba(255,255,255,.62);
    border-radius: 18px;
}
.staff-schedule-meta strong { font-weight: 900; }
.staff-schedule-meta small { color: var(--muted-color, #736f85); }
.staff-schedule-table-wrap {
    overflow: auto;
    border-radius: 20px;
    border: 1px solid rgba(110, 95, 170, .15);
    background: rgba(255,255,255,.72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.staff-schedule-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    font-size: .82rem;
}
.staff-schedule-table th,
.staff-schedule-table td {
    border-bottom: 1px solid rgba(110, 95, 170, .1);
    border-left: 1px solid rgba(110, 95, 170, .08);
    padding: 7px;
    text-align: center;
    white-space: nowrap;
}
.staff-schedule-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(248, 246, 255, .96);
    backdrop-filter: blur(10px);
}
.staff-schedule-person {
    position: sticky;
    right: 0;
    z-index: 2;
    min-width: 170px;
    text-align: right !important;
    background: rgba(255,255,255,.96);
    box-shadow: -8px 0 18px rgba(38, 26, 82, .06);
}
.staff-schedule-person strong,
.staff-schedule-person small {
    display: block;
}
.staff-schedule-person small {
    color: var(--muted-color, #736f85);
    font-size: .72rem;
    margin-top: 2px;
}
.staff-day-head span,
.staff-day-head small {
    display: block;
}
.staff-day-head small {
    color: var(--muted-color, #736f85);
    font-size: .7rem;
}
.staff-schedule-cell {
    min-width: 94px;
    transition: .18s ease;
}
.staff-schedule-cell select {
    width: 86px;
    min-width: 86px;
    max-width: 86px;
    border-radius: 12px;
    padding: 6px 8px;
    border: 1px solid rgba(110, 95, 170, .18);
    background: rgba(255,255,255,.86);
    font: inherit;
    font-size: .76rem;
    cursor: pointer;
}
.staff-schedule-cell.has-shift {
    background: color-mix(in srgb, var(--shift-color, #6c5ce7) 10%, transparent);
}
.staff-schedule-cell.has-shift select {
    border-color: color-mix(in srgb, var(--shift-color, #6c5ce7) 40%, #fff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--shift-color, #6c5ce7) 10%, transparent);
}
.staff-schedule-cell.is-saving select {
    opacity: .55;
    cursor: progress;
}
@media (max-width: 700px) {
    .staff-schedule-person { min-width: 132px; }
    .staff-schedule-cell { min-width: 82px; }
    .staff-schedule-cell select { width: 74px; min-width: 74px; max-width: 74px; font-size: .72rem; }
    .empty-day-added-grid { grid-template-columns: 1fr; }
}

/* Study planner v90 */
.study-planner-grid { display:block; }
.study-shell { display:flex; flex-direction:column; gap:18px; width:100%; }
.study-hero { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:22px; border-radius:28px; background:linear-gradient(135deg, rgba(102,217,255,.14), rgba(139,152,255,.10)), var(--card-bg, rgba(255,255,255,.06)); border:1px solid rgba(255,255,255,.12); box-shadow:0 18px 45px rgba(0,0,0,.18); }
.study-hero h2 { margin:4px 0 8px; font-size:clamp(1.4rem, 2vw, 2.2rem); }
.study-hero-actions { display:flex; gap:10px; flex-wrap:wrap; }
.study-loading { padding:14px 18px; border-radius:18px; border:1px solid rgba(102,217,255,.24); background:rgba(102,217,255,.08); color:var(--text-color); }
.study-kpi-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:14px; }
.study-kpi { padding:16px; border-radius:22px; background:rgba(255,255,255,.065); border:1px solid rgba(255,255,255,.10); display:flex; flex-direction:column; gap:6px; min-height:112px; }
.study-kpi span, .study-kpi small { color:var(--muted-color); }
.study-kpi strong { font-size:1.45rem; color:var(--text-color); }
.study-main-grid { display:grid; grid-template-columns:1.15fr .85fr; gap:16px; align-items:start; }
.study-panel { padding:18px; border-radius:26px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.10); box-shadow:0 12px 30px rgba(0,0,0,.12); overflow:hidden; }
.study-panel-wide { grid-column:span 1; }
.study-panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.study-panel-head h3 { margin:4px 0 0; }
.study-panel-head > span { color:var(--muted-color); font-size:.9rem; }
.study-mini-form, .study-plan-form, .study-test-form, .study-goal-form { display:grid; gap:10px; margin-bottom:14px; }
.study-mini-form { grid-template-columns:repeat(2, minmax(0,1fr)); }
.study-mini-form button { grid-column:1 / -1; }
.study-plan-form { grid-template-columns:repeat(4, minmax(0,1fr)); align-items:end; }
.study-plan-form button { min-height:44px; }
.study-test-form { grid-template-columns:repeat(3, minmax(0,1fr)); align-items:end; }
.study-test-form button { grid-column:1 / -1; }
.study-goal-form { grid-template-columns:1.4fr 1fr 1fr .8fr auto; align-items:end; }
.study-mini-form label, .study-plan-form label, .study-test-form label { display:flex; flex-direction:column; gap:6px; color:var(--muted-color); font-size:.86rem; }
.study-mini-form input, .study-mini-form select, .study-plan-form input, .study-plan-form select, .study-test-form input, .study-test-form select, .study-goal-form input, .study-goal-form select { width:100%; min-height:42px; border-radius:15px; border:1px solid rgba(255,255,255,.12); background:rgba(8,13,25,.38); color:var(--text-color); padding:0 12px; outline:none; }
[data-theme="light"] .study-mini-form input, [data-theme="light"] .study-mini-form select, [data-theme="light"] .study-plan-form input, [data-theme="light"] .study-plan-form select, [data-theme="light"] .study-test-form input, [data-theme="light"] .study-test-form select, [data-theme="light"] .study-goal-form input, [data-theme="light"] .study-goal-form select { background:rgba(255,255,255,.82); border-color:rgba(15,23,42,.12); }
.study-subjects-strip { display:flex; flex-wrap:wrap; gap:10px; }
.study-subject-chip { --study-color:#66d9ff; border:1px solid color-mix(in srgb, var(--study-color) 45%, rgba(255,255,255,.18)); background:linear-gradient(135deg, color-mix(in srgb, var(--study-color) 18%, transparent), rgba(255,255,255,.05)); color:var(--text-color); border-radius:18px; padding:10px 12px; display:grid; grid-template-columns:auto 1fr; gap:3px 8px; align-items:center; cursor:pointer; transition:.18s ease; }
.study-subject-chip i { width:12px; height:12px; border-radius:999px; background:var(--study-color); box-shadow:0 0 0 4px color-mix(in srgb, var(--study-color) 18%, transparent); }
.study-subject-chip small { grid-column:2; color:var(--muted-color); }
.study-subject-chip.active { transform:translateY(-2px); background:linear-gradient(135deg, color-mix(in srgb, var(--study-color) 32%, transparent), rgba(255,255,255,.08)); box-shadow:0 12px 28px color-mix(in srgb, var(--study-color) 18%, transparent); }
.study-list { display:flex; flex-direction:column; gap:10px; }
.study-list.compact { gap:8px; }
.study-empty { padding:15px; border-radius:18px; background:rgba(255,255,255,.045); border:1px dashed rgba(255,255,255,.12); color:var(--muted-color); text-align:center; }
.study-topic-item, .study-plan-item, .study-review-item, .study-test-row, .study-goal-row { --study-color:#66d9ff; border-radius:18px; border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.055); padding:12px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.study-topic-item { border-color:color-mix(in srgb, var(--study-color) 30%, rgba(255,255,255,.1)); }
.study-topic-item strong, .study-plan-item strong, .study-review-item strong { display:block; }
.study-topic-item small, .study-plan-item small, .study-review-item small { color:var(--muted-color); }
.study-row-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.study-plan-main { display:flex; align-items:center; gap:10px; min-width:0; }
.study-plan-main i { width:13px; height:40px; border-radius:999px; background:var(--study-color); box-shadow:0 0 0 4px color-mix(in srgb, var(--study-color) 14%, transparent); flex:0 0 auto; }
.study-plan-item.is-done { opacity:.78; }
.study-plan-item.is-overdue { border-color:rgba(251,113,133,.35); background:rgba(251,113,133,.08); }
.study-status-pill { font-size:.78rem; padding:5px 8px; border-radius:999px; background:rgba(255,255,255,.08); color:var(--muted-color); }
.study-review-item { border-color:color-mix(in srgb, var(--study-color) 28%, rgba(255,255,255,.1)); }
.study-test-row b { padding:6px 10px; border-radius:999px; background:rgba(102,217,255,.12); color:#66d9ff; }
.study-goal-row { align-items:center; }
.study-mini-progress { flex:1; min-width:90px; height:8px; border-radius:999px; background:rgba(255,255,255,.09); overflow:hidden; }
.study-mini-progress i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#66d9ff,#8b98ff); }
.study-week-board { display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); gap:10px; }
.study-week-day { min-height:125px; border-radius:18px; padding:10px; background:rgba(255,255,255,.045); border:1px solid rgba(255,255,255,.10); display:flex; flex-direction:column; gap:6px; }
.study-week-day strong { color:var(--text-color); }
.study-week-day small, .study-week-day em { color:var(--muted-color); font-style:normal; font-size:.78rem; }
.study-week-day span { --study-color:#66d9ff; padding:6px 8px; border-radius:12px; background:color-mix(in srgb, var(--study-color) 15%, rgba(255,255,255,.04)); border:1px solid color-mix(in srgb, var(--study-color) 25%, transparent); font-size:.78rem; color:var(--text-color); }
@media (max-width: 1100px) { .study-kpi-grid { grid-template-columns:repeat(2, minmax(0,1fr)); } .study-main-grid { grid-template-columns:1fr; } .study-plan-form, .study-test-form, .study-goal-form { grid-template-columns:repeat(2, minmax(0,1fr)); } .study-week-board { grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .study-hero { flex-direction:column; align-items:stretch; } .study-kpi-grid, .study-mini-form, .study-plan-form, .study-test-form, .study-goal-form { grid-template-columns:1fr; } .study-week-board { grid-template-columns:1fr; } .study-topic-item, .study-plan-item, .study-review-item, .study-test-row, .study-goal-row { align-items:flex-start; flex-direction:column; } }

/* v92.1.0 — study planner display modes + shift request display settings */
.request-model-title-block{display:grid;gap:5px;min-width:0;}
.request-model-title-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.request-model-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.request-color-guide{display:flex;align-items:center;gap:7px;flex-wrap:wrap;}
.request-color-guide-item{display:inline-flex;align-items:center;gap:5px;border:1px solid color-mix(in srgb,var(--request-shift-color) 38%,rgba(255,255,255,.12));border-radius:999px;background:color-mix(in srgb,var(--request-shift-color) 13%,rgba(255,255,255,.05));padding:4px 8px;font-size:10px;color:var(--muted);}
.request-color-guide-item i{width:10px;height:10px;border-radius:999px;background:var(--request-shift-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--request-shift-color) 18%,transparent);}
.request-color-guide-item b{font-weight:1000;color:var(--text);}
.request-color-guide-item em{font-style:normal;color:var(--muted);max-width:120px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.request-model-day span.request-shift-badge.has-full-name{max-width:100%;grid-auto-flow:column;grid-template-columns:auto minmax(0,1fr);}
.request-model-day span.request-shift-badge.has-full-name em{display:inline!important;font-style:normal;font-size:9px;font-weight:800;color:var(--muted);max-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.request-display-settings-card{width:min(560px,94vw)!important;}
.request-display-settings-body{display:grid;gap:12px;}
.request-display-setting-row{display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid rgba(255,255,255,.10);border-radius:22px;background:rgba(255,255,255,.045);padding:14px;}
.request-display-setting-row strong{display:block;color:var(--text);font-size:14px;margin-bottom:4px;}
.request-display-setting-row small{display:block;color:var(--muted);font-size:12px;line-height:1.8;}
.request-toggle-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;user-select:none;}
.request-toggle-switch input{position:absolute;opacity:0;pointer-events:none;}
.request-toggle-switch span{width:58px;height:32px;border-radius:999px;position:relative;background:rgba(248,113,113,.22);border:1px solid rgba(248,113,113,.32);transition:.18s ease;}
.request-toggle-switch span i{position:absolute;top:4px;left:4px;width:22px;height:22px;border-radius:999px;background:#fff;box-shadow:0 5px 18px rgba(0,0,0,.25);transition:.18s ease;}
.request-toggle-switch b{font-size:12px;color:var(--muted);min-width:44px;}
.request-toggle-switch.is-on span{background:linear-gradient(135deg,rgba(34,197,94,.40),rgba(102,217,255,.30));border-color:rgba(34,197,94,.45);}
.request-toggle-switch.is-on span i{left:30px;}
.request-toggle-switch.is-on b{color:#86efac;}
.request-toggle-switch.is-off b{color:#fca5a5;}

.study-shell-modern{gap:18px;}
.study-hero-modern{position:relative;overflow:hidden;}
.study-hero-modern:after{content:"";position:absolute;inset:auto -8% -45% auto;width:240px;height:240px;border-radius:50%;background:radial-gradient(circle,rgba(102,217,255,.22),transparent 65%);pointer-events:none;}
.study-mode-panel{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start;}
.study-mode-panel .study-panel-wide,.study-books-panel,.study-course-manager-panel,.study-calendar-panel{grid-column:1 / -1;}
.study-book-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:14px;}
.study-book-card{--study-color:#66d9ff;position:relative;min-height:190px;border:1px solid color-mix(in srgb,var(--study-color) 40%,rgba(255,255,255,.14));border-radius:24px;background:linear-gradient(145deg,color-mix(in srgb,var(--study-color) 26%,rgba(255,255,255,.08)),rgba(255,255,255,.045));box-shadow:0 18px 38px rgba(0,0,0,.16), inset 8px 0 0 color-mix(in srgb,var(--study-color) 55%,rgba(255,255,255,.10));padding:18px 18px 14px;display:flex;flex-direction:column;align-items:flex-start;text-align:right;color:var(--text-color);cursor:pointer;transition:.2s ease;overflow:hidden;}
.study-book-card:before{content:"";position:absolute;inset:10px 14px auto auto;width:42px;height:4px;border-radius:999px;background:rgba(255,255,255,.24);box-shadow:0 11px 0 rgba(255,255,255,.14),0 22px 0 rgba(255,255,255,.10);}
.study-book-card:hover,.study-book-card.active{transform:translateY(-4px);box-shadow:0 24px 50px color-mix(in srgb,var(--study-color) 18%,rgba(0,0,0,.24)), inset 8px 0 0 color-mix(in srgb,var(--study-color) 70%,rgba(255,255,255,.10));}
.study-book-icon{font-size:30px;margin-bottom:22px;filter:drop-shadow(0 8px 18px rgba(0,0,0,.25));}
.study-book-card strong{font-size:17px;margin-bottom:7px;}
.study-book-card small{color:var(--muted-color);line-height:1.8;}
.study-book-card i{display:block;width:100%;height:8px;border-radius:999px;background:rgba(255,255,255,.12);overflow:hidden;margin-top:auto;}
.study-book-card i b{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--study-color),rgba(255,255,255,.7));}
.study-course-manager{display:grid;gap:14px;}
.study-course-manager-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;border:1px solid color-mix(in srgb,var(--study-color) 24%,rgba(255,255,255,.08));border-radius:22px;background:color-mix(in srgb,var(--study-color) 10%,rgba(255,255,255,.04));padding:14px;}
.study-course-manager-head h3{margin:4px 0;}
.study-chapter-list{display:grid;gap:10px;}
.study-chapter-item{border-right:4px solid var(--study-color);}
.study-form-actions{grid-column:1 / -1;display:flex;gap:8px;flex-wrap:wrap;}
.study-exam-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:end;}
.study-exam-form label{display:flex;flex-direction:column;gap:6px;color:var(--muted-color);font-size:.86rem;}
.study-exam-form input,.study-exam-form select,.study-exam-form textarea{width:100%;min-height:42px;border-radius:15px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 12px;outline:none;}
.study-exam-form textarea{padding:10px 12px;resize:vertical;}
.study-exam-form .study-exam-scope,.study-exam-form .study-exam-notes{grid-column:span 2;}
.study-exam-form button{min-height:44px;}
.study-exam-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px;}
.study-exam-card{--study-color:#66d9ff;border:1px solid color-mix(in srgb,var(--study-color) 32%,rgba(255,255,255,.10));border-radius:24px;background:linear-gradient(145deg,color-mix(in srgb,var(--study-color) 14%,rgba(255,255,255,.06)),rgba(255,255,255,.04));padding:14px;display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center;}
.study-exam-card.is-past{opacity:.65;filter:saturate(.7);}
.study-exam-count{width:70px;height:70px;border-radius:22px;background:color-mix(in srgb,var(--study-color) 20%,rgba(255,255,255,.07));border:1px solid color-mix(in srgb,var(--study-color) 38%,rgba(255,255,255,.12));display:grid;place-items:center;text-align:center;}
.study-exam-count strong{display:block;font-size:24px;color:var(--text-color);line-height:1;}
.study-exam-count span{font-size:11px;color:var(--muted-color);}
.study-exam-main h4{margin:0 0 6px;color:var(--text-color);}
.study-exam-main p,.study-exam-main small{display:block;margin:0;color:var(--muted-color);line-height:1.8;}
.study-exam-card .study-row-actions{grid-column:1 / -1;}
.study-calendar-weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;margin-bottom:8px;}
.study-calendar-weekdays span{border-radius:14px;background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.08);color:var(--muted-color);text-align:center;padding:8px;font-size:12px;}
.study-calendar-month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;}
.study-calendar-day{min-height:116px;border:1px solid rgba(255,255,255,.10);border-radius:18px;background:rgba(255,255,255,.04);padding:9px;display:flex;flex-direction:column;gap:6px;overflow:hidden;}
.study-calendar-day.empty{opacity:.25;}
.study-calendar-day.is-today,.study-calendar-week-cell.is-today{border-color:rgba(102,217,255,.38);box-shadow:0 0 0 1px rgba(102,217,255,.12),0 16px 32px rgba(102,217,255,.08);}
.study-calendar-day>strong{width:28px;height:28px;border-radius:11px;background:rgba(255,255,255,.07);display:grid;place-items:center;color:var(--text-color);font-size:12px;}
.study-cal-chip{--study-color:#66d9ff;display:block;border:1px solid color-mix(in srgb,var(--study-color) 30%,rgba(255,255,255,.10));border-radius:12px;background:color-mix(in srgb,var(--study-color) 15%,rgba(255,255,255,.04));color:var(--text-color);font-size:11px;line-height:1.5;padding:5px 7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.study-cal-chip.review{border-style:dashed;}
.study-cal-chip.exam{background:rgba(251,191,36,.12);border-color:rgba(251,191,36,.28);}
.study-calendar-week-board .study-cal-chip{white-space:normal;}
html[data-theme="light"] .study-exam-form input,html[data-theme="light"] .study-exam-form select,html[data-theme="light"] .study-exam-form textarea,body[data-theme="light"] .study-exam-form input,body[data-theme="light"] .study-exam-form select,body[data-theme="light"] .study-exam-form textarea{background:rgba(255,255,255,.86);border-color:rgba(15,23,42,.12);}
html[data-theme="light"] .study-book-card,body[data-theme="light"] .study-book-card,html[data-theme="light"] .study-exam-card,body[data-theme="light"] .study-exam-card,html[data-theme="light"] .study-calendar-day,body[data-theme="light"] .study-calendar-day{background:rgba(255,255,255,.82);border-color:rgba(15,23,42,.10);}
@media(max-width:900px){.study-mode-panel{grid-template-columns:1fr}.study-exam-form{grid-template-columns:1fr 1fr}.study-calendar-month-grid{grid-template-columns:repeat(7,minmax(84px,1fr));overflow:auto}.study-calendar-panel{overflow:auto}.request-model-head{flex-direction:column}.request-model-actions{justify-content:flex-start}.request-display-setting-row{align-items:flex-start;flex-direction:column}.request-toggle-switch span{flex:0 0 auto}}
@media(max-width:640px){.study-book-grid,.study-exam-grid{grid-template-columns:1fr}.study-exam-form,.study-exam-form .study-exam-scope,.study-exam-form .study-exam-notes{grid-template-columns:1fr;grid-column:auto}.study-calendar-month-grid{grid-template-columns:repeat(7,minmax(72px,1fr))}.study-calendar-day{min-height:96px;padding:6px}.request-color-guide-item em{max-width:88px}}

/* v92.2.0 — study subject modal + inline course manager */
.study-add-subject-btn{border-color:rgba(102,217,255,.28);background:rgba(102,217,255,.08);}
.study-book-grid-inline{align-items:start;}
.study-inline-manager{grid-column:1 / -1;border:1px solid color-mix(in srgb,var(--study-color,#66d9ff) 24%,rgba(255,255,255,.10));border-radius:26px;background:linear-gradient(145deg,color-mix(in srgb,var(--study-color,#66d9ff) 9%,rgba(255,255,255,.05)),rgba(255,255,255,.035));padding:14px;box-shadow:0 18px 42px rgba(0,0,0,.14);}
.study-book-category{display:inline-flex;align-items:center;gap:5px;border:1px solid color-mix(in srgb,var(--study-color) 36%,rgba(255,255,255,.14));border-radius:999px;background:color-mix(in srgb,var(--study-color) 15%,rgba(255,255,255,.06));color:var(--text-color);font-size:11px;font-weight:900;padding:4px 8px;margin:-8px 0 9px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.study-topic-accordion{border:1px solid color-mix(in srgb,var(--study-color) 24%,rgba(255,255,255,.10));border-radius:22px;background:rgba(255,255,255,.045);overflow:hidden;}
.study-topic-accordion summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 15px;cursor:pointer;color:var(--text-color);font-weight:1000;}
.study-topic-accordion summary::-webkit-details-marker{display:none;}
.study-topic-accordion summary span{display:inline-flex;align-items:center;gap:8px;}
.study-topic-accordion summary small{color:var(--muted-color);font-weight:700;font-size:12px;}
.study-topic-accordion[open] summary{border-bottom:1px solid rgba(255,255,255,.09);background:color-mix(in srgb,var(--study-color) 9%,rgba(255,255,255,.03));}
.study-topic-accordion .topic-form{padding:14px;margin:0;}
.study-subject-modal-card{width:min(820px,calc(100vw - 24px));max-height:calc(100vh - 36px);overflow:auto;}
.study-subject-modal-body{display:grid;gap:14px;}
.study-subject-modal-form{display:grid;gap:16px;}
.study-subject-modal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.study-subject-modal-form label,.study-modal-topic-row label{display:flex;flex-direction:column;gap:6px;color:var(--muted-color);font-size:.86rem;}
.study-subject-modal-form input,.study-subject-modal-form select,.study-modal-topic-row input,.study-modal-topic-row select{width:100%;min-height:42px;border-radius:15px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 12px;outline:none;}
.study-subject-modal-form input:focus,.study-subject-modal-form select:focus,.study-modal-topic-row input:focus,.study-modal-topic-row select:focus{border-color:rgba(102,217,255,.45);box-shadow:0 0 0 3px rgba(102,217,255,.12);}
.study-modal-chapters-head{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid rgba(255,255,255,.10);border-radius:20px;background:linear-gradient(135deg,rgba(102,217,255,.09),rgba(139,152,255,.06));padding:12px 14px;}
.study-modal-chapters-head strong{display:block;color:var(--text-color);}
.study-modal-chapters-head small{display:block;color:var(--muted-color);line-height:1.8;}
.study-modal-topic-list{display:grid;gap:10px;}
.study-modal-topic-row{position:relative;display:grid;grid-template-columns:1.2fr 1fr .72fr .9fr auto;gap:10px;align-items:end;border:1px solid rgba(255,255,255,.10);border-radius:20px;background:rgba(255,255,255,.045);padding:12px;}
.study-modal-topic-remove{align-self:end;width:42px;height:42px;border-color:rgba(251,113,133,.28);color:#fca5a5;background:rgba(251,113,133,.08);}
.study-modal-actions{justify-content:flex-end;}
html[data-theme="light"] .study-inline-manager,body[data-theme="light"] .study-inline-manager,html[data-theme="light"] .study-topic-accordion,body[data-theme="light"] .study-topic-accordion,html[data-theme="light"] .study-modal-topic-row,body[data-theme="light"] .study-modal-topic-row{background:rgba(255,255,255,.82);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .study-subject-modal-form input,html[data-theme="light"] .study-subject-modal-form select,html[data-theme="light"] .study-modal-topic-row input,html[data-theme="light"] .study-modal-topic-row select,body[data-theme="light"] .study-subject-modal-form input,body[data-theme="light"] .study-subject-modal-form select,body[data-theme="light"] .study-modal-topic-row input,body[data-theme="light"] .study-modal-topic-row select{background:rgba(255,255,255,.88);border-color:rgba(15,23,42,.13);}
@media(max-width:900px){.study-subject-modal-grid,.study-modal-topic-row{grid-template-columns:1fr 1fr}.study-modal-topic-remove{width:100%;grid-column:1 / -1}.study-topic-accordion summary{align-items:flex-start;flex-direction:column}.study-subject-modal-card{max-height:calc(100vh - 20px)}}
@media(max-width:640px){.study-subject-modal-grid,.study-modal-topic-row{grid-template-columns:1fr}.study-modal-chapters-head{align-items:stretch;flex-direction:column}.study-modal-actions{justify-content:stretch}.study-modal-actions .primary-btn,.study-modal-actions .ghost-btn{width:100%;}}

/* v92.3.0 — weekly study goals, reflections, daily logs, and fixed weekly schedule */
.study-week-overview{background:linear-gradient(135deg,rgba(102,217,255,.10),rgba(139,152,255,.07));}
.study-week-nav{display:flex;align-items:center;justify-content:space-between;gap:14px;}
.study-week-nav h3{margin:3px 0 6px;color:var(--text-color);}
.study-week-mini-stats{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px;}
.study-week-mini-stats span{display:inline-flex;gap:5px;align-items:center;border:1px solid rgba(255,255,255,.10);border-radius:999px;background:rgba(255,255,255,.055);padding:7px 10px;color:var(--muted-color);font-size:12px;}
.study-week-mini-stats b{color:var(--text-color);}
.study-week-goal-form{display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:12px;}
.study-week-goal-form input,.study-week-goal-row input,.study-week-reflection-form select,.study-week-reflection-form textarea,.study-day-log-card input,.study-day-log-card select,.study-day-log-card textarea,.study-day-activity-row input,.study-weekly-schedule-form input,.study-weekly-schedule-form select,.study-weekly-schedule-form textarea{width:100%;min-height:40px;border-radius:14px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 11px;outline:none;}
.study-week-reflection-form textarea,.study-day-log-card textarea,.study-weekly-schedule-form textarea{padding:10px 11px;resize:vertical;}
.study-week-goal-list{display:grid;gap:9px;}
.study-week-goal-row{display:grid;grid-template-columns:auto 1fr auto auto;gap:8px;align-items:center;border:1px solid rgba(255,255,255,.10);border-radius:18px;background:rgba(255,255,255,.045);padding:9px;}
.study-week-goal-row.is-done input[name="title"]{text-decoration:line-through;color:var(--muted-color);}
.study-check-line{display:inline-grid;place-items:center;cursor:pointer;}
.study-check-line input{position:absolute;opacity:0;pointer-events:none;}
.study-check-line span{width:28px;height:28px;border-radius:10px;border:1px solid rgba(102,217,255,.35);background:rgba(102,217,255,.08);position:relative;}
.study-check-line input:checked+span{background:linear-gradient(135deg,rgba(34,197,94,.65),rgba(102,217,255,.40));border-color:rgba(34,197,94,.55);}
.study-check-line input:checked+span:after{content:"✓";position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-weight:1000;}
.danger-icon{border-color:rgba(251,113,133,.26)!important;color:#fda4af!important;background:rgba(251,113,133,.08)!important;}
.study-week-reflection-form{display:grid;grid-template-columns:minmax(120px,180px) 1fr;gap:10px;align-items:end;}
.study-week-reflection-form label{display:flex;flex-direction:column;gap:6px;color:var(--muted-color);font-size:.86rem;}
.study-reflection-achievements{grid-column:span 1;}
.study-week-reflection-form .study-row-actions{grid-column:1 / -1;}
.study-day-log-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px;}
.study-day-log-card{border:1px solid rgba(255,255,255,.10);border-radius:24px;background:rgba(255,255,255,.04);padding:12px;display:grid;gap:11px;}
.study-day-log-head{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:9px;}
.study-day-log-head strong{color:var(--text-color);font-size:15px;}
.study-day-log-head small{color:var(--muted-color);}
.study-day-time-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.study-day-time-grid label,.study-day-note{display:flex;flex-direction:column;gap:6px;color:var(--muted-color);font-size:.82rem;}
.study-mood-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;}
.study-mood-option{display:grid;place-items:center;gap:3px;border:1px solid rgba(255,255,255,.10);border-radius:16px;background:rgba(255,255,255,.045);padding:7px 4px;cursor:pointer;transition:.16s ease;}
.study-mood-option input{position:absolute;opacity:0;pointer-events:none;}
.study-mood-option span{font-size:20px;line-height:1;}
.study-mood-option small{color:var(--muted-color);font-size:10px;}
.study-mood-option.is-active{border-color:rgba(102,217,255,.42);background:rgba(102,217,255,.12);box-shadow:0 0 0 3px rgba(102,217,255,.07);}
.study-mood-option.is-active small{color:var(--text-color);font-weight:900;}
.study-day-activities-head{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.study-day-activities-head strong{color:var(--text-color);font-size:13px;}
.study-day-activity-list{display:grid;gap:7px;}
.study-day-activity-row{display:grid;grid-template-columns:1fr 62px 62px auto;gap:6px;align-items:center;}
.study-day-activity-row input[data-activity-hours],.study-day-activity-row input[data-activity-minutes]{text-align:center;padding:0 4px;}
.study-weekly-schedule-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-items:end;}
.study-weekly-schedule-form label{display:flex;flex-direction:column;gap:6px;color:var(--muted-color);font-size:.86rem;}
.study-weekly-schedule-notes{grid-column:span 2;}
.study-weekly-schedule-form .study-row-actions{grid-column:1 / -1;justify-content:flex-end;}
.study-weekly-schedule-grid{display:grid;grid-template-columns:repeat(7,minmax(170px,1fr));gap:10px;overflow:auto;padding-bottom:4px;}
.study-weekly-schedule-day{border:1px solid rgba(255,255,255,.10);border-radius:22px;background:rgba(255,255,255,.04);padding:10px;min-height:190px;}
.study-weekly-schedule-day header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;}
.study-weekly-schedule-day header strong{color:var(--text-color);}
.study-weekly-schedule-day header span{border-radius:999px;background:rgba(255,255,255,.07);color:var(--muted-color);padding:3px 7px;font-size:11px;}
.study-weekly-schedule-list{display:grid;gap:9px;}
.study-weekly-schedule-list em{font-style:normal;color:var(--muted-color);font-size:12px;}
.study-weekly-schedule-card{--study-color:#66d9ff;border:1px solid color-mix(in srgb,var(--study-color) 34%,rgba(255,255,255,.10));border-radius:18px;background:linear-gradient(145deg,color-mix(in srgb,var(--study-color) 15%,rgba(255,255,255,.04)),rgba(255,255,255,.035));padding:10px;display:grid;gap:8px;}
.study-weekly-schedule-card strong{display:block;color:var(--text-color);margin-bottom:4px;}
.study-weekly-schedule-card small,.study-weekly-schedule-card p{display:block;margin:0;color:var(--muted-color);line-height:1.7;font-size:12px;}
.study-weekly-schedule-card .study-row-actions{justify-content:flex-start;}
html[data-theme="light"] .study-week-goal-row,body[data-theme="light"] .study-week-goal-row,html[data-theme="light"] .study-day-log-card,body[data-theme="light"] .study-day-log-card,html[data-theme="light"] .study-weekly-schedule-day,body[data-theme="light"] .study-weekly-schedule-day{background:rgba(255,255,255,.84);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .study-week-goal-form input,html[data-theme="light"] .study-week-goal-row input,html[data-theme="light"] .study-week-reflection-form select,html[data-theme="light"] .study-week-reflection-form textarea,html[data-theme="light"] .study-day-log-card input,html[data-theme="light"] .study-day-log-card select,html[data-theme="light"] .study-day-log-card textarea,html[data-theme="light"] .study-day-activity-row input,html[data-theme="light"] .study-weekly-schedule-form input,html[data-theme="light"] .study-weekly-schedule-form select,html[data-theme="light"] .study-weekly-schedule-form textarea,body[data-theme="light"] .study-week-goal-form input,body[data-theme="light"] .study-week-goal-row input,body[data-theme="light"] .study-week-reflection-form select,body[data-theme="light"] .study-week-reflection-form textarea,body[data-theme="light"] .study-day-log-card input,body[data-theme="light"] .study-day-log-card select,body[data-theme="light"] .study-day-log-card textarea,body[data-theme="light"] .study-day-activity-row input,body[data-theme="light"] .study-weekly-schedule-form input,body[data-theme="light"] .study-weekly-schedule-form select,body[data-theme="light"] .study-weekly-schedule-form textarea{background:rgba(255,255,255,.88);border-color:rgba(15,23,42,.13);}
@media(max-width:1100px){.study-weekly-schedule-form{grid-template-columns:repeat(2,minmax(0,1fr));}.study-weekly-schedule-grid{grid-template-columns:repeat(4,minmax(170px,1fr));}.study-week-nav{align-items:flex-start;flex-direction:column}.study-week-nav .ghost-btn{width:100%;}}
@media(max-width:720px){.study-week-goal-form,.study-week-goal-row,.study-week-reflection-form,.study-day-time-grid,.study-weekly-schedule-form{grid-template-columns:1fr;}.study-reflection-achievements,.study-weekly-schedule-notes{grid-column:auto}.study-day-activity-row{grid-template-columns:1fr 54px 54px auto}.study-mood-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.study-weekly-schedule-grid{grid-template-columns:1fr;overflow:visible}.study-week-reflection-form .study-row-actions,.study-weekly-schedule-form .study-row-actions{justify-content:stretch}.study-week-reflection-form .study-row-actions button,.study-weekly-schedule-form .study-row-actions button{width:100%;}}

/* Study planner v92.4 weekly layout refinements */
.study-week-hero-compact{align-items:center;}
.study-week-hero-compact .study-hero-copy{min-width:0;flex:1;}
.study-week-hero-copy{display:grid;gap:10px;}
.study-week-hero-title-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.study-week-hero-title-row h2{margin:0;font-size:clamp(1.18rem,1.8vw,1.72rem);line-height:1.6;}
.study-week-mini-stats-inline{margin-top:0;}
.study-calendar-week-layout{display:grid;gap:16px;}
.study-weekly-calendar-panel{overflow:hidden;}
.study-horizontal-scroll{overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;cursor:grab;overscroll-behavior-x:contain;scroll-snap-type:x proximity;padding-bottom:6px;}
.study-horizontal-scroll.drag-scroll-active{cursor:grabbing;user-select:none;}
.study-calendar-week-board{display:flex;grid-template-columns:none;gap:12px;min-width:100%;}
.study-calendar-week-board .study-calendar-week-cell{flex:0 0 240px;min-width:225px;scroll-snap-align:start;}
.study-week-day-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:4px;}
.study-week-day-top > div{display:grid;gap:3px;}
.study-day-add-btn{width:32px;height:32px;border-radius:12px;background:linear-gradient(135deg,rgba(102,217,255,.20),rgba(139,152,255,.14));border:1px solid rgba(102,217,255,.28);color:var(--text-color);font-weight:900;flex:0 0 auto;}
.study-day-add-btn:hover{transform:translateY(-1px);border-color:rgba(102,217,255,.48);box-shadow:0 10px 24px rgba(102,217,255,.12);}
.study-week-day-content{display:grid;gap:6px;}
.study-day-log-grid.study-horizontal-scroll{display:flex;grid-template-columns:none;gap:12px;align-items:stretch;}
.study-day-log-grid.study-horizontal-scroll .study-day-log-card{flex:0 0 315px;min-width:315px;scroll-snap-align:start;}
.study-week-two-column{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start;}
.study-plan-modal-card{width:min(760px,calc(100vw - 28px));max-height:min(86vh,760px);overflow:auto;}
.study-plan-modal-body{display:grid;gap:14px;}
.study-plan-modal-form{display:grid;gap:14px;}
.study-plan-modal-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.study-plan-modal-grid label,.study-plan-modal-notes{display:flex;flex-direction:column;gap:6px;color:var(--muted-color);font-size:.88rem;}
.study-plan-modal-grid input,.study-plan-modal-grid select,.study-plan-modal-notes textarea{width:100%;min-height:42px;border-radius:15px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 12px;outline:none;}
.study-plan-modal-notes textarea{padding:11px 12px;resize:vertical;}
.study-plan-date-box{border:1px solid rgba(255,255,255,.10);border-radius:20px;background:rgba(255,255,255,.045);padding:12px;}
.study-plan-date-box .date-fields-main{width:100%;}
html[data-theme="light"] .study-plan-date-box,body[data-theme="light"] .study-plan-date-box{background:rgba(255,255,255,.78);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .study-plan-modal-grid input,html[data-theme="light"] .study-plan-modal-grid select,html[data-theme="light"] .study-plan-modal-notes textarea,body[data-theme="light"] .study-plan-modal-grid input,body[data-theme="light"] .study-plan-modal-grid select,body[data-theme="light"] .study-plan-modal-notes textarea{background:rgba(255,255,255,.9);border-color:rgba(15,23,42,.13);}
@media(max-width:980px){.study-week-two-column{grid-template-columns:1fr;}.study-plan-modal-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.study-week-hero-compact{align-items:stretch;}.study-week-hero-title-row .ghost-btn{flex:1 1 120px;}.study-week-hero-title-row h2{order:-1;width:100%;}}
@media(max-width:640px){.study-calendar-week-board .study-calendar-week-cell{flex-basis:82vw;min-width:260px;}.study-day-log-grid.study-horizontal-scroll .study-day-log-card{flex-basis:84vw;min-width:265px;}.study-plan-modal-grid{grid-template-columns:1fr;}.study-week-hero-title-row{gap:8px;}.study-week-hero-title-row .ghost-btn{width:100%;}.study-hero-actions .primary-btn,.study-hero-actions .ghost-btn{width:100%;}}

/* v92.5.0 — smoother weekly study scrollers and study record timer modal */
.study-calendar-week-layout{grid-template-columns:1fr;}
.study-horizontal-scroll{scroll-snap-type:none;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;}
.study-calendar-week-board .study-calendar-week-cell,.study-day-log-grid.study-horizontal-scroll .study-day-log-card{scroll-snap-align:none;}
.study-horizontal-scroll.drag-scroll-active{scroll-behavior:auto;}
.study-day-add-btn{width:auto;min-width:74px;border-radius:999px;padding:0 10px;font-size:11px;gap:4px;}
.study-cal-chip.study-cal-chip-plan{width:100%;text-align:right;cursor:pointer;font-family:inherit;display:flex;align-items:flex-start;justify-content:space-between;gap:8px;}
.study-cal-chip.study-cal-chip-plan small{color:var(--muted-color);font-size:10px;white-space:nowrap;}
.study-cal-chip.study-cal-chip-plan.is-done{opacity:.72;text-decoration:none;}
.study-cal-chip.study-cal-chip-plan:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--study-color) 52%,rgba(255,255,255,.16));}
.study-plan-details-modal-card{max-width:min(920px,calc(100vw - 24px));width:920px;}
.study-plan-details-modal-body{display:grid;gap:14px;max-height:min(72vh,720px);overflow:auto;padding-inline-end:4px;}
.study-plan-details{display:grid;gap:14px;}
.study-plan-detail-summary{border:1px solid color-mix(in srgb,var(--study-color) 34%,rgba(255,255,255,.10));background:linear-gradient(135deg,color-mix(in srgb,var(--study-color) 18%,rgba(255,255,255,.05)),rgba(255,255,255,.035));border-radius:24px;padding:14px;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.study-plan-detail-summary h3{margin:4px 0 6px;font-size:20px;}
.study-plan-detail-summary p{margin:0;color:var(--muted-color);}
.study-status-pill.done{background:rgba(34,197,94,.18);border-color:rgba(34,197,94,.32);}
.study-plan-detail-progress{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.study-plan-detail-progress>div{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.04);border-radius:18px;padding:12px;display:grid;gap:5px;}
.study-plan-detail-progress span{color:var(--muted-color);font-size:12px;}
.study-plan-detail-progress strong{font-size:18px;}
.study-plan-detail-bar{height:10px;}
.study-plan-detail-notes,.study-plan-detail-timer,.study-plan-records-table-wrap{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.04);border-radius:22px;padding:13px;}
.study-plan-detail-notes p{margin:6px 0 0;color:var(--muted-color);line-height:1.9;}
.study-plan-detail-timer{display:grid;gap:12px;}
.study-detail-timer-display{direction:ltr;text-align:center;font-size:34px;font-weight:900;letter-spacing:2px;border-radius:20px;padding:14px;background:rgba(8,13,25,.42);border:1px solid rgba(255,255,255,.10);}
.study-plan-detail-timer label{display:grid;gap:6px;}
.study-plan-detail-timer input{width:100%;min-height:42px;border-radius:14px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 12px;outline:none;}
.study-panel-head.compact{margin-bottom:10px;}
.study-record-table-scroll{overflow:auto;border-radius:16px;border:1px solid rgba(255,255,255,.08);}
.study-record-table{width:100%;border-collapse:collapse;min-width:520px;}
.study-record-table th,.study-record-table td{padding:10px 12px;text-align:right;border-bottom:1px solid rgba(255,255,255,.08);font-size:13px;}
.study-record-table th{color:var(--muted-color);background:rgba(255,255,255,.04);}
.study-record-table tr:last-child td{border-bottom:0;}
.study-week-followup-grid{margin-top:0;}
html[data-theme="light"] .study-plan-detail-progress>div,body[data-theme="light"] .study-plan-detail-progress>div,html[data-theme="light"] .study-plan-detail-notes,body[data-theme="light"] .study-plan-detail-notes,html[data-theme="light"] .study-plan-detail-timer,body[data-theme="light"] .study-plan-detail-timer,html[data-theme="light"] .study-plan-records-table-wrap,body[data-theme="light"] .study-plan-records-table-wrap{background:rgba(255,255,255,.84);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .study-detail-timer-display,body[data-theme="light"] .study-detail-timer-display,html[data-theme="light"] .study-plan-detail-timer input,body[data-theme="light"] .study-plan-detail-timer input{background:rgba(255,255,255,.88);border-color:rgba(15,23,42,.13);}
@media(max-width:760px){.study-plan-detail-progress{grid-template-columns:1fr;}.study-plan-detail-summary{flex-direction:column;}.study-detail-timer-display{font-size:28px;}.study-plan-details-modal-card{width:calc(100vw - 18px);}}

/* v92.6.0 — study planner polish: accurate seconds, clean modal, drag sorting, display settings */
.study-horizontal-scroll{scroll-snap-type:none!important;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;touch-action:pan-y;}
.study-horizontal-scroll.drag-scroll-active{scroll-behavior:auto;}
.study-week-day-content{min-height:34px;}
.study-cal-chip.study-cal-chip-plan.is-done{opacity:.62;text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:color-mix(in srgb,var(--study-color) 70%,currentColor);}
.study-cal-chip.study-cal-chip-plan.is-dragging{opacity:.55;transform:scale(.98);box-shadow:0 12px 30px rgba(0,0,0,.22);}
.study-week-goal-row{grid-template-columns:auto minmax(0,1fr) auto;}
.study-week-goal-row input[data-study-week-goal-title]{transition:border-color .18s ease, box-shadow .18s ease;}
.study-week-goal-row input[data-study-week-goal-title]:focus{border-color:rgba(102,217,255,.45);box-shadow:0 0 0 3px rgba(102,217,255,.08);}
.study-day-activity-row{grid-template-columns:minmax(130px,1fr) 72px 72px auto;align-items:end;}
.study-day-activity-row label{display:grid;gap:4px;color:var(--muted-color);font-size:10px;}
.study-day-activity-row label span{padding-inline:2px;}
.study-activity-time-field input{text-align:center!important;}
.study-plan-details-modal-card{overflow:hidden;}
.study-plan-details-modal-body{max-height:min(72vh,720px);overflow-y:auto;overflow-x:hidden;padding-inline-end:4px;}
.study-plan-details{min-width:0;overflow-x:hidden;}
.study-plan-detail-summary,.study-plan-detail-progress,.study-plan-detail-timer,.study-plan-records-table-wrap{min-width:0;}
.study-record-table-scroll{overflow-x:hidden;overflow-y:visible;}
.study-record-table{min-width:0;width:100%;table-layout:fixed;}
.study-record-table th,.study-record-table td{white-space:normal;word-break:break-word;}
.study-week-display-modal-card{width:min(520px,calc(100vw - 28px));}
.study-week-display-modal-body{display:grid;gap:12px;}
.study-week-display-settings{display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.045);border-radius:22px;padding:14px;}
.study-week-display-settings strong{display:block;color:var(--text-color);margin-bottom:5px;}
.study-week-display-settings p{margin:0;line-height:1.8;}
.study-dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px;}
.study-dashboard-grid>div{border:1px solid rgba(255,255,255,.10);border-radius:18px;background:rgba(255,255,255,.045);padding:12px;display:grid;gap:4px;}
.study-dashboard-grid strong{color:var(--text-color);font-size:20px;}
.study-dashboard-grid span{color:var(--muted-color);font-size:12px;}
.study-dashboard-next{margin-top:12px;border-radius:18px;background:linear-gradient(135deg,rgba(102,217,255,.12),rgba(139,152,255,.08));border:1px solid rgba(102,217,255,.20);padding:12px;}
.study-dashboard-next strong{display:block;margin-bottom:4px;color:var(--text-color);}
.study-dashboard-next p{margin:0;color:var(--muted-color);line-height:1.8;}
html[data-theme="light"] .study-week-display-settings,body[data-theme="light"] .study-week-display-settings,html[data-theme="light"] .study-dashboard-grid>div,body[data-theme="light"] .study-dashboard-grid>div{background:rgba(255,255,255,.86);border-color:rgba(15,23,42,.10);}
@media(max-width:720px){.study-day-activity-row{grid-template-columns:1fr 72px 72px auto;}.study-week-display-settings{align-items:stretch;flex-direction:column}.study-week-display-settings .toggle-pill{align-self:flex-start}.study-dashboard-grid{grid-template-columns:1fr;}}
.study-week-display-settings .toggle-pill{min-width:92px;height:42px;border-radius:999px;border:1px solid rgba(148,163,184,.24);background:rgba(148,163,184,.14);color:var(--muted-color);display:inline-flex;align-items:center;gap:8px;justify-content:flex-start;padding:0 9px;font-family:inherit;cursor:pointer;transition:.18s ease;}
.study-week-display-settings .toggle-pill span{width:24px;height:24px;border-radius:50%;background:rgba(255,255,255,.76);box-shadow:0 4px 12px rgba(0,0,0,.18);transition:.18s ease;}
.study-week-display-settings .toggle-pill b{font-size:12px;}
.study-week-display-settings .toggle-pill.active{justify-content:flex-end;background:rgba(34,197,94,.18);border-color:rgba(34,197,94,.36);color:var(--text-color);}
.study-week-display-settings .toggle-pill.active span{background:#34d399;}

/* v92.7.0 — planner UI polish: clean daily cards, reliable mood buttons, one-scroll details modal */
.study-day-log-grid.study-horizontal-scroll{gap:16px;padding:2px 2px 8px;scroll-behavior:smooth;}
.study-day-log-grid.study-horizontal-scroll .study-day-log-card{flex:0 0 370px;min-width:370px;}
.study-day-log-card{gap:13px;padding:14px;border-radius:26px;background:linear-gradient(145deg,rgba(255,255,255,.065),rgba(255,255,255,.035));box-shadow:0 14px 34px rgba(0,0,0,.12);}
.study-day-log-head{border:0;padding:0;align-items:flex-start;}
.study-day-log-head>div{display:grid;gap:3px;}
.study-day-log-badge{font-size:11px;color:var(--muted-color);border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.055);border-radius:999px;padding:5px 9px;white-space:nowrap;}
.study-day-section{border:1px solid rgba(255,255,255,.09);background:rgba(8,13,25,.18);border-radius:20px;padding:11px;display:grid;gap:10px;}
.study-day-section-title{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;}
.study-day-section-title b{color:var(--text-color);font-size:13px;}
.study-day-section-title span{color:var(--muted-color);font-size:11px;line-height:1.6;text-align:left;}
.study-day-time-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;}
.study-day-time-grid label,.study-day-note{font-size:11px;}
.study-day-time-grid label span,.study-day-note span{font-weight:800;color:var(--muted-color);}
.study-mood-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;}
.study-mood-option{appearance:none;border:1px solid rgba(255,255,255,.10);border-radius:18px;background:rgba(255,255,255,.045);min-height:58px;color:var(--text-color);padding:7px 4px;cursor:pointer;transition:transform .16s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease;font-family:inherit;}
.study-mood-option:hover{transform:translateY(-1px);border-color:rgba(102,217,255,.32);background:rgba(102,217,255,.07);}
.study-mood-option.is-active{border-color:rgba(102,217,255,.55);background:linear-gradient(135deg,rgba(102,217,255,.18),rgba(139,152,255,.10));box-shadow:0 0 0 3px rgba(102,217,255,.08),0 12px 24px rgba(0,0,0,.12);}
.study-mood-option.is-active span{filter:drop-shadow(0 6px 12px rgba(102,217,255,.22));}
.study-day-activities-head{align-items:flex-start;}
.study-day-activities-head>div{display:grid;gap:3px;}
.study-day-activities-head small{color:var(--muted-color);font-size:11px;line-height:1.6;}
.study-day-activity-list{gap:9px;}
.study-day-activity-row{grid-template-columns:minmax(150px,1fr) 88px 92px auto;gap:8px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.035);border-radius:16px;padding:8px;}
.study-day-activity-row label{font-size:11px;}
.study-day-activity-row label span{font-weight:800;color:var(--muted-color);}
.study-duration-input{display:flex;align-items:center;gap:6px;border:1px solid rgba(255,255,255,.10);background:rgba(8,13,25,.32);border-radius:14px;padding:0 8px;min-height:40px;}
.study-duration-input input{border:0!important;background:transparent!important;min-height:36px!important;padding:0!important;box-shadow:none!important;}
.study-duration-input em{font-style:normal;color:var(--muted-color);font-size:10px;white-space:nowrap;}
.study-day-save-btn{min-height:42px;border-radius:16px;}
.study-cal-chip.study-cal-chip-plan{align-items:center;grid-template-columns:auto 1fr auto;}
.study-cal-chip-title{min-width:0;overflow:hidden;text-overflow:ellipsis;}
.study-cal-drag-handle{display:inline-grid;place-items:center;width:22px;height:28px;flex:0 0 22px;border-radius:10px;color:var(--muted-color);background:rgba(255,255,255,.06);font-style:normal;cursor:grab;letter-spacing:-2px;line-height:1;}
.study-cal-chip.study-cal-chip-plan:hover .study-cal-drag-handle{color:var(--text-color);background:color-mix(in srgb,var(--study-color) 18%,rgba(255,255,255,.08));}
.study-cal-chip.study-cal-chip-plan.is-dragging .study-cal-drag-handle{cursor:grabbing;}
.modal:not(.hidden)>.modal-card.study-plan-details-modal-card,.modal-card.study-plan-details-modal-card{width:min(920px,calc(100vw - 24px))!important;max-height:calc(100dvh - 32px)!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;}
.study-plan-details-modal-card .modal-head{flex:0 0 auto!important;margin-bottom:12px!important;}
.study-plan-details-modal-body{flex:1 1 auto;min-height:0;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;padding:0 2px 4px 0!important;overscroll-behavior:contain;}
.study-plan-details{overflow:visible!important;min-width:0;}
.study-record-table-scroll{overflow-x:hidden!important;overflow-y:visible!important;}
.study-record-table{min-width:0!important;width:100%!important;table-layout:fixed;}
.study-record-table th,.study-record-table td{white-space:normal;word-break:break-word;}
button.is-loading .btn-loading-spinner,.primary-btn.is-loading .btn-loading-spinner,.ghost-btn.is-loading .btn-loading-spinner{display:inline-block;}
html[data-theme="light"] .study-day-section,body[data-theme="light"] .study-day-section,html[data-theme="light"] .study-day-activity-row,body[data-theme="light"] .study-day-activity-row{background:rgba(255,255,255,.72);border-color:rgba(15,23,42,.09);}
html[data-theme="light"] .study-duration-input,body[data-theme="light"] .study-duration-input{background:rgba(255,255,255,.85);border-color:rgba(15,23,42,.12);}
@media(max-width:720px){.study-day-log-grid.study-horizontal-scroll .study-day-log-card{flex-basis:86vw;min-width:280px;}.study-day-time-grid{grid-template-columns:1fr;}.study-mood-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.study-day-activity-row{grid-template-columns:1fr 1fr;}.study-day-activity-row .danger-icon{grid-column:1 / -1;width:100%;}.study-day-section-title{flex-direction:column}.study-day-section-title span{text-align:right}.study-plan-details-modal-card .modal-head h3{font-size:22px!important;}}


/* v92.8.0 — focused fixes: reliable study-record saving + cleaner daily log cards */
.study-day-log-grid.study-horizontal-scroll{
    align-items:stretch!important;
    gap:18px!important;
    padding:4px 4px 10px!important;
}
.study-day-log-grid.study-horizontal-scroll .study-day-log-card{
    flex:0 0 430px!important;
    min-width:430px!important;
    max-width:430px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    align-self:stretch!important;
}
.study-day-log-card,
.study-day-log-card *,
.study-day-section,
.study-day-activity-row,
.study-day-activity-row *{
    box-sizing:border-box;
    min-width:0;
}
.study-day-section{overflow:hidden!important;}
.study-day-section-title{display:grid!important;grid-template-columns:1fr;gap:3px!important;}
.study-day-section-title span{text-align:right!important;}
.study-day-time-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
.study-mood-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;}
.study-mood-option{width:100%;display:grid;place-items:center;gap:3px;}
.study-day-activity-row{
    grid-template-columns:repeat(2,minmax(0,1fr)) auto!important;
    align-items:end!important;
    overflow:hidden!important;
}
.study-day-activity-row .study-activity-title-field{grid-column:1 / -1!important;}
.study-day-activity-row .danger-icon{width:38px;height:40px;align-self:end;}
.study-duration-input{width:100%;overflow:hidden;}
.study-duration-input input{width:100%!important;min-width:0!important;}
.study-day-note textarea{width:100%;max-width:100%;}
.study-plan-details-modal:not(.hidden){overflow:hidden!important;}
.study-plan-details-modal:not(.hidden) > .modal-card.study-plan-details-modal-card{
    overflow:hidden!important;
    scrollbar-gutter:auto!important;
    display:flex!important;
    flex-direction:column!important;
}
.study-plan-details-modal-body{
    overflow-y:auto!important;
    overflow-x:hidden!important;
    scrollbar-gutter:stable!important;
}
.study-detail-notice{border-radius:18px;padding:10px 12px;font-size:13px;font-weight:800;line-height:1.8;border:1px solid rgba(255,255,255,.10);}
.study-detail-notice.success{background:rgba(34,197,94,.12);border-color:rgba(34,197,94,.24);color:#86efac;}
.study-detail-notice.error{background:rgba(248,113,113,.12);border-color:rgba(248,113,113,.28);color:#fecaca;}
@media(max-width:720px){
    .study-day-log-grid.study-horizontal-scroll .study-day-log-card{flex-basis:88vw!important;min-width:300px!important;max-width:88vw!important;}
    .study-day-time-grid{grid-template-columns:1fr!important;}
    .study-mood-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
    .study-day-activity-row{grid-template-columns:1fr 1fr!important;}
    .study-day-activity-row .danger-icon{grid-column:1 / -1!important;width:100%!important;}
}

/* v92.9.0 — smoother daily drag, compact non-study activities, edit plan modal + monthly reorder */
.study-day-log-grid.study-horizontal-scroll{
    scroll-behavior:auto!important;
    cursor:grab;
    will-change:scroll-position;
    touch-action:pan-y;
}
.study-day-log-grid.study-horizontal-scroll.drag-scroll-active{cursor:grabbing;scroll-behavior:auto!important;}
.study-day-log-grid.study-horizontal-scroll .study-day-log-card{
    flex:0 0 440px!important;
    min-width:440px!important;
    max-width:440px!important;
}
.study-day-activity-composer{
    display:grid;
    grid-template-columns:minmax(0,1fr) 74px 78px auto;
    gap:8px;
    align-items:end;
    border:1px solid rgba(102,217,255,.14);
    background:linear-gradient(135deg,rgba(102,217,255,.08),rgba(255,255,255,.035));
    border-radius:18px;
    padding:9px;
}
.study-day-activity-composer label{display:grid;gap:5px;font-size:11px;color:var(--muted-color);font-weight:800;}
.study-day-activity-composer input{width:100%;min-width:0;}
.study-day-activity-composer .primary-btn{height:40px;border-radius:14px;white-space:nowrap;}
.study-day-activity-list.compact{display:grid;gap:7px;min-height:0;}
.study-day-activity-empty{
    border:1px dashed rgba(255,255,255,.12);
    border-radius:15px;
    padding:9px 10px;
    color:var(--muted-color);
    font-size:12px;
    text-align:center;
    background:rgba(255,255,255,.025);
}
.study-day-activity-row.compact{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:8px!important;
    padding:8px 9px!important;
    min-height:48px;
    border-radius:16px!important;
    background:rgba(255,255,255,.045)!important;
}
.study-day-activity-summary{display:grid;gap:2px;min-width:0;}
.study-day-activity-summary strong{font-size:12px;color:var(--text-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.study-day-activity-summary small{font-size:11px;color:var(--muted-color);}
.study-day-activity-row.compact .study-row-actions{gap:5px;flex-wrap:nowrap;}
.study-day-activity-row.compact .tiny-btn{min-height:32px;padding:0 8px;border-radius:12px;font-size:11px;}
.danger-text{color:#fecaca!important;border-color:rgba(248,113,113,.24)!important;background:rgba(248,113,113,.08)!important;}
.study-plan-detail-edit-btn{align-self:flex-start;border-color:rgba(102,217,255,.28)!important;background:rgba(102,217,255,.10)!important;}
.study-month-day-content{display:grid;gap:6px;min-height:38px;}
.study-calendar-day .study-cal-chip-plan{cursor:pointer;}
.study-calendar-day .study-cal-chip-plan[draggable="true"] .study-cal-drag-handle{opacity:1;}
.study-calendar-day .study-cal-chip-plan.is-dragging{opacity:.55;transform:scale(.98);}
@media(max-width:720px){
    .study-day-log-grid.study-horizontal-scroll .study-day-log-card{flex-basis:88vw!important;min-width:300px!important;max-width:88vw!important;}
    .study-day-activity-composer{grid-template-columns:1fr 1fr;}
    .study-day-activity-composer .study-activity-title-field{grid-column:1 / -1;}
    .study-day-activity-composer .primary-btn{grid-column:1 / -1;width:100%;}
    .study-day-activity-row.compact{grid-template-columns:1fr!important;}
    .study-day-activity-row.compact .study-row-actions{justify-content:stretch;}
    .study-day-activity-row.compact .study-row-actions .tiny-btn{flex:1;}
}

/* v92.10.0 — monthly study calendar day details + display settings */
.study-calendar-month-layout .study-calendar-panel{overflow:visible;}
.study-calendar-day[data-open-study-month-day]{cursor:pointer;transition:border-color .18s ease, background .18s ease, transform .18s ease;}
.study-calendar-day[data-open-study-month-day]:hover{border-color:rgba(102,217,255,.28);background:rgba(102,217,255,.055);transform:translateY(-1px);}
.study-calendar-day[data-open-study-month-day]:focus-visible{outline:0;box-shadow:0 0 0 3px rgba(102,217,255,.18);}
.study-cal-chip-title{display:inline;min-width:0;}
.study-month-day-modal-card{width:min(760px,calc(100vw - 28px));max-height:calc(100vh - 36px);overflow:hidden;}
.study-month-day-modal-body{max-height:min(74vh,720px);overflow-y:auto;overflow-x:hidden;padding-inline-end:4px;}
.study-month-day-details{display:grid;gap:14px;min-width:0;}
.study-month-day-summary{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;border:1px solid rgba(102,217,255,.20);background:linear-gradient(135deg,rgba(102,217,255,.13),rgba(139,152,255,.08));border-radius:24px;padding:16px;}
.study-month-day-summary h3{margin:4px 0 6px;}
.study-month-day-summary p{margin:0;line-height:1.8;}
.study-month-day-list{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.045);border-radius:24px;padding:14px;min-width:0;}
.study-month-day-plan-list,.study-month-day-side-list{display:grid;gap:9px;min-width:0;}
.study-month-day-plan{--study-color:#66d9ff;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;text-align:right;border:1px solid color-mix(in srgb,var(--study-color) 30%,rgba(255,255,255,.10));background:linear-gradient(135deg,color-mix(in srgb,var(--study-color) 13%,rgba(255,255,255,.045)),rgba(255,255,255,.035));border-radius:18px;padding:11px 12px;color:var(--text-color);font-family:inherit;cursor:pointer;transition:.18s ease;}
.study-month-day-plan:hover{transform:translateY(-1px);box-shadow:0 12px 26px color-mix(in srgb,var(--study-color) 12%,rgba(0,0,0,.20));}
.study-month-day-plan i{width:12px;height:34px;border-radius:999px;background:var(--study-color);box-shadow:0 0 0 4px color-mix(in srgb,var(--study-color) 16%,transparent);}
.study-month-day-plan span{display:grid;gap:3px;min-width:0;}
.study-month-day-plan strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.study-month-day-plan small{color:var(--muted-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.study-month-day-plan b{border-radius:999px;padding:5px 8px;background:rgba(255,255,255,.08);color:var(--muted-color);font-size:11px;white-space:nowrap;}
.study-month-day-plan.is-done{opacity:.68;}
.study-month-day-plan.is-done strong{text-decoration:line-through;text-decoration-thickness:2px;}
.study-month-day-side-item{border-radius:16px;border:1px solid rgba(255,255,255,.09);background:rgba(255,255,255,.04);padding:10px 12px;color:var(--text-color);font-size:13px;line-height:1.8;}
.study-month-day-side-item.exam{border-color:rgba(251,191,36,.24);background:rgba(251,191,36,.08);}
.study-month-day-side-item.review{border-color:rgba(102,217,255,.22);background:rgba(102,217,255,.07);}
html[data-theme="light"] .study-month-day-list,body[data-theme="light"] .study-month-day-list,html[data-theme="light"] .study-month-day-side-item,body[data-theme="light"] .study-month-day-side-item{background:rgba(255,255,255,.86);border-color:rgba(15,23,42,.10);}
@media(max-width:680px){.study-month-day-summary{flex-direction:column}.study-month-day-summary .primary-btn{width:100%;}.study-month-day-plan{grid-template-columns:auto minmax(0,1fr);}.study-month-day-plan b{grid-column:2;justify-self:start}.study-month-day-modal-card{width:calc(100vw - 18px);}.study-month-day-modal-body{max-height:76vh;}}

/* v92.11.0 — subject topic modals, weekly fixed board in calendar, performance table */
.study-manager-under-books{margin-top:14px;display:block!important;}
.study-books-panel .study-book-grid-inline{margin-bottom:0;}
.study-topic-item .study-row-actions .is-soft-success{border-color:rgba(34,197,94,.25)!important;background:rgba(34,197,94,.09)!important;color:#bbf7d0!important;}
.study-topic-edit-grid{margin-bottom:14px;}
.study-topic-modal-form{display:grid;gap:14px;}
.study-topic-records-modal{display:grid;gap:14px;}
.study-topic-records-hero{border:1px solid color-mix(in srgb,var(--study-color) 30%,rgba(255,255,255,.10));background:linear-gradient(135deg,color-mix(in srgb,var(--study-color) 14%,rgba(255,255,255,.04)),rgba(255,255,255,.035));border-radius:24px;padding:16px;}
.study-topic-records-hero h3{margin:4px 0 6px;}
.study-topic-records-hero p{margin:0;line-height:1.8;}
.study-weekly-schedule-board.study-weekly-schedule-compact{overflow:hidden;}
.study-weekly-schedule-board .study-panel-head p{margin:5px 0 0;line-height:1.8;}
.study-weekly-schedule-grid.study-horizontal-scroll{display:flex!important;grid-template-columns:none!important;gap:12px;overflow-x:auto;overflow-y:hidden;padding:4px 4px 10px;cursor:grab;scroll-behavior:auto;}
.study-weekly-schedule-grid.study-horizontal-scroll.drag-scroll-active{cursor:grabbing;}
.study-weekly-schedule-grid.study-horizontal-scroll .study-weekly-schedule-day{flex:0 0 245px;min-width:245px;max-width:245px;}
.study-weekly-schedule-day header{align-items:flex-start;}
.study-weekly-schedule-day header .study-row-actions{gap:6px;justify-content:flex-end;}
.study-weekly-schedule-day .study-day-add-btn{width:auto;min-width:76px;border-radius:14px;padding:0 9px;font-size:11px;}
.study-weekly-schedule-modal-form{display:grid;gap:14px;margin:0;}
.study-weekly-schedule-modal-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start;}
.study-weekly-schedule-modal-grid label{display:flex;flex-direction:column;gap:7px;color:var(--muted-color);font-size:.86rem;font-weight:800;}
.study-weekly-schedule-modal-grid input,.study-weekly-schedule-modal-grid select,.study-weekly-schedule-modal-grid textarea{width:100%;min-height:42px;border-radius:15px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 12px;outline:none;}
.study-weekly-schedule-modal-grid textarea{padding:10px 12px;resize:vertical;}
.study-weekly-title-field,.study-weekly-schedule-notes{grid-column:span 2;}
.study-performance-panel{overflow:hidden;}
.study-performance-table-wrap{overflow:auto;border-radius:22px;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.035);}
.study-performance-table{width:100%;min-width:720px;border-collapse:separate;border-spacing:0;}
.study-performance-table th,.study-performance-table td{padding:12px 14px;border-bottom:1px solid rgba(255,255,255,.08);text-align:right;white-space:nowrap;}
.study-performance-table thead th{position:sticky;top:0;background:rgba(20,27,45,.96);color:var(--text-color);z-index:1;}
.study-performance-table tbody th{color:var(--text-color);font-weight:900;}
.study-performance-table tbody tr:hover{background:rgba(102,217,255,.055);}
.study-performance-table tbody tr:last-child th,.study-performance-table tbody tr:last-child td{border-bottom:0;}
.study-month-day-content .study-cal-chip-plan .study-cal-chip-title{white-space:normal;line-height:1.5;}
.study-month-day-content .study-cal-chip-plan small{display:block;margin-inline-start:30px;}
html[data-theme="light"] .study-topic-records-hero,body[data-theme="light"] .study-topic-records-hero,html[data-theme="light"] .study-performance-table-wrap,body[data-theme="light"] .study-performance-table-wrap{background:rgba(255,255,255,.84);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .study-weekly-schedule-modal-grid input,html[data-theme="light"] .study-weekly-schedule-modal-grid select,html[data-theme="light"] .study-weekly-schedule-modal-grid textarea,body[data-theme="light"] .study-weekly-schedule-modal-grid input,body[data-theme="light"] .study-weekly-schedule-modal-grid select,body[data-theme="light"] .study-weekly-schedule-modal-grid textarea{background:rgba(255,255,255,.88);border-color:rgba(15,23,42,.13);}
html[data-theme="light"] .study-performance-table thead th,body[data-theme="light"] .study-performance-table thead th{background:rgba(248,250,252,.98);}
@media(max-width:780px){.study-weekly-schedule-modal-grid{grid-template-columns:1fr}.study-weekly-title-field,.study-weekly-schedule-notes{grid-column:auto}.study-weekly-schedule-grid.study-horizontal-scroll .study-weekly-schedule-day{flex-basis:82vw;min-width:280px;max-width:82vw}.study-performance-table{min-width:640px}.study-topic-item{align-items:flex-start;flex-direction:column}.study-topic-item .study-row-actions{justify-content:flex-start}}

/* v92.12 planner polish */
.study-weekly-schedule-modal-form.polished{grid-template-columns:1fr!important;gap:16px!important;}
.study-weekly-modal-hero{border:1px solid rgba(255,255,255,.10);border-radius:22px;padding:14px 16px;background:linear-gradient(135deg,rgba(102,217,255,.13),rgba(255,255,255,.035));}
.study-weekly-modal-hero h3{margin:4px 0 6px;color:var(--text-color);font-size:22px;}
.study-weekly-modal-hero p{margin:0;line-height:1.8;}
.study-weekly-time-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px;grid-column:span 2;}
.study-weekly-time-pair label{display:flex;flex-direction:column;gap:7px;color:var(--muted-color);font-size:.86rem;font-weight:800;}
.study-topic-records-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;}
.study-topic-records-total{white-space:nowrap;border-radius:999px;padding:8px 12px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.10);color:var(--text-color);font-size:13px;}
.study-topic-item .study-row-actions{flex-wrap:wrap;}
.study-topic-item .is-soft-success{border-color:rgba(34,197,94,.28)!important;background:rgba(34,197,94,.10)!important;color:#86efac!important;}
.study-calendar-month-grid .study-cal-chip-title{display:block;white-space:normal;line-height:1.55;}
.study-calendar-month-grid .study-cal-chip small{display:block;margin-top:2px;}
@media(max-width:780px){.study-weekly-time-pair{grid-column:auto;grid-template-columns:1fr}.study-topic-records-hero{flex-direction:column}.study-topic-records-total{white-space:normal}}

/* v92.13.0 — study subject/category polish, topic record filters and modal flow */
.study-topic-item .study-row-actions .is-soft-success,
.study-topic-item .is-soft-success{
    border-color:rgba(34,197,94,.65)!important;
    background:linear-gradient(135deg,rgba(34,197,94,.95),rgba(21,128,61,.92))!important;
    color:#052e16!important;
    box-shadow:0 10px 22px rgba(34,197,94,.18)!important;
    font-weight:950!important;
}
html[data-theme="light"] .study-topic-item .study-row-actions .is-soft-success,
body[data-theme="light"] .study-topic-item .study-row-actions .is-soft-success,
html[data-theme="light"] .study-topic-item .is-soft-success,
body[data-theme="light"] .study-topic-item .is-soft-success{
    background:linear-gradient(135deg,#dcfce7,#bbf7d0)!important;
    border-color:#22c55e!important;
    color:#14532d!important;
    box-shadow:0 10px 22px rgba(34,197,94,.12)!important;
}
.study-subject-category-field{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end;min-width:0;}
.study-subject-category-field label{min-width:0;}
.study-category-manager-btn{height:42px;border-radius:15px;white-space:nowrap;padding:0 12px;}
.modal.modal-on-top{z-index:10050!important;}
.study-modal-topic-composer{display:grid;grid-template-columns:minmax(170px,1.25fr) minmax(140px,1fr) 92px 130px auto;gap:9px;align-items:end;border:1px solid rgba(102,217,255,.15);background:linear-gradient(135deg,rgba(102,217,255,.08),rgba(255,255,255,.035));border-radius:20px;padding:10px;}
.study-modal-topic-composer label{display:grid;gap:6px;color:var(--muted-color);font-size:12px;font-weight:850;}
.study-modal-topic-composer input,.study-modal-topic-composer select{width:100%;min-width:0;min-height:40px;border-radius:14px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 11px;outline:none;}
.study-modal-topic-composer .primary-btn{height:40px;border-radius:14px;white-space:nowrap;}
.study-modal-topic-list.compact{display:grid;gap:8px;}
.study-modal-topic-row-compact{grid-template-columns:minmax(0,1fr) auto!important;}
.study-modal-topic-row-compact .study-row-actions{display:flex;gap:6px;flex-wrap:nowrap;}
.study-topic-edit-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;border:1px solid color-mix(in srgb,var(--study-color) 30%,rgba(255,255,255,.10));background:linear-gradient(135deg,color-mix(in srgb,var(--study-color) 15%,rgba(255,255,255,.04)),rgba(255,255,255,.035));border-radius:24px;padding:16px;}
.study-topic-edit-hero h3{margin:4px 0 6px;color:var(--text-color);font-size:22px;}
.study-topic-edit-hero p{margin:0;line-height:1.8;}
.study-topic-edit-hero>span{border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.07);border-radius:999px;padding:7px 11px;color:var(--muted-color);font-size:12px;white-space:nowrap;}
.modern-topic-edit-grid .study-topic-title-field{grid-column:span 2;}
.study-topic-records-hero-actions{display:grid;gap:8px;justify-items:end;}
.study-topic-record-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.04);border-radius:20px;padding:12px;}
.study-topic-record-filters label{display:grid;gap:6px;color:var(--muted-color);font-size:12px;font-weight:850;}
.study-topic-record-filters select,.study-manual-record-grid input,.study-topic-record-entry-form input{width:100%;min-height:40px;border-radius:14px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 11px;outline:none;}
.study-topic-record-entry-form{display:grid;gap:14px;}
.study-manual-record-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.study-manual-record-grid label{display:grid;gap:6px;color:var(--muted-color);font-size:12px;font-weight:850;}
html[data-theme="light"] .study-modal-topic-composer,
body[data-theme="light"] .study-modal-topic-composer,
html[data-theme="light"] .study-topic-edit-hero,
body[data-theme="light"] .study-topic-edit-hero,
html[data-theme="light"] .study-topic-record-filters,
body[data-theme="light"] .study-topic-record-filters{background:rgba(255,255,255,.86);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .study-modal-topic-composer input,
html[data-theme="light"] .study-modal-topic-composer select,
html[data-theme="light"] .study-topic-record-filters select,
html[data-theme="light"] .study-manual-record-grid input,
html[data-theme="light"] .study-topic-record-entry-form input,
body[data-theme="light"] .study-modal-topic-composer input,
body[data-theme="light"] .study-modal-topic-composer select,
body[data-theme="light"] .study-topic-record-filters select,
body[data-theme="light"] .study-manual-record-grid input,
body[data-theme="light"] .study-topic-record-entry-form input{background:rgba(255,255,255,.9);border-color:rgba(15,23,42,.13);}
.study-mood-option.is-active{position:relative;}
.study-mood-option.is-active::after{content:'×';position:absolute;top:5px;left:7px;width:16px;height:16px;display:grid;place-items:center;border-radius:999px;background:rgba(248,113,113,.18);color:#fecaca;font-size:12px;font-weight:1000;}
@media(max-width:840px){.study-modal-topic-composer{grid-template-columns:1fr 1fr}.study-modal-topic-composer .study-topic-title-draft{grid-column:1 / -1}.study-modal-topic-composer .primary-btn{grid-column:1 / -1;width:100%}.modern-topic-edit-grid .study-topic-title-field{grid-column:auto}.study-subject-category-field{grid-template-columns:1fr}.study-category-manager-btn{width:100%}.study-topic-records-hero-actions{justify-items:stretch}.study-topic-record-filters{grid-template-columns:1fr}.study-manual-record-grid{grid-template-columns:1fr}.study-topic-edit-hero{flex-direction:column}.study-topic-edit-hero>span{white-space:normal}.study-modal-topic-row-compact{grid-template-columns:1fr!important}.study-modal-topic-row-compact .study-row-actions{justify-content:stretch}.study-modal-topic-row-compact .study-row-actions .tiny-btn{flex:1}}

/* v92.14 study planner polish: subject modal, topic records, record timer */
.study-subject-modal-card{width:min(980px,calc(100vw - 24px))!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;}
.study-subject-modal-card .modal-head{flex:0 0 auto;}
.study-subject-modal-body{overflow-y:auto!important;overflow-x:hidden!important;max-height:calc(100dvh - 170px);padding-inline-end:4px;}
.study-subject-modal-form,.study-subject-modal-form *{min-width:0;box-sizing:border-box;}
.study-subject-category-field{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end;}
.study-subject-category-manager{display:grid;gap:14px;}
.study-subject-category-chips{display:flex;flex-wrap:wrap;gap:8px;padding:10px;border:1px solid rgba(255,255,255,.10);border-radius:20px;background:rgba(255,255,255,.04);}
.study-subject-category-chip{border:1px solid rgba(102,217,255,.22);background:rgba(102,217,255,.10);color:var(--text-color);border-radius:999px;padding:8px 12px;font-weight:850;cursor:pointer;}
.study-subject-category-create{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end;border:1px solid rgba(255,255,255,.10);border-radius:20px;padding:12px;background:rgba(255,255,255,.045);}
.study-subject-category-create label{display:grid;gap:6px;color:var(--muted-color);font-size:12px;font-weight:850;}
.study-subject-category-create input{width:100%;min-height:42px;border-radius:14px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 12px;}
.study-modal-topic-row-compact{grid-template-columns:auto minmax(0,1fr) auto!important;align-items:center;cursor:grab;}
.study-modal-topic-row-compact.dragging{opacity:.55;transform:scale(.99);}
.study-modal-topic-row-compact[data-editing="1"]{grid-template-columns:1fr!important;cursor:default;}
.study-topic-drag-handle{width:28px;height:36px;border-radius:12px;display:grid;place-items:center;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.10);color:var(--muted-color);font-weight:900;line-height:1;}
.study-modal-topic-inline-edit{display:grid;grid-template-columns:minmax(160px,1.4fr) minmax(130px,1fr) 100px 140px;gap:8px;align-items:end;}
.study-modal-topic-inline-edit label{display:grid!important;gap:6px!important;color:var(--muted-color);font-size:12px;font-weight:850;}
.study-modal-topic-inline-edit input,.study-modal-topic-inline-edit select{width:100%;min-height:40px;border-radius:14px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 11px;}
.study-topic-record-timer-box{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid rgba(102,217,255,.16);background:linear-gradient(135deg,rgba(102,217,255,.10),rgba(255,255,255,.035));border-radius:22px;padding:14px;}
.study-topic-record-timer-box>div:first-child{display:grid;gap:4px;}
.study-topic-record-timer-box span{color:var(--muted-color);font-size:12px;font-weight:850;}
.study-topic-record-timer-box strong{direction:ltr;font-size:28px;font-weight:950;letter-spacing:1px;}
.study-topic-record-timer-box small{color:var(--muted-color);}
.study-record-actions{display:flex;gap:6px;flex-wrap:wrap;}
.study-plan-detail-timer .study-row-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:center;}
.study-row-actions .is-soft-success,.study-topic-item .is-soft-success{background:linear-gradient(135deg,rgba(34,197,94,.20),rgba(16,185,129,.12))!important;border-color:rgba(34,197,94,.38)!important;color:#bbf7d0!important;box-shadow:0 8px 18px rgba(16,185,129,.10);}
html[data-theme="light"] .study-row-actions .is-soft-success,body[data-theme="light"] .study-row-actions .is-soft-success,html[data-theme="light"] .study-topic-item .is-soft-success,body[data-theme="light"] .study-topic-item .is-soft-success{background:linear-gradient(135deg,rgba(22,163,74,.15),rgba(21,128,61,.08))!important;border-color:rgba(22,163,74,.34)!important;color:#166534!important;}
html[data-theme="light"] .study-subject-category-chips,body[data-theme="light"] .study-subject-category-chips,html[data-theme="light"] .study-subject-category-create,body[data-theme="light"] .study-subject-category-create,html[data-theme="light"] .study-topic-record-timer-box,body[data-theme="light"] .study-topic-record-timer-box{background:rgba(255,255,255,.86);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .study-subject-category-create input,body[data-theme="light"] .study-subject-category-create input,html[data-theme="light"] .study-modal-topic-inline-edit input,html[data-theme="light"] .study-modal-topic-inline-edit select,body[data-theme="light"] .study-modal-topic-inline-edit input,body[data-theme="light"] .study-modal-topic-inline-edit select{background:rgba(255,255,255,.9);border-color:rgba(15,23,42,.13);}
@media(max-width:860px){.study-subject-category-field,.study-subject-category-create{grid-template-columns:1fr}.study-subject-category-create .primary-btn{width:100%;}.study-modal-topic-inline-edit{grid-template-columns:1fr 1fr}.study-topic-record-timer-box{align-items:stretch;flex-direction:column}.study-topic-record-timer-box .study-row-actions{justify-content:stretch}.study-topic-record-timer-box .tiny-btn{flex:1}}
@media(max-width:640px){.study-modal-topic-inline-edit{grid-template-columns:1fr}.study-modal-topic-row-compact{grid-template-columns:1fr!important}.study-topic-drag-handle{width:100%;height:28px}.study-subject-modal-body{max-height:calc(100dvh - 150px)}}

/* v92.15 study planner compact records, subject categories and inline daily activities */
.study-subject-category-chips{display:none!important;}
.study-subject-category-list{display:grid;gap:8px;max-height:min(46vh,420px);overflow:auto;padding-inline-end:2px;}
.study-subject-category-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.045);border-radius:18px;padding:8px;cursor:grab;}
.study-subject-category-row.dragging{opacity:.55;transform:scale(.99);}
.study-subject-category-row[data-editing="1"]{grid-template-columns:minmax(0,1fr) auto;cursor:default;}
.study-subject-category-name{display:flex;align-items:center;gap:8px;min-width:0;border:0;background:transparent;color:var(--text-color);font-weight:900;text-align:right;cursor:pointer;padding:6px;border-radius:12px;}
.study-subject-category-name i{width:12px;height:12px;border-radius:999px;background:var(--study-color);box-shadow:0 0 0 4px color-mix(in srgb,var(--study-color) 18%,transparent);flex:0 0 auto;}
.study-subject-category-name:hover{background:rgba(255,255,255,.06);}
.study-subject-category-inline-edit{display:grid;grid-template-columns:minmax(0,1fr) 72px;gap:8px;align-items:end;}
.study-subject-category-inline-edit label{display:grid;gap:5px;color:var(--muted-color);font-size:11px;font-weight:850;}
.study-subject-category-inline-edit input{width:100%;min-width:0;min-height:38px;border-radius:13px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 10px;}
.study-subject-modal-card{width:min(1080px,calc(100vw - 22px))!important;}
.study-modal-topic-composer{grid-template-columns:minmax(210px,1.5fr) minmax(150px,1fr) 110px minmax(150px,.85fr) auto!important;overflow:visible;}
.study-modal-topic-composer .primary-btn{min-width:86px;box-shadow:0 12px 24px rgba(102,217,255,.16);}
.study-modal-topic-row-compact{min-height:50px;}
.study-modal-topic-row-compact .study-day-activity-summary{display:flex;align-items:center;gap:8px;min-width:0;}
.study-modal-topic-row-compact .study-day-activity-summary strong{max-width:240px;}
.study-modal-topic-row-compact .study-day-activity-summary small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.study-modal-topic-row-compact .study-row-actions{margin-inline-start:auto;}
.study-modal-topic-inline-edit{grid-template-columns:minmax(180px,1.4fr) minmax(140px,1fr) 110px minmax(150px,.9fr)!important;}
.study-record-table-scroll.compact-record-scroll{max-height:min(44vh,420px);overflow:auto;border-radius:18px;}
.study-record-table-compact th,.study-record-table-compact td{padding:8px 10px!important;font-size:12px;vertical-align:middle;}
.compact-actions{display:inline-flex!important;gap:4px!important;align-items:center;justify-content:flex-end;flex-wrap:nowrap!important;}
.icon-btn{width:30px!important;min-width:30px!important;height:30px!important;min-height:30px!important;padding:0!important;border-radius:10px!important;display:inline-grid!important;place-items:center!important;font-size:14px!important;line-height:1!important;}
.study-day-activity-row.compact{grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;}
.study-day-activity-row.compact .study-row-actions{margin-inline-start:auto;}
.study-day-activity-row[data-editing="1"]{grid-template-columns:minmax(0,1fr) auto!important;}
.study-day-activity-inline-edit{display:grid;grid-template-columns:minmax(120px,1fr) 64px 64px;gap:6px;align-items:end;min-width:0;}
.study-day-activity-inline-edit label{display:grid;gap:4px;color:var(--muted-color);font-size:10px;font-weight:850;}
.study-day-activity-inline-edit input{width:100%;min-width:0;min-height:34px;border-radius:12px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 8px;}
html[data-theme="light"] .study-subject-category-row,body[data-theme="light"] .study-subject-category-row{background:rgba(255,255,255,.86);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .study-subject-category-inline-edit input,html[data-theme="light"] .study-day-activity-inline-edit input,body[data-theme="light"] .study-subject-category-inline-edit input,body[data-theme="light"] .study-day-activity-inline-edit input{background:rgba(255,255,255,.9);border-color:rgba(15,23,42,.13);}
@media(max-width:900px){.study-modal-topic-composer{grid-template-columns:1fr 1fr!important}.study-modal-topic-composer .study-topic-title-draft{grid-column:1 / -1}.study-modal-topic-composer .primary-btn{grid-column:1 / -1;width:100%;}.study-modal-topic-row-compact .study-day-activity-summary{display:grid;gap:2px}.study-modal-topic-row-compact .study-day-activity-summary strong{max-width:100%;}.study-modal-topic-inline-edit{grid-template-columns:1fr 1fr!important}.study-subject-category-inline-edit{grid-template-columns:1fr 70px}.study-day-activity-inline-edit{grid-template-columns:1fr 58px 58px;}}
@media(max-width:640px){.study-subject-category-row,.study-subject-category-row[data-editing="1"],.study-day-activity-row.compact,.study-day-activity-row[data-editing="1"]{grid-template-columns:1fr!important}.study-day-activity-inline-edit,.study-subject-category-inline-edit,.study-modal-topic-inline-edit{grid-template-columns:1fr!important}.compact-actions{justify-content:stretch!important}.icon-btn{flex:1;width:auto!important}.study-modal-topic-row-compact .study-row-actions,.study-day-activity-row.compact .study-row-actions{justify-content:stretch}}

/* v92.16 — study planner exams, performance, category and weekly button polish */
.study-subject-category-create{grid-template-columns:minmax(0,1fr) auto!important;}
.study-subject-category-inline-edit.no-color{grid-template-columns:minmax(0,1fr)!important;}
.study-subject-category-name i{display:none!important;}
.study-subject-modal-card{width:min(1180px,calc(100vw - 20px))!important;}
.study-subject-modal-body{overflow-x:hidden!important;}
.study-modal-topic-composer.is-roomy{grid-template-columns:minmax(240px,1.6fr) minmax(170px,1fr) minmax(130px,.75fr) minmax(170px,.9fr) minmax(138px,auto)!important;gap:10px;align-items:end;}
.study-modal-topic-composer.is-roomy label{min-width:0;}
.study-modal-topic-composer.is-roomy input,.study-modal-topic-composer.is-roomy select{min-width:0;width:100%;}
.study-topic-add-btn{min-width:138px!important;white-space:nowrap;}
.study-modal-topic-row-compact{grid-template-columns:auto minmax(0,1fr) max-content!important;padding:8px 10px!important;}
.study-modal-topic-row-compact .study-day-activity-summary{min-width:0;white-space:nowrap;overflow:hidden;}
.study-modal-topic-row-compact .study-day-activity-summary strong{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.study-modal-topic-row-compact .study-day-activity-summary small{max-width:420px;}
.study-day-add-btn.is-wide{width:auto!important;min-width:104px!important;min-height:38px!important;height:auto!important;padding:0 13px!important;border-radius:14px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;font-size:12px!important;font-weight:900!important;line-height:1.2!important;white-space:nowrap!important;}
.study-week-day-top .study-day-add-btn.is-wide,.study-weekly-schedule-day header .study-day-add-btn.is-wide{flex:0 0 auto;}
.study-performance-head{align-items:center;}
.study-performance-summary-row{display:grid;grid-template-columns:auto minmax(110px,1fr) auto minmax(110px,1fr);gap:8px 12px;align-items:center;margin-bottom:12px;border:1px solid rgba(255,255,255,.10);background:linear-gradient(135deg,rgba(102,217,255,.08),rgba(255,255,255,.035));border-radius:20px;padding:12px 14px;}
.study-performance-summary-row span{color:var(--muted-color);font-size:12px;font-weight:850;}
.study-performance-summary-row strong{color:var(--text-color);font-weight:950;}
.study-performance-table.is-polished{border-collapse:separate;border-spacing:0 8px;min-width:720px;}
.study-performance-table.is-polished thead th{background:transparent;color:var(--muted-color);font-size:12px;font-weight:900;padding:4px 12px;}
.study-performance-table.is-polished tbody tr{box-shadow:0 10px 22px rgba(0,0,0,.08);}
.study-performance-table.is-polished tbody th,.study-performance-table.is-polished tbody td{background:rgba(255,255,255,.055);border-block:1px solid rgba(255,255,255,.08);padding:12px;text-align:center;}
.study-performance-table.is-polished tbody th{border-start-start-radius:16px;border-end-start-radius:16px;color:var(--text-color);text-align:right;font-weight:950;}
.study-performance-table.is-polished tbody td:last-child{border-start-end-radius:16px;border-end-end-radius:16px;}
.study-exam-empty-hero{display:grid;place-items:center;text-align:center;gap:12px;padding:28px;border:1px dashed rgba(102,217,255,.26);background:linear-gradient(135deg,rgba(102,217,255,.10),rgba(139,152,255,.06));border-radius:28px;}
.study-empty-illustration{width:74px;height:74px;border-radius:24px;display:grid;place-items:center;background:rgba(255,255,255,.08);font-size:34px;border:1px solid rgba(255,255,255,.12);}
.study-exam-empty-hero h3{margin:0;color:var(--text-color);}
.study-exam-empty-hero p{margin:0;color:var(--muted-color);max-width:520px;line-height:1.8;}
.study-exam-accordion{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.045);border-radius:24px;overflow:hidden;}
.study-exam-accordion summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 16px;cursor:pointer;font-weight:950;color:var(--text-color);}
.study-exam-accordion summary::-webkit-details-marker{display:none;}
.study-exam-accordion summary small{font-size:12px;color:var(--muted-color);font-weight:750;}
.study-exam-accordion[open] summary{border-bottom:1px solid rgba(255,255,255,.09);background:rgba(102,217,255,.06);}
.modern-exam-form{display:grid;gap:14px;width:100%;text-align:right;}
.study-exam-empty-hero .modern-exam-form{margin-top:8px;max-width:980px;}
.study-exam-form-grid{display:grid;grid-template-columns:minmax(220px,1.4fr) minmax(160px,1fr) 120px 150px;gap:10px;align-items:end;}
.study-exam-title-field{grid-column:auto;}
.modern-exam-form label{display:grid;gap:6px;color:var(--muted-color);font-size:12px;font-weight:850;}
.modern-exam-form input,.modern-exam-form select,.modern-exam-form textarea{width:100%;min-height:42px;border-radius:15px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 12px;outline:none;}
.modern-exam-form textarea{padding:10px 12px;resize:vertical;}
.study-exam-scope-box{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.04);border-radius:22px;padding:12px;}
.study-panel-head.compact{margin-bottom:10px;}
.study-panel-head.compact strong{color:var(--text-color);}
.study-panel-head.compact p{margin:4px 0 0;}
.study-exam-scope-tree{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;}
.study-exam-scope-subject{border:1px solid color-mix(in srgb,var(--study-color) 28%,rgba(255,255,255,.10));background:linear-gradient(135deg,color-mix(in srgb,var(--study-color) 10%,rgba(255,255,255,.04)),rgba(255,255,255,.035));border-radius:18px;padding:10px;display:grid;gap:8px;}
.study-exam-scope-subject-head{display:flex!important;align-items:center;gap:8px!important;color:var(--text-color)!important;font-weight:950!important;}
.study-exam-scope-subject-head small{margin-inline-start:auto;color:var(--muted-color);font-weight:750;}
.study-exam-scope-topic-list{display:grid;gap:6px;padding-inline-start:4px;}
.study-exam-scope-topic-list label{display:flex;align-items:center;gap:7px;border-radius:12px;padding:6px 8px;background:rgba(255,255,255,.045);color:var(--muted-color);font-size:12px;}
.study-exam-scope-topic-list em{color:var(--muted-color);font-style:normal;font-size:12px;padding:6px;}
.study-exam-scope-tree input[type="checkbox"]{width:16px;min-height:16px;accent-color:#66d9ff;}
html[data-theme="light"] .study-performance-summary-row,body[data-theme="light"] .study-performance-summary-row,html[data-theme="light"] .study-exam-empty-hero,body[data-theme="light"] .study-exam-empty-hero,html[data-theme="light"] .study-exam-accordion,body[data-theme="light"] .study-exam-accordion,html[data-theme="light"] .study-exam-scope-box,body[data-theme="light"] .study-exam-scope-box{background:rgba(255,255,255,.86);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .study-performance-table.is-polished tbody th,html[data-theme="light"] .study-performance-table.is-polished tbody td,body[data-theme="light"] .study-performance-table.is-polished tbody th,body[data-theme="light"] .study-performance-table.is-polished tbody td{background:rgba(255,255,255,.92);border-color:rgba(15,23,42,.08);}
html[data-theme="light"] .modern-exam-form input,html[data-theme="light"] .modern-exam-form select,html[data-theme="light"] .modern-exam-form textarea,body[data-theme="light"] .modern-exam-form input,body[data-theme="light"] .modern-exam-form select,body[data-theme="light"] .modern-exam-form textarea{background:rgba(255,255,255,.92);border-color:rgba(15,23,42,.13);}
@media(max-width:980px){.study-modal-topic-composer.is-roomy{grid-template-columns:1fr 1fr!important}.study-topic-add-btn{grid-column:1 / -1;width:100%;}.study-exam-form-grid{grid-template-columns:1fr 1fr}.study-performance-summary-row{grid-template-columns:1fr 1fr}.study-performance-head{align-items:flex-start;flex-direction:column}.study-performance-head .study-row-actions{justify-content:flex-start}.study-modal-topic-row-compact{grid-template-columns:auto minmax(0,1fr)!important}.study-modal-topic-row-compact .study-row-actions{grid-column:1 / -1;justify-content:flex-start}}
@media(max-width:640px){.study-exam-form-grid,.study-exam-scope-tree,.study-performance-summary-row{grid-template-columns:1fr}.study-day-add-btn.is-wide{min-width:96px!important}.study-subject-modal-card{width:calc(100vw - 12px)!important}.study-modal-topic-row-compact{grid-template-columns:1fr!important}.study-modal-topic-row-compact .study-day-activity-summary{white-space:normal}.study-modal-topic-row-compact .study-day-activity-summary small{white-space:normal;max-width:100%;}.study-modal-topic-row-compact .study-row-actions{justify-content:stretch}.study-modal-topic-row-compact .study-row-actions .tiny-btn{flex:1}}


/* v92.17 — first exam modal and reliable subject chapter composer layout */
.study-empty-action-btn{min-width:190px;min-height:46px;border-radius:16px;font-weight:950;display:inline-flex;align-items:center;justify-content:center;}
.study-exam-modal-shell{width:100%;max-width:1040px;margin:0 auto;}
.study-exam-modal-shell .modern-exam-form{max-width:100%;}
.study-exam-modal-shell .study-exam-form-grid{grid-template-columns:minmax(230px,1.35fr) minmax(170px,1fr) minmax(120px,.65fr) minmax(150px,.8fr);}
.study-subject-modal-card{width:min(1280px,calc(100vw - 18px))!important;max-height:min(92vh,880px);}
.study-subject-modal-body{overflow-x:hidden!important;max-height:calc(92vh - 92px);}
.study-subject-modal-form{overflow-x:hidden;}
.study-modal-topic-composer.is-roomy{display:grid!important;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(92px,.55fr) minmax(0,.9fr)!important;gap:10px!important;align-items:end!important;width:100%;box-sizing:border-box;}
.study-modal-topic-composer.is-roomy .study-topic-add-btn{grid-column:1 / -1!important;width:100%!important;min-width:0!important;min-height:44px!important;height:auto!important;padding:0 18px!important;border-radius:15px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;font-size:13px!important;line-height:1.2!important;box-sizing:border-box;}
.study-modal-topic-composer.is-roomy label,.study-modal-topic-composer.is-roomy input,.study-modal-topic-composer.is-roomy select{min-width:0!important;max-width:100%!important;box-sizing:border-box;}
.study-modal-topic-composer.is-roomy select{padding-inline-end:12px;}
@media(max-width:900px){.study-exam-modal-shell .study-exam-form-grid{grid-template-columns:1fr 1fr}.study-modal-topic-composer.is-roomy{grid-template-columns:1fr 1fr!important}.study-modal-topic-composer.is-roomy .study-topic-title-draft{grid-column:1 / -1!important}.study-modal-topic-composer.is-roomy .study-topic-add-btn{grid-column:1 / -1!important;width:100%!important;}}
@media(max-width:640px){.study-exam-modal-shell .study-exam-form-grid,.study-modal-topic-composer.is-roomy{grid-template-columns:1fr!important}.study-subject-modal-card{width:calc(100vw - 10px)!important}.study-subject-modal-body{max-height:calc(92vh - 88px);}}


/* v92.18 focused polish: performance grid, compact topics, reschedule/exam modals */
.study-performance-list{display:grid;gap:8px;min-width:720px;overflow:visible;direction:rtl;}
.study-performance-list .study-performance-row{display:grid;grid-template-columns:minmax(120px,1.15fr) repeat(4,minmax(118px,1fr));gap:0;align-items:stretch;border-radius:18px;overflow:hidden;box-shadow:0 10px 22px rgba(0,0,0,.07);}
.study-performance-list .study-performance-row.head{box-shadow:none;color:var(--muted-color);font-size:12px;font-weight:950;padding:0 2px;}
.study-performance-list .study-performance-row.head>div{padding:4px 12px;text-align:center;white-space:nowrap;}
.study-performance-list .study-performance-row:not(.head)>div{background:rgba(255,255,255,.055);border-block:1px solid rgba(255,255,255,.08);border-inline-end:1px solid rgba(255,255,255,.06);padding:12px;text-align:center;display:flex;align-items:center;justify-content:center;min-height:48px;box-sizing:border-box;}
.study-performance-list .study-performance-row:not(.head)>div:first-child{border-start-start-radius:18px;border-end-start-radius:18px;justify-content:flex-start;gap:8px;font-weight:950;}
.study-performance-list .study-performance-row:not(.head)>div:last-child{border-start-end-radius:18px;border-end-end-radius:18px;border-inline-end:0;}
.study-performance-cell.day span{color:var(--muted-color);font-size:12px;font-weight:800;}
html[data-theme="light"] .study-performance-list .study-performance-row:not(.head)>div,body[data-theme="light"] .study-performance-list .study-performance-row:not(.head)>div{background:rgba(255,255,255,.92);border-color:rgba(15,23,42,.08);}
.study-modal-topic-row-compact{grid-template-columns:auto minmax(0,1fr) max-content!important;align-items:center!important;min-height:46px!important;padding:7px 10px!important;}
.study-modal-topic-row-compact .study-day-activity-summary{display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important;white-space:nowrap!important;overflow:hidden!important;}
.study-modal-topic-row-compact .study-day-activity-summary strong{max-width:280px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
.study-modal-topic-row-compact .study-day-activity-summary small{max-width:430px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
.study-modal-topic-row-compact .study-row-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;flex-wrap:nowrap!important;margin-inline-start:auto!important;}
.study-modal-topic-row-compact .study-row-actions .tiny-btn{white-space:nowrap!important;min-width:auto!important;padding-inline:10px!important;}
.study-reschedule-form{display:grid;gap:14px;width:100%;}
.study-reschedule-form .date-fields-main{grid-template-columns:repeat(4,minmax(110px,1fr));}
.reschedule-hero{margin-bottom:0;}
.study-exam-modal-shell{width:100%;max-width:1080px;margin:0 auto;overflow-x:hidden;}
.study-exam-modal-shell .modern-exam-form{display:grid!important;gap:16px!important;overflow-x:hidden!important;}
.study-exam-modal-shell .study-exam-form-grid{display:grid!important;grid-template-columns:minmax(260px,1.4fr) minmax(190px,1fr) minmax(135px,.65fr) minmax(160px,.75fr)!important;gap:12px!important;align-items:end!important;}
.study-exam-modal-shell .date-choice-box .date-fields-main{grid-template-columns:repeat(3,minmax(130px,1fr))!important;}
.study-exam-modal-shell .study-exam-scope-box{max-height:34vh;overflow:auto;}
.study-exam-modal-shell .study-exam-scope-tree{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px;}
.study-exam-modal-shell .primary-btn[type="submit"]{min-height:46px;border-radius:16px;}
.study-plan-item .study-row-actions,.study-review-item .study-row-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
@media(max-width:980px){.study-performance-list{min-width:640px}.study-exam-modal-shell .study-exam-form-grid{grid-template-columns:1fr 1fr!important}.study-reschedule-form .date-fields-main{grid-template-columns:1fr 1fr}.study-modal-topic-row-compact{grid-template-columns:auto minmax(0,1fr) max-content!important}.study-modal-topic-row-compact .study-row-actions{grid-column:auto!important;}}
@media(max-width:640px){.study-exam-modal-shell .study-exam-form-grid,.study-exam-modal-shell .date-choice-box .date-fields-main,.study-reschedule-form .date-fields-main{grid-template-columns:1fr!important}.study-performance-list{min-width:560px}.study-modal-topic-row-compact{grid-template-columns:1fr!important}.study-modal-topic-row-compact .study-day-activity-summary{white-space:normal!important;display:grid!important}.study-modal-topic-row-compact .study-day-activity-summary strong,.study-modal-topic-row-compact .study-day-activity-summary small{max-width:100%!important;white-space:normal!important}.study-modal-topic-row-compact .study-row-actions{justify-content:stretch!important}.study-modal-topic-row-compact .study-row-actions .tiny-btn{flex:1}.study-plan-item .study-row-actions,.study-review-item .study-row-actions{justify-content:flex-start}}


/* v92.19 — focused fixes: performance nav, compact chapter rows, cleaner exam modal */
.study-performance-head .study-row-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;position:relative;z-index:2;}
.study-performance-head [data-study-performance-prev],.study-performance-head [data-study-performance-next]{min-width:88px;pointer-events:auto;}
.study-performance-list{overflow-x:auto;padding-bottom:4px;scrollbar-width:thin;}
.study-performance-list .study-performance-row{grid-template-columns:minmax(118px,1.05fr) repeat(4,minmax(124px,1fr));}
.study-performance-list .study-performance-row.head>div,.study-performance-list .study-performance-row:not(.head)>div{box-sizing:border-box;}

.study-subject-modal-card{width:min(1100px,calc(100vw - 28px));max-width:1100px;}
.study-subject-modal-form{overflow-x:hidden;}
.study-modal-topic-list.compact{display:grid;gap:7px;}
.study-modal-topic-row-compact:not([data-editing="1"]){display:flex!important;align-items:center;gap:8px;min-height:42px;padding:7px 9px!important;border-radius:14px;overflow:hidden;}
.study-modal-topic-row-compact:not([data-editing="1"]) .study-topic-drag-handle{flex:0 0 auto;line-height:1;color:var(--muted-color);}
.study-modal-topic-row-compact:not([data-editing="1"]) .study-day-activity-summary{flex:1 1 auto;min-width:0;display:flex!important;align-items:center;gap:8px;white-space:nowrap;overflow:hidden;}
.study-modal-topic-row-compact:not([data-editing="1"]) .study-day-activity-summary strong{flex:0 1 auto;min-width:0;max-width:44%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;}
.study-modal-topic-row-compact:not([data-editing="1"]) .study-day-activity-summary small{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--muted-color);}
.study-modal-topic-row-compact:not([data-editing="1"]) .study-row-actions{margin-inline-start:auto;flex:0 0 auto;display:flex!important;align-items:center;justify-content:flex-end;gap:6px;grid-column:auto!important;}
.study-modal-topic-row-compact:not([data-editing="1"]) .study-row-actions .tiny-btn{padding:5px 9px;min-height:28px;font-size:11px;}
.study-modal-topic-inline-edit{display:grid;grid-template-columns:minmax(160px,1.4fr) minmax(130px,1fr) minmax(110px,.8fr) minmax(120px,.9fr);gap:10px;width:100%;}
.study-modal-topic-row-compact[data-editing="1"]{display:grid!important;grid-template-columns:1fr max-content;align-items:end;gap:10px;padding:10px!important;}
.study-modal-topic-row-compact[data-editing="1"] .study-row-actions{align-self:end;display:flex;gap:6px;}

.study-exam-modal-shell{max-width:980px;margin:0 auto;}
.study-exam-form-polished{display:grid;gap:14px;min-width:0;}
.study-exam-form-section{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.045);border-radius:22px;padding:14px;box-shadow:0 12px 28px rgba(0,0,0,.08);min-width:0;}
.study-exam-section-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px;}
.study-exam-section-title strong{font-size:14px;font-weight:950;color:var(--text-color);}
.study-exam-section-title span{font-size:12px;color:var(--muted-color);line-height:1.7;text-align:left;}
.study-exam-form-grid.polished{display:grid;grid-template-columns:minmax(220px,1.5fr) minmax(180px,1fr) minmax(120px,.7fr) minmax(140px,.8fr);gap:10px;align-items:end;}
.study-exam-form-polished label{min-width:0;}
.study-exam-form-polished input,.study-exam-form-polished select,.study-exam-form-polished textarea{width:100%;min-width:0;box-sizing:border-box;}
.study-exam-date-section .date-fields-main{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;}
.polished-date-box{display:grid;gap:10px;margin:0;}
.polished-scope-box{display:grid;gap:10px;}
.polished-scope-box .study-exam-scope-tree{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;max-height:320px;overflow:auto;padding-inline-end:4px;}
.polished-scope-box .study-exam-scope-subject{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.04);border-radius:18px;padding:10px;min-width:0;}
.polished-scope-box .study-exam-scope-subject-head{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-weight:900;}
.polished-scope-box .study-exam-scope-subject-head span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.polished-scope-box .study-exam-scope-subject-head small{margin-inline-start:auto;color:var(--muted-color);white-space:nowrap;font-size:11px;}
.polished-scope-box .study-exam-scope-topic-list{display:grid;gap:6px;max-height:145px;overflow:auto;padding-inline-end:2px;}
.polished-scope-box .study-exam-scope-topic-list label{display:flex;align-items:center;gap:7px;padding:6px 8px;border-radius:12px;background:rgba(0,0,0,.08);font-size:12px;}
.study-exam-notes-section textarea{resize:vertical;min-height:74px;}
.study-exam-actions-row{display:flex;justify-content:flex-end;gap:8px;}
.study-exam-actions-row .primary-btn{min-width:150px;}
html[data-theme="light"] .study-exam-form-section,body[data-theme="light"] .study-exam-form-section{background:rgba(255,255,255,.92);border-color:rgba(15,23,42,.10);}
html[data-theme="light"] .polished-scope-box .study-exam-scope-subject,body[data-theme="light"] .polished-scope-box .study-exam-scope-subject{background:rgba(248,250,252,.9);border-color:rgba(15,23,42,.09);}
html[data-theme="light"] .polished-scope-box .study-exam-scope-topic-list label,body[data-theme="light"] .polished-scope-box .study-exam-scope-topic-list label{background:rgba(15,23,42,.045);}
@media(max-width:980px){.study-exam-form-grid.polished{grid-template-columns:1fr 1fr}.study-modal-topic-inline-edit{grid-template-columns:1fr 1fr}.study-modal-topic-row-compact[data-editing="1"]{grid-template-columns:1fr}.study-modal-topic-row-compact[data-editing="1"] .study-row-actions{justify-content:flex-start}.study-exam-section-title{display:block}.study-exam-section-title span{display:block;text-align:right;margin-top:4px}}
@media(max-width:640px){.study-subject-modal-card{width:calc(100vw - 10px)!important}.study-modal-topic-row-compact:not([data-editing="1"]){align-items:flex-start}.study-modal-topic-row-compact:not([data-editing="1"]) .study-day-activity-summary{display:grid!important;gap:2px}.study-modal-topic-row-compact:not([data-editing="1"]) .study-day-activity-summary strong,.study-modal-topic-row-compact:not([data-editing="1"]) .study-day-activity-summary small{max-width:100%;}.study-exam-form-grid.polished,.study-exam-date-section .date-fields-main,.polished-scope-box .study-exam-scope-tree{grid-template-columns:1fr}.study-exam-actions-row{justify-content:stretch}.study-exam-actions-row .primary-btn{width:100%;}.study-performance-list{min-width:620px}}

.study-week-display-modal-card.study-exam-modal-card{width:min(1040px,calc(100vw - 28px));max-height:min(88vh,900px);}
.study-week-display-modal-card.study-exam-modal-card .study-week-display-modal-body{overflow-x:hidden;}

/* v92.20 — exam modal rebuilt as clean one-column flow */
.study-week-display-modal-card.study-exam-modal-card{
  width:min(760px, calc(100vw - 28px)) !important;
  max-height:min(90vh, 920px) !important;
  overflow:hidden !important;
}
.study-week-display-modal-card.study-exam-modal-card .study-week-display-modal-body{
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding-inline:18px !important;
}
.study-exam-modal-shell,
.study-exam-modal-shell *{box-sizing:border-box;}
.study-exam-modal-shell{width:100%;max-width:700px;margin:0 auto;overflow-x:hidden;}
.study-exam-modal-shell .study-exam-form,
.study-exam-modal-shell .study-exam-form-polished,
.study-exam-form-polished{
  display:flex !important;
  flex-direction:column !important;
  gap:14px !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow-x:hidden !important;
}
.study-exam-form-section{
  width:100% !important;
  min-width:0 !important;
  border-radius:24px !important;
  padding:16px !important;
}
.study-exam-section-title{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:4px !important;
  margin-bottom:14px !important;
  text-align:right !important;
}
.study-exam-section-title span{text-align:right !important;}
.study-exam-form-grid.polished,
.study-exam-modal-shell .study-exam-form-grid,
.study-exam-modal-shell .study-exam-form-grid.polished{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:12px !important;
  align-items:stretch !important;
  width:100% !important;
}
.study-exam-form-polished label{
  display:grid !important;
  gap:7px !important;
  width:100% !important;
  min-width:0 !important;
}
.study-exam-form-polished label > span{
  font-weight:850 !important;
  color:var(--text-color) !important;
  font-size:.88rem !important;
}
.study-exam-form-polished input,
.study-exam-form-polished select,
.study-exam-form-polished textarea{
  width:100% !important;
  min-width:0 !important;
  min-height:46px !important;
  border-radius:16px !important;
}
.study-exam-date-section .date-choice-box,
.study-exam-modal-shell .date-choice-box{
  width:100% !important;
  min-width:0 !important;
  overflow:hidden !important;
}
.study-exam-date-section .date-fields-main,
.study-exam-modal-shell .date-choice-box .date-fields-main{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:10px !important;
  width:100% !important;
}
.study-exam-date-section .hint-box,
.study-exam-modal-shell .hint-box{
  margin-top:10px !important;
  width:100% !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
.polished-scope-box .study-exam-scope-tree,
.study-exam-modal-shell .study-exam-scope-tree{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:10px !important;
  max-height:300px !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding-inline-end:4px !important;
}
.polished-scope-box .study-exam-scope-subject,
.study-exam-modal-shell .study-exam-scope-subject{width:100%;min-width:0;}
.polished-scope-box .study-exam-scope-topic-list,
.study-exam-modal-shell .study-exam-scope-topic-list{
  max-height:160px !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
}
.polished-scope-box .study-exam-scope-topic-list label,
.study-exam-modal-shell .study-exam-scope-topic-list label{
  width:100% !important;
  min-width:0 !important;
}
.study-exam-notes-section textarea{min-height:88px !important;}
.study-exam-actions-row{display:flex !important;justify-content:stretch !important;width:100% !important;}
.study-exam-actions-row .primary-btn{width:100% !important;min-height:48px !important;border-radius:18px !important;}
.study-exam-accordion .study-exam-form{padding:14px;}
.study-exam-accordion .study-exam-form-section{box-shadow:none;}
@media(min-width:760px){
  .study-exam-date-section .date-fields-main,
  .study-exam-modal-shell .date-choice-box .date-fields-main{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
}
@media(max-width:560px){
  .study-week-display-modal-card.study-exam-modal-card{width:calc(100vw - 12px) !important;}
  .study-week-display-modal-card.study-exam-modal-card .study-week-display-modal-body{padding-inline:10px !important;}
  .study-exam-form-section{padding:12px !important;border-radius:20px !important;}
}

/* v92.21 — exams & test records polish */
.study-exam-form-polished{overflow-x:hidden!important;}
.study-exam-form-polished.is-modal{max-width:760px!important;margin:0 auto;}
.study-exam-form-polished.is-accordion{padding:14px!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:14px!important;align-items:start!important;}
.study-exam-form-polished.is-accordion .study-exam-primary-section,
.study-exam-form-polished.is-accordion .study-exam-date-section,
.study-exam-form-polished.is-accordion .study-exam-scope-box{grid-column:auto!important;}
.study-exam-form-polished.is-accordion .study-exam-notes-section,
.study-exam-form-polished.is-accordion .study-exam-actions-row,
.study-exam-form-polished.is-accordion .message{grid-column:1 / -1!important;}
.study-exam-form-polished.is-accordion .study-exam-form-grid.polished{grid-template-columns:1fr!important;}
.study-exam-form-polished.is-accordion .study-exam-date-section .date-fields-main{grid-template-columns:1fr!important;}
.study-field-title{display:block;margin:10px 0 8px;color:var(--muted-color);font-size:12px;font-weight:850;}
.study-exam-subject-picker{display:flex;flex-wrap:wrap;gap:8px;}
.study-exam-subject-chip{display:inline-flex!important;align-items:center!important;gap:8px!important;width:auto!important;min-height:38px!important;padding:8px 11px!important;border-radius:999px!important;border:1px solid color-mix(in srgb,var(--study-color) 36%,rgba(255,255,255,.12))!important;background:linear-gradient(135deg,color-mix(in srgb,var(--study-color) 12%,rgba(255,255,255,.05)),rgba(255,255,255,.035))!important;color:var(--text-color)!important;cursor:pointer;}
.study-exam-subject-chip input{width:16px!important;min-height:16px!important;accent-color:#66d9ff;}
.study-exam-scope-modern{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:10px;max-height:340px;overflow:auto;padding-inline-end:4px;}
.study-exam-budget-card{border:1px solid color-mix(in srgb,var(--study-color) 30%,rgba(255,255,255,.12));background:linear-gradient(145deg,color-mix(in srgb,var(--study-color) 12%,rgba(255,255,255,.055)),rgba(255,255,255,.035));border-radius:20px;padding:10px;min-width:0;}
.study-exam-budget-head{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;align-items:center!important;gap:9px!important;margin:0 0 9px!important;padding:8px!important;border-radius:15px!important;background:color-mix(in srgb,var(--study-color) 10%,rgba(255,255,255,.05))!important;color:var(--text-color)!important;}
.study-exam-budget-head input,.study-exam-budget-topic input{width:16px!important;min-height:16px!important;accent-color:#66d9ff;}
.study-exam-budget-head span{display:grid;gap:2px;min-width:0;}
.study-exam-budget-head strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.study-exam-budget-head small{font-size:11px;color:var(--muted-color);}
.study-exam-budget-head b{font-size:11px;color:var(--muted-color);font-weight:800;white-space:nowrap;}
.study-exam-budget-topic-list{display:flex;flex-wrap:wrap;gap:7px;max-height:150px;overflow:auto;align-content:flex-start;}
.study-exam-budget-topic{display:inline-flex!important;align-items:center!important;gap:6px!important;width:auto!important;max-width:100%!important;padding:7px 9px!important;border-radius:999px!important;background:rgba(0,0,0,.10)!important;color:var(--muted-color)!important;font-size:12px!important;cursor:pointer;}
.study-exam-budget-topic span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;}
.study-exam-budget-topic-list em{font-size:12px;color:var(--muted-color);font-style:normal;padding:7px;}
.study-test-form-modern{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;align-items:end!important;}
.study-test-date-inline{grid-column:1 / -1;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.045);border-radius:18px;padding:10px;display:grid;gap:8px;}
.study-test-date-inline>span{font-size:12px;color:var(--muted-color);font-weight:850;}
.study-test-date-inline .date-fields-main{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.study-test-date-inline label{gap:4px!important;}
.study-test-date-inline small{font-size:11px;color:var(--muted-color);}
.study-test-date-inline em{font-size:12px;color:#66d9ff;font-style:normal;}
.study-test-form-actions{grid-column:1 / -1;display:flex;gap:8px;justify-content:flex-end;}
.study-test-filter-bar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px;padding:10px;border:1px solid rgba(255,255,255,.09);background:rgba(255,255,255,.04);border-radius:18px;}
.study-test-filter-bar label{display:grid;gap:5px;min-width:115px;color:var(--muted-color);font-size:12px;}
.study-test-filter-bar select{min-height:38px;border-radius:13px;border:1px solid rgba(255,255,255,.12);background:rgba(8,13,25,.38);color:var(--text-color);padding:0 10px;}
.study-test-row-modern{display:grid!important;grid-template-columns:minmax(0,1.3fr) auto auto auto!important;align-items:center!important;gap:10px!important;}
.study-test-row-modern div:first-child{display:grid;gap:3px;min-width:0;}
.study-test-row-modern small{color:var(--muted-color);font-size:12px;}
.study-test-row-modern .study-row-actions{display:flex;gap:6px;justify-content:flex-end;}
.study-exam-card .study-row-actions .danger,.study-test-row-modern .danger{color:#ff8f9a;}
html[data-theme="light"] .study-exam-budget-topic,body[data-theme="light"] .study-exam-budget-topic{background:rgba(15,23,42,.055)!important;}
html[data-theme="light"] .study-test-filter-bar select,body[data-theme="light"] .study-test-filter-bar select{background:#fff;border-color:rgba(15,23,42,.12);}
@media(max-width:980px){.study-exam-form-polished.is-accordion{grid-template-columns:1fr!important}.study-test-form-modern{grid-template-columns:1fr 1fr!important}.study-exam-scope-modern{grid-template-columns:1fr}.study-test-row-modern{grid-template-columns:1fr auto!important}.study-test-row-modern .study-row-actions{grid-column:1 / -1;justify-content:flex-start}}
@media(max-width:640px){.study-test-form-modern,.study-test-date-inline .date-fields-main{grid-template-columns:1fr!important}.study-test-form-actions{justify-content:stretch;flex-direction:column}.study-test-form-actions button{width:100%}.study-exam-subject-picker{display:grid;grid-template-columns:1fr}.study-test-row-modern{grid-template-columns:1fr!important}.study-test-filter-bar label{flex:1 1 90px;min-width:90px}}


/* v92.22 — exam performance and test report two-column layout */
.study-exam-results-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start;}
.study-exam-results-grid .study-panel{min-width:0;height:100%;}
.study-exam-results-grid .study-test-form-modern{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
.study-exam-results-grid .study-test-form-modern label:first-child{grid-column:1 / -1;}
.study-exam-results-grid .study-test-record-list{max-height:520px;overflow:auto;padding-inline-end:4px;}
.study-exam-results-grid .study-test-filter-bar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
.study-exam-results-grid .study-test-filter-bar label{min-width:0;}
.study-exam-results-grid .study-test-row-modern{grid-template-columns:minmax(0,1fr) auto!important;}
.study-exam-results-grid .study-test-row-modern>b{justify-self:end;}
.study-exam-results-grid .study-test-row-modern>span{font-size:12px;color:var(--muted-color);}
.study-exam-results-grid .study-test-row-modern .study-row-actions{grid-column:1 / -1;justify-content:flex-end;}
@media(max-width:980px){.study-exam-results-grid{grid-template-columns:1fr}.study-exam-results-grid .study-test-form-modern{grid-template-columns:1fr 1fr!important}}
@media(max-width:640px){.study-exam-results-grid .study-test-form-modern,.study-exam-results-grid .study-test-filter-bar{grid-template-columns:1fr!important}.study-exam-results-grid .study-test-row-modern{grid-template-columns:1fr!important}.study-exam-results-grid .study-test-row-modern .study-row-actions{justify-content:flex-start}}


/* v92.23 — make exam performance/test report occupy full page width */
.study-exams-view > .study-exam-results-grid{
  grid-column:1 / -1 !important;
  width:100% !important;
  max-width:none !important;
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  gap:18px !important;
  align-items:stretch !important;
}
.study-exams-view > .study-exam-results-grid > .study-panel{
  width:100% !important;
  min-width:0 !important;
  height:100% !important;
}
@media(max-width:980px){
  .study-exams-view > .study-exam-results-grid{
    grid-template-columns:1fr !important;
  }
}

/* v92.25 monthly department roster assistant */
.shift-monthly-roster-card .monthly-roster-body{display:flex;flex-direction:column;gap:18px}.roster-step-grid{display:grid;gap:16px}.roster-step-card{border:1px solid var(--border-color,rgba(148,163,184,.24));background:linear-gradient(145deg,rgba(255,255,255,.94),rgba(248,250,252,.84));border-radius:24px;padding:18px;box-shadow:0 18px 48px rgba(15,23,42,.08);overflow:hidden}.dark .roster-step-card,[data-theme="dark"] .roster-step-card{background:linear-gradient(145deg,rgba(30,41,59,.92),rgba(15,23,42,.82));border-color:rgba(148,163,184,.18)}.roster-step-head{display:flex;align-items:flex-start;gap:12px;margin-bottom:14px}.roster-step-head>span{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:13px;background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;font-weight:900}.roster-step-head h4{margin:0 0 4px;font-size:1rem}.roster-step-head p{margin:0;color:var(--muted-color,#64748b);font-size:.86rem;line-height:1.8}.roster-select-field,.roster-large-field{display:flex;flex-direction:column;gap:8px}.roster-select-field span,.roster-large-field span{font-weight:800;color:var(--text-color,#0f172a)}.roster-select-field select,.roster-large-field input,.roster-default-count input,.roster-day-demand input,.roster-staffing-row input{width:100%;border:1px solid rgba(148,163,184,.35);border-radius:14px;background:var(--card-bg,#fff);color:var(--text-color,#0f172a);padding:10px 12px}.roster-simple-help{padding:12px 14px;border-radius:18px;background:rgba(99,102,241,.08);color:var(--text-color,#0f172a);line-height:1.8;margin-bottom:12px}.roster-default-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;align-items:end;margin-bottom:12px}.roster-default-count{display:flex;flex-direction:column;gap:7px;font-size:.86rem;font-weight:800}.roster-demand-scroll{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x proximity;padding:4px 2px 10px;cursor:grab;scroll-behavior:smooth}.roster-demand-scroll.dragging,.roster-person-strip.dragging{cursor:grabbing;user-select:none}.roster-day-demand{flex:0 0 190px;border:1px solid rgba(148,163,184,.24);border-radius:20px;background:rgba(255,255,255,.72);padding:12px;scroll-snap-align:start}.dark .roster-day-demand,[data-theme="dark"] .roster-day-demand{background:rgba(15,23,42,.42)}.roster-day-demand strong{display:block;font-size:1.25rem}.roster-day-demand small{display:block;color:var(--muted-color,#64748b);margin-bottom:8px}.roster-day-demand label{display:grid;grid-template-columns:1fr 66px;align-items:center;gap:8px;margin-top:7px}.roster-day-demand span{font-size:.82rem;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.roster-person-strip{display:flex;gap:12px;overflow-x:auto;padding:4px 2px 10px;scroll-snap-type:x proximity;cursor:grab}.roster-person-card{flex:0 0 270px;scroll-snap-align:start;border:1px solid rgba(148,163,184,.24);border-radius:22px;background:linear-gradient(145deg,rgba(255,255,255,.86),rgba(241,245,249,.82));padding:14px;display:flex;flex-direction:column;gap:10px;min-height:170px}.dark .roster-person-card,[data-theme="dark"] .roster-person-card{background:linear-gradient(145deg,rgba(30,41,59,.78),rgba(15,23,42,.78))}.roster-person-main strong{display:block;font-size:1rem}.roster-person-main small{display:block;color:var(--muted-color,#64748b);margin-top:4px}.roster-person-summary{display:flex;flex-wrap:wrap;gap:6px;margin-top:auto}.roster-person-summary span,.roster-global-summary span{font-size:.78rem;border-radius:999px;padding:5px 8px;background:rgba(99,102,241,.1);color:#4f46e5;font-weight:800}.dark .roster-person-summary span,.dark .roster-global-summary span,[data-theme="dark"] .roster-person-summary span,[data-theme="dark"] .roster-global-summary span{color:#c4b5fd;background:rgba(139,92,246,.18)}.roster-global-summary{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}.roster-action-row{display:flex;gap:10px;flex-wrap:wrap}.roster-action-row .primary-btn,.roster-action-row .ghost-btn{min-height:42px}.roster-modal-card{width:min(1100px,calc(100vw - 28px));max-height:calc(100vh - 38px);overflow:hidden;display:flex;flex-direction:column}.roster-modal-body{overflow-y:auto;overflow-x:hidden;padding-inline:2px 8px;display:flex;flex-direction:column;gap:16px}.roster-modal-layout{display:grid;grid-template-columns:minmax(320px,1fr) minmax(300px,.9fr);gap:16px}.roster-modal-section-title{font-weight:900;margin-bottom:8px}.roster-rule-calendar{gap:8px}.roster-rule-calendar.compact{max-height:280px;overflow:auto}.roster-calendar-day{border:1px solid rgba(148,163,184,.25);border-radius:16px;background:var(--card-bg,#fff);padding:9px 6px;display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;min-height:64px;color:var(--text-color,#0f172a);cursor:pointer}.roster-calendar-day.selected{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.16);background:rgba(99,102,241,.1)}.roster-calendar-day.has-rule::after{content:'';width:6px;height:6px;border-radius:50%;background:#10b981}.roster-calendar-day small{font-size:.68rem;color:var(--muted-color,#64748b)}.roster-day-rule-panel{border:1px solid rgba(148,163,184,.22);border-radius:22px;background:rgba(248,250,252,.72);padding:16px;display:flex;flex-direction:column;gap:14px}.dark .roster-day-rule-panel,[data-theme="dark"] .roster-day-rule-panel{background:rgba(15,23,42,.42)}.roster-day-rule-panel h4{margin:0}.roster-switch-line{display:flex;align-items:center;gap:10px;padding:12px;border-radius:16px;background:rgba(239,68,68,.08);font-weight:900}.roster-chip-section>span{display:block;font-weight:900;margin-bottom:8px}.roster-chip-grid{display:flex;gap:8px;flex-wrap:wrap}.roster-toggle-chip input{position:absolute;opacity:0;pointer-events:none}.roster-toggle-chip span{display:inline-flex;align-items:center;min-height:34px;padding:7px 12px;border-radius:999px;border:1px solid rgba(148,163,184,.32);background:var(--card-bg,#fff);font-size:.82rem;font-weight:900;cursor:pointer}.roster-toggle-chip input:checked+span{border-color:#6366f1;background:rgba(99,102,241,.12);color:#4f46e5}.roster-toggle-chip.danger input:checked+span{border-color:#ef4444;background:rgba(239,68,68,.12);color:#dc2626}.roster-global-grid{display:grid;grid-template-columns:minmax(300px,.85fr) minmax(420px,1.15fr);gap:16px}.roster-global-panel{border:1px solid rgba(148,163,184,.24);border-radius:22px;padding:16px;background:rgba(255,255,255,.7)}.dark .roster-global-panel,[data-theme="dark"] .roster-global-panel{background:rgba(15,23,42,.45)}.roster-global-panel h4{margin:0 0 12px}.roster-pair-form{display:flex;flex-direction:column;gap:12px}.roster-pair-people{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px;max-height:180px;overflow:auto}.roster-pair-people label{display:flex;align-items:center;gap:8px;padding:8px;border-radius:12px;background:rgba(148,163,184,.1);font-size:.82rem}.roster-pair-list{list-style:none;margin:12px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}.roster-pair-list li{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 10px;border-radius:14px;background:rgba(99,102,241,.08);font-size:.82rem}.roster-pair-list li.empty{justify-content:center;color:var(--muted-color,#64748b)}.roster-selected-day-title{font-weight:900;margin:10px 0}.roster-staffing-list{display:flex;flex-direction:column;gap:10px}.roster-staffing-row{display:grid;grid-template-columns:1.2fr repeat(4,76px);gap:8px;align-items:end;border:1px solid rgba(148,163,184,.18);border-radius:16px;padding:10px;background:rgba(248,250,252,.7)}.dark .roster-staffing-row,[data-theme="dark"] .roster-staffing-row{background:rgba(30,41,59,.5)}.roster-staffing-row strong{font-size:.88rem}.roster-staffing-row label{display:flex;flex-direction:column;gap:5px}.roster-staffing-row span{font-size:.72rem;color:var(--muted-color,#64748b);font-weight:800}.shift-roster-result{border:1px solid rgba(148,163,184,.24);border-radius:24px;padding:16px;background:rgba(255,255,255,.72);box-shadow:0 18px 48px rgba(15,23,42,.06)}.dark .shift-roster-result,[data-theme="dark"] .shift-roster-result{background:rgba(15,23,42,.5)}.roster-result-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px}.roster-result-head h4{margin:0 0 4px}.roster-result-head p{margin:0;color:var(--muted-color,#64748b)}.roster-result-head>span{border-radius:999px;background:rgba(16,185,129,.12);color:#059669;padding:6px 10px;font-weight:900}.roster-warnings{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.roster-warnings span{border-radius:999px;background:rgba(245,158,11,.14);color:#b45309;padding:6px 10px;font-size:.8rem;font-weight:900}.roster-table-wrap{overflow:auto;max-height:520px;border-radius:18px;border:1px solid rgba(148,163,184,.22)}.roster-result-table{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0;background:var(--card-bg,#fff)}.roster-result-table th,.roster-result-table td{border-bottom:1px solid rgba(148,163,184,.2);border-inline-end:1px solid rgba(148,163,184,.14);padding:9px;min-width:82px;text-align:center;vertical-align:middle}.roster-result-table thead th{position:sticky;top:0;background:rgba(248,250,252,.96);z-index:3}.dark .roster-result-table thead th,[data-theme="dark"] .roster-result-table thead th{background:rgba(30,41,59,.96)}.roster-result-table tbody th{position:sticky;right:0;background:rgba(248,250,252,.97);z-index:2;min-width:170px;text-align:right}.dark .roster-result-table tbody th,[data-theme="dark"] .roster-result-table tbody th{background:rgba(30,41,59,.98)}.roster-result-table th small{display:block;color:var(--muted-color,#64748b);font-size:.7rem;margin-top:2px}.roster-result-table td span{display:inline-flex;margin:2px;padding:4px 7px;border-radius:999px;background:color-mix(in srgb,var(--shift-color,#6366f1) 16%,transparent);color:var(--shift-color,#6366f1);font-weight:900;font-size:.78rem}.roster-result-table td em{color:var(--muted-color,#94a3b8);font-style:normal}@media(max-width:900px){.roster-modal-layout,.roster-global-grid{grid-template-columns:1fr}.roster-staffing-row{grid-template-columns:1fr 1fr}.roster-result-head{align-items:flex-start;flex-direction:column}.roster-default-grid{grid-template-columns:1fr}.roster-step-card{padding:14px}}

/* v92.26 monthly roster modal polish: keep roster assistant popups identical to the app modal layer and prevent inner overflow */
.modal[data-roster-person-modal],
.modal[data-roster-global-modal]{position:fixed;inset:0;z-index:1300;display:flex;align-items:center;justify-content:center;padding:18px;overflow:hidden;isolation:isolate;}
.modal.hidden[data-roster-person-modal],
.modal.hidden[data-roster-global-modal]{display:none!important;}
.modal[data-roster-person-modal] .modal-backdrop,
.modal[data-roster-global-modal] .modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.58);backdrop-filter:blur(4px);}
.modal[data-roster-person-modal] .modal-card,
.modal[data-roster-global-modal] .modal-card{position:relative;z-index:1;margin:auto;transform:none;width:min(1120px,calc(100vw - 32px));max-height:min(88vh,860px);border-radius:var(--modal-radius,28px);overflow:hidden;display:flex;flex-direction:column;}
.modal[data-roster-person-modal] .modal-head,
.modal[data-roster-global-modal] .modal-head{flex:0 0 auto;min-width:0;}
.modal[data-roster-person-modal] .modal-head>div,
.modal[data-roster-global-modal] .modal-head>div{min-width:0;}
.modal[data-roster-person-modal] .modal-subtitle,
.modal[data-roster-global-modal] .modal-subtitle{white-space:normal;overflow-wrap:anywhere;}
.roster-modal-body{padding:18px 20px 20px;overflow-y:auto;overflow-x:hidden;min-width:0;scrollbar-gutter:stable;}
.roster-modal-body *,
.roster-modal-layout>*,
.roster-global-grid>*,
.roster-day-rule-panel,
.roster-global-panel{min-width:0;box-sizing:border-box;}
.roster-modal-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:18px;}
.roster-global-grid{grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);align-items:start;gap:18px;}
.roster-rule-calendar{display:grid;grid-template-columns:repeat(7,minmax(58px,1fr));gap:8px;max-width:100%;}
.roster-calendar-day{width:100%;min-width:0;overflow:hidden;}
.roster-calendar-day strong,
.roster-calendar-day small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.roster-day-rule-panel{overflow:hidden;}
.roster-day-rule-panel h4,
.roster-chip-section>span,
.roster-switch-line span{white-space:normal;overflow-wrap:anywhere;line-height:1.8;}
.roster-chip-grid{max-width:100%;overflow:hidden;}
.roster-toggle-chip{max-width:100%;}
.roster-toggle-chip span{max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.65;text-align:center;}
.roster-pair-people{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));}
.roster-pair-people label,
.roster-pair-list li{min-width:0;}
.roster-pair-people span,
.roster-pair-list span{min-width:0;overflow-wrap:anywhere;}
.roster-staffing-row{grid-template-columns:minmax(120px,1.2fr) repeat(4,minmax(68px,78px));}
.roster-staffing-row strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@media(max-width:920px){.modal[data-roster-person-modal] .modal-card,.modal[data-roster-global-modal] .modal-card{width:min(720px,calc(100vw - 24px));max-height:90vh}.roster-modal-layout,.roster-global-grid{grid-template-columns:1fr}.roster-rule-calendar{grid-template-columns:repeat(4,minmax(64px,1fr))}.roster-staffing-row{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.modal[data-roster-person-modal],.modal[data-roster-global-modal]{padding:10px}.roster-rule-calendar{grid-template-columns:repeat(3,minmax(64px,1fr))}.roster-modal-body{padding:14px}.roster-staffing-row{grid-template-columns:1fr}.roster-calendar-day{min-height:58px}}


/* v92.27 monthly roster modal/calendar polish */
.roster-demand-scroll{
    scroll-behavior:auto;
    overscroll-behavior-x:contain;
    touch-action:pan-x;
    will-change:scroll-position;
}
.roster-demand-scroll.drag-scroll-active,
.roster-person-strip.drag-scroll-active{
    cursor:grabbing;
    user-select:none;
    scroll-snap-type:none;
}
.modal[data-roster-person-modal] .modal-card,
.modal[data-roster-global-modal] .modal-card{
    width:min(1180px,calc(100vw - 28px));
    max-width:min(1180px,calc(100vw - 28px));
}
.modal[data-roster-person-modal] .roster-modal-body,
.modal[data-roster-global-modal] .roster-modal-body{
    padding:18px 20px 20px;
    overflow-y:auto;
    overflow-x:hidden;
    scrollbar-gutter:stable;
}
.roster-modal-layout.roster-rule-layout-pro,
.roster-global-grid{
    display:grid;
    grid-template-columns:minmax(360px,.95fr) minmax(420px,1.05fr);
    gap:16px;
    align-items:start;
    min-width:0;
}
.roster-calendar-panel,
.roster-global-panel{
    min-width:0;
    position:relative;
    z-index:1;
}
.roster-rule-calendar{
    display:grid;
    grid-template-columns:repeat(7,minmax(54px,1fr));
    gap:8px;
    min-width:0;
    overflow:visible;
    position:relative;
    z-index:2;
    isolation:isolate;
}
.roster-rule-calendar.compact{
    max-height:none;
    overflow:visible;
}
.roster-calendar-day{
    position:relative;
    z-index:2;
    min-width:0;
    width:100%;
    min-height:66px;
    overflow:hidden;
}
.roster-calendar-day strong,
.roster-calendar-day small{
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.roster-day-rule-panel.request-rule-editor-pro{
    position:relative;
    z-index:1;
    min-width:0;
    align-self:start;
}
.roster-day-rule-panel .request-rule-pro-card{
    width:100%;
    box-sizing:border-box;
}
.roster-chip-grid{
    min-width:0;
}
.roster-toggle-chip span{
    max-width:100%;
    white-space:normal;
    line-height:1.45;
}
.roster-global-panel{
    overflow:hidden;
}
.roster-global-panel .roster-rule-calendar{
    margin-bottom:10px;
}
.roster-pair-people label,
.roster-pair-list li,
.roster-staffing-row{
    min-width:0;
}
.roster-pair-people span,
.roster-pair-list span,
.roster-staffing-row strong{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
}
@media(max-width:920px){
    .roster-modal-layout.roster-rule-layout-pro,
    .roster-global-grid{grid-template-columns:1fr;}
    .modal[data-roster-person-modal] .modal-card,
    .modal[data-roster-global-modal] .modal-card{width:min(760px,calc(100vw - 22px));}
    .roster-rule-calendar{grid-template-columns:repeat(4,minmax(62px,1fr));}
}
@media(max-width:560px){
    .modal[data-roster-person-modal],.modal[data-roster-global-modal]{padding:10px;}
    .modal[data-roster-person-modal] .roster-modal-body,
    .modal[data-roster-global-modal] .roster-modal-body{padding:14px;}
    .roster-rule-calendar{grid-template-columns:repeat(3,minmax(64px,1fr));}
    .roster-calendar-day{min-height:58px;}
}

/* v92.24-local — monthly roster base-shift logic and wider rule modals */
.roster-default-grid{
    grid-template-columns:repeat(3,minmax(160px,1fr)) auto;
}
.roster-default-grid .ghost-btn{
    min-width:150px;
    white-space:nowrap;
}
.roster-day-demand{
    flex-basis:178px;
}
.modal[data-roster-person-modal] .modal-card,
.modal[data-roster-global-modal] .modal-card{
    width:min(1280px,calc(100vw - 24px));
    max-width:min(1280px,calc(100vw - 24px));
    max-height:min(92vh,900px);
}
.roster-modal-layout.roster-rule-layout-pro,
.roster-global-grid{
    grid-template-columns:minmax(430px,.95fr) minmax(500px,1.05fr);
    gap:18px;
}
.roster-calendar-panel,
.roster-global-panel,
.roster-day-rule-panel.request-rule-editor-pro{
    min-width:0;
    overflow:hidden;
}
.roster-rule-calendar{
    grid-template-columns:repeat(7,minmax(48px,1fr));
    gap:7px;
}
.roster-calendar-day{
    min-height:60px;
    padding:7px 5px;
}
.roster-day-rule-panel .request-rule-pro-card,
.roster-global-panel .request-rule-pro-card{
    min-width:0;
    overflow:hidden;
}
.roster-chip-grid{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    overflow:visible;
}
.roster-toggle-chip span{
    min-height:32px;
    padding:6px 10px;
    font-size:.8rem;
    line-height:1.45;
}
.roster-staffing-row{
    grid-template-columns:minmax(118px,1.05fr) repeat(4,minmax(62px,72px));
    gap:7px;
}
.roster-staffing-row input{
    padding:8px 9px;
}
@media(max-width:1050px){
    .roster-modal-layout.roster-rule-layout-pro,
    .roster-global-grid{grid-template-columns:1fr;}
    .modal[data-roster-person-modal] .modal-card,
    .modal[data-roster-global-modal] .modal-card{width:min(820px,calc(100vw - 22px));}
    .roster-rule-calendar{grid-template-columns:repeat(7,minmax(44px,1fr));}
}
@media(max-width:720px){
    .roster-default-grid{grid-template-columns:1fr;}
    .roster-rule-calendar{grid-template-columns:repeat(4,minmax(56px,1fr));}
    .roster-staffing-row{grid-template-columns:1fr 1fr;}
}
@media(max-width:520px){
    .roster-rule-calendar{grid-template-columns:repeat(3,minmax(60px,1fr));}
    .roster-calendar-day{min-height:56px;}
    .roster-staffing-row{grid-template-columns:1fr;}
}

/* v92.33 local roster popup refinement: smaller modal, clean in-card calendars, no refresh-like day selection */
.modal[data-roster-person-modal] .modal-card,
.modal[data-roster-global-modal] .modal-card{
    width:min(980px,calc(100vw - 32px)) !important;
    max-width:min(980px,calc(100vw - 32px)) !important;
    max-height:min(88vh,820px) !important;
}
.modal[data-roster-person-modal] .roster-modal-body,
.modal[data-roster-global-modal] .roster-modal-body{
    padding:16px 18px 18px !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
}
.roster-modal-layout.roster-rule-layout-pro,
.roster-global-grid{
    grid-template-columns:minmax(0,.94fr) minmax(0,1.06fr) !important;
    gap:14px !important;
    align-items:start !important;
}
.request-rule-calendar-panel,
.roster-calendar-panel,
.roster-global-panel,
.roster-day-rule-panel.request-rule-editor-pro{
    min-width:0 !important;
    max-width:100% !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
}
.roster-rule-calendar{
    display:grid !important;
    grid-template-columns:repeat(7,minmax(0,1fr)) !important;
    gap:6px !important;
    width:100% !important;
    max-width:100% !important;
    overflow:visible !important;
}
.roster-calendar-day{
    min-width:0 !important;
    width:100% !important;
    min-height:58px !important;
    padding:7px 4px !important;
    border-radius:14px !important;
    overflow:hidden !important;
}
.roster-calendar-day strong{
    font-size:.92rem !important;
    line-height:1.1 !important;
}
.roster-calendar-day .roster-day-condition-badge,
.roster-calendar-day small.roster-day-condition-badge{
    min-height:16px !important;
    max-width:100% !important;
    font-size:.62rem !important;
    line-height:1.35 !important;
    color:#059669 !important;
    font-weight:900 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}
.dark .roster-calendar-day .roster-day-condition-badge,
[data-theme="dark"] .roster-calendar-day .roster-day-condition-badge{
    color:#34d399 !important;
}
.roster-calendar-day:not(.has-rule) .roster-day-condition-badge:empty::before{
    content:'—';
    color:var(--muted-color,#94a3b8);
    font-weight:700;
}
.roster-calendar-day.has-rule::after{display:none !important;}
.roster-calendar-day.has-rule{
    box-shadow:inset 0 -3px 0 rgba(16,185,129,.45);
}
.roster-day-rule-panel.request-rule-editor-pro,
.roster-global-panel{
    padding:13px !important;
    border-radius:20px !important;
}
.roster-chip-grid{
    gap:6px !important;
}
.roster-toggle-chip span{
    min-height:30px !important;
    padding:5px 9px !important;
    font-size:.76rem !important;
    line-height:1.35 !important;
}
.roster-pair-people{
    grid-template-columns:repeat(auto-fit,minmax(118px,1fr)) !important;
    gap:6px !important;
    max-height:148px !important;
}
.roster-pair-people label{
    padding:7px 8px !important;
    font-size:.76rem !important;
}
.roster-pair-list{
    max-height:120px;
    overflow:auto;
}
.roster-pair-list li{
    padding:7px 9px !important;
    font-size:.76rem !important;
}
.roster-staffing-row{
    grid-template-columns:minmax(86px,1fr) repeat(4,minmax(44px,54px)) !important;
    gap:6px !important;
    padding:8px !important;
}
.roster-staffing-row strong{
    font-size:.78rem !important;
}
.roster-staffing-row span{
    font-size:.66rem !important;
}
.roster-staffing-row input{
    padding:7px 6px !important;
    border-radius:11px !important;
}
.roster-selected-day-title{
    margin:8px 0 !important;
    font-size:.86rem !important;
}
.modal[data-roster-person-modal] .form-actions,
.modal[data-roster-global-modal] .form-actions{
    padding:12px 18px 16px;
    gap:8px;
}
@media(max-width:900px){
    .modal[data-roster-person-modal] .modal-card,
    .modal[data-roster-global-modal] .modal-card{width:min(760px,calc(100vw - 24px)) !important;}
    .roster-modal-layout.roster-rule-layout-pro,
    .roster-global-grid{grid-template-columns:1fr !important;}
}
@media(max-width:620px){
    .modal[data-roster-person-modal] .modal-card,
    .modal[data-roster-global-modal] .modal-card{width:calc(100vw - 20px) !important;}
    .roster-rule-calendar{grid-template-columns:repeat(4,minmax(0,1fr)) !important;}
    .roster-staffing-row{grid-template-columns:1fr 1fr !important;}
}


/* v92.34 local roster rule modal feedback and compact badges */
.modal[data-roster-person-modal] .modal-card,
.modal[data-roster-global-modal] .modal-card{
    width:min(940px,calc(100vw - 32px)) !important;
    max-width:min(940px,calc(100vw - 32px)) !important;
}
.roster-calendar-day.selected{
    border-color:#4f46e5 !important;
    background:linear-gradient(145deg,rgba(79,70,229,.22),rgba(14,165,233,.13)) !important;
    box-shadow:0 0 0 3px rgba(79,70,229,.22), inset 0 0 0 1px rgba(255,255,255,.16) !important;
    transform:translateY(-1px);
}
.dark .roster-calendar-day.selected,
[data-theme="dark"] .roster-calendar-day.selected{
    border-color:#a78bfa !important;
    background:linear-gradient(145deg,rgba(139,92,246,.28),rgba(14,165,233,.14)) !important;
    box-shadow:0 0 0 3px rgba(139,92,246,.25), inset 0 0 0 1px rgba(255,255,255,.1) !important;
}
.roster-calendar-day.selected strong{
    color:#312e81 !important;
}
.dark .roster-calendar-day.selected strong,
[data-theme="dark"] .roster-calendar-day.selected strong{
    color:#ede9fe !important;
}
.roster-calendar-day .roster-day-condition-badge{
    border-radius:999px;
    padding:1px 5px;
    background:rgba(16,185,129,.1);
}
.roster-calendar-day.has-rule .roster-day-condition-badge{
    background:rgba(16,185,129,.16);
    color:#047857 !important;
}
.dark .roster-calendar-day.has-rule .roster-day-condition-badge,
[data-theme="dark"] .roster-calendar-day.has-rule .roster-day-condition-badge{
    background:rgba(52,211,153,.14);
    color:#6ee7b7 !important;
}
.roster-pair-form .swap-segmented label.is-selected{
    border-color:rgba(79,70,229,.45) !important;
    background:linear-gradient(135deg,rgba(79,70,229,.18),rgba(14,165,233,.10)) !important;
    color:var(--text-color,var(--text,#0f172a)) !important;
    box-shadow:0 8px 22px rgba(79,70,229,.10) !important;
}
.dark .roster-pair-form .swap-segmented label.is-selected,
[data-theme="dark"] .roster-pair-form .swap-segmented label.is-selected{
    border-color:rgba(167,139,250,.42) !important;
    background:linear-gradient(135deg,rgba(139,92,246,.25),rgba(14,165,233,.10)) !important;
    color:#f8fafc !important;
}
.modal[data-roster-person-modal] .form-actions .danger-text{
    color:#dc2626;
    border-color:rgba(239,68,68,.25);
    background:rgba(239,68,68,.06);
}
.dark .modal[data-roster-person-modal] .form-actions .danger-text,
[data-theme="dark"] .modal[data-roster-person-modal] .form-actions .danger-text{
    color:#fca5a5;
    background:rgba(239,68,68,.12);
}
@media(max-width:900px){
    .modal[data-roster-person-modal] .modal-card,
    .modal[data-roster-global-modal] .modal-card{width:min(740px,calc(100vw - 24px)) !important;}
}

/* Study Leitner / Anki-style flashcards */
#studyFlashcardModal .modal-card,
.study-flashcard-modal-card{
    width:min(760px,calc(100vw - 24px));
    max-height:min(88vh,820px);
}
.study-flashcard-modal-body{
    display:flex;
    flex-direction:column;
    gap:14px;
}
.study-leitner-view{
    display:grid;
    grid-template-columns:minmax(0,1.25fr) minmax(260px,.75fr);
    gap:18px;
    align-items:start;
}
.study-flashcard-review-panel,
.study-flashcard-cards-panel{
    min-width:0;
}
.study-flashcard-review-panel{grid-column:1 / -1;}
.study-flashcard-decks-panel{min-width:0;}
.study-flashcard-deck-filter-row{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:12px 0 16px;
}
.study-flashcard-deck-chip{
    border:1px solid rgba(148,163,184,.32);
    background:rgba(255,255,255,.62);
    color:var(--text-color,var(--text,#0f172a));
    border-radius:999px;
    padding:8px 12px;
    display:inline-flex;
    align-items:center;
    gap:8px;
    cursor:pointer;
    transition:.18s ease;
}
.study-flashcard-deck-chip i,
.study-flashcard-deck-row i,
.study-flashcard-list-main i{
    width:10px;
    height:10px;
    border-radius:999px;
    background:var(--study-color,#66d9ff);
    box-shadow:0 0 0 4px color-mix(in srgb,var(--study-color,#66d9ff) 16%,transparent);
    flex:0 0 auto;
}
.study-flashcard-deck-chip.is-active,
.study-flashcard-deck-chip:hover{
    border-color:color-mix(in srgb,var(--study-color,#4f46e5) 45%,rgba(148,163,184,.4));
    background:linear-gradient(135deg,color-mix(in srgb,var(--study-color,#4f46e5) 14%,rgba(255,255,255,.7)),rgba(255,255,255,.78));
    transform:translateY(-1px);
}
.study-flashcard-deck-chip b{font-weight:800;}
.study-flashcard-review-card{
    display:grid;
    gap:14px;
    border:1px solid rgba(148,163,184,.26);
    border-radius:24px;
    padding:16px;
    background:linear-gradient(145deg,rgba(255,255,255,.82),rgba(248,250,252,.65));
    box-shadow:0 16px 42px rgba(15,23,42,.08);
}
.study-flashcard-meta-row{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.study-flashcard-meta-row span{
    border:1px solid rgba(148,163,184,.26);
    border-radius:999px;
    padding:4px 9px;
    font-size:.8rem;
    color:var(--muted-color,var(--muted,#64748b));
    background:rgba(255,255,255,.52);
}
.study-flashcard-face{
    border:1px solid rgba(148,163,184,.22);
    border-radius:20px;
    padding:16px;
    background:rgba(255,255,255,.72);
    min-height:120px;
    white-space:normal;
    overflow-wrap:anywhere;
}
.study-flashcard-face small{
    display:block;
    margin-bottom:8px;
    color:var(--muted-color,var(--muted,#64748b));
    font-size:.78rem;
}
.study-flashcard-face div{
    font-size:1.08rem;
    line-height:1.9;
    color:var(--text-color,var(--text,#0f172a));
}
.study-flashcard-face.back{
    background:linear-gradient(145deg,rgba(16,185,129,.08),rgba(14,165,233,.08));
    border-color:rgba(16,185,129,.22);
}
.study-flashcard-face p{
    margin:12px 0 0;
    color:var(--muted-color,var(--muted,#64748b));
    line-height:1.8;
}
.study-flashcard-show-answer{justify-self:center;min-width:190px;}
.study-flashcard-rating-row{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
}
.study-flashcard-rating-btn{
    border:1px solid rgba(148,163,184,.28);
    border-radius:18px;
    padding:12px 10px;
    background:rgba(255,255,255,.72);
    color:var(--text-color,var(--text,#0f172a));
    display:flex;
    flex-direction:column;
    gap:3px;
    cursor:pointer;
    transition:.18s ease;
}
.study-flashcard-rating-btn:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(15,23,42,.08);}
.study-flashcard-rating-btn small{color:var(--muted-color,var(--muted,#64748b));}
.study-flashcard-rating-btn.rating-1{border-color:rgba(239,68,68,.28);}
.study-flashcard-rating-btn.rating-2{border-color:rgba(245,158,11,.28);}
.study-flashcard-rating-btn.rating-3{border-color:rgba(16,185,129,.28);}
.study-flashcard-rating-btn.rating-4{border-color:rgba(14,165,233,.28);}
.study-flashcard-review-empty{
    border:1px dashed rgba(148,163,184,.35);
    border-radius:24px;
    padding:28px;
    text-align:center;
    background:rgba(255,255,255,.55);
}
.study-flashcard-deck-list,
.study-flashcard-list{
    display:grid;
    gap:10px;
}
.study-flashcard-deck-row,
.study-flashcard-list-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    border:1px solid rgba(148,163,184,.24);
    border-radius:18px;
    padding:10px;
    background:rgba(255,255,255,.58);
}
.study-flashcard-deck-main,
.study-flashcard-list-main{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
    flex:1;
    border:0;
    background:transparent;
    text-align:right;
    color:inherit;
    cursor:pointer;
}
.study-flashcard-deck-main span,
.study-flashcard-list-main span{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:3px;
}
.study-flashcard-deck-main strong,
.study-flashcard-list-main strong{
    color:var(--text-color,var(--text,#0f172a));
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.study-flashcard-deck-main small,
.study-flashcard-list-main small{
    color:var(--muted-color,var(--muted,#64748b));
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.study-flashcard-form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}
.study-flashcard-form-grid label{
    display:flex;
    flex-direction:column;
    gap:6px;
}
.study-flashcard-form-grid label span{
    font-size:.84rem;
    color:var(--muted-color,var(--muted,#64748b));
}
.study-flashcard-form-grid input,
.study-flashcard-form-grid select,
.study-flashcard-form-grid textarea{
    width:100%;
}
.study-flashcard-wide{grid-column:1 / -1;}
.dark .study-flashcard-deck-chip,
[data-theme="dark"] .study-flashcard-deck-chip,
.dark .study-flashcard-review-card,
[data-theme="dark"] .study-flashcard-review-card,
.dark .study-flashcard-face,
[data-theme="dark"] .study-flashcard-face,
.dark .study-flashcard-review-empty,
[data-theme="dark"] .study-flashcard-review-empty,
.dark .study-flashcard-deck-row,
[data-theme="dark"] .study-flashcard-deck-row,
.dark .study-flashcard-list-item,
[data-theme="dark"] .study-flashcard-list-item,
.dark .study-flashcard-rating-btn,
[data-theme="dark"] .study-flashcard-rating-btn{
    background:rgba(15,23,42,.62);
    border-color:rgba(148,163,184,.20);
}
.dark .study-flashcard-face.back,
[data-theme="dark"] .study-flashcard-face.back{
    background:linear-gradient(145deg,rgba(16,185,129,.13),rgba(14,165,233,.11));
}
@media(max-width:900px){
    .study-leitner-view{grid-template-columns:1fr;}
    .study-flashcard-rating-row{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:620px){
    .study-flashcard-form-grid{grid-template-columns:1fr;}
    .study-flashcard-deck-row,
    .study-flashcard-list-item{align-items:stretch;flex-direction:column;}
    .study-flashcard-rating-row{grid-template-columns:1fr;}
}

/* Fitness planner v94 */
.fitness-planner-grid {
    display: block;
}

.fitness-shell {
    width: 100%;
    display: grid;
    gap: 18px;
}

.fitness-hero {
    overflow: hidden;
}

.fitness-date-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.fitness-kpi-grid .fitness-kpi strong {
    direction: rtl;
}

.fitness-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr);
    gap: 18px;
    align-items: start;
}

.fitness-day-form {
    display: grid;
    gap: 16px;
}

.fitness-date-inline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.fitness-date-inline label,
.fitness-notes,
.fitness-calorie-input {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: .88rem;
}

.fitness-date-inline input,
.fitness-meal-row input,
.fitness-activity-row input,
.fitness-notes textarea {
    width: 100%;
    border: 1px solid var(--border-color, rgba(148,163,184,.24));
    border-radius: 16px;
    background: rgba(255,255,255,.06);
    color: var(--text);
    padding: 11px 12px;
    outline: none;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.fitness-date-inline input:focus,
.fitness-meal-row input:focus,
.fitness-activity-row input:focus,
.fitness-notes textarea:focus {
    border-color: rgba(102, 217, 255, .7);
    background: rgba(255,255,255,.09);
    box-shadow: 0 0 0 4px rgba(102, 217, 255, .12);
}

.fitness-meals-list,
.fitness-activity-list {
    display: grid;
    gap: 10px;
}

.fitness-meal-row,
.fitness-activity-row {
    display: grid;
    grid-template-columns: minmax(135px, .55fr) minmax(0, 1fr) minmax(120px, .32fr);
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border-color, rgba(148,163,184,.24));
    border-radius: 20px;
    background: rgba(255,255,255,.045);
}

.fitness-activity-row {
    grid-template-columns: minmax(0, 1fr) minmax(130px, .3fr) auto;
}

.fitness-meal-label {
    display: grid;
    gap: 3px;
    align-self: center;
}

.fitness-meal-label strong,
.fitness-section-title strong {
    color: var(--text);
}

.fitness-meal-label small {
    color: var(--muted);
    font-size: .78rem;
}

.fitness-section-title,
.fitness-live-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.fitness-activity-box {
    display: grid;
    gap: 10px;
}

.fitness-live-summary {
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(102,217,255,.12), rgba(139,152,255,.10));
    border: 1px solid rgba(255,255,255,.10);
}

.fitness-live-summary span {
    color: var(--muted);
}

.fitness-live-summary b {
    color: var(--text);
    font-size: 1.05rem;
}

.fitness-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.fitness-month-day {
    min-height: 68px;
    border: 1px solid var(--border-color, rgba(148,163,184,.24));
    border-radius: 18px;
    background: rgba(255,255,255,.045);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    gap: 3px;
    padding: 8px 4px;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.fitness-month-day:hover {
    transform: translateY(-2px);
    border-color: rgba(102,217,255,.55);
}

.fitness-month-day.has-log {
    background: rgba(102,217,255,.11);
    border-color: rgba(102,217,255,.28);
}

.fitness-month-day.is-active {
    background: linear-gradient(135deg, rgba(102,217,255,.25), rgba(139,152,255,.20));
    border-color: rgba(102,217,255,.70);
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.fitness-month-day strong {
    font-size: 1rem;
}

.fitness-month-day small {
    color: var(--muted);
    font-size: .72rem;
}

@media (max-width: 980px) {
    .fitness-layout,
    .fitness-date-inline,
    .fitness-meal-row,
    .fitness-activity-row {
        grid-template-columns: 1fr;
    }

    .fitness-date-actions {
        justify-content: stretch;
    }

    .fitness-date-actions > * {
        flex: 1 1 120px;
    }
}

@media (max-width: 640px) {
    .fitness-month-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .fitness-month-day {
        min-height: 60px;
    }
}
