/* Neutral component theme adapted for the existing PHP calendar. */
:root{--bg:#fafafa;--surface:#fff;--text:#18181b;--muted:#71717a;--line:#e4e4e7;--hover:#f4f4f5;--blue:#18181b;--today:#18181b;--shadow:0 1px 3px #0000000d,0 1px 2px #00000008;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:14px;color-scheme:light}
[data-theme=dark]{--bg:#09090b;--surface:#111113;--text:#fafafa;--muted:#a1a1aa;--line:#27272a;--hover:#27272a;--blue:#fafafa;--today:#fafafa;color-scheme:dark}
body{background:var(--bg);-webkit-font-smoothing:antialiased}
button,a,input,select,textarea{transition:background-color .15s,border-color .15s,box-shadow .15s}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[data-id]:focus-visible{outline:2px solid var(--muted);outline-offset:3px}
.topbar{background:var(--surface);border-bottom:1px solid var(--line);gap:6px;padding:0 16px}
.identity{font-size:18px;font-weight:600;letter-spacing:-.5px;min-width:188px}
.calicon{background:var(--text);color:var(--surface);box-shadow:none;border:1px solid var(--line);border-radius:8px;font-size:16px;padding:0;width:30px;height:32px}
.topbar h1{font-size:18px;letter-spacing:-.4px;font-weight:600;margin-left:14px}
.icon,.topbar #prevBtn,.topbar #nextBtn{border-radius:6px;width:34px;height:34px;color:var(--muted)}
.icon:hover{background:var(--hover);color:var(--text)}
.icon svg,.rail svg{width:19px;height:19px}
.today,.topbar #viewSelect{border:1px solid var(--line);border-radius:6px;background:var(--surface);font-size:13px;font-weight:500;min-height:34px;box-shadow:var(--shadow)}
.today{padding:6px 16px}
.topbar #viewSelect{padding-top:6px;padding-bottom:6px;line-height:20px}
.today:hover,.topbar #viewSelect:hover{background:var(--hover)}
.avatar{background:var(--text);color:var(--surface);border:0;outline:0;width:32px;height:32px;font-size:12px}
.mode-switch{border-color:var(--line);border-radius:7px;background:var(--hover);padding:3px;gap:2px}
.mode-switch button{width:36px;height:28px;border-radius:4px;color:var(--muted)}
.mode-switch button:first-child,body.tasks-mode .mode-switch button:last-child{background:var(--surface);color:var(--text);box-shadow:var(--shadow)}
body.tasks-mode .mode-switch button:first-child{background:transparent;color:var(--muted);box-shadow:none}
.layout{padding:0;grid-template-columns:256px minmax(0,1fr) 52px}
.sidebar,body.tasks-mode .sidebar{background:var(--bg);border-right:1px solid var(--line);padding:20px 16px}
#calendarSurface,body.tasks-mode #calendarSurface{border-radius:0;background:var(--surface)}
.create,[data-theme=dark] .create{background:var(--text);color:var(--surface);height:38px;min-width:0;width:100%;border:1px solid var(--text);border-radius:6px;box-shadow:var(--shadow);font-size:13px;font-weight:500;justify-content:center;gap:8px}
.create:hover{opacity:.9;box-shadow:var(--shadow)}
.create svg{width:18px;height:18px}.create .chevron{margin-left:auto}
.mini{margin:26px 0 20px}.mini header{font-size:12px;font-weight:600}.mini th{color:var(--muted);font-weight:500}.mini button{border-radius:5px;font-size:11px}
.mini .active,.day-number.today,.week-head .today-head b{background:var(--text);color:var(--surface)}
.mini button.selected{outline:1px solid var(--text);outline-offset:-1px}
.sidebar h2{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);margin:24px 8px 10px}
.calendar-item{font-size:12px;border-radius:6px;padding:8px}.calendar-item input{width:15px;height:15px}
.sidebar .textbtn{color:var(--muted);font-size:12px}.people-search{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:9px 10px;font-size:12px}
.rail{background:var(--bg);border-left:1px solid var(--line);gap:12px}
.rail button,.rail button[title]{background:transparent;color:var(--muted);border:1px solid transparent;border-radius:6px;box-shadow:none;width:32px;height:32px}
.rail button:hover{background:var(--hover);color:var(--text);border-color:var(--line)}
.week-head div,.month-weekday{font-weight:500;font-size:10px;letter-spacing:.04em}.week-head b{font-size:24px;font-weight:500}.week-head .today-head b{border-radius:8px}
.day-column:hover{background-color:var(--hover)}.time-label{color:var(--muted)}
.event,.month-event,.all-day-event{border-radius:4px;font-weight:500}.event{box-shadow:0 1px 2px #00000012}.month-day.other{background:var(--bg)}
.searchbar{background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow)}.searchbar input{font-size:14px}
dialog,#detailDialog,#toolDialog{border:1px solid var(--line);border-radius:10px;background:var(--surface);box-shadow:0 16px 48px #00000026}
dialog::backdrop{background:#0007;backdrop-filter:blur(2px)}
dialog header h2,#settingsDialog h2,#helpDialog h2,#trashDialog h2,#calendarDialog h2{font-size:18px;font-weight:600;letter-spacing:-.4px}
dialog label,#eventDialog label{font-size:12px;font-weight:500;color:var(--text)}
dialog input:not([type=checkbox]):not([type=color]),dialog textarea,dialog select,#eventDialog input:not([type=hidden]):not([type=checkbox]),#eventDialog textarea,#eventDialog select{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:9px 11px;font-size:13px;box-shadow:var(--shadow)}
dialog input:focus,dialog textarea:focus,dialog select:focus{outline:2px solid var(--muted);outline-offset:2px}
#eventDialog #eventTitle{font-size:20px;border:1px solid var(--line);padding:10px 12px;letter-spacing:-.4px}
dialog footer button,#eventDialog footer button,#calendarDialog footer button,#trashItems button{border:1px solid var(--line);background:var(--surface);border-radius:6px;padding:8px 16px;font-size:13px;font-weight:500;cursor:pointer}
.primary{background:var(--text)!important;color:var(--surface)!important;border-color:var(--text)!important}
.danger{color:#dc2626}.primary:hover{opacity:.9}dialog footer button:hover{background:var(--hover)}
.event-tabs{background:var(--hover);padding:3px;gap:3px;border-radius:6px}.event-tabs button{flex:1;background:transparent;border-radius:4px;padding:7px 12px;font-size:12px;color:var(--muted)}.event-tabs button.selected{background:var(--surface);color:var(--text);box-shadow:var(--shadow)}
.floating-menu,.task-menu,.account-menu{background:var(--surface);border:1px solid var(--line);border-radius:7px;box-shadow:0 4px 12px #00000012;padding:4px}
.floating-menu button,.task-menu button{border-radius:4px;padding:8px 10px;font-size:12px}.account-menu{padding:20px}.account-menu button{border-radius:6px}
.task-nav{border-radius:6px;padding:8px 12px;font-size:13px;gap:10px}.task-nav.active,[data-theme=dark] .task-nav.active{background:var(--hover);color:var(--text);font-weight:600}.task-nav svg{width:17px;height:17px}
.tasks-sidebar .create{margin:0 0 24px;min-width:0}.task-list-toggle{padding:8px 12px;font-size:12px;border-radius:6px}.task-list-toggle input{width:15px;height:15px;accent-color:var(--text)}
.tasks-board{padding:24px;gap:16px;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));background:var(--bg)}
.task-card{border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);background:var(--surface);padding-top:16px}.task-card:hover{border-color:var(--line)}.task-card h2{font-size:16px;font-weight:600;letter-spacing:-.3px}
.task-add,[data-theme=light] .task-add{color:var(--text);font-size:12px;font-weight:500}.task-title-button{font-size:13px}.task-check{width:16px;height:16px;border-width:1.5px}.task-detail-preview{font-size:12px}.task-completed{font-size:12px;color:var(--muted)}
.task-date{border-radius:5px;font-size:11px;font-weight:500;min-height:23px;padding:2px 7px}.task-date .ht-icon{width:13px;height:13px}.task-celebration h3{font-size:17px;font-weight:600}.task-celebration p{font-size:13px;color:var(--muted)}
.toast{background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow);font-size:13px}
.signin{background:var(--bg)}.signin h1{font-size:28px;letter-spacing:-1px;font-weight:600}.signin p{font-size:14px;color:var(--muted)}.signin .brandmark{background:var(--text);color:var(--surface);border-radius:14px;box-shadow:var(--shadow)}.workspace-login{background:var(--text);color:var(--surface);border-radius:6px;font-size:13px;font-weight:500}.signin small{font-size:11px;color:var(--muted)}
.app-version{font-size:10px;background:var(--bg);color:var(--muted)}
@media(max-width:1100px){.layout{grid-template-columns:230px minmax(0,1fr) 50px}.identity{min-width:140px}.topbar h1{font-size:16px}}
@media(max-width:750px){.layout{grid-template-columns:minmax(0,1fr) 44px}.topbar{padding:0 8px;gap:4px}.topbar .today{padding:6px 12px}.topbar #viewSelect{min-height:34px}.tasks-board{padding:12px;grid-template-columns:minmax(0,1fr)}.sidebar.mobile-open{bottom:24px;border-right:1px solid var(--line)}#toolDialog{right:8px}dialog .row{gap:12px}.signin h1{font-size:24px}}
@media(prefers-reduced-motion:reduce){button,a,input,select,textarea{transition:none}}
@media print{.layout{display:block}.tasks-board{background:white;padding:0}.task-card{break-inside:avoid;box-shadow:none}#calendarSurface{border:0}.app-version{display:none}}
/* Visibility audit: preserve readable controls at narrow widths and on touch. */
.topbar>*{flex-shrink:0}.topbar .toolbar-spacer{flex-shrink:1}.topbar h1{min-width:0}
dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;overflow-wrap:anywhere}
dialog .row>*{min-width:0}dialog input,dialog select,dialog textarea{min-width:0;max-width:100%}
dialog footer{flex-wrap:wrap}dialog footer button{white-space:nowrap;flex-shrink:0}
#taskEditDialog footer button,#taskListDialog footer button,#taskConfirmDialog button{border-radius:6px;padding:8px 14px}
.task-actions{opacity:1;flex-shrink:0}.task-card header .icon{flex-shrink:0}.task-card h2{min-width:0}
.task-menu,.floating-menu{max-height:calc(100dvh - 24px);max-width:calc(100vw - 16px);overflow-y:auto}
.task-menu button,.floating-menu button{overflow-wrap:anywhere}
.event b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;line-height:15px}.event br{display:none}
.all-day-event{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
[data-theme=dark] .rail button[title]{background:transparent;color:var(--muted)}
[data-theme=dark] .mode-switch button:first-child,[data-theme=dark] body.tasks-mode .mode-switch button:last-child{background:var(--surface);color:var(--text)}
[data-theme=dark] body.tasks-mode .mode-switch button:first-child{background:transparent;color:var(--muted)}
.people-search>.ht-icon{color:var(--muted)}[data-theme=dark] .danger{color:#fca5a5}
button:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:1100px){.topbar .mode-switch{display:flex}.identity{min-width:110px}.identity span:last-child{font-size:16px}.topbar h1{font-size:14px;margin-left:6px}}
@media(min-width:751px) and (max-width:1000px){.topbar .identity{min-width:32px}.topbar .identity span:last-child{display:none}.topbar #helpBtn{display:none}.topbar #viewSelect{flex-basis:130px;width:130px;min-width:130px}}
@media(max-width:750px){
 .topbar{height:104px;flex-wrap:wrap;align-content:center;row-gap:8px;padding:8px}
 .topbar .toolbar-spacer{display:none}.topbar .avatar{margin-left:auto;flex:0 0 32px}
 .topbar #viewSelect{order:2;flex:1 0 calc(100% - 100px);width:auto;min-width:126px;max-width:none}
 .topbar .mode-switch{order:2;display:flex;margin-left:0;flex-shrink:0}.mode-switch button{width:30px;height:26px}
 body .layout{height:calc(100dvh - 128px)}.sidebar.mobile-open{top:104px;bottom:24px}
 #eventDialog .row{grid-template-columns:minmax(0,1fr)}
 dialog form,#eventDialog form{padding:16px}#settingsDialog form,#taskEditDialog form,#taskListDialog form,#calendarDialog form{padding:0}
 #settingsDialog,#taskEditDialog,#taskListDialog,#taskConfirmDialog,#calendarDialog,#helpDialog,#trashDialog{padding:20px}
 #toolDialog{top:112px;height:calc(100dvh - 144px)}
 #calendarSurface:has(.day-column:nth-child(5)) .week-head,#calendarSurface:has(.day-column:nth-child(5)) .all-day-strip,#calendarSurface:has(.day-column:nth-child(5)) .time-grid{min-width:460px}
 #calendarSurface:has(.day-column:nth-child(8)) .week-head,#calendarSurface:has(.day-column:nth-child(8)) .all-day-strip,#calendarSurface:has(.day-column:nth-child(8)) .time-grid{min-width:760px}
 .task-date{font-size:12px}.task-actions .icon{width:30px;height:30px}.task-title-button{font-size:14px}
 .task-card .task-row{gap:8px}.searchbar{height:44px;right:8px;left:8px}
}
@media print{body .layout{height:auto}.task-actions{display:none!important}}

.event,.all-day-event,.month-event{color:var(--event-ink,#fff)}
.calendar-item span,.account-menu{overflow-wrap:anywhere}
.calendar-item input{flex-shrink:0}
.searchbar input{min-width:0}

@media screen and (min-width:751px) and (max-width:900px){
 .rail{display:flex}
 .topbar #rangeTitle{display:block;font-size:13px}
 #calendarSurface:has(.day-column:nth-child(8)) .week-head,
 #calendarSurface:has(.day-column:nth-child(8)) .all-day-strip,
 #calendarSurface:has(.day-column:nth-child(8)) .time-grid{min-width:760px}
}

@media screen and (max-width:750px){
 body:not(.tasks-mode) .topbar{height:132px}
 .topbar #rangeTitle{display:block;order:3;flex-basis:100%;margin:0;padding:0 4px;font-size:13px;line-height:20px}
 body:not(.tasks-mode) .layout{height:calc(100dvh - 156px)}
 body:not(.tasks-mode) .sidebar.mobile-open{top:132px}
 body:not(.tasks-mode) #toolDialog{top:140px;height:calc(100dvh - 172px)}
}
