/* JJ Schedule workbench v27 */
@media (min-width: 901px) {
  body { background: #f4f6fa; }
  .app { max-width: none; padding: 18px 18px 28px 112px; }
  .topbar {
    min-height: 68px; margin: 0 0 12px; padding: 10px 14px;
    border-color: #e1e6ef; background: rgba(255,255,255,.94);
    box-shadow: 0 4px 18px rgba(35,45,76,.05);
  }
  .brand-mark { width: 40px; height: 40px; background: #3157c8; box-shadow: 0 8px 20px rgba(49,87,200,.2); }
  .brand h1 { font-size: 24px; }
  .view-nav {
    position: fixed; z-index: 45; inset: 18px auto 18px 18px; width: 78px;
    margin: 0; padding: 10px 7px; display: flex; flex-direction: column;
    align-items: stretch; gap: 7px; border: 0; border-radius: 8px;
    background: #17213a; box-shadow: 0 20px 45px rgba(23,33,58,.22);
  }
  .view-nav::before {
    content: "JJ"; min-height: 48px; display: grid; place-items: center;
    color: #fff; font-size: 18px; font-weight: 850;
    border-bottom: 1px solid rgba(255,255,255,.13); margin-bottom: 5px;
  }
  .view-tab {
    min-height: 58px; padding: 7px 4px; border: 0; border-radius: 7px;
    background: transparent; color: #bfc8dd; display: grid; justify-items: center;
    align-content: center; gap: 5px; font-size: 11px; line-height: 1.1; box-shadow: none;
  }
  .view-tab .icon-svg { width: 20px; height: 20px; }
  .view-tab:hover { transform: translateY(-1px); color: #fff; background: rgba(255,255,255,.09); }
  .view-tab.active { color: #fff; background: #3157c8; box-shadow: 0 8px 20px rgba(21,42,113,.4); }
  .mobile-more-tab { display: none; }
  .more-actions { display: block; position: relative; }
  .more-actions > summary { display: inline-flex; list-style: none; }
  .more-actions-menu { display: none; }
  .more-actions[open] .more-actions-menu {
    position: absolute; z-index: 95; top: calc(100% + 8px); right: 0; width: 230px;
    padding: 8px; display: grid; gap: 7px; border: 1px solid #dce2ec;
    border-radius: 8px; background: #fff; box-shadow: 0 16px 38px rgba(24,32,51,.18);
  }
  .more-actions[open] .more-actions-menu .text-btn,
  .more-actions[open] .more-actions-menu .offline-badge { width: 100%; }
  .calendar-toolbar {
    min-height: 48px; margin-bottom: 12px; padding: 5px 7px;
    border-color: #e1e6ef; background: #fff; box-shadow: none;
  }
  .shell, body[data-view="timeline"] .shell { grid-template-columns: 260px minmax(0,1fr); gap: 12px; }
  body[data-view="week"] .shell,
  body[data-view="month"] .shell,
  body[data-view="editor"] .shell { grid-template-columns: minmax(0,1fr); }
  .main-panel, .side-panel { border-color: #e1e6ef; box-shadow: none; }
  .main-panel { min-width: 0; }
  .quick-panel {
    display: block !important; position: fixed; z-index: 80; top: 18px; right: 18px;
    bottom: 18px; width: min(420px,calc(100vw - 132px)); padding: 18px;
    overflow-y: auto; border: 1px solid #dce2ec; background: #fff;
    box-shadow: -16px 0 44px rgba(24,32,51,.16);
    transform: translateX(calc(100% + 36px)); opacity: 0; pointer-events: none;
    transition: transform 300ms cubic-bezier(.2,.75,.2,1), opacity 220ms ease;
  }
  .quick-panel.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
  body[data-view="timeline"] .focus-alert,
  body[data-view="timeline"] .date-strip { display: none; }
}

.migration-banner {
  margin: 0 0 12px; padding: 12px 14px; border: 1px solid #c8d3fa;
  border-left: 4px solid var(--indigo); border-radius: 7px; background: #f1f4ff;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.migration-banner > div:first-child { display: grid; gap: 3px; }
.migration-banner span { color: var(--muted); font-size: 13px; }
.migration-actions { display: flex; gap: 7px; }
.calendar-host { min-width: 0; animation: viewIn 220ms ease both; }
.calendar-host .fc {
  --fc-border-color: #e1e6ef; --fc-page-bg-color: #fff; --fc-neutral-bg-color: #f7f8fb;
  --fc-list-event-hover-bg-color: #f4f6fa; --fc-today-bg-color: #f0f3ff;
  --fc-now-indicator-color: #e05248; color: var(--text); font-size: 13px;
}
.calendar-host .fc-theme-standard td,
.calendar-host .fc-theme-standard th,
.calendar-host .fc-theme-standard .fc-scrollgrid { border-color: #e1e6ef; }
.calendar-host .fc-scrollgrid { border-radius: 7px; overflow: hidden; }
.calendar-host .fc-col-header-cell { background: #f7f8fb; }
.calendar-host .fc-col-header-cell-cushion,
.calendar-host .fc-daygrid-day-number { color: var(--text); text-decoration: none; font-weight: 720; padding: 8px; }
.calendar-host .fc-timegrid-slot-label-cushion { color: var(--muted); font-size: 11px; }
.calendar-host .fc-timegrid-slot { height: 32px; }
.calendar-host .fc-event {
  border: 0; border-left: 3px solid currentColor; border-radius: 5px; padding: 0;
  color: #315b8d; background: #e7f0fb; box-shadow: 0 4px 10px rgba(35,49,83,.08);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease; cursor: pointer;
}
.calendar-host .fc-event:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(35,49,83,.14); z-index: 8 !important; }
.calendar-host .fc-event.schedule-task { color: #15735f; background: #e3f4ef; }
.calendar-host .fc-event.schedule-alert,
.calendar-host .fc-event.schedule-priority-high { color: #a6322e; background: #fde8e5; }
.calendar-host .fc-event.schedule-personal { color: #6544b7; background: #eee8fc; }
.calendar-host .fc-event.schedule-homework { color: #9d5a12; background: #fff0d8; }
.calendar-host .fc-event.schedule-exam { color: #b43c55; background: #fbe5ec; }
.calendar-host .fc-event.schedule-holiday { color: #16717c; background: #dff3f4; }
.calendar-host .fc-event.schedule-status-done { filter: saturate(.55); opacity: .66; }
.calendar-host .fc-event.schedule-status-cancelled,
.calendar-host .fc-event.schedule-holiday-cancelled { color: #7b8494; background: #eceff3; opacity: .62; text-decoration: line-through; }
.calendar-host .fc-event.schedule-conflict { box-shadow: inset 0 0 0 2px #dc554c,0 5px 14px rgba(211,79,69,.16); }
.calendar-host .fc-event.schedule-blocked { outline: 2px dashed #7654d6; outline-offset: -2px; }
.calendar-host .fc-event.schedule-fuzzy::after {
  content: ""; position: absolute; inset: 62% 0 0; pointer-events: none;
  background: linear-gradient(to bottom,transparent,rgba(255,255,255,.92));
}
.fc-schedule-event { display: grid; grid-template-columns: 48px minmax(0,1fr); height: 100%; min-height: 42px; }
.fc-schedule-time {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  gap: 2px; padding: 5px 3px; font-size: 10px; font-weight: 800; background: rgba(255,255,255,.42);
}
.fc-schedule-time i { width: 2px; min-height: 10px; flex: 1 1 auto; background: currentColor; opacity: .55; }
.fc-schedule-body { min-width: 0; padding: 5px 7px; display: grid; align-content: start; gap: 2px; }
.fc-schedule-body strong,
.fc-event-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-schedule-body span,
.fc-schedule-body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; opacity: .8; }
.fc-event-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.calendar-host .fc-daygrid-event .fc-event-main { min-width: 0; padding: 3px 5px; display: flex; align-items: center; gap: 4px; color: inherit; }
.calendar-host .fc-daygrid-event .fc-event-time { font-size: 10px; opacity: .75; }
.calendar-host .fc-daygrid-day-frame { min-height: 112px; }

.mobile-timeline-item {
  --timeline-color: #3976b9; position: relative; display: grid;
  grid-template-columns: 62px minmax(0,1fr); min-width: 0; margin: 0 0 10px;
  border: 1px solid #e1e6ef; border-left: 4px solid var(--timeline-color);
  border-radius: 7px; background: #fff; overflow: hidden;
  box-shadow: 0 5px 16px rgba(28,40,70,.06); animation: cardIn 220ms ease both;
}
.mobile-timeline-item.task { --timeline-color: #178066; }
.mobile-timeline-item.alert { --timeline-color: #d34f45; background: #fff8f7; }
.mobile-timeline-item.personal { --timeline-color: #7654d6; }
.mobile-timeline-item.homework { --timeline-color: #d17820; background: #fffbf3; }
.mobile-timeline-item.exam { --timeline-color: #c43f61; }
.mobile-timeline-item.holiday { --timeline-color: #168b8f; }
.mobile-timeline-item.conflict { box-shadow: inset 0 0 0 2px #dc554c; }
.mobile-timeline-item.blocked { outline: 2px dashed #7654d6; outline-offset: -3px; }
.mobile-timeline-item.status-done { opacity: .62; filter: saturate(.55); }
.mobile-timeline-item.status-cancelled { opacity: .58; background: #f2f4f7; }
.mobile-timeline-item.fuzzy::after {
  content: ""; position: absolute; left: 62px; right: 0; bottom: 0;
  height: var(--fuzzy-tail); max-height: 44%; pointer-events: none;
  background: linear-gradient(to bottom,transparent,rgba(255,255,255,.95));
}
.mobile-time-rail {
  padding: 12px 5px; display: flex; flex-direction: column; align-items: center;
  color: var(--timeline-color); font-size: 11px; background: #f8fafc;
}
.mobile-time-rail span { width: 2px; min-height: 30px; flex: 1 1 auto; margin: 4px 0; background: var(--timeline-color); opacity: .55; }
.mobile-time-rail small { color: var(--muted); }
.mobile-event-content { min-width: 0; padding: 11px 12px; }
.mobile-event-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mobile-event-heading strong { min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.mobile-event-meta,
.mobile-event-state { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.mobile-event-meta span,
.state-pill { padding: 3px 6px; border-radius: 5px; color: #526077; background: #f0f3f7; font-size: 10px; font-weight: 700; }
.state-pill.danger { color: #a6322e; background: #fde8e5; }
.state-pill.dependency { color: #5b3fa9; background: #eee8fc; }
.mobile-event-content p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.timeline-empty { padding: 40px 16px; color: var(--muted); text-align: center; }

.timeline-gesture-hint {
  margin: 0 0 8px; padding: 7px 9px; border-radius: 6px;
  color: #55627a; background: #f3f6fa; font-size: 11px; line-height: 1.35;
}
.timeline-day-scroll {
  position: relative; width: 100%; height: min(68dvh,720px); min-height: 420px;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  border: 1px solid #dde3ed; border-radius: 7px; background: #fbfcfe;
  scrollbar-gutter: stable; scroll-behavior: smooth;
}
.timeline-day-canvas { position: relative; width: 100%; min-width: 0; background: #fff; }
.timeline-hour {
  position: absolute; z-index: 0; left: 0; right: 0; height: 1px;
  border-top: 1px solid #e8ecf2; pointer-events: none;
}
.timeline-hour span {
  position: absolute; left: 6px; top: -8px; width: 42px;
  color: #7a8598; background: #fff; font-size: 10px; line-height: 16px; text-align: right;
}
.mobile-now-line {
  position: absolute; z-index: 8; left: 50px; right: 5px; height: 2px;
  background: #e05248; pointer-events: none;
}
.mobile-now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #e05248; }
.mobile-now-line span { position: absolute; right: 2px; top: -17px; padding: 1px 4px; border-radius: 4px; color: #fff; background: #e05248; font-size: 9px; }
.mobile-timeline-event {
  --timeline-color: #3976b9; position: absolute; z-index: 2; box-sizing: border-box;
  min-width: 0; min-height: 44px; padding: 6px 7px; overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--timeline-color) 30%,#dfe5ee);
  border-left: 4px solid var(--timeline-color); border-radius: 6px;
  color: #26334b; background: color-mix(in srgb,var(--timeline-color) 10%,#fff);
  box-shadow: 0 5px 14px rgba(28,40,70,.09); touch-action: pan-y;
  transition: box-shadow 160ms ease,filter 160ms ease,opacity 160ms ease;
}
.mobile-timeline-event.task { --timeline-color: #178066; }
.mobile-timeline-event.alert { --timeline-color: #d34f45; }
.mobile-timeline-event.personal { --timeline-color: #7654d6; }
.mobile-timeline-event.homework { --timeline-color: #d17820; }
.mobile-timeline-event.exam { --timeline-color: #c43f61; }
.mobile-timeline-event.holiday { --timeline-color: #168b8f; }
.mobile-timeline-event > strong { display: block; overflow: hidden; color: inherit; font-size: 12px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.mobile-timeline-event > span { display: block; margin-top: 3px; overflow: hidden; color: #647087; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-event-time { margin-bottom: 2px; color: var(--timeline-color); font-size: 9px; font-weight: 850; line-height: 1.15; }
.mobile-timeline-event.conflict { box-shadow: inset 0 0 0 2px #dc554c,0 6px 16px rgba(211,79,69,.15); }
.mobile-timeline-event.blocked { outline: 2px dashed #7654d6; outline-offset: -3px; }
.mobile-timeline-event.status-done { opacity: .62; filter: saturate(.55); }
.mobile-timeline-event.status-cancelled { opacity: .58; background: #f2f4f7; }
.mobile-timeline-event.fuzzy::after {
  content: ""; position: absolute; z-index: 0; left: 0; right: 0; bottom: 0;
  height: var(--fuzzy-tail); max-height: 58%; pointer-events: none;
  background: linear-gradient(to bottom,transparent,rgba(255,255,255,.96));
}
.mobile-timeline-event > * { position: relative; z-index: 1; }
.mobile-timeline-event.is-dragging {
  z-index: 40; left: 54px !important; width: calc(100% - 62px) !important;
  opacity: .96; filter: none; box-shadow: 0 18px 42px rgba(31,49,88,.28);
}
.mobile-timeline-event.over-delete-zone { border-color: #d84e45; background: #fff0ee; box-shadow: 0 18px 44px rgba(205,66,58,.3); }
.timeline-drag-preview {
  position: absolute; z-index: 4; right: 5px; top: 5px; display: none;
  padding: 3px 5px; border-radius: 4px; color: #fff; background: #17213a;
  font-size: 10px; font-weight: 850; box-shadow: 0 4px 12px rgba(23,33,58,.2);
}
.mobile-timeline-event.is-dragging .timeline-drag-preview { display: block; }
.mobile-all-day-strip { margin: 0 0 8px; padding: 8px; border: 1px solid #dde3ed; border-radius: 7px; background: #f8fafc; }
.mobile-all-day-strip > strong { display: block; margin-bottom: 6px; color: #667188; font-size: 10px; text-transform: uppercase; }
.mobile-all-day-strip > div { display: grid; gap: 5px; }
.mobile-all-day-item {
  position: relative; min-width: 0; min-height: 40px; padding: 7px 9px;
  border-left: 4px solid #168b8f; border-radius: 5px; background: #e7f5f5;
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px;
}
.mobile-all-day-item strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-all-day-item span { color: #627087; font-size: 10px; }
body.timeline-gesture-active { user-select: none; -webkit-user-select: none; }

.month-day-panel {
  position: fixed; z-index: 115; left: 50%; bottom: 18px; width: min(720px,calc(100vw - 28px));
  max-height: min(380px,60dvh); padding: 14px; overflow: hidden;
  border: 1px solid #d9e0ea; border-radius: 8px; background: rgba(255,255,255,.98);
  box-shadow: 0 24px 64px rgba(24,32,51,.24); backdrop-filter: blur(14px);
  opacity: 0; transform: translate(-50%,18px); transition: opacity 220ms ease,transform 220ms ease;
}
.month-day-panel[hidden] { display: none; }
.month-day-panel.open { opacity: 1; transform: translate(-50%,0); }
.month-day-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.month-day-panel-head span { color: #667188; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.month-day-panel-head h2 { margin: 2px 0 0; font-size: 18px; }
.month-day-panel-list { max-height: 218px; overflow-y: auto; display: grid; gap: 6px; }
.month-preview-item {
  width: 100%; min-width: 0; min-height: 46px; padding: 7px 9px; border: 1px solid #e0e5ed;
  border-left: 4px solid #3976b9; border-radius: 6px; background: #fff; text-align: left;
  display: grid; grid-template-columns: 82px minmax(0,1fr) auto; align-items: center; gap: 8px;
}
.month-preview-item.task { border-left-color: #178066; }
.month-preview-item.alert { border-left-color: #d34f45; background: #fff8f7; }
.month-preview-item.homework { border-left-color: #d17820; background: #fffbf3; }
.month-preview-item.exam { border-left-color: #c43f61; }
.month-preview-item.personal { border-left-color: #7654d6; }
.month-preview-item.holiday { border-left-color: #168b8f; }
.month-preview-item > span,.month-preview-item > small { color: #677389; font-size: 10px; }
.month-preview-item > strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.month-day-panel-actions { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.delete-confirm-dialog form { display: grid; gap: 10px; }
.delete-confirm-kicker { color: #b23f39; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.delete-confirm-dialog h2 { margin: 0; overflow-wrap: anywhere; }
.delete-confirm-dialog p { margin: 0; color: #667188; font-size: 12px; line-height: 1.45; }
.delete-scope-options { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.delete-scope-options[hidden] { display: none; }
.delete-scope-options legend { grid-column: 1/-1; margin-bottom: 5px; color: #667188; font-size: 11px; font-weight: 750; }
.delete-scope-options label { min-height: 44px; padding: 8px; border: 1px solid #dce2eb; border-radius: 6px; display: flex; align-items: center; gap: 7px; background: #f8fafc; }
.delete-scope-options input { width: 18px; height: 18px; accent-color: #c94e47; }
.delete-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.all-day-toggle {
  min-height: 44px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px;
  display: flex; align-items: center; gap: 8px; background: #f7f8fb; cursor: pointer;
}
.all-day-toggle input { width: 18px; height: 18px; }
.undo-toast {
  position: fixed; z-index: 150; left: 50%; bottom: 24px; transform: translate(-50%,18px);
  min-width: min(360px,calc(100vw - 28px)); padding: 10px 11px 10px 14px;
  border-radius: 7px; color: #fff; background: #17213a; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  opacity: 0; animation: undoIn 220ms ease forwards;
}
.undo-toast button { min-height: 34px; padding: 0 10px; border-radius: 5px; color: #fff; background: #3157c8; font-weight: 800; }
@keyframes undoIn { to { opacity: 1; transform: translate(-50%,0); } }
.item-action-dialog {
  width: min(360px,calc(100vw - 24px)); padding: 0; border: 0;
  border-radius: 8px; background: #fff; box-shadow: var(--shadow);
}
.item-action-dialog::backdrop { background: rgba(17,24,39,.38); backdrop-filter: blur(2px); }
.item-action-dialog form { padding: 14px; }
.item-action-dialog h2 { margin: 4px 0 12px; font-size: 17px; }
.item-action-list { display: grid; gap: 7px; }
.item-action-list .text-btn { width: 100%; justify-content: flex-start; }
.action-sheet-handle { display: none; }

@media (max-width: 900px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); background: #f4f6fa; }
  .app { width: 100%; padding: 8px 8px 16px; }
  .topbar {
    min-height: 48px; margin-bottom: 8px; padding: 6px; border: 0;
    background: #fff; box-shadow: 0 3px 14px rgba(29,40,70,.06);
  }
  .brand-mark { width: 34px; height: 34px; }
  .toolbar { grid-template-columns: minmax(64px,1fr) 38px 38px 38px; }
  .view-nav {
    position: fixed; z-index: 100; left: max(8px,env(safe-area-inset-left));
    right: max(8px,env(safe-area-inset-right)); bottom: max(8px,env(safe-area-inset-bottom));
    height: 58px; margin: 0; padding: 4px; display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px;
    border: 1px solid #dce2ec; border-radius: 8px; background: rgba(255,255,255,.96);
    box-shadow: 0 14px 40px rgba(29,40,70,.2); backdrop-filter: blur(14px);
  }
  .view-tab {
    min-height: 48px; padding: 4px 2px; border: 0; border-radius: 6px;
    display: grid; justify-items: center; align-content: center; gap: 2px;
    font-size: 10px; background: transparent; box-shadow: none;
  }
  .view-tab.active { color: #fff; background: #3157c8; }
  .view-nav [data-view="timeline"],
  .view-nav [data-view="editor"] { display: none; }
  .mobile-more-tab { display: grid; }
  .calendar-toolbar {
    min-height: 48px; grid-template-columns: 42px minmax(0,1fr) auto 42px;
    grid-template-areas: "prev range today next"; padding: 4px; margin-bottom: 8px;
    border: 0; box-shadow: 0 3px 14px rgba(29,40,70,.05);
  }
  .calendar-date-picker { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
  #calendarRangeLabel { font-size: 13px; }
  .migration-banner { align-items: stretch; flex-direction: column; }
  .migration-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .date-strip { min-height: 58px; margin-bottom: 8px; }
  .day-tab { min-height: 52px; }
  .shell,
  body[data-view="timeline"] .shell { width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr); }
  .main-panel,
  .side-panel,
  .quick-panel { min-width: 0; width: 100%; border: 0; box-shadow: 0 4px 18px rgba(29,40,70,.06); }
  .panel-title h2 { font-size: 16px; }
  .main-panel { padding: 12px; }
  .side-panel { margin-top: 0; }
  body[data-view="today"] .side-panel { display: none; }
  .quick-panel {
    display: block !important; position: fixed; z-index: 120; left: 8px; right: 8px;
    bottom: max(8px,env(safe-area-inset-bottom)); width: auto; max-height: calc(100dvh - 28px);
    padding: 14px; overflow-y: auto; border-radius: 8px 8px 6px 6px; background: #fff;
    box-shadow: 0 -16px 50px rgba(24,32,51,.24);
    transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none;
    transition: transform 300ms cubic-bezier(.2,.75,.2,1), opacity 220ms ease;
  }
  .quick-panel.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .focus-alert { display: none !important; }
  .today-hero { grid-template-columns: 1fr; }
  .big-tile { min-height: 96px; padding: 13px; }
  .big-tile h3 { font-size: 19px; }
  .agenda-row { grid-template-columns: 58px minmax(0,1fr); }
  .calendar-host .fc { font-size: 11px; }
  .calendar-host .fc-toolbar,
  .calendar-host .fc-col-header-cell-cushion { font-size: 11px; }
  .calendar-host .fc-daygrid-day-frame { min-height: 74px; }
  .calendar-host .fc-daygrid-day-number { padding: 5px; font-size: 11px; }
  .calendar-host .fc-daygrid-event { margin: 1px 2px; border-left-width: 2px; }
  .calendar-host .fc-daygrid-event .fc-event-main { padding: 2px 3px; gap: 3px; }
  .calendar-host .fc-daygrid-event .fc-event-time { display: none; }
  .calendar-host .fc-daygrid-event strong { font-size: 9px; }
  .calendar-host .fc-list-event-time { width: 66px; color: var(--muted); }
  .calendar-host .fc-list-event-title a { color: var(--text); text-decoration: none; font-weight: 700; }
  .timeline { width: 100%; min-height: 0 !important; border: 0; overflow: visible; background: transparent; }
  .timeline .hour,
  .timeline .now-line,
  .timeline .event-card { display: none; }
  .timeline-day-scroll { height: calc(100dvh - 250px); min-height: 430px; }
  .month-day-panel { bottom: calc(76px + env(safe-area-inset-bottom)); width: calc(100vw - 16px); max-height: 56dvh; padding: 12px; }
  .month-day-panel-list { max-height: calc(56dvh - 142px); }
  .month-preview-item { grid-template-columns: 68px minmax(0,1fr); }
  .month-preview-item > small { grid-column: 2; }
  .more-actions[open] .more-actions-menu {
    position: fixed; z-index: 130; left: 8px; right: 8px; top: auto;
    bottom: calc(74px + env(safe-area-inset-bottom)); width: auto; padding: 10px;
    border-radius: 8px; box-shadow: 0 -12px 42px rgba(24,32,51,.22);
  }
  .undo-toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
  .item-action-dialog {
    width: auto; max-width: none; margin: auto 8px max(8px,env(safe-area-inset-bottom));
    border-radius: 8px 8px 6px 6px;
  }
  .action-sheet-handle { display: block; width: 36px; height: 4px; margin: -3px auto 10px; border-radius: 4px; background: #ccd3df; }
}

@media (max-width: 390px) {
  .app { padding-inline: 6px; }
  .topbar, .calendar-toolbar, .shell { width: 100%; }
  .language-picker { max-width: 110px; }
  .brand-mark { width: 32px; height: 32px; }
  .main-panel { padding: 10px; }
  .calendar-host .fc-daygrid-day-frame { min-height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  .quick-panel,
  .calendar-host .fc-event,
  .mobile-timeline-item,
  .mobile-timeline-event,
  .month-day-panel,
  .undo-toast { animation: none !important; transition: none !important; }
}
