/* Foxtap panels: right rail cards, entry editor, timers, timesheet, matters, settings, matter picker. */

/* right rail */
.rail-right { width: var(--rail-right); border-left: 1px solid var(--line); background: var(--bg-2); overflow: auto; padding: 14px 14px 80px; display: flex; flex-direction: column; gap: 12px; }
.app.rail-closed .rail-right { display: none; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow-1); }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-h h3 { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.card-h .muted { font-size: 12px; }
.big { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.big small { font-size: 13px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.stat-row { display: flex; gap: 14px; margin-top: 8px; }
.stat { font-size: 12px; color: var(--ink-3); }
.stat b { display: block; font-size: 14px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.chart { width: 100%; height: 76px; margin-top: 10px; display: block; }
.chart .target { stroke: var(--ink-4); stroke-dasharray: 2 3; }
.chart .b { fill: var(--ok); }
.chart .nb { fill: var(--ink-4); }
.chart .lbl { fill: var(--ink-3); font-size: 10px; }
.chart .today .lbl { fill: var(--accent); font-weight: 600; }
.src-list { display: flex; flex-direction: column; gap: 2px; }
.src-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 8px; cursor: pointer; }
.src-row:hover { background: var(--bg-hover); }
.src-row svg { width: 15px; height: 15px; color: var(--ink-3); }
.src-row .n { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; }
.src-row.off { opacity: .45; }
.sug-list { display: flex; flex-direction: column; gap: 4px; }
.sug-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.sug-item:hover, .sug-item.focus { background: var(--bg-hover); border-color: var(--line); }
.sug-item .t { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sug-item .ttl { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-item .sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-item .acts { display: flex; gap: 2px; }
.sug-item .acts button { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--ink-3); }
.sug-item .acts button:hover { background: var(--bg-3); color: var(--ink); }
.sug-item .acts .accept:hover { color: var(--ok); }
.timer-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.timer-row:first-of-type { border-top: 0; }
.timer-row .tm { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13px; margin-left: auto; color: var(--ink-2); }
.timer-row.running .tm { color: var(--accent); font-weight: 600; }
.timer-row .nm { min-width: 0; }
.timer-row .nm b { display: block; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-row .nm span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.timer-row .ctl { display: flex; gap: 2px; }
.timer-row .ctl button { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--ink-2); }
.timer-row .ctl button:hover { background: var(--bg-3); color: var(--ink); }
.timer-row .ctl .stop:hover { color: var(--danger); }
.timer-row .dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h) var(--blk-s) var(--blk-edge-l)); flex: none; }
.timer-row.running .dot { background: var(--accent); position: relative; }
.timer-row.running .dot::after, .dock-pill .live::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--accent); opacity: .5; animation: pulse 1.6s infinite; will-change: transform, opacity; }
@keyframes pulse { 0% { transform: scale(.8); opacity: .6; } 70% { transform: scale(1.6); opacity: 0; } 100% { transform: scale(1.6); opacity: 0; } }

/* timer dock (bottom right of calendar views) */
.timer-dock { position: absolute; left: 16px; bottom: 16px; z-index: 20; display: none; }
.app[data-view="week"] .timer-dock, .app[data-view="day"] .timer-dock { display: block; }
.dock-pill { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); padding: 8px 10px 8px 14px; border-radius: 999px; box-shadow: var(--shadow-3); cursor: pointer; }
.dock-pill .tm { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
.dock-pill .nm { font-size: 12.5px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.dock-pill button { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); color: inherit; }
.dock-pill button:hover { background: rgba(255,255,255,.26); }
.dock-pill .live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; }
.dock-open { width: 340px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-3); padding: 12px 14px; }
.dock-open .card-h { margin-bottom: 6px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.quick .chip { cursor: pointer; }

/* entry editor panel */
/* the editor is a column of the app grid: it pushes the calendar and takes the sidebar's place while open */
.panel { width: 0; overflow: hidden; background: var(--bg); border-left: 0 solid var(--line); display: flex; flex-direction: column; transition: width .18s cubic-bezier(.2,.8,.2,1); height: 100vh; }
.panel.open { width: var(--panel-w); border-left-width: 1px; }
.panel > * { min-width: var(--panel-w); }
.panel-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; }
.panel-h .ttl { font-weight: 600; font-size: 15px; }
.panel-h .muted { font-size: 12px; }
.panel-b { flex: 1; overflow: auto; padding: 4px 16px 16px; }
.panel-f { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg-2); }
.panel-f .tb-spacer { flex: 1; }
.matter-hdr { --h: 220; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: hsl(var(--h) var(--blk-s) var(--blk-fill-l)); color: hsl(var(--h) 40% var(--blk-ink-l)); margin-bottom: 14px; cursor: pointer; }
.matter-hdr.none { background: var(--bg-3); color: var(--ink-2); border: 1.5px dashed var(--line-2); }
.matter-hdr .sw { width: 10px; height: 34px; border-radius: 3px; background: hsl(var(--h) var(--blk-s) var(--blk-edge-l)); flex: none; }
.matter-hdr.none .sw { background: var(--ink-4); }
.matter-hdr .c { font-size: 11.5px; opacity: .8; }
.matter-hdr .m { font-weight: 600; font-size: 14px; }
.matter-hdr .code { margin-left: auto; font-family: var(--mono); font-size: 11.5px; opacity: .7; }
.acts { display: flex; flex-wrap: wrap; gap: 5px; }
.lint { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }
.lint span { display: inline-flex; align-items: center; gap: 4px; }
.lint span.bad { color: var(--warn); font-weight: 500; }
.lint svg { width: 12px; height: 12px; }
.lint-msg { font-size: 12px; color: var(--warn); margin-top: 4px; }
.time-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.time-grid label { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }
.daybar { position: relative; height: 10px; border-radius: 999px; background: var(--bg-3); margin-top: 10px; overflow: hidden; }
.daybar i { position: absolute; top: 0; bottom: 0; background: var(--ink-4); opacity: .6; border-radius: 2px; }
.daybar i.me { background: var(--accent); opacity: 1; }
.daybar-lbl { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-4); margin-top: 3px; font-variant-numeric: tabular-nums; }
.source { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: var(--bg-2); color: var(--ink-3); font-size: 12px; }
.source svg { width: 14px; height: 14px; }
.warnbox { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 12px; }
.warnbox svg { width: 15px; height: 15px; margin-top: 1px; }
.errbox { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 12.5px; }
.menu { position: absolute; z-index: 40; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-3); padding: 6px; min-width: 180px; }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 7px; text-align: left; font-size: 13px; }
.menu button:hover { background: var(--bg-hover); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* matter picker */
.picker { position: relative; }
.picker .dd { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-3); max-height: 320px; overflow: auto; z-index: 45; padding: 6px; }
.picker .dd-h { font-size: 11px; color: var(--ink-4); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 6px 8px 2px; }
.picker .opt { --h: 220; display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.picker .opt:hover, .picker .opt.focus { background: var(--bg-hover); }
.picker .opt .sw { width: 10px; height: 10px; border-radius: 3px; background: hsl(var(--h) var(--blk-s) var(--blk-edge-l)); }
.picker .opt .nm { font-weight: 500; font-size: 13px; }
.picker .opt .cl { font-size: 11.5px; color: var(--ink-3); }
.picker .opt .code { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.picker .opt svg { width: 12px; height: 12px; color: var(--warn); fill: var(--warn); }

/* timesheet */
.sheet { padding: 16px 20px 80px; }
.sheet-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sheet-day { margin-bottom: 18px; }
.sheet-day-h { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.sheet-day-h b { font-size: 14px; }
.sheet-day-h .tot { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.sheet-day-h.today b { color: var(--accent); }
table.ts { width: 100%; border-collapse: collapse; }
.ts td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ts tr:hover td { background: var(--bg-2); }
.ts tr.sel td { background: var(--accent-soft); }
.ts td.chk { width: 28px; padding-left: 4px; }
.ts td.chk input { accent-color: var(--accent); }
.ts td.tm { width: 54px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.ts td.mt { width: 230px; }
.ts td.mt .nm { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.ts td.mt .cl { font-size: 11.5px; color: var(--ink-3); }
.ts td.mt .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: hsl(var(--h) var(--blk-s) var(--blk-edge-l)); margin-right: 6px; vertical-align: middle; }
.ts td.ac { width: 90px; color: var(--ink-2); font-size: 12.5px; }
.ts td.na { }
.ts td.na .ed { display: block; width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; background: transparent; outline: 0; min-height: 26px; }
.ts td.na .ed:hover { border-color: var(--line-2); }
.ts td.na .ed:focus { border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 3px var(--accent-soft); }
.ts td.un { width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.ts td.un input { width: 56px; text-align: right; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; background: transparent; outline: 0; font-variant-numeric: tabular-nums; }
.ts td.un input:hover { border-color: var(--line-2); }
.ts td.un input:focus { border-color: var(--accent); background: var(--bg); }
.ts td.hr { width: 54px; text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.ts td.st { width: 86px; text-align: right; }
.ts td.bl { width: 30px; text-align: center; }
.ts tr.posted td.na .ed, .ts tr.posted td.un input { pointer-events: none; color: var(--ink-3); }
.sheet-foot { display: flex; gap: 20px; justify-content: flex-end; padding: 10px 8px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sheet-foot b { color: var(--ink); }
.bulkbar { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); padding: 8px 10px 8px 14px; border-radius: 12px; box-shadow: var(--shadow-3); width: max-content; margin: 16px auto 0; }
.bulkbar .btn { background: rgba(255,255,255,.12); border-color: transparent; color: inherit; }
.bulkbar .btn:hover { background: rgba(255,255,255,.22); }

/* matters */
.matters { padding: 16px 20px 80px; max-width: 980px; }
.client-h { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; }
.client-h .sw { width: 12px; height: 12px; border-radius: 3px; background: hsl(var(--h) var(--blk-s) var(--blk-edge-l)); }
.client-h b { font-size: 14px; }
.client-h .muted { font-size: 12px; }
.mrow { display: grid; grid-template-columns: 28px 110px 1fr 150px 90px; align-items: center; gap: 12px; padding: 8px 8px; border-radius: 8px; }
.mrow:hover { background: var(--bg-2); }
.mrow .code { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.mrow .nm { font-weight: 500; }
.mrow .star { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--ink-4); }
.mrow .star.on { color: var(--warn); }
.mrow .star.on svg { fill: var(--warn); }
.mrow .star:hover { background: var(--bg-3); }
.mrow .tot { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.budget { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.budget i { display: block; height: 100%; background: var(--ok); }
.budget.amber i { background: var(--warn); }
.budget.red i { background: var(--danger); }
.budget-lbl { font-size: 11px; color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }

/* settings */
.settings { padding: 20px 24px 80px; max-width: 640px; }
.settings h2 { font-size: 15px; margin: 22px 0 10px; }
.settings h2:first-child { margin-top: 0; }
.set-row { display: grid; grid-template-columns: 200px 1fr; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.set-row label { color: var(--ink-2); }
.set-row .input { max-width: 240px; }
.set-row .help { grid-column: 2; font-size: 12px; color: var(--ink-3); margin-top: -4px; }
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* timers page */
.timers-page { padding: 16px 20px 80px; max-width: 760px; }
.timers-page .timer-row { padding: 12px 4px; }
.timers-page .timer-row .tm { font-size: 18px; }

/* self test badge */
.selftest { position: fixed; right: 12px; top: 64px; z-index: 70; padding: 6px 10px; border-radius: 8px; font-size: 12px; font-family: var(--mono); background: var(--ok-soft); color: var(--ok); box-shadow: var(--shadow-2); }
.selftest.fail { background: var(--danger-soft); color: var(--danger); }

/* Intapp-shaped editor additions */
.matter-hdr.firm { --h: 220; background: var(--bg-3); color: var(--ink-2); }
.matter-hdr.firm .sw { background: var(--ink-3); }
.note { font-size: 12px; color: var(--ink-3); margin-top: 6px; min-height: 0; }
.note span { display: inline-flex; align-items: center; gap: 5px; }
.note .warn { color: var(--warn); font-weight: 500; }
.note svg { width: 13px; height: 13px; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; vertical-align: middle; background: var(--bg-3); color: var(--ink-3); }
.tag.closed { background: var(--danger-soft); color: var(--danger); }
.tag.lit { background: var(--accent-soft); color: var(--accent); }
.code-sw { font-family: var(--mono); font-size: 11px; color: var(--ink-3); background: var(--bg-3); border-radius: 4px; padding: 1px 5px; min-width: 28px; text-align: center; }
.chip .code-sw { margin-right: 4px; padding: 0 4px; font-size: 10.5px; }
.chip.active .code-sw { background: rgba(255,255,255,.2); color: inherit; }
.picker .opt.disabled { opacity: .5; cursor: default; }
.picker .opt .code-sw { justify-self: start; }
.picker .dd-h { position: sticky; top: 0; background: var(--bg); z-index: 1; }
.warnbox.soft { background: var(--bg-2); color: var(--ink-2); }
.linkbtn { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.mrow.closed .nm { color: var(--ink-3); }
.ts tr.firm td.mt .sw { background: var(--ink-4); }
.ts td.ac .code-sw { margin-right: 6px; }

.field > div { min-width: 0; }
.acts .chip { max-width: 100%; min-width: 0; flex: 0 1 auto; }
.acts .chip .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.picker .opt { grid-template-columns: minmax(10px, auto) 1fr auto; }
.picker .opt .code-sw { width: 36px; }

/* time row */
.time-grid.four { grid-template-columns: 1fr 1fr 1fr 1fr; }
.time-grid input { text-align: center; padding: 0 6px; }
.date-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.date-row .input { max-width: 170px; }
.date-row .muted { font-size: 12px; }
/* temporary clients and matters */
.tag.temp { background: var(--warn-soft); color: var(--warn); }
.blk.temp { box-shadow: inset 3px 0 0 var(--warn), 0 0 0 1px rgba(255,255,255,.6); --h: 45; }
.blk.temp .blk-title::after { content: " · temp"; font-weight: 500; opacity: .7; font-size: 10.5px; }
.matter-hdr.temp { --h: 45; }
.temps { margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.temps h3 { margin: 0 0 4px; font-size: 13.5px; color: var(--warn); }
.temps .muted { color: var(--ink-2); font-size: 12px; }
.temp-row { display: grid; grid-template-columns: 1fr 110px 300px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--warn) 18%, transparent); margin-top: 8px; }
.temp-row .nm { font-weight: 600; }
.temp-row .cl { font-size: 12px; color: var(--ink-3); }
.temp-row .n { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.temp-row .picker .input { background: var(--bg); }
/* day header close tick */
.cdh-bar-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.cdh-bar-row .cdh-bar { flex: 1; margin-top: 0; }
.cdh-tick { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--line-2); background: var(--bg); display: grid; place-items: center; color: transparent; flex: none; cursor: pointer; transition: background .12s, border-color .12s; }
.cdh-tick svg { width: 11px; height: 11px; stroke-width: 3; }
.cdh-tick:hover { border-color: var(--ok); }
.cdh-tick.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.cdh-tick.part { border-color: var(--ok); color: var(--ok); }
.cdh-tick.none { opacity: .35; cursor: default; }
.panel-f .btn.danger.icon { color: var(--danger); }

/* floating timer window (Document PiP or popup) */
.pip .timer-row { padding: 9px 0; }
.pip .timer-row .tm { font-size: 15px; }
.pip .card-h h3 { font-size: 13px; }

/* whole-day grid: hours outside the core are tinted */
.offhours { position: absolute; left: 0; right: 0; background: var(--bg-2); opacity: .7; pointer-events: none; z-index: 0; }
.cal-col.today .offhours { background: var(--bg-3); opacity: .45; }
/* favourite chips sit above the time-code box */
#favs { margin-bottom: 8px; }
#favs[hidden] { margin: 0; }
/* units stepper */
.stepper { position: relative; }
.stepper .input { padding-right: 22px; }
.stepper .arrows { position: absolute; right: 3px; top: 3px; bottom: 3px; width: 18px; display: flex; flex-direction: column; }
.stepper .arrows button { flex: 1; display: grid; place-items: center; color: var(--ink-3); border-radius: 4px; }
.stepper .arrows button:hover { background: var(--bg-3); color: var(--ink); }
.stepper .arrows svg { width: 10px; height: 10px; stroke-width: 2.5; }
