:root {
 --navy:#102749;--navy-deep:#0c1e38;--blue:#4168d5;--mint:#15a38a;--ink:#1a2e4c;--muted:#75839a;
 --bg:#f5f7fb;--white:#fff;--border:#e7ecf3;--shadow:0 3px 16px rgba(14,35,66,.045);
 font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:#dfe6f1;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}body{touch-action:manipulation}
button,input,textarea,select{font:inherit}input,textarea,select{font-size:16px!important}button{cursor:pointer}button:disabled{opacity:.55;cursor:default}
a{color:inherit;text-decoration:none}[hidden]{display:none!important}svg{display:block;flex:none}button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #8cb4fd;outline-offset:2px}
.app-frame{height:100vh;height:100dvh;max-width:580px;margin:auto;background:var(--bg);overflow:hidden;position:relative;box-shadow:0 0 40px rgba(15,41,75,.1)}
.shell{height:100%;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.top-bar{height:calc(49px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 15px 0 17px;background:var(--white);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex:none}
.top-brand{display:flex;align-items:center;gap:8px;background:none;border:0;color:var(--navy);padding:0}
.brand-square,.login-mark{position:relative;display:grid;place-items:center;color:white;background:linear-gradient(145deg,#214a89,#0e2951);font-family:Georgia,serif;font-weight:bold}
.brand-square{width:28px;height:28px;border-radius:9px;font-size:20px}.brand-square span,.login-mark span{position:absolute;color:#bcdcfb;right:3px;top:3px;font-family:inherit;font-size:7px}
.brand-word{font-size:17px;font-weight:750;letter-spacing:-.7px}.brand-word small{font-size:9px;letter-spacing:1.5px;color:#8190a6;margin-left:3px}
.header-right{display:flex;align-items:center;gap:7px;min-width:0}.firm-caption{max-width:126px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:600;color:#7e899a}
.menu-button,.icon-button{border:0;background:transparent;color:#2e4060;display:grid;place-items:center;width:39px;height:40px;border-radius:10px}.menu-button svg,.icon-button svg{width:22px;height:22px}
/* Compact one-line section headers: no decorative eyebrow subtitles. */
.view-header{background:var(--white);min-height:42px;padding:6px 17px;flex:none;display:flex;justify-content:space-between;align-items:center;gap:10px}
.view-header h1{font-size:19px;letter-spacing:-.4px;line-height:1.15;margin:0;color:var(--navy);font-weight:760}
.app-frame[data-page="calendar"] .view-header h1{font-size:18px}
.view-count{border-radius:99px;background:#edf2fa;color:#4d6588;padding:5px 9px;font-size:11px;font-weight:750}
.view-content{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:13px 15px 15px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.view-content::-webkit-scrollbar,.sheet-body::-webkit-scrollbar{display:none}
/* Flush, fixed navigation: exactly 54px of usable height; additional pixels ONLY for device safe area. */
.bottom-nav{height:calc(54px + env(safe-area-inset-bottom));padding:0 0 env(safe-area-inset-bottom);display:grid;grid-template-columns:repeat(5,minmax(0,1fr));flex:none;align-items:stretch;background:var(--white);border-top:1px solid #dce4f0;box-shadow:none;z-index:3}
.nav-item{border:0;border-top:2px solid transparent;margin-top:-1px;padding:3px 0 2px;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:9px;font-weight:650;line-height:1.1;color:#8c99ad;min-width:0}
.nav-item svg{width:20px;height:20px;stroke-width:1.9}.nav-item.active{color:var(--blue);border-top-color:var(--blue);background:#f9fbff}
.section-heading{display:flex;align-items:center;justify-content:space-between;margin:16px 2px 8px;gap:9px}.section-heading strong{font-size:13px;letter-spacing:-.15px;color:#263c5c}.section-heading button{border:0;background:transparent;color:var(--blue);font-weight:750;font-size:11px;padding:7px 0}
.hero-share{display:flex;align-items:center;justify-content:space-between;gap:10px;border:0;text-align:left;width:100%;color:white;border-radius:15px;padding:15px 15px 14px;background:linear-gradient(115deg,#163862,#205389);min-height:105px}
.hero-share .hero-kicker{color:#c2d7f6;font-size:10px;letter-spacing:.9px;font-weight:750;display:block;margin-bottom:6px}.hero-share strong{display:block;font-size:18px;letter-spacing:-.35px;line-height:1.2}.hero-share small{display:block;color:#d3e0f1;font-size:11px;margin-top:5px}.hero-share svg{width:39px;height:39px;stroke-width:1.25;opacity:.8;margin:0 5px}
.quick-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:10px}.action-tile{border:1px solid var(--border);background:#fff;text-align:left;border-radius:13px;padding:13px 12px;display:flex;align-items:center;gap:9px;min-height:61px;box-shadow:var(--shadow)}
.action-tile svg{width:21px;height:21px;color:var(--blue)}.action-tile.green svg{color:var(--mint)}.action-tile b{display:block;font-size:12px}.action-tile small{display:block;color:var(--muted);font-size:10px;margin-top:2px}
.compact-strip{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:10px}.strip-link{border:1px solid var(--border);border-radius:12px;background:#fff;padding:11px 12px;text-align:left;display:flex;align-items:center;justify-content:space-between;gap:6px}.strip-link b{font-size:11px}.strip-link span{font-size:10px;color:var(--muted);display:block;margin-top:3px}.strip-link svg{color:var(--blue);width:17px;height:17px}
.item-list{display:flex;flex-direction:column;gap:7px}.item-row{width:100%;background:#fff;border:1px solid var(--border);border-radius:12px;min-height:59px;display:flex;align-items:center;gap:10px;padding:10px;text-align:left;box-shadow:var(--shadow)}.item-row:active,.action-tile:active{background:#f6f9ff}
.row-icon{display:grid;place-items:center;width:35px;height:35px;border-radius:10px;background:#ecf2ff;color:#4470ca;flex:none}.row-icon svg{width:18px;height:18px}.row-icon.green{background:#e9f8f2;color:#13967b}.row-icon.orange{background:#fff4e8;color:#c77931}.row-icon.violet{background:#f0edff;color:#7764c7}
.row-copy{flex:1;min-width:0}.row-copy strong{font-size:12.5px;color:#263b58;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-copy small{font-size:10.5px;color:#7c8ba1;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px}
.row-end{max-width:112px;display:flex;gap:4px;align-items:center;flex:none;color:#9ca8b8}.row-end svg{width:15px;height:15px}.date-tag{font-size:10px;font-weight:700;background:#f0f3fa;color:#5d7192;border-radius:6px;padding:5px;white-space:nowrap}.status-tag{font-size:10px;border-radius:7px;padding:5px 7px;background:#ecf8f3;color:#168b68;font-weight:700;white-space:nowrap}
.search-line{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--border);border-radius:11px;margin:0 0 10px;padding:0 10px;height:43px}.search-line svg{width:17px;height:17px;color:#8b98ae}.search-line input{background:none;outline:0;border:0;flex:1;min-width:0;color:var(--ink)}.search-line input::placeholder{color:#a1acbc}
.screen-action{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;gap:8px}.screen-action span{color:#738198;font-size:11px;font-weight:650}.mini-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;background:#eaf0ff;color:#355bc5;border:0;border-radius:9px;padding:8px 11px;font-size:11px;font-weight:750;min-height:34px}.mini-button svg{width:15px;height:15px}
.chips{display:flex;gap:6px;margin-bottom:11px;overflow-x:auto;scrollbar-width:none}.chips::-webkit-scrollbar{display:none}.chips button{white-space:nowrap;border:1px solid #e1e8f1;border-radius:99px;background:#fff;color:#657791;padding:8px 12px;font-weight:700;font-size:11px;min-height:34px}.chips button.selected{color:#fff;background:var(--navy);border-color:var(--navy)}
.share-help{background:#edf4ff;color:#416390;border-radius:11px;font-size:11px;line-height:1.45;padding:11px 12px;margin-bottom:11px}
.loading{display:flex;align-items:center;justify-content:center;gap:11px;font-size:12px;color:#8090a8;padding:48px 0}.spinner{width:18px;height:18px;border:2px solid #d4dff1;border-top-color:var(--blue);border-radius:50%;animation:spin .9s linear infinite}
.empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:7px;padding:38px 18px;color:#74849a}.empty svg{width:27px;height:27px;color:#9cafc8}.empty b{color:var(--navy);font-size:13px}.empty p{margin:0;font-size:12px;line-height:1.5}.retry-button{margin-top:12px}
.overlay,.sheet-overlay{position:absolute;inset:0;background:rgba(10,25,46,.44);z-index:6}
.drawer{position:absolute;right:0;top:0;bottom:0;z-index:7;background:#fff;width:min(88%,350px);display:flex;flex-direction:column;box-shadow:-8px 0 34px rgba(9,28,59,.12);padding:calc(env(safe-area-inset-top) + 15px) 18px calc(env(safe-area-inset-bottom) + 15px);animation:slide-from-right .18s ease-out}
.drawer-header{display:flex;justify-content:space-between;align-items:center}.drawer-header strong{font-size:19px;color:var(--navy)}.drawer-user{padding:15px 0;border-bottom:1px solid var(--border);margin-bottom:12px}.drawer-user b{font-size:13px;display:block}.drawer-user p{font-size:11px;margin:5px 0 0;color:var(--muted)}.drawer-links{flex:1;overflow:auto;min-height:0}.drawer-link{border:0;background:none;width:100%;display:flex;align-items:center;text-align:left;gap:12px;padding:13px 4px;color:#2e4361;font-size:13px;font-weight:650}.drawer-link svg{width:19px;height:19px;color:#5471b0}.drawer-link svg:last-child{margin-left:auto;width:16px;height:16px;color:#a8b4c4}.drawer-bottom{border-top:1px solid var(--border);padding-top:8px}.drawer-footer-button{display:flex;align-items:center;gap:9px;background:none;border:0;color:#475f80;font-size:12px;font-weight:650;padding:12px 0;width:100%}.drawer-footer-button svg{width:17px;height:17px}.drawer-footer-button.danger{color:#b45854}.drawer-version{color:#9cabc0;font-size:9px;letter-spacing:.7px;margin-top:11px}
.sheet-overlay{z-index:8}.sheet{position:absolute;z-index:9;left:0;right:0;bottom:0;max-height:calc(91% - env(safe-area-inset-top));display:flex;flex-direction:column;background:#fff;border-radius:19px 19px 0 0;padding-bottom:env(safe-area-inset-bottom);animation:slide-from-bottom .2s ease-out;box-shadow:0 -8px 40px rgba(9,28,59,.15)}
.sheet-grabber{height:4px;width:37px;border-radius:3px;background:#dbe3ed;margin:9px auto 4px;flex:none}.sheet-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 17px 11px;border-bottom:1px solid var(--border);flex:none}.sheet-header h2{font-size:17px;color:var(--navy);margin:0;letter-spacing:-.35px}.sheet-body{overflow-y:auto;min-height:0;padding:16px 18px 20px;-webkit-overflow-scrolling:touch}
.sheet-lead{margin:0 0 16px;color:var(--navy);font-weight:760;font-size:19px;line-height:1.3}.detail-line{display:flex;align-items:flex-start;gap:10px;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--border);font-size:12px}.detail-line span{color:#8390a3;min-width:100px}.detail-line b{font-weight:620;color:#28405e;text-align:right;overflow-wrap:anywhere}.sheet-actions,.pair-buttons{display:flex;gap:9px;margin-top:18px;flex-wrap:wrap}.sheet-actions>*{flex:1}.primary-button,.secondary-button{border:0;border-radius:11px;min-height:43px;padding:11px 14px;font-weight:750;font-size:12px;display:inline-flex;gap:8px;align-items:center;justify-content:center}.primary-button{background:var(--navy);color:white}.secondary-button{color:#3451a2;background:#edf2ff}.primary-button svg,.secondary-button svg{width:17px;height:17px}
.input-field{display:flex;flex-direction:column;margin:0 0 12px;gap:6px;color:#41516b;font-size:11px;font-weight:700}.input-field input,.input-field select{height:44px;border:1px solid #dce4ef;border-radius:9px;padding:0 11px;color:#263953;background:#fff;width:100%;min-width:0}.form-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.form-caption{color:#7f8ba0;line-height:1.5;font-size:11px;margin-bottom:15px}.form-error{background:#fff0f1;color:#a63d47;border-radius:9px;padding:10px 12px;font-size:12px}.sheet-form-error{margin:12px 0}.contact-links{display:flex;gap:9px;margin:0 0 14px}.contact-links a{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:#edf3ff;border-radius:9px;color:#3558b6;font-weight:750;font-size:12px;min-height:40px;flex:1}.contact-links svg{width:17px;height:17px}
.qr-image-box{width:min(255px,80%);aspect-ratio:1;margin:15px auto;background:white;padding:10px;border:1px solid #e1e7ee;border-radius:15px;display:grid;place-items:center}.qr-image-box img{width:100%;height:100%;object-fit:contain}.qr-url{background:#f4f7fb;border-radius:9px;padding:9px 10px;overflow-wrap:anywhere;font-size:11px;color:#60738c;line-height:1.4}.warning{background:#fff7e8;border-radius:9px;color:#916026;font-size:11px;line-height:1.5;padding:11px 12px;margin:12px 0}
.toast{position:absolute;bottom:calc(65px + env(safe-area-inset-bottom));left:12px;right:12px;z-index:15;background:#1b3556;color:white;border-radius:11px;text-align:center;font-size:12px;padding:13px;box-shadow:0 5px 20px rgba(20,40,70,.18)}
.login-screen{height:100%;display:flex;flex-direction:column;overflow-y:auto;padding:calc(env(safe-area-inset-top) + 27px) 24px calc(env(safe-area-inset-bottom) + 15px);background:linear-gradient(155deg,#102849,#1a4779 60%,#10325d);color:#fff}.login-mark{width:54px;height:54px;font-size:37px;border-radius:16px;box-shadow:0 10px 25px #0b234d60}.login-topline{font-size:14px;letter-spacing:2px;margin-top:12px}.login-topline strong{font-size:10px;color:#c7d9f3}.login-intro{margin:33px 0 28px}.login-kicker{font-size:10px;letter-spacing:2px;color:#bfd6f6;font-weight:750}.login-intro h1{font-size:39px;line-height:1.08;letter-spacing:-1.4px;margin:10px 0}.login-intro h1 em{color:#a2cfff;font-style:normal}.login-intro p{color:#c7d7eb;line-height:1.5;font-size:13px;max-width:280px;margin:0}.login-form{background:white;color:#1b3254;border-radius:17px;padding:19px;box-shadow:0 10px 30px #071e3e50}.login-form h2{font-size:18px;margin:0 0 18px}.login-form label{display:block;color:#465b79;font-size:11px;font-weight:750;margin:0 0 13px}.login-form input{width:100%;height:43px;margin-top:6px;border:1px solid #dee5f0;border-radius:9px;padding:0 11px;background:#fff}.password-field{position:relative}.password-field input{padding-right:46px}.password-field button{position:absolute;right:2px;top:6px;height:43px;width:42px;border:0;background:none;display:grid;place-items:center;color:#677d9c}.password-field button svg{width:19px;height:19px}.login-submit{width:100%;margin-top:4px;justify-content:space-between;padding:13px 15px}.login-foot{text-align:center;color:#b4cbeb;font-size:9px;letter-spacing:1.2px;margin:21px 0 0}
@keyframes spin{to{transform:rotate(360deg)}}@keyframes slide-from-right{from{transform:translateX(35px);opacity:.7}to{transform:translateX(0);opacity:1}}@keyframes slide-from-bottom{from{transform:translateY(25px);opacity:.75}to{transform:translateY(0);opacity:1}}
@media(min-width:620px){.app-frame{margin:14px auto;height:calc(100dvh - 28px);border-radius:16px}.login-screen{border-radius:16px}}
@media(max-height:690px){.view-header{min-height:52px;padding-top:6px;padding-bottom:8px}.view-header h1{font-size:20px}.view-content{padding-top:10px}.login-intro{margin:20px 0}.login-intro h1{font-size:33px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}

/* Companion-specific detail content */
.input-field textarea{border:1px solid #dce4ef;border-radius:9px;padding:11px;color:#263953;background:#fff;width:100%;min-width:0;resize:vertical;line-height:1.45}
.input-field span{display:block;margin-bottom:3px}
.sign-recipient{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--border);padding:11px 0;font-size:12px}
.sign-recipient b,.sign-recipient small{display:block;line-height:1.35}
.sign-recipient small{color:var(--muted);margin-top:4px;word-break:break-word}
.sign-recipient>.mini-button{flex:none}
.forum-reply{padding:12px 0;border-bottom:1px solid var(--border);font-size:12px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.forum-reply b{font-size:11px;color:var(--blue)}.forum-reply p{margin:6px 0 0}
.topic-body{font-size:13px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;color:#304761}
.sheet-actions a{flex:1}.sheet-actions .primary-button,.sheet-actions .secondary-button{flex:1}


/* v0.6: The iOS screen.height includes a non-interactive 47px home-indicator
   region on some devices. Keep the bottom buttons INSIDE visualViewport instead
   of stretching the frame into that region. Paint the system strip white so it
   visually joins the nav, with no gray gutter or clipped labels. */
html,body{background:#fff!important}
.app-frame{position:fixed;top:var(--lexira-viewport-top,0px);left:0;right:0;bottom:auto;
 width:100%;height:var(--lexira-viewport-height,100dvh);max-width:580px;margin:0 auto;
 border-radius:0;box-shadow:none;overflow:hidden}
.shell{position:absolute;inset:0;height:100%;min-height:0;display:flex;flex-direction:column}
.bottom-nav{height:48px;flex:0 0 48px;padding:0;
 display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch;
 border-top:1px solid #dce4f0;background:#fff;box-shadow:none;z-index:3}
.nav-item{margin:0;padding:4px 0 1px;gap:2px;font-size:9px;line-height:1.15;min-height:0}
.nav-item svg{width:19px;height:19px}
.view-content{padding-bottom:10px}
.toast{bottom:60px}
@media(min-width:620px){.app-frame{top:14px;bottom:auto;height:calc(100dvh - 28px);border-radius:16px;box-shadow:0 0 40px rgba(15,41,75,.1)}}
.intake-action{margin-top:16px;padding:13px 11px;background:#edf4ff;border:1px solid #d9e5fb;border-radius:12px;display:flex;flex-direction:column;gap:10px}
.intake-action b{display:block;color:var(--navy);font-size:12px}
.intake-action small{display:block;color:#607895;font-size:11px;margin-top:4px}
.intake-action .primary-button{width:100%;justify-content:center}
.intake-caption{display:flex;align-items:center;gap:8px;margin-bottom:9px;color:var(--navy);font-size:12px;font-weight:700}
.intake-caption svg{width:18px;height:18px;color:var(--blue)}
.intake-renew{width:100%;margin-top:12px}

/* v0.7: quick client intake link on each eligible matter. */
.intake-inline-buttons{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:8px}
.intake-inline-buttons .primary-button,.intake-inline-buttons .secondary-button{min-width:0;padding:9px 7px;font-size:11px;line-height:1.3;text-align:center}
.intake-inline-buttons svg{width:15px;height:15px}
.manual-copy-link{display:block;width:100%;min-height:92px;resize:none;white-space:normal;overflow-wrap:anywhere;border:1px solid #ccd7e8;border-radius:9px;padding:12px;font-size:14px;color:var(--navy);background:#f4f7fb}

/* v0.8 Mobile calendar: compact month dots, daily agenda and landscape week */
.cal-mode-tabs{display:flex;gap:5px;margin-bottom:11px;padding:4px;background:#eaf0f7;border-radius:11px}
.cal-mode-tabs button{border:0;background:transparent;color:#6b7f9b;border-radius:8px;min-height:34px;padding:7px 14px;font-size:12px;font-weight:750;flex:1}
.cal-mode-tabs button.selected{background:white;color:#193965;box-shadow:0 1px 5px #203b6119}
.cal-toolbar{display:flex;align-items:center;justify-content:space-between;gap:7px;margin:0 0 9px;min-width:0}
.cal-period-nav{display:flex;align-items:center;gap:3px;min-width:0;flex:0 1 auto}
.cal-period-nav strong{flex:0 1 auto;min-width:0;color:#18355b;font-size:12px;line-height:1.2;letter-spacing:-.15px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-toolbar-actions{display:flex;align-items:center;gap:5px;flex:none;margin-left:auto}
.cal-arrow{display:grid;place-items:center;border:1px solid #e0e7f1;border-radius:8px;width:30px;height:34px;background:#fff;color:#3c5a84;flex:none;padding:0}
.cal-arrow svg{width:16px;height:16px}.cal-period-nav .cal-arrow:first-child svg{transform:rotate(180deg)}
.cal-today{border:0;border-radius:8px;background:#e8efff;color:#3557a8;font-size:11px;font-weight:750;min-height:34px;padding:0 9px}
.cal-add{display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:8px;background:#eaf0ff;color:#355bc5;flex:none;padding:0}
.cal-add svg{width:17px;height:17px}
.cal-filters{margin-bottom:12px}.cal-filters button{padding:7px 11px;min-height:31px}
.cal-month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;background:#fff;border:1px solid var(--border);border-radius:12px;padding:8px 5px;margin-bottom:14px;box-shadow:var(--shadow)}
.cal-weekday{font-weight:780;font-size:10px;text-align:center;color:#8090a9;min-height:23px;display:grid;place-items:center}
.cal-date{display:flex;flex-direction:column;align-items:center;gap:4px;border:1px solid transparent;border-radius:8px;background:transparent;color:#324762;min-width:0;min-height:49px;padding:5px 1px 4px}
.cal-date-number{display:grid;place-items:center;min-width:23px;height:22px;font-size:12px;font-weight:680}
.cal-date.outside{opacity:.44}.cal-date.today .cal-date-number{color:#3364bd;border:1px solid #b5c8ed;border-radius:50%}
.cal-date.picked{background:#eaf1ff;border-color:#cbdbf9;color:#1d4898}.cal-date.picked .cal-date-number{font-weight:800}
.cal-dots{display:flex;gap:2px;align-items:center;justify-content:center;min-height:6px;max-width:100%}.cal-dots small{font-size:8px;color:#71829f}
.cal-dot{width:5px;height:5px;border-radius:50%;display:inline-block;flex:0 0 5px;background:#6d86c7}
.cal-dot-closing{background:#d69a38}.cal-dot-taskcal{background:#376cce}.cal-dot-event{background:#3aab84}
.cal-agenda-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;font-weight:760;color:#263e5d;margin:8px 2px 10px}
.cal-agenda-heading span{color:#8896a9;font-weight:600;font-size:10px;white-space:nowrap}
.cal-list-group{margin-bottom:16px}.cal-list-group .cal-agenda-heading{margin-top:17px}
.cal-week-layout{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin-bottom:13px}
.cal-week-column{display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;min-width:0;min-height:142px;padding:8px 3px;border:1px solid #e2e9f3;background:#fff;border-radius:10px;color:#2a4264}
.cal-week-column.picked{border-color:#a8c3f4;background:#edf4ff}.cal-week-column.today strong{color:#2e64c5}
.cal-week-name{font-size:10px;color:#798ca6;font-weight:720}.cal-week-column strong{font-size:16px;line-height:1.2}
.cal-week-entries{display:flex;flex-direction:column;gap:4px;width:100%;padding-top:5px}
.cal-week-event{font-size:9px;line-height:1.25;text-align:left;padding:4px 3px;background:#e4edff;color:#365a9e;border-left:2px solid #4176cd;border-radius:3px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere}
.cal-event-closing{background:#fff4df;border-color:#d89b36;color:#87602b}.cal-event-event{background:#e4f6ee;border-color:#3aab84;color:#2d765e}
.cal-week-entries small{font-size:9px;color:#7485a0}
.cal-check{display:flex;align-items:center;gap:10px;margin:5px 0 16px;font-size:12px;font-weight:700;color:#405677}
.cal-check input{accent-color:#365cba;width:17px;height:17px}
.date-file-identity{border:1px solid #d6e3f6;border-radius:11px;background:#f2f6fd;padding:13px 14px;margin-bottom:13px}
.date-file-identity>span{display:block;color:#6784ad;letter-spacing:.8px;font-size:9px;font-weight:800;margin-bottom:6px}
.date-file-identity strong{display:block;color:#183660;font-size:16px;line-height:1.35;overflow-wrap:anywhere}
.date-file-identity p{font-size:11px;color:#526987;margin:5px 0 3px;overflow-wrap:anywhere}
.date-file-identity small{color:#7b8da5;font-size:11px}
@media(orientation:landscape) and (max-height:600px){
 .app-frame{top:0!important;left:0;right:0;max-width:none!important;width:100%;height:var(--lexira-viewport-height,100dvh)!important;border-radius:0!important;box-shadow:none!important}
 .view-header{min-height:34px;padding:5px 14px}.view-header h1{font-size:17px}.app-frame[data-page="calendar"] .view-header h1{font-size:16px}
 .top-bar{height:40px;padding-top:0}.bottom-nav{height:43px;flex-basis:43px}.view-content{padding:7px 12px 8px}
 .cal-mode-tabs{margin-bottom:5px;padding:2px}.cal-mode-tabs button{min-height:28px;padding:3px 10px}
 .cal-toolbar{margin-bottom:6px}.cal-arrow,.cal-today,.cal-add{height:29px;min-height:29px}.cal-filters{margin-bottom:7px}
 .cal-week-column{min-height:102px;padding:5px 3px}.cal-week-entries{padding-top:2px}
 .cal-week-event{font-size:9px;padding:2px 3px}.cal-agenda-heading{margin-top:5px}
 .screen-action{margin-bottom:6px}
}
/* v0.9: full 24-hour daily/weekly time grid; the day header and all-day row
   remain visible while the hours scroll independently. */
.section-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;padding:3px;margin:0 0 12px;border:1px solid #dbe5f2;background:#eaf0f7;border-radius:12px}
.section-tabs button{border:0;border-radius:9px;background:transparent;color:#607693;font-size:12px;font-weight:750;min-height:42px;padding:8px 6px;min-width:0;overflow-wrap:anywhere}
.section-tabs button.selected{background:#fff;color:#153767;box-shadow:0 1px 5px #173e6818}
.cal-timeline{--cal-hour-h:64px;--cal-rail:45px;--cal-cols:1;min-width:0;width:100%;overflow-x:auto;overflow-y:hidden;border:1px solid #dce5f2;border-radius:12px;background:#fff;box-shadow:var(--shadow);overscroll-behavior-x:contain}
.cal-timeline-week{--cal-cols:7}
.cal-timeline-top,.cal-timeline-allday,.cal-timeline-body{display:grid;grid-template-columns:var(--cal-rail) repeat(var(--cal-cols),minmax(0,1fr));min-width:0}
.cal-timeline-week .cal-timeline-top,.cal-timeline-week .cal-timeline-allday,.cal-timeline-week .cal-timeline-body{min-width:635px}
.cal-timeline-top{border-bottom:1px solid #dfe7f2;background:#f8faff;align-items:stretch}
.cal-timeline-spacer{border-right:1px solid #e1e8f1}
.cal-time-day-header{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:33px;padding:5px 1px;border-right:1px solid #edf1f7;color:#62748d;font-size:10px;font-weight:720}
.cal-time-day-header b{color:#2d4b74;font-size:12px}.cal-time-day-header.today{background:#ecf3ff;color:#1e5fb9}.cal-time-day-header.today b{color:#1e5fb9}
.cal-timeline-allday{min-height:31px;border-bottom:1px solid #dce5f1;background:#fff}
.cal-allday-label{border-right:1px solid #e1e8f1;display:flex;align-items:center;justify-content:center;font-size:9px;color:#8291a5;line-height:1.15;text-align:center}
.cal-allday-cell{border-right:1px solid #edf1f7;min-width:0;min-height:31px;padding:2px;display:flex;flex-direction:column;gap:2px}
.cal-allday-item{background:#fff1d8;color:#86632d;border:1px solid #f2dcae;border-radius:4px;font-size:9px;min-height:22px;padding:2px 3px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}
.cal-allday-item.cal-event-taskcal{background:#ecf1ff;border-color:#bcd1f9;color:#2256a8}
.cal-allday-item.cal-event-event{background:#e1f8ee;border-color:#bcdfd2;color:#247b64}
.cal-timeline-scroll{overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;height:clamp(225px,calc(var(--lexira-viewport-height,100dvh) - 325px),650px)}
.cal-timeline-body{height:calc(24 * var(--cal-hour-h));position:relative}
.cal-hour-axis{height:100%;position:relative;border-right:1px solid #dce5f0}
.cal-hour-label{position:absolute;right:4px;font-size:9px;color:#8493a8;line-height:1;background:#fff;transform:translateY(-1px);white-space:nowrap}
.cal-timed-day{height:100%;position:relative;min-width:0;border-right:1px solid #e8edf4;background-image:repeating-linear-gradient(to bottom,transparent 0,transparent calc(var(--cal-hour-h) - 1px),#e6ebf4 calc(var(--cal-hour-h) - 1px),#e6ebf4 var(--cal-hour-h)),repeating-linear-gradient(to bottom,transparent 0,transparent calc(var(--cal-hour-h) / 2 - 1px),#f3f5f9 calc(var(--cal-hour-h) / 2 - 1px),#f3f5f9 calc(var(--cal-hour-h) / 2));background-color:#fff}
.cal-time-entry{position:absolute;z-index:1;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:2px;overflow:hidden;min-width:0;border-radius:5px;border:1px solid #bcd0f4;border-left:3px solid #4176cd;padding:4px 3px;background:#e7efff;color:#22549e;text-align:left;box-shadow:0 1px 2px #193e6715}
.cal-time-entry.cal-event-closing{background:#fff4df;border-color:#e4c28d;color:#815c2d}
.cal-time-entry.cal-event-event{background:#dff4ec;border-color:#b9e3d1;border-left-color:#299873;color:#236d55}
.cal-entry-time{font-size:9px;font-weight:770;line-height:1.15;white-space:nowrap}
.cal-entry-title{font-size:10px;font-weight:690;line-height:1.15;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.cal-timeline-week .cal-entry-time{font-size:8px}.cal-timeline-week .cal-entry-title{font-size:9px;-webkit-line-clamp:3}
@media(orientation:landscape) and (max-height:600px){
 .section-tabs{margin-bottom:6px}.section-tabs button{min-height:30px;padding:5px;font-size:11px}
 .cal-timeline-scroll{height:calc(var(--lexira-viewport-height,100dvh) - 254px);min-height:112px;max-height:none}
 .cal-time-day-header{min-height:28px;padding:3px 1px}
 .cal-allday-cell{min-height:24px}.cal-allday-item{min-height:19px;padding:2px 2px}
 .cal-timeline-week .cal-timeline-top,.cal-timeline-week .cal-timeline-allday,.cal-timeline-week .cal-timeline-body{min-width:625px}
}

@media(orientation:landscape) and (max-height:600px){
 /* One forced Week mode needs no single-choice mode tab. Let the time grid
    occupy the scarce vertical space on a phone rotated sideways. */
 .cal-mode-tabs{display:none}
 .cal-timeline-week{margin-top:0}
 .screen-action>span:first-child{display:none}
 .screen-action{justify-content:flex-end;min-height:27px}
 .screen-action .mini-button{min-height:25px;padding:4px 9px}
 .cal-filters button{min-height:24px;padding:3px 10px}
 .cal-toolbar{margin-top:0}
 .cal-timeline-scroll{height:calc(var(--lexira-viewport-height,100dvh) - 220px);min-height:128px}
}

@media(orientation:landscape) and (max-height:600px){
 .app-frame[data-page="calendar"] .view-header{display:none}
 .app-frame[data-page="calendar"] .cal-toolbar .cal-add{width:29px;height:29px}
 .app-frame[data-page="calendar"] .cal-timeline-scroll{height:calc(var(--lexira-viewport-height,100dvh) - 196px);min-height:135px}
}

.cal-allday-cell{max-height:84px;overflow-y:auto;scrollbar-width:thin}

/* v0.9.1 — independent source checkboxes; compact in portrait and landscape. */
.cal-filters{display:flex;gap:7px;align-items:center;flex-wrap:nowrap;margin:0 0 11px;overflow-x:auto;scrollbar-width:none}
.cal-filters::-webkit-scrollbar{display:none}
.cal-filter-check{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:1 0 auto;min-height:32px;padding:5px 9px;border:1px solid #dce5f0;border-radius:8px;background:#f8faff;color:#355276;font-size:11px;font-weight:720;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}
.cal-filter-check:has(input:not(:checked)){color:#8492a6;background:#fff;border-color:#e4e9f0}
.cal-filter-check input{width:15px;height:15px;min-width:15px;margin:0;accent-color:var(--navy);cursor:pointer}
.cal-filter-check:focus-within{outline:2px solid #6f95ce;outline-offset:1px}
.event-reg-link{margin-top:12px;padding:10px 12px;border:1px solid #dce5f0;border-radius:10px;background:#f5f8fd;overflow-wrap:anywhere}
.event-reg-link span{display:block;margin-bottom:5px;color:#617993;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.4px}
.event-reg-link a{font-size:12px;line-height:1.5;color:#1d58a4;overflow-wrap:anywhere}
@media(orientation:landscape) and (max-height:600px){.cal-filters{margin-bottom:6px;gap:5px}.cal-filter-check{min-height:25px;padding:3px 8px;font-size:10px}.cal-filter-check input{width:13px;height:13px;min-width:13px}}

/* v0.9.2: give the calendar itself more of the phone screen. */
.app-frame[data-page="calendar"] .view-content{padding-top:7px}
.app-frame[data-page="calendar"] .cal-mode-tabs{margin-bottom:8px}

/* Date-based browse: keep controls visible and open on today. Older above, newer below. */
.dated-scroll{overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;
 max-height:calc(var(--lexira-viewport-height, 100dvh) - 198px);min-height:100px;padding:2px 1px 12px;
 scrollbar-gutter:stable; padding-bottom:max(12px, calc(var(--lexira-viewport-height, 100dvh) - 195px))}
.app-frame[data-page="calendar"] .dated-scroll{max-height:calc(var(--lexira-viewport-height, 100dvh) - 223px)}
.timeline-row{display:block;margin-bottom:7px}
.dated-scroll .timeline-row .item-row{width:100%}
.timeline-today-marker{font-size:11px;font-weight:800;color:#355bc5;padding:10px 2px 8px;
 border-top:1px solid #ccd9f0;margin-top:6px}
.timeline-more{width:100%;min-height:35px;border:1px solid #dce5f0;background:#f4f7fd;
 border-radius:9px;color:#375c92;font-size:11px;font-weight:750;margin:8px 0}
.matter-notes{margin-top:19px;padding-top:14px;border-top:1px solid var(--border)}
.matter-notes-heading{font-size:14px;color:var(--navy);font-weight:780;margin:0 0 12px}
.matter-note{border:1px solid var(--border);border-radius:11px;background:#f8faff;padding:11px;margin-bottom:9px}
.matter-note-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;color:#375475;font-size:11px}
.matter-note-head time{font-size:10px;color:#8492a6;text-align:right}
.matter-note-body{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.5;margin-top:8px;color:#273f5b}
.matter-notes textarea{width:100%;min-height:88px;border:1px solid #dce4ef;border-radius:9px;padding:10px;
 resize:vertical;background:#fff;color:#263953;margin:7px 0 10px}
.matter-notes button[type="submit"]{width:100%}

.matter-note-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.matter-note-title .matter-notes-heading{margin:0}


/* 0.9.4: keep the matter summary unchanged, with notes in a dedicated slide-in screen. */
.sheet-header h2{flex:1;min-width:0}
.sheet-header .sheet-back{width:30px;height:35px;flex:none;margin-left:-6px}
.notes-slide-in{animation:notes-slide-in .22s ease-out}
.notes-slide-back{animation:notes-slide-back .20s ease-out}
@keyframes notes-slide-in{from{opacity:.6;transform:translateX(35px)}to{opacity:1;transform:translateX(0)}}
@keyframes notes-slide-back{from{opacity:.7;transform:translateX(-28px)}to{opacity:1;transform:translateX(0)}}
.notes-shortcuts{margin-top:15px}
.notes-shortcuts button{min-width:115px}
.notes-screen .notes-context{padding:3px 0 17px;border-bottom:1px solid var(--border);margin-bottom:16px;display:flex;flex-direction:column;gap:5px}
.notes-context strong{font-size:12px;color:#304b6d}
.notes-context span{font-size:13px;color:#677a96;line-height:1.4;overflow-wrap:anywhere}
.notes-toolbar{display:flex;gap:6px;align-items:center}
.notes-screen .matter-note-title{margin-bottom:14px}
.notes-screen #matter-note-form{background:#f6f8fd;border:1px solid #e2eaf6;border-radius:11px;padding:12px;margin-bottom:16px}
.notes-screen #matter-note-form .input-field{font-size:12px;margin-bottom:9px}
.notes-screen #matter-note-form textarea{min-height:110px}
.notes-screen #matter-note-form button[type=submit]{width:100%}
.upcoming-expand{width:100%;padding:10px;border:1px solid #dfe7f2;background:#fff;color:var(--blue);border-radius:10px;font-size:12px;font-weight:740;display:flex;align-items:center;justify-content:center;gap:7px}
.upcoming-expand svg{width:15px;height:15px}
@media(prefers-reduced-motion:reduce){.notes-slide-in,.notes-slide-back{animation:none}}


/* v0.9.5: keep the file-note composer ABOVE the keyboard and near the foot
   of its dedicated screen. Only the history, not the form, may scroll. */
.sheet.notes-mode{height:calc(91% - env(safe-area-inset-top));}
.sheet.notes-mode .sheet-body{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.sheet.notes-mode .notes-screen{display:flex;flex-direction:column;flex:1;min-height:0;width:100%}
.sheet.notes-mode .notes-context,.sheet.notes-mode .matter-note-title{flex:none}
.sheet.notes-mode .notes-list-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;
 -webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:6px}
.sheet.notes-mode .notes-list-scroll::-webkit-scrollbar{display:none}
.sheet.notes-mode #matter-note-form{display:flex;flex-direction:column;flex:0 1 auto;min-height:0;
 max-height:69%;overflow:hidden;margin:9px 0 0;padding:11px;background:#f6f8fd;
 border:1px solid #e2eaf6;border-radius:11px}
.sheet.notes-mode #matter-note-form .input-field{flex:0 1 auto;min-height:0;margin:0;overflow:hidden}
.sheet.notes-mode #matter-note-form textarea{display:block;flex:0 1 auto;min-height:66px;max-height:220px;
 margin:5px 0 0;resize:none;overflow-y:auto;overscroll-behavior:contain}
.sheet.notes-mode #matter-note-form button[type=submit]{flex:none;min-height:43px;margin-top:9px;width:100%}
/* A reduced visual viewport (including the on-screen keyboard) should free
   more space for the note and Save button instead of pushing them out. */
.sheet.notes-mode.notes-compact .notes-context{padding:0 0 6px;margin-bottom:8px}
.sheet.notes-mode.notes-compact .notes-context span{display:none}
.sheet.notes-mode.notes-compact .matter-note-title{margin-bottom:7px}

/* Very small visible regions (landscape + keyboard): prioritize input/actions. */
.sheet.notes-mode.notes-tiny .notes-context,.sheet.notes-mode.notes-tiny .matter-note-title{display:none}
.sheet.notes-mode.notes-tiny #matter-note-form{max-height:96%}
.sheet.notes-mode.notes-tiny #matter-note-form textarea{min-height:44px}


/* v0.9.6 — iOS keyboard: notes dialog lives directly under <body>.
   Neither the app frame nor Safari's automatic focus-panning can displace it.
   Follow visualViewport's height AND offsetTop, not merely 100vh/100dvh. */
.sheet.notes-mode.notes-viewport-sheet{
 position:fixed;
 top:var(--lexira-notes-top,9dvh);
 bottom:auto;
 left:0;
 right:0;
 width:min(100%,580px);
 max-height:none;
 height:var(--lexira-notes-height,91dvh);
 margin:0 auto;
 z-index:20;
 overscroll-behavior:none;
}
.sheet.notes-mode.notes-viewport-sheet .sheet-body{
 overscroll-behavior:none;
 -webkit-overflow-scrolling:auto;
}
/* Prevent Safari's scroll anchoring from repositioning the composer. */
.sheet.notes-mode.notes-viewport-sheet #matter-note-form{overflow-anchor:none}
