.planner { padding: 26px; color: var(--ink); }
.planner .calendar-top { flex-wrap: wrap; gap: 16px; }
.planner .calendar-top h2 { font-size: 23px; line-height: 1.3; }
.planner .calendar-nav { display: flex; gap: 6px; width: auto; }
.planner .calendar-nav button { min-height: 40px; }
.planner-toolbar, .planner-filters { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.planner-toolbar { padding-top: 8px; }
.planner-modes { display: flex; gap: 4px; padding: 4px; border: 1px solid #d5e2eb; border-radius: 12px; background: #edf4f9; }
.planner-modes button { border: 0; border-radius: 8px; color: #526c7e; background: transparent; font-size: 13px; padding: 8px 14px; min-height: 40px; }
.planner-modes button[aria-pressed="true"] { background: var(--accent); color: white; box-shadow: 0 2px 6px #004f7620; }
.planner-date-tools { display: flex; gap: 14px; }
.planner-date-tools label { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.planner-date-tools input, .planner-date-tools select { width: auto; min-height: 40px; margin: 0; font-size: 13px; }
.planner-filters { padding: 16px 0; border-top: 1px solid #e2eaf0; border-bottom: 1px solid #e2eaf0; }
.planner-types { display: flex; flex-wrap: wrap; gap: 8px; }
.planner-types > label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 8px 10px; margin: 0; border-radius: 8px; border: 1px solid #c7dceb; background: #e7f1fc; color: #2863a0; cursor: pointer; }
.planner-types > label.due { background: #fff0f2; border-color: #efd1d7; color: #ac3448; }
.planner-types > label.hearing { background: #f2ecfb; border-color: #dfd3ef; color: #7653a0; }
.planner-types > label.task { background: #e9f7ee; border-color: #c8e4d4; color: #22704b; }
.planner-types > label:has(input:not(:checked)) { background: #f6f8fa; border-color: #dfe6eb; color: #647b89; }
.planner-types input { width: 15px; height: 15px; min-height: 0; margin: 0; padding: 0; accent-color: currentColor; cursor: pointer; }
.planner-types svg { width: 15px; height: 15px; }
.planner-filters > .search-field { flex: 1; min-width: 200px; max-width: 350px; }
.planner-filters > .search-field input { font-size: 13px; }
.planner-period-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #567082; font-size: 12px; }
.planner-today-key { display: flex; align-items: center; gap: 7px; }
.planner-today-key i { width: 10px; height: 10px; border-radius: 3px; background: #f4d47d; border: 1px solid #c9a443; }
.calendar-surface { min-width: 0; }
.planner .calendar-board { gap: 0; }
.planner .calendar-weekdays { gap: 6px; padding: 10px 0 12px; }
.planner .calendar-weekdays span { font-size: 12px; font-weight: 600; color: #526b7b; }
.planner .calendar-grid { gap: 6px; }
.planner .calendar-day { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; width: 100%; min-width: 0; min-height: 138px; height: 138px; padding: 9px; border: 1px solid #d5e4ed; border-radius: 12px; background: #edf5fb; box-shadow: none; color: var(--ink); gap: 7px; aspect-ratio: auto; overflow: hidden; }
.planner .calendar-day:nth-child(7n), .planner .calendar-day:nth-child(7n - 1) { background: #f3f0f8; border-color: #e2dce9; }
.planner .calendar-day.muted-day { background: #f4f6f8; color: #778b98; border-color: #e1e7ec; }
.planner .calendar-day:hover { border-color: #91b8d0; background: #e5f0f8; }
.planner .calendar-day.selected { background: #e9f5fc; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.planner .calendar-day.today { background: #fff9e9; border-color: #d3b565; }
.planner .calendar-day.today.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.planner-day-top { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: 4px; }
.planner .day-number { flex: 0 0 25px; width: 25px; height: 25px; font-weight: 650; font-size: 12px; }
.planner .calendar-day.today .day-number { background: #f4d47d; color: #634b12; }
.planner-today-label { font-size: 10px; color: #80621b; font-weight: 600; }
.planner-mini-list { display: grid; gap: 4px; min-width: 0; }
.planner-mini { display: flex; align-items: center; gap: 5px; padding: 3px 5px; border-radius: 5px; background: #dcecfb; color: #275e94; min-width: 0; font-size: 10px; line-height: 1.6; font-weight: 600; text-align: left; }
.planner-mini.due { background: #f9dfe5; color: #a13147; }
.planner-mini.hearing { background: #e9dff5; color: #694792; }
.planner-mini.task { background: #dcefe4; color: #256b47; }
.planner-mini svg { width: 12px; height: 12px; flex: 0 0 12px; }
.planner-mini-desktop { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.planner-mini-mobile { display: none; }
.planner-day-bottom { display: block; font-size: 10px; line-height: 14px; font-weight: 500; margin-top: auto; text-align: left; color: #607887; min-height: 14px; }
.planner-week-frame { overflow: auto; max-height: 680px; border: 1px solid #dae5ed; border-radius: 12px; background: white; overscroll-behavior: contain; }
.planner-week-table { width: 100%; min-width: 970px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.planner-week-table thead th { position: sticky; top: 0; z-index: 1; background: #f2f7fa; padding: 8px; text-transform: none; border-right: 1px solid #e1e9ef; }
.planner-week-table thead th.today { background: #fff4d7; }
.planner .planner-week-table th, .planner .planner-week-table td { width: auto; }
.planner .planner-week-table th:first-child { width: 62px; }
.planner-week-table thead button { display: grid; justify-items: center; gap: 3px; padding: 4px; min-height: 60px; width: 100%; color: #49677b; background: transparent; border: 0; border-radius: 7px; }
.planner-week-table thead button:hover { background: #e0edf7; }
.planner-week-table thead strong { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-size: 15px; }
.planner-week-table thead .today strong { background: #f4d47d; color: #634b12; }
.planner-week-table thead .selected button { box-shadow: inset 0 0 0 2px var(--accent); }
.planner-week-table td, .planner-week-table tbody th { padding: 6px; vertical-align: top; border-right: 1px solid #e5ecf0; border-bottom: 1px solid #e5ecf0; white-space: normal; }
.planner-week-table tbody th { font-size: 10px; font-weight: 500; color: #62798a; background: #f8fafc; padding-top: 13px; }
.planner-week-table tbody td { height: 60px; background: #fff; }
.planner-week-table tbody td.today { background: #fffcf3; }
.planner-week-table tbody td.selected { background: #f1f8fc; }
.planner-week-table .planner-week-allday td { min-height: 78px; background: #f6f9fb; }
.planner-week-event { width: 100%; display: grid; gap: 3px; padding: 7px 8px; margin-bottom: 5px; min-height: 48px; border-radius: 7px; border: 1px solid #c8ddeb; color: #285f91; background: #e6f0fb; text-align: left; font-size: 10px; box-shadow: none; }
.planner-week-event.hearing { border-color: #dbcaed; background: #f0e9fa; color: #67408e; }
.planner-week-event.task { border-color: #c3e1ce; background: #e8f6ed; color: #256747; }
.planner-week-event.due { border-color: #eec9d2; background: #fff0f3; color: #ab344a; }
.planner-week-event:hover { background: #fff; box-shadow: inset 0 0 0 1px currentColor; }
.planner-week-event strong { font-size: 11px; }
.planner-week-event > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font-weight: 500; }
.planner-week-more { width: 100%; padding: 3px 5px; min-height: 28px; font-size: 10px; background: #eef3f7; color: #587184; }
.planner-agenda { display: grid; gap: 26px; }
.planner-agenda-day { min-width: 0; }
.planner-agenda-day > header { display: flex; gap: 14px; justify-content: space-between; align-items: center; border-bottom: 1px solid #dbe6ef; padding-bottom: 10px; }
.planner-agenda-day > header > span { font-size: 12px; color: var(--muted); }
.planner-agenda-day > header > button { display: flex; justify-content: flex-start; gap: 12px; background: transparent; color: var(--ink); padding: 0; border: 0; min-height: 36px; font-size: 13px; }
.planner-agenda-day > header > button > span { display: grid; place-items: center; height: 36px; width: 36px; background: #e6eff6; color: var(--accent); border-radius: 10px; font-size: 17px; }
.planner-agenda-day.today > header > button > span { background: #f4d47d; color: #634b12; }
.planner-agenda-day.selected > header > button > span { box-shadow: inset 0 0 0 2px var(--accent); }
.planner-agenda-day > header svg { width: 15px; }
.planner-item { display: flex; gap: 14px; align-items: center; min-width: 0; padding: 18px 0; border-bottom: 1px solid #e6edf2; }
.planner-item-symbol { display: grid; place-items: center; height: 42px; width: 42px; flex: 0 0 42px; border-radius: 11px; background: #e5f0fa; color: #2a659e; }
.planner-item-symbol svg { width: 20px; height: 20px; }
.planner-item.due .planner-item-symbol { background: #ffe8ee; color: var(--red); }
.planner-item.hearing .planner-item-symbol { background: #eee6f8; color: var(--hearing); }
.planner-item.task .planner-item-symbol { background: #e2f4e8; color: var(--green); }
.planner-item-copy { flex: 1; min-width: 0; }
.planner-item-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; font-size: 11px; }
.planner-item-meta > span { color: #386b98; font-weight: 650; }
.planner-item.due .planner-item-meta > span { color: var(--red); }
.planner-item.hearing .planner-item-meta > span { color: var(--hearing); }
.planner-item.task .planner-item-meta > span { color: var(--green); }
.planner-item-meta time { font-size: 13px; font-weight: 650; color: var(--ink); }
.planner-file-link { display: block; text-align: left; padding: 0; min-height: 0; border: 0; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.5; font-weight: 650; overflow-wrap: anywhere; }
.planner-file-link:hover { color: var(--accent); background: transparent; box-shadow: none; }
.planner-item-copy > p { font-size: 12px; margin: 4px 0; color: var(--muted); overflow-wrap: anywhere; }
.planner-item-title { font-size: 12px; font-weight: 500; color: #466175; overflow-wrap: anywhere; }
.planner-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.planner-item-actions .icon-button { width: 36px; height: 36px; min-height: 36px; border-radius: 9px; }
.planner-item-actions .planner-complete { color: var(--green); border-color: #c4dfce; }
.planner-message { color: #28694b; background: #edf8f1; padding: 10px 14px; font-size: 12px; border: 1px solid #cce5d6; border-radius: 9px; margin: 0; }
.planner-message.error { background: #fff1f4; color: var(--red); border-color: #eed2d9; }
.planner-invalid { color: #8a621d; background: #fff9ed; border-top: 1px solid #eadcc0; padding: 14px; border-radius: 8px; font-size: 12px; }
.planner-invalid summary { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.planner-invalid svg { width: 17px; height: 17px; }
.planner-invalid .planner-file-link { padding: 12px 0 0; font-size: 12px; }
dialog.planner-day-dialog { width: min(940px, calc(100vw - 40px)); max-width: 940px; max-height: min(90vh, 1000px); padding: 0; border-radius: 20px; overflow: auto; color: var(--ink); background: #fff; }
.planner-day-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 28px 18px; background: #f2f8fc; border-bottom: 1px solid #dbe8f0; }
.planner-day-header > div:first-child { min-width: 0; }
.planner-day-header h2 { font-size: 22px; line-height: 1.4; margin: 0; overflow-wrap: anywhere; }
.planner-day-header .muted { margin: 6px 0 0; font-size: 12px; }
.planner-day-nav { display: flex; gap: 6px; flex-shrink: 0; }
.planner-day-commands { display: flex; gap: 8px; align-items: center; padding: 20px 28px; border-bottom: 1px solid #e2ebf0; }
.planner-day-commands > button:last-child { margin-left: auto; }
.planner-day-body { padding: 12px 28px 24px; }
.planner-day-group { padding: 10px 0; }
.planner-day-group > h3 { display: flex; align-items: center; gap: 9px; font-size: 13px; margin: 0; padding: 12px 0 5px; color: var(--accent); }
.planner-day-group > h3 > svg { width: 17px; height: 17px; }
.planner-day-group > h3 > span { margin-left: auto; background: #f0f5f8; border-radius: 5px; min-width: 23px; padding: 1px 5px; text-align: center; font-size: 11px; }
.planner-day-group.hearing > h3 { color: var(--hearing); }
.planner-day-group.due > h3 { color: var(--red); }
.planner-day-group.task > h3 { color: var(--green); }
.planner-day-dialog > .planner-message { margin: 14px 28px 0; }
.planner-filter-notice { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 28px; background: #fff9e9; color: #7c641f; font-size: 12px; }
.planner-filter-notice button { min-height: 30px; padding: 4px 10px; font-size: 11px; }
.planner-milestone-choice { display: flex; gap: 18px; border: 1px solid #d7e4ed; border-radius: 10px; padding: 14px; margin: 18px 0 0; }
.planner-milestone-choice legend { font-size: 12px; padding: 0 5px; font-weight: 600; }
.planner-milestone-choice label { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12px; }
.planner-milestone-choice input { width: 16px; min-height: 0; margin: 0; }
.planner-existing-notes { padding: 12px 0; font-size: 12px; }
.planner-existing-notes summary { color: var(--accent); cursor: pointer; }
.planner-existing-notes article { border-bottom: 1px solid var(--line); padding: 12px 0; }
.planner-existing-notes time { color: var(--muted); font-size: 11px; }
.planner-existing-notes p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; }
.case-workspace-heading { flex-wrap: wrap; gap: 8px; }
.case-workspace-heading #case-pin { margin-left: auto; }
@media (max-width: 1100px) {
  .planner { padding: 22px; }
  .planner-date-tools { flex-wrap: wrap; }
  .planner-filters > .search-field { max-width: none; }
  .planner .calendar-day { padding: 7px; min-height: 130px; height: 130px; }
  .planner-today-label { display: none; }
}
@media (max-width: 700px) {
  .planner { padding: 16px; gap: 16px; }
  .planner .calendar-top h2 { font-size: 19px; }
  .planner-toolbar { gap: 12px; }
  .planner-modes { width: 100%; }
  .planner-modes button { flex: 1; padding: 8px 10px; font-size: 12px; }
  .planner-date-tools { width: 100%; justify-content: space-between; gap: 10px; }
  .planner-date-tools label { font-size: 11px; gap: 6px; }
  .planner-types { gap: 6px; }
  .planner-types > label { padding: 6px 8px; font-size: 11px; gap: 5px; }
  .planner-types svg { width: 13px; height: 13px; }
  .planner-filters { gap: 12px; }
  .planner-filters > .search-field { min-width: 160px; }
  .planner .calendar-grid, .planner .calendar-weekdays { gap: 4px; }
  .planner .calendar-weekdays span { font-size: 10px; }
  .planner .calendar-day { min-height: 108px; height: 108px; padding: 5px; border-radius: 9px; gap: 5px; }
  .planner-mini { padding: 2px 3px; font-size: 10px; line-height: 1.5; justify-content: center; }
  .planner-mini svg, .planner-mini-desktop { display: none; }
  .planner-mini-mobile { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .planner .day-number { width: 22px; height: 22px; flex-basis: 22px; font-size: 11px; }
  .planner-day-bottom { font-size: 9px; line-height: 12px; }
  .planner-week-frame { max-height: 620px; }
  .planner-week-table { min-width: 1130px; }
  .planner-item { gap: 10px; flex-wrap: wrap; }
  .planner-item-symbol { width: 34px; height: 34px; flex-basis: 34px; }
  .planner-item-copy { flex-basis: calc(100% - 44px); }
  .planner-item-actions { margin-left: 44px; }
  .planner-file-link { font-size: 13px; }
  dialog.planner-day-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: 100dvh; margin: 0; border-radius: 0; }
  .planner-day-header { padding: 20px 16px 16px; gap: 12px; align-items: flex-start; }
  .planner-day-header h2 { font-size: 18px; }
  .planner-day-nav { flex-wrap: wrap; max-width: 82px; justify-content: flex-end; }
  .planner-day-nav .icon-button { height: 34px; width: 34px; min-height: 34px; }
  .planner-day-nav > button:last-child { order: -1; margin-left: 40px; }
  .planner-day-commands { padding: 14px 16px; gap: 6px; flex-wrap: wrap; }
  .planner-day-commands > button:not(:last-child) { padding: 9px 10px; font-size: 12px; flex: 1 1 auto; }
  .planner-day-commands > button:last-child { margin-left: 0; }
  .planner-day-body { padding: 8px 16px 20px; }
  .planner-day-dialog > .planner-message { margin: 12px 16px 0; }
  .planner-filter-notice { padding: 10px 16px; }
}
@media (max-width: 380px) {
  .planner-mini { padding: 2px 1px; font-size: 9px; }
  .planner .calendar-day { height: 106px; min-height: 106px; padding: 3px; gap: 4px; }
  .planner .calendar-grid, .planner .calendar-weekdays { gap: 3px; }
  .planner .calendar-nav { gap: 4px; }
  .planner .calendar-nav .icon-button { width: 34px; }
  .planner .calendar-nav button { font-size: 12px; }
  .planner-types { gap: 5px; }
  .planner-types > label { padding: 6px; }
  .planner-types svg { display: none; }
  .planner-date-tools { flex-direction: column; }
  .planner-date-tools label { justify-content: space-between; }
  .planner-day-commands > button { flex-basis: calc(50% - 4px) !important; }
  .planner-day-commands > button:last-child { flex-basis: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .planner .calendar-day { transition: background .18s, border-color .18s, box-shadow .18s; }
  .planner .calendar-day:hover .day-number { transform: scale(1.08); }
  .planner-day-group { animation: planner-row-in .25s ease-out both; }
  .planner-day-group:nth-child(2) { animation-delay: .04s; }
  .planner-day-group:nth-child(3) { animation-delay: .08s; }
  .planner-day-group:nth-child(4) { animation-delay: .12s; }
  @keyframes planner-row-in { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
}
