/* Calendar controls and responsive layouts; legacy event/permission data is unchanged. */
.nc2-calendar-toolbar,.nc2-calendar-views {display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.nc2-calendar-toolbar {margin:0 0 10px;padding:8px;background:#f4f7fb;border:1px solid #d1dce9;border-radius:10px;line-height:1.5}
.nc2-calendar-toolbar button,.nc2-calendar-views button,.nc2-calendar-toolbar a,.nc2-calendar-date-picker input[type=button] {box-sizing:border-box;min-height:36px;padding:6px 10px;border:1px solid #9aadc4;border-radius:7px;background:#fff;color:#204567;font:inherit;line-height:1.4;text-decoration:none;cursor:pointer}
.nc2-calendar-views button[aria-pressed=true] {background:#244e75;color:#fff;border-color:#244e75;font-weight:700}
.nc2-calendar-toolbar button:hover,.nc2-calendar-toolbar a:hover,.nc2-calendar-views button:hover {box-shadow:inset 0 0 0 2px #7898b7}
.nc2-calendar-root :is(a,button):focus-visible,.nc2-calendar-date-picker :is(a,button,input,select):focus-visible,.nc2-calendar-scroll:focus-visible {outline:3px solid #1476c8;outline-offset:2px}
.nc2-calendar-toolbar .nc2-calendar-external {font-size:90%;margin-left:auto}
.nc2-calendar-root :is(.calendar_yearly,.calendar_lmonthly,.calendar_smonthly,.calendar_weekly,.calendar_daily,.calendar_schedule) {box-sizing:border-box;max-width:100%;min-width:0;color:#263749}
.nc2-calendar-root table.calendar_head {margin:0 0 12px;border-collapse:separate;border-spacing:4px}
.nc2-calendar-root table.calendar_head td {padding:2px 4px;white-space:normal}
.nc2-calendar-root table.calendar_head :is(td.calendar_prev_year,td.calendar_prev_month,td.calendar_next_year,td.calendar_next_month) {width:auto}
.nc2-calendar-root table.calendar_head :is(.calendar_this_month,.calendar_this_year) {font-size:clamp(18px,2.4vw,26px);font-weight:700}
/* Keep year/month navigation together and distinguish day/week jumps. */
.nc2-calendar-root table.nc2-calendar-period {display:block;width:100%;max-width:100%;border-spacing:0}
.nc2-calendar-root table.nc2-calendar-period>tbody {display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px 12px}
.nc2-calendar-root table.nc2-calendar-period>tbody>tr {display:flex;align-items:center;gap:4px}
.nc2-calendar-root table.nc2-calendar-period td {display:block;padding:0;width:auto}
.nc2-calendar-root table.nc2-calendar-period :is(.calendar_this_year,.calendar_this_month) {font-size:22px;line-height:1.4;min-width:3em;text-align:center}
.nc2-calendar-root table.nc2-calendar-period .nc2-calendar-week-row {flex-basis:100%;justify-content:center}
.nc2-calendar-root table.nc2-calendar-period td.nc2-calendar-week-navigation {display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px}
.nc2-calendar-root .nc2-calendar-week-navigation>:is(a,span) {box-sizing:border-box;min-height:32px;display:inline-flex;align-items:center;justify-content:center;padding:4px 6px}
.nc2-calendar-root .calendar_action,.nc2-calendar-date-picker .calendar_action {display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;box-sizing:border-box;border:1px solid #adbed1;border-radius:5px;background:#f7faff;color:#245075;text-decoration:none;vertical-align:middle;gap:5px;padding:4px}
.nc2-calendar-root .calendar_action:hover,.nc2-calendar-date-picker .calendar_action:hover {background:#e7eff8}
.nc2-calendar-root a[aria-disabled=true] {opacity:.45;cursor:default;pointer-events:none}
.nc2-calendar-root .calendar_action img:not(.nc2-calendar-icon),.nc2-calendar-date-picker .calendar_action img:not(.nc2-calendar-icon) {display:none}
.nc2-calendar-icon,.nc2-web .nc2-calendar-root img.nc2-calendar-icon,.nc2-web .nc2-calendar-date-picker img.nc2-calendar-icon {width:16px;height:16px;flex:none;display:inline-block;vertical-align:middle;object-fit:contain}
.nc2-calendar-action-text {font-size:12px;line-height:1.4}
.nc2-calendar-root .calendar_foot_switch {display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:12px;white-space:normal}
.nc2-calendar-root .calendar_yearly table.calendar_body {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,255px),1fr));gap:14px;width:100%}
.nc2-calendar-root .calendar_yearly table.calendar_body>tbody,.nc2-calendar-root .calendar_yearly table.calendar_body>tbody>tr {display:contents}
.nc2-calendar-root .calendar_yearly table.calendar_body td.calendar_frame {display:block;box-sizing:border-box;min-width:0;padding:10px;border:1px solid #cad7e5;border-radius:10px;background:#fff}
.nc2-calendar-root .calendar_yearly table.calendar_month,.nc2-calendar-root .calendar_smonthly table.calendar_body {width:100%;table-layout:fixed;border-collapse:collapse;margin-top:8px}
.nc2-calendar-root .calendar_smonthly {width:100%;max-width:min(100%,440px);margin-inline:auto}
/* Small month navigation must fit a sidebar even on a wide desktop screen. */
.nc2-calendar-root .calendar_smonthly table.nc2-calendar-period {margin:0 0 6px}
.nc2-calendar-root .calendar_smonthly table.nc2-calendar-period>tbody {display:grid;gap:2px;justify-content:stretch}
.nc2-calendar-root .calendar_smonthly table.nc2-calendar-period>tbody>tr {display:grid;grid-template-columns:32px minmax(0,1fr) 32px;gap:4px;width:100%;align-items:center}
.nc2-calendar-root .calendar_smonthly table.nc2-calendar-period :is(.calendar_this_year,.calendar_this_month) {min-width:0;font-size:16px;line-height:1.25;white-space:nowrap}
.nc2-calendar-root .calendar_smonthly .calendar_this_year>a {font:inherit;white-space:nowrap}
.nc2-calendar-root .calendar_smonthly table.nc2-calendar-period .calendar_action {width:32px;height:32px;min-width:32px;min-height:32px;padding:4px;border-radius:5px}
.nc2-calendar-root .calendar_smonthly table.nc2-calendar-period .nc2-calendar-icon {width:16px;height:16px}
.nc2-calendar-small-options {margin-top:8px;border:1px solid #d1dce9;border-radius:6px;background:#f7faff}
.nc2-calendar-small-options>summary {box-sizing:border-box;min-height:32px;padding:6px 8px;color:#204567;font-size:12px;line-height:1.5;cursor:pointer}
.nc2-calendar-small-options>summary:focus-visible {outline:3px solid #1476c8;outline-offset:2px}
.nc2-calendar-small-options[open]>summary {border-bottom:1px solid #d1dce9}
.nc2-calendar-small-options .nc2-calendar-toolbar {margin:6px;padding:6px}
.nc2-calendar-root .nc2-calendar-small-options .calendar_foot_switch {margin:6px}
.nc2-calendar-root :is(.calendar_month,.calendar_smonthly) td.calendar_date a {display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;min-height:40px;font-size:14px}
.nc2-calendar-root :is(.calendar_month,.calendar_smonthly) td.calendar_date {padding:0}
/* Keep the day and its existing line of event marks inside narrow sidebar cells. */
.nc2-web .nc2-calendar-root .calendar_smonthly table.calendar_body td.calendar_date {padding:0}
.nc2-web .nc2-calendar-root .calendar_smonthly table.calendar_body td.calendar_date a {display:block;width:100%;min-height:40px;padding:0;font-size:12px;line-height:18px;white-space:nowrap}
.nc2-calendar-root .calendar_smonthly .calendar_plan_smark {margin-inline:0}
.nc2-calendar-root td.calendar_today {box-shadow:inset 0 0 0 2px #326b9e;background:#edf5ff;border-width:1px!important}
.nc2-calendar-root a.calendar_outside {color:#6c7886!important}
.nc2-calendar-root .calendar_scroll_hint {margin:0 0 6px;color:#526172;font-size:12px}
/* Isolate table min-content sizing from legacy theme tables without clipping its scroll area. */
.nc2-calendar-scroll {box-sizing:border-box;width:100%;max-width:100%;min-width:0;contain:inline-size;overflow-x:auto;overscroll-behavior-x:contain;border:1px solid #cad7e5;border-radius:8px}
.nc2-calendar-root .calendar_lmonthly .nc2-calendar-scroll>table {width:100%;min-width:665px;table-layout:fixed;border-collapse:collapse}
.nc2-calendar-root .calendar_lmonthly table.calendar_body td.calendar_date {height:110px;width:auto;padding:4px}
.nc2-calendar-root .calendar_lmonthly table.calendar_body td.calendar_date :is(div.calendar_date_num,div.calendar_date_plan,div.calendar_plan) {box-sizing:border-box;max-width:100%;width:auto;float:none;margin:0}
.nc2-calendar-root .calendar_lmonthly table.calendar_body .calendar_week_th {width:32px}
.nc2-calendar-root .calendar_lmonthly table.calendar_body>tbody>tr:first-child>td:first-child {width:32px}
.nc2-calendar-root .calendar_lmonthly td.calendar_date .calendar_date_num a {width:auto;min-width:36px;min-height:36px;display:inline-flex;align-items:center;justify-content:center}
/* Date and compact add button share a row, leaving the month cell to its plans. */
.nc2-calendar-root .calendar_lmonthly table.calendar_body td.calendar_date div.calendar_date_num {float:left}
.nc2-calendar-root .calendar_lmonthly table.calendar_body td.calendar_date div.calendar_addplan {float:right}
.nc2-calendar-root .calendar_lmonthly .calendar_addplan .calendar_action {min-width:24px;min-height:24px;width:24px;height:24px;padding:3px;border-color:transparent;background:transparent}
.nc2-calendar-root .calendar_lmonthly .calendar_addplan .calendar_action:is(:hover,:focus-visible) {border-color:#adbed1;background:#e7eff8}
.nc2-calendar-root .calendar_lmonthly .calendar_addplan .nc2-calendar-icon {width:14px;height:14px}
.nc2-calendar-root .calendar_weekly .nc2-calendar-scroll>table {width:100%;min-width:630px;table-layout:fixed;border-collapse:collapse}
.nc2-calendar-root .calendar_weekly table.calendar_body :is(th.calendar_room_name,th.calendar_date_head,td.calendar_date) {padding:6px;vertical-align:top}
.nc2-calendar-root .calendar_weekly table.calendar_body th.calendar_room_name {width:15%;position:sticky;left:0;z-index:1;background:#f4f7fb}
.nc2-calendar-root .calendar_weekly table.calendar_body :is(th.calendar_date_head div,td.calendar_date div.calendar_plan,.calendar_plan_public,.calendar_plan_group,.calendar_plan_private,.calendar_plan_members) {width:auto;max-width:100%}
/* Stack the date and add control so seven days fit an ordinary content column. */
.nc2-calendar-root .calendar_weekly table.calendar_body th.calendar_date_head {white-space:normal}
.nc2-calendar-root .calendar_weekly table.calendar_body th.calendar_date_head div.calendar_date {display:flex;flex-direction:column;align-items:center;gap:4px}
.nc2-calendar-root .calendar_weekly table.calendar_body th.calendar_date_head div.calendar_date > a {flex:none}
.nc2-calendar-root .calendar_weekly table.calendar_body>tbody>tr:first-child>td:first-child {width:15%}
.nc2-calendar-root :is(.calendar_lmonthly,.calendar_weekly,.calendar_schedule) .calendar_plan {border-left:3px solid #7894b0;background:#f5f8fc;border-radius:3px;margin:5px 0;padding:5px;overflow:visible;white-space:normal;overflow-wrap:anywhere}
.nc2-calendar-root :is(.calendar_plan_title,.calendar_user_name) {overflow-wrap:anywhere;white-space:normal}
.nc2-calendar-root .calendar_daily table.calendar_head td.calendar_date_head {line-height:1.8}
.nc2-calendar-root .calendar_daily .calendar_date_num {font-size:clamp(18px,4vw,26px)!important}
.nc2-calendar-root .calendar_daily_allday {border-radius:8px 8px 0 0;background:#f7faff;padding:8px}
.nc2-calendar-root .calendar_daily_time {box-sizing:border-box;width:100%;max-width:100%;min-width:0;contain:inline-size;border-radius:0 0 8px 8px;overscroll-behavior:contain}
.nc2-calendar-root .calendar_daily table.calendar_body {width:100%;border-collapse:collapse}
.nc2-calendar-root .calendar_daily table.calendar_body th.calendar_time {position:sticky;left:0;z-index:1;background:#f4f7fb;width:72px;text-align:center}
.nc2-calendar-root .calendar_daily table.calendar_body th.calendar_time div {box-sizing:border-box;width:72px;height:60px;display:flex;flex-direction:column;align-items:center;font-size:14px;line-height:16px;font-weight:600;font-variant-numeric:tabular-nums}
.nc2-calendar-root .calendar_daily table.calendar_body th.calendar_time a.calendar_addplan {display:flex;flex:none;width:32px;height:32px;min-width:32px;min-height:32px;margin:4px auto 0}
.nc2-calendar-root .calendar_daily table.calendar_body td.calendar_time {min-width:calc(120px * var(--nc2-calendar-branches,1))}
.nc2-calendar-root .calendar_daily table.calendar_body td img.calendar_time_blank {width:1px;height:1px}
.nc2-calendar-root .calendar_daily .calendar_branch {min-width:120px;width:calc(100% / var(--nc2-calendar-branches,1))}
.nc2-calendar-root .calendar_daily table.calendar_body td.calendar_time div.calendar_plan,.nc2-calendar-root .calendar_daily table.calendar_body td.calendar_time div.calendar_noplan {box-sizing:border-box;width:auto;min-width:110px;margin:0 3px;padding:0 6px}
.nc2-calendar-root .calendar_daily .calendar_plan {border-left:3px solid #3e6c99;border-radius:4px}
.nc2-calendar-date-picker {max-width:min(560px,calc(100vw - 56px));white-space:normal;line-height:1.6}
.nc2-calendar-date-picker .outerdiv {padding:12px 0 0}
/* Keep the full YYYY/MM/DD visible when mobile controls use 16px type. */
.nc2-web input.calendar_start_date,.nc2-web input.calendar_end_date,.nc2-calendar-date-picker input.comp_calendar_text {box-sizing:border-box;width:12ch;min-width:12ch;max-width:100%}
.nc2-calendar-date-picker :is(input[type=text],select) {min-height:40px;box-sizing:border-box;font:inherit;max-width:100%}
.nc2-calendar-date-picker .nc2-calendar-views {margin-bottom:6px}
.nc2-calendar-root .calendar_schedule div.calendar_body div.calendar_plan_frame {width:auto;max-width:100%;margin-left:12px}
.nc2-calendar-root .calendar_schedule :is(.calendar_plan_title,.calendar_plan_allday_title,.calendar_user_name) {width:auto!important}
/* Agenda metadata stays aligned, including long titles and member names. */
.nc2-calendar-root .calendar_schedule .nc2-calendar-day-toggle {display:flex;align-items:center;gap:8px;box-sizing:border-box;width:100%;min-height:44px;padding:8px 10px;margin:6px 0;border:1px solid #cad7e5;border-radius:6px;background:#fff;font:inherit;text-align:left;cursor:pointer}
.nc2-calendar-root .calendar_schedule .nc2-calendar-day-toggle[aria-expanded=true] {background:#eef4fa;font-weight:600}
.nc2-calendar-root .calendar_schedule :is(.calendar_t_schedule,.calendar_u_schedule)>a {display:inline-flex;align-items:center;min-height:44px;padding:0 8px}
.nc2-calendar-root .calendar_schedule table.calendar_plan_content {display:block;box-sizing:border-box;width:100%;margin:8px 0;padding:8px;border:1px solid #d9e2ed;border-left:3px solid #7894b0;border-radius:5px;background:#fff}
.nc2-calendar-root .calendar_schedule table.calendar_plan_content tbody {display:block}
.nc2-calendar-root .calendar_schedule table.calendar_plan_content tr {display:grid;grid-template-columns:100px minmax(0,1fr);gap:3px 10px;align-items:start}
.nc2-calendar-root .calendar_schedule table.calendar_plan_content td {min-width:0;padding:0!important;white-space:normal!important}
.nc2-calendar-root .calendar_schedule table.calendar_plan_content td:has(.calendar_plan_time) {grid-column:1;grid-row:1}
.nc2-calendar-root .calendar_schedule table.calendar_plan_content td:has(.calendar_user_name) {grid-column:1;grid-row:2}
.nc2-calendar-root .calendar_schedule[data-calendar-sort=user] table.calendar_plan_content td:has(.calendar_user_name) {grid-row:1}
.nc2-calendar-root .calendar_schedule[data-calendar-sort=user] table.calendar_plan_content td:has(.calendar_plan_time) {grid-row:2}
.nc2-calendar-root .calendar_schedule table.calendar_plan_content td:has(.calendar_plan_title,.calendar_plan_allday_title) {grid-column:2;grid-row:1 / span 2}
.nc2-calendar-root .calendar_schedule :is(.calendar_plan_time,.calendar_user_name) {font-size:13px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
.nc2-calendar-root .calendar_schedule :is(.calendar_plan_title,.calendar_plan_allday_title)>a {display:block;min-height:44px;line-height:1.6}
/* The print window uses print_preview without nc2-web; include timed plans and remove controls. */
.print_preview .nc2-calendar-root .calendar_daily_time {display:block!important;height:auto!important;max-height:none;overflow:visible;contain:none}
.print_preview .nc2-calendar-root :is(.calendar_action,.calendar_addplan,.nc2-calendar-toolbar,.calendar_scroll_hint) {display:none!important}
.print_preview .nc2-calendar-root img.calendar_time_blank {display:none!important}
.print_preview .nc2-calendar-root .calendar_daily :is(td.calendar_time,.calendar_branch,td.calendar_time div.calendar_plan,td.calendar_time div.calendar_noplan) {min-width:0}
.print_preview .nc2-calendar-root .nc2-calendar-day-toggle {border:0;background:none;cursor:default}
.print_preview .nc2-calendar-root .nc2-calendar-scroll {contain:none;overflow:visible;border:0}
.print_preview .nc2-calendar-root :is(.calendar_lmonthly,.calendar_weekly) .nc2-calendar-scroll>table {min-width:0}
@media(max-width:600px) {
 .nc2-calendar-toolbar {padding:8px;gap:8px}
 .nc2-calendar-views {gap:4px}
 .nc2-calendar-toolbar button,.nc2-calendar-views button {padding:8px 10px}
 .nc2-calendar-toolbar .nc2-calendar-external {margin-left:0;width:100%;text-align:center}
 .nc2-calendar-root .calendar_yearly table.calendar_body {grid-template-columns:1fr}
 .nc2-calendar-root table.calendar_head {border-spacing:0}
 .nc2-calendar-root table.nc2-calendar-period td.nc2-calendar-week-navigation {width:100%}
 .nc2-calendar-root .nc2-calendar-week-navigation>:is(a,span) {flex:1 1 0;min-width:0;padding:5px 2px;flex-direction:column;gap:2px}
 .nc2-calendar-root .calendar_daily table.calendar_head td.calendar_date_head {display:flex;flex-wrap:wrap;align-items:center;gap:4px}
 .nc2-calendar-root .calendar_daily .calendar_date {flex:1;min-width:160px}
 .nc2-calendar-root .calendar_schedule table.calendar_plan_content tr {grid-template-columns:84px minmax(0,1fr);gap:3px 8px}
}
/* Small artwork with generous touch areas on phones and touch displays. */
@media (max-width:700px), (pointer:coarse) {
 .nc2-calendar-toolbar button,.nc2-calendar-views button,.nc2-calendar-toolbar a,.nc2-calendar-date-picker input[type=button] {min-height:44px}
 .nc2-calendar-root .calendar_action,.nc2-calendar-date-picker .calendar_action {min-width:44px;min-height:44px}
 .nc2-calendar-root .calendar_lmonthly .calendar_addplan .calendar_action {width:44px;height:44px;min-width:44px;min-height:44px}
 .nc2-calendar-root .calendar_daily table.calendar_body th.calendar_time a.calendar_addplan {width:44px;height:44px;min-width:44px;min-height:44px;margin:0 auto}
}
@media print {
 .nc2-calendar-toolbar,.calendar_scroll_hint,.nc2-calendar-root :is(.calendar_action,.calendar_addplan) {display:none!important}
 .nc2-calendar-root img.calendar_time_blank {display:none!important}
 .nc2-calendar-root .calendar_daily :is(td.calendar_time,.calendar_branch,td.calendar_time div.calendar_plan,td.calendar_time div.calendar_noplan) {min-width:0}
 .nc2-calendar-root .calendar_daily_time {display:block!important;height:auto!important;max-height:none;overflow:visible;contain:none}
 .nc2-calendar-scroll {contain:none;overflow:visible;border:0}
 .nc2-calendar-root :is(.calendar_lmonthly,.calendar_weekly) .nc2-calendar-scroll>table {min-width:0}
 .nc2-calendar-root .calendar_yearly table.calendar_body {grid-template-columns:repeat(3,minmax(0,1fr))}
 .nc2-calendar-root .calendar_yearly td.calendar_frame {break-inside:avoid}
}
