/* Timmy-only styles. Shared chrome comes from kit.css (linked first). */
body { font-variant-numeric: tabular-nums; }

/* The kit's button rule is for rail buttons (block, full width, left text).
   Timmy's own button types set their own box. */
.chip, .entry, .pc, .cal .c, .yearbars .m, .linkish, .note button, .catrow .del,
.vhead > button, .seg button, .days7 button, dialog .x, .addnote button, .viewbtn { width: auto; margin: 0; }
.vhead > button, .seg button, .days7 button, .viewbtn, button.primary { text-align: center; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 600; }
button.primary:hover { background: color-mix(in srgb, var(--accent) 78%, #fff); border-color: color-mix(in srgb, var(--accent) 78%, #fff); color: var(--ink); }
.bigbtn { padding: 10px; }
/* In the view and dialogs, buttons sharing a row share it equally, whatever their labels. */
#viewscroll .btnrow > button, dialog .btnrow > button { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* inputs the kit doesn't cover */
input[type=text]:not(.num):not(#docname), input[type=date], input:not([type]), textarea {
  font: inherit; color: var(--text); background: var(--ink); border: 1px solid var(--line); border-radius: 3px; padding: 7px 9px; min-width: 0;
}
input[type=text]:not(.num):focus-visible, input[type=date]:focus-visible, input:not([type]):focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); }
.notefield { width: 100%; resize: vertical; min-height: 60px; }

/* ---- rail ---- */
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.chip { display: inline-flex; align-items: center; border-radius: 12px; padding: 3px 9px; font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip[aria-pressed=true] { background: var(--raise); color: #fff; font-weight: 400; border-color: var(--c, var(--accent)); }
.tagrow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 6px 0 2px; }
.tagchip { display: inline-flex; align-items: center; border-radius: 10px; padding: 1px 8px; font-size: 10px; border: 1px solid color-mix(in srgb, var(--t) 70%, transparent); color: var(--t); background: color-mix(in srgb, var(--t) 10%, transparent); white-space: nowrap; }
.chip.addtag, #railfoot .timercard .chip.addtag { font-size: 10px; padding: 1px 8px; margin: 0; border: 1px dashed var(--line); color: var(--dim); background: transparent; font-weight: 400; letter-spacing: 0; text-align: center; width: auto; min-height: 0; }
#railfoot .timercard .chip.addtag:hover { color: #fff; border-color: var(--accent); background: transparent; }
.chip.tagtoggle[aria-pressed=true] { border-color: var(--t); color: #fff; background: color-mix(in srgb, var(--t) 16%, var(--raise)); }
.chip.tagtoggle[aria-pressed=true]::after { content: '✓'; margin-left: 6px; color: var(--t); }
.chip.tagtoggle[aria-pressed=false] { color: var(--dim); }
.dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; }
.timercard { border: 1px solid var(--line); border-radius: 3px; padding: 10px 10px 4px; background: #1b212866; margin-bottom: 8px; }
#railfoot .timercard { margin: 0 0 8px; }
#railfoot #timerbox { min-width: 0; }
#railfoot .timercard .row select { max-width: 55%; min-width: 0; }
#railfoot #runrow { margin: 0 0 6px; }
.timercard.running { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.clockrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.clockrow .nudges { display: flex; gap: 4px; flex: none; }
.clockrow .nudge { min-width: 36px; height: 30px; font-size: 11px; }
#railfoot .timercard .nudge { background: var(--raise); color: var(--dim); border: 1px solid var(--line); font-weight: 400; padding: 0 6px; width: auto; letter-spacing: 0; text-transform: none; }
#railfoot .timercard .nudge:hover { color: #fff; border-color: var(--accent); background: var(--raise); }
.tip .acc, .acc { color: var(--accent); }
.clock { font-size: 30px; font-weight: 600; color: var(--accent); letter-spacing: .02em; line-height: 1.1; }
.runbadge { font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; }
.timercard input.task { width: 100%; color: #fff; }
.timercard .row label .dot { margin-right: 6px; }
.timercard .tip { margin: 6px 0; }
.entries { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.entry { display: grid; grid-template-columns: max-content minmax(0, 1fr) 44px; gap: 8px; padding: 6px 8px; border-radius: 3px; background: transparent; border-color: transparent; font-weight: 400; align-items: center; }
.entry:hover { border-color: var(--line); background: var(--raise); color: var(--text); }
.entry .t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.entry .d { text-align: right; }
.entry.live { background: var(--raise); }
.entry.live .d, .entry.live .when { color: var(--accent); }
.untitled { color: var(--dim); font-style: italic; }
.empty { color: var(--dim); font-size: 11px; padding: 4px 0; margin: 0; }
.targetline { margin: 4px 0 2px; }
.targetline .line { display: flex; justify-content: space-between; margin-bottom: 4px; }
.linkish { display: block; background: transparent; border: 0; padding: 0; text-align: left; color: var(--text); font-weight: 400; }
.linkish:hover { color: #fff; background: transparent; }
.linkish .tip { margin: 2px 0 0; }
#railfoot #timerbtn { margin-top: 0; }

/* ---- main view ---- */
#viewscroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 20px 28px 60px; display: flex; flex-direction: column; gap: 18px; outline: none; }
#viewscroll > * { flex-shrink: 0; }
#viewscroll .tip, dialog .tip { margin: 0; }
#viewscroll a { color: var(--accent); text-decoration: none; }
#viewscroll a:hover { color: #fff; }
.vhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-left: 52px; min-height: 30px; }
.vtitle { font-size: 16px; font-weight: 600; color: #fff; }
.vsub { font-size: 11px; color: var(--dim); }
.vhead .grow { flex: 1; }
.seg { display: flex; gap: 4px; }
.stats { display: flex; gap: 28px; align-items: flex-end; flex-wrap: wrap; }
.lab { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .14em; }
.stat .val { font-size: 18px; color: #fff; }
.stat.big .val { font-size: 34px; font-weight: 600; color: var(--accent); line-height: 1.1; }
.stat .val small { font-size: 10px; color: var(--dim); font-weight: 400; }
.over { color: var(--accent); } .under { color: var(--warn); } .muted { color: var(--dim); }
.targetbox { width: 300px; max-width: 100%; display: flex; flex-direction: column; gap: 5px; margin-left: auto; }
.targetbox .line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bar { position: relative; height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; }
.panel { border: 1px solid var(--line); border-radius: 3px; background: var(--panel); padding: 14px 16px; }
.panel h2 { font-size: 10px; text-transform: uppercase; letter-spacing: .16em; color: var(--dim); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin: 0 0 10px; font-weight: 400; display: flex; justify-content: space-between; gap: 10px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.two.wideleft { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }

/* week timeline */
.tl .axis, .tl .day { display: grid; grid-template-columns: 76px minmax(0, 1fr) 118px; gap: 12px; align-items: center; }
.tl .axis .ticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--dim); }
.tl .day { height: 44px; border-top: 1px solid var(--line-soft); }
.tl .day.today .dname { color: var(--accent); }
.tl .dname { width: auto; margin: 0; padding: 4px 6px 4px 0; background: transparent; border: 0; text-align: left; font-weight: 400; color: var(--text); }
.tl .dname:hover { color: #fff; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.tl .offband { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); border: 1px dashed var(--line); border-radius: 3px; background: repeating-linear-gradient(135deg, transparent 0 6px, var(--line-soft) 6px 7px); pointer-events: none; }
.tl .track { position: relative; height: 26px; background: repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px 12.5%); border-radius: 2px; }
.tl .pc { position: absolute; top: 0; bottom: 0; border-radius: 3px; padding: 0 6px; display: flex; align-items: center; font-size: 11px; color: var(--ink); overflow: hidden; white-space: nowrap; border: 0; min-width: 3px; font-weight: 400; }
.tl .pc:hover { filter: brightness(1.12); color: var(--ink); }
.tl .pc.nc { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,.2) 0 4px, transparent 4px 8px); }
.tl .pc.live { box-shadow: 0 0 0 1px var(--accent) inset, 0 0 8px color-mix(in srgb, var(--accent) 50%, transparent); }
.tl .pc span { overflow: hidden; text-overflow: ellipsis; }
.tl .tot { text-align: right; } .tl .tot .dl { display: inline-block; min-width: 46px; font-size: 11px; }
.tl .nowline { position: absolute; top: -3px; bottom: -3px; width: 1px; background: #fff; opacity: .6; }
.tasklist .trow { display: grid; grid-template-columns: 10px minmax(0, 1fr) 120px 48px; gap: 10px; align-items: center; padding: 5px 0; }
.tasklist .trow .t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tasklist .trow .mini { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.tasklist .trow .mini > i { display: block; height: 6px; border-radius: 3px; }
.tasklist .trow .d { text-align: right; }

/* month */
.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 3px; background: var(--panel); padding: 12px 14px; }
.card .val { font-size: 26px; color: #fff; line-height: 1.2; }
.card .val.acc { color: var(--accent); font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 64px; gap: 4px; }
.cal .h { font-size: 10px; color: var(--dim); }
.cal .c { height: 46px; border-radius: 3px; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 6px; font-size: 12px; background: var(--raise); color: var(--dim); border: 0; text-align: left; font-weight: 400; }
.cal .c:hover { outline: 1px solid var(--accent); }
.cal .c .top { display: flex; justify-content: space-between; font-size: 10px; }
.cal .c .hrs { font-weight: 600; }
/* The date sits in a ring so it doesn't read as one of the numbers; today's ring is filled. */
.cal .c .top { align-items: center; }
.cal .c .dn { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 3px; border-radius: 10px; border: 1px solid currentColor; font-size: 10px; line-height: 1; opacity: .8; }
.calkey { text-transform: none; letter-spacing: .04em; }
.swatch-ramp { display: inline-block; width: 28px; height: 8px; border-radius: 2px; vertical-align: 0; background: linear-gradient(90deg, var(--raise), var(--accent)); }
.cal .c.offc { background-image: repeating-linear-gradient(135deg, transparent 0 6px, var(--line-soft) 6px 7px); }
.cal .c { overflow: hidden; }
.cal .c .mk.off { font-size: 10px; color: var(--dim); white-space: nowrap; }
.cal .c.today .dn { background: var(--accent); border-color: var(--accent); color: var(--ink); opacity: 1; font-weight: 600; }
.cal .c.blank { background: transparent; pointer-events: none; }
.cal .c.future { background: transparent; border: 1px dashed var(--line); }
.cal .c.today { outline: 1px solid var(--accent); outline-offset: 1px; }
.cal .wk { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; font-size: 12px; }
.cal .wk small { font-size: 10px; }

/* year */
.yearbars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; height: 240px; align-items: end; }
.yearbars .m { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 4px; text-align: center; font-size: 10px; background: transparent; border: 0; padding: 0; font-weight: 400; color: var(--text); }
.yearbars .m:hover { color: #fff; background: transparent; }
.yearbars .m .b { border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--accent) 40%, transparent); min-height: 2px; }
.yearbars .m.cur .b, .yearbars .m .b.met { background: var(--accent); }
.yearbars .m .n { color: var(--dim); }

/* notes */
.notesgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.notegroup h3 { font-size: 10px; text-transform: uppercase; letter-spacing: .16em; color: var(--dim); font-weight: 400; border-bottom: 1px solid var(--line); padding-bottom: 5px; margin: 0 0 2px; display: flex; justify-content: space-between; }
.note { display: flex; align-items: flex-start; gap: 6px; border-bottom: 1px solid var(--line-soft); padding: 2px 0; }
.note .txt { flex: 1; padding: 6px 0; cursor: text; }
.note.done .txt { color: var(--dim); text-decoration: line-through; }
.note button { background: transparent; border-color: transparent; padding: 6px; }
.note button:hover { background: transparent; }
.note .check { padding: 8px 4px; }
.note .play { color: var(--accent); }
.note .del:hover { color: var(--danger); border-color: transparent; }
.addnote { display: flex; gap: 6px; align-items: stretch; }
.addnote input { flex: 1; }
.addnote select { max-width: 40%; }

/* settings */
.setgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.days7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.days7 button { padding: 5px 0; }
.catrow { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.catrow .sortgrip { flex: none; width: auto; text-align: center; background: transparent; border-color: transparent; color: var(--dim); padding: 4px 6px; cursor: grab; touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.catrow .sortgrip:hover, .catrow .sortgrip:focus-visible { color: #fff; border-color: transparent; }
.sortlist.sorting { cursor: grabbing; }
.sortlist .catrow { position: relative; transition: transform .12s; }
.sortlist .catrow.dragging { transition: none; z-index: 2; background: var(--panel); outline: 1px solid var(--accent); border-radius: 3px; }
@media (pointer: coarse) { .catrow .sortgrip { min-width: 36px; min-height: 36px; font-size: 16px; } }
.catrow .row { margin: 0; flex: none; }
.catrow input.catname { flex: 1; }
.catrow .powtoggle { margin: 0; flex: none; width: auto; min-width: 9.6em; }
.catrow .del { background: transparent; border-color: transparent; padding: 4px 6px; flex: none; }
.catrow .del:hover:not(:disabled) { color: var(--danger); border-color: transparent; background: transparent; }

/* import */
.drop { border: 1px dashed var(--accent); border-radius: 3px; padding: 22px; text-align: center; background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.drop.over { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.imptable { width: 100%; border-collapse: collapse; }
.imptable th { text-align: left; font-size: 10px; color: var(--dim); font-weight: 400; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.imptable td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.imptable td.r, .imptable th.r { text-align: right; }
.imptable .iss { font-size: 10px; color: var(--dim); }
.imptable .st-fixed, .imptable .st-needs, .imptable .st-duplicate { color: var(--warn); }
.imptable .st-ok, .imptable .st-picked { color: var(--dim); }
.imptable select { max-width: none; }

/* dialogs (Timmy's own: edit entry, long-timer check) */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px 10px; width: min(440px, 94vw); max-height: 92dvh; overflow: auto; }
dialog::backdrop { background: #06080a9e; }
dialog h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .18em; margin: 0; flex: 1; font-weight: 600; }
.dhead { display: flex; align-items: center; margin-bottom: 12px; }
.dhead .x { background: transparent; border-color: transparent; padding: 4px 8px; }
.dgrid { display: flex; flex-direction: column; gap: 12px; }
.dgrid .lab { display: block; margin-bottom: 4px; }
.dgrid input, .dgrid textarea { width: 100%; }
.dgrid .btnrow { margin: 0; }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.durbox { border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.durbox .dur { font-size: 22px; font-weight: 600; color: var(--accent); }
.badge { border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; color: var(--accent); font-size: 10px; }
.err { color: var(--danger); font-size: 11px; min-height: 1em; margin: 0; }
.longclock { font-size: 24px; font-weight: 600; color: var(--warn); }
.warnbox { border: 1px solid var(--warn); border-radius: 3px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
dialog .stopat { text-align: left; }

/* ---- simple view ---- */
.simplewrap { max-width: 460px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.shead { display: flex; align-items: center; gap: 10px; min-height: 30px; padding-left: 56px; }
html.sheet .shead { padding-left: 40px; }
.sbrand { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em; }
.shead .grow { flex: 1; }
#acctslot { min-width: 0; }
#acctslot #acctfoot { margin: 0; }
.scols { display: flex; flex-direction: column; gap: 16px; }
.scol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.scard { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.scard.running { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.scard .row { margin-top: 0; }
.scard input.task { width: 100%; font-size: 16px; color: #fff; padding: 11px 12px; }
.lab.acc { color: var(--accent); }
.sclockrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sclockrow .sclock { flex: 1; min-width: 0; }
.nudge { flex: none; width: auto; min-width: 44px; height: 44px; padding: 0 8px; text-align: center; font-size: 13px; color: var(--dim); }
.nudge:hover { color: #fff; }
.sclock { font-size: min(60px, 13vw); font-weight: 600; color: var(--accent); text-align: center; line-height: 1.05; letter-spacing: .02em; }
.sbtns { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; }
.sbtns.three { grid-template-columns: 2fr 1fr 1fr; }
.scard.pausedcard, .timercard.pausedcard { border-color: var(--warn); border-style: dashed; }
.pausedcard .sclock, .pausedcard .clock { color: var(--dim); }
.pausedcard .lab, .pausedcard .runbadge { color: var(--warn); }
.ptask { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 2px 0 6px; }
.ptask.big { font-size: 16px; text-align: center; margin: 0; }
.tip.center { text-align: center; margin: 0; }
.stopped { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--dim); border: 1px dashed var(--line); border-radius: 3px; padding: 6px 6px 6px 10px; margin-bottom: 8px; }
.stopped span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stopped b { color: var(--text); font-weight: 500; }
.stopped button { flex: none; width: auto; padding: 5px 10px; margin: 0; }
#railfoot .timercard .stopped button { background: var(--raise); color: var(--text); border: 1px solid var(--line); font-weight: 400; letter-spacing: 0; text-transform: none; }
#railfoot .timercard .stopped button:hover { border-color: var(--accent); color: #fff; }
.sbtns button, .sstart { margin: 0; padding: 13px; font-size: 15px; }
.sdiscard { align-self: center; font-size: 11px; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }
.sdiscard:hover { color: var(--danger); }
.srecent { display: flex; flex-direction: column; gap: 6px; }
.spanel { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.shrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.stotal { font-size: 20px; font-weight: 600; color: #fff; }
.tline { display: flex; justify-content: space-between; font-size: 10px; color: var(--dim); margin-bottom: 4px; }
.sstrip { position: relative; height: 16px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px 12.5%); }
.sstrip i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.sstrip b { position: absolute; top: -3px; bottom: -3px; width: 1px; background: #fff; opacity: .6; }
.sticks { display: flex; justify-content: space-between; font-size: 9px; color: var(--dim); margin-top: -6px; }
.sweek { border-top: 1px solid var(--line); padding-top: 10px; }
.sfull { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
/* Simple hides the rail and tool column (the kit's railhidden); the view uses the whole screen. */
html.simple #viewscroll { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
html.sheet.simple #viewscroll { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
/* Landscape phones: timer on the left, today on the right. */
@media (max-height: 560px) and (orientation: landscape) and (min-width: 541px) {
  .simplewrap { max-width: none; gap: 10px; }
  .scols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .sclock { font-size: 36px; }
  .shead { padding-left: 64px; }
  .nudge { height: 36px; min-width: 40px; }
  .scard { padding: 12px; gap: 8px; }
  .sbtns button, .sstart { padding: 10px; }
  #viewscroll { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

/* ---- small screens ---- */
/* Phone portrait: the kit turns the rail into a bottom sheet over the view. */
/* Phone top content starts where the kit puts the ? button (kit 1.4). */
html.sheet #viewscroll { padding: var(--sheet-top) 14px var(--view-inset, 60vh); gap: 14px; }
html.sheet .vhead { padding-left: 42px; }
/* Touch screens beside the rail (phone landscape): the ? button is 34px, so the header
   starts clear of it. */
@media (pointer: coarse) { html:not(.sheet) .vhead { padding-left: 60px; } }
/* Phones: the timer is a full row above the buttons; Stop leads, Switch/Discard follow;
   Import/CSV live in Settings › Data to keep the peek row short. */
html.compact #railfoot #timerbox { order: -1; flex: 1 0 100%; }
html.compact #railfoot #timerbtn { flex: 2 1 0; }
html.compact #railfoot #runrow button { order: 1; }
html.compact #railfoot .filerow.files { display: none; }
html.compact #railfoot .timercard { padding: 6px 8px 0; margin: 0; }
html.compact #railfoot .timercard .clockrow { margin-bottom: 4px; }
html.compact #railfoot .timercard .row { margin-top: 4px; }
html.compact #railfoot .timercard .tip { display: none; }
html.compact #railfoot .tagrow { flex-wrap: nowrap; overflow-x: auto; margin: 4px 0; }
/* The account row stays a full row above the compact one-row foot. */
html.compact #railfoot { flex-wrap: wrap; }
html.compact #acctfoot { order: -2; flex: 1 0 100%; }
html.compact .timercard .clock { font-size: 26px; }
@media (max-height: 560px) { .timercard .clock, html.compact .timercard .clock { font-size: 24px; } }
.runbadge { white-space: nowrap; }
html.compact #tipstoggle { margin-top: 8px; }
@media (max-width: 760px) {
  .vhead > div:not(.seg) { order: -1; flex-basis: calc(100% - 4px); }
  .vhead .grow { display: none; }
  .vhead .seg { margin-left: auto; }
  .stats { gap: 16px; }
  .targetbox { width: 100%; margin-left: 0; }
  .tl .axis, .tl .day { grid-template-columns: 50px minmax(0, 1fr) 54px; gap: 8px; }
  .tl .tot { line-height: 1.2; } .tl .tot .dl { display: block; min-width: 0; }
  .tl .pc span { display: none; }
  .tl .axis .ticks span:nth-child(even) { visibility: hidden; }
  .two, .two.wideleft, .notesgrid, .setgrid { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal .wk, .cal .h.wkh { display: none; }
  .cal .c { height: 40px; padding: 3px 4px; font-size: 10px; }
  .cal { gap: 3px; }
  .cal .c { overflow: hidden; }
  .cal .c .dn { min-width: 16px; height: 16px; font-size: 9px; padding: 0 2px; }
  .cal .c .hrs { font-size: 10px; }
  /* No room for "−2:30" in a phone cell: a dot says "short", the tooltip and week view have the number. */
  .cal .c .mk.short { font-size: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex: none; }
  .cal .c .mk.off { font-size: 0; width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--dim); flex: none; }
  .yearbars { gap: 4px; height: 180px; }
  .yearbars .m .v { display: none; }
  .imptable .hide-s { display: none; }
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 12px 12px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
@media (pointer: coarse) {
  .entry { min-height: 44px; }
  .chip { padding: 7px 12px; font-size: 12px; }
  input[type=text]:not(.num), input[type=date], input:not([type]), textarea, select { font-size: 16px; }
  .note button { min-height: 38px; min-width: 38px; }
}

/* Second press needed: a button asking "Delete this entry? Click again". */
button.confirming, .linkish.confirming, #runrow button.confirming { color: var(--danger) !important; border-color: var(--danger) !important; border-style: solid !important; background: color-mix(in srgb, var(--danger) 12%, var(--raise)) !important; text-decoration: none; }
.btnrow > button.confirming, #runrow > button.confirming { flex: 2.2 1 0 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Simple view: the task's comment, folded by default */
.scard .snote { margin: 0; }
.scard .snote > summary { display: flex; align-items: center; gap: 10px; }
.snote .peek { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); text-transform: none; letter-spacing: 0; font-size: 11px; padding-right: 18px; }
.snote textarea { display: block; width: calc(100% - 16px); margin: 0 8px 8px; min-height: 110px; resize: vertical; font: inherit; font-size: 13px; line-height: 1.5; color: var(--text); background: var(--ink); border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; }
.snote textarea:focus { outline: none; border-color: var(--accent); }

/* ---- sprints ---- */
.sprintrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 12px; }
.sprintrow .chip.addtag { font-size: 11px; padding: 3px 10px; }
.sprintchip { width: auto; display: inline-flex; align-items: baseline; gap: 8px; padding: 4px 10px; border: 1px solid var(--t); background: color-mix(in srgb, var(--t) 14%, var(--raise)); color: #fff; border-radius: 14px; font-size: 11px; }
.sprintchip small { color: var(--dim); font-size: 10px; }
.sprintchip:hover { border-color: #fff; }
.sprmini { display: inline-block; width: auto; max-width: 100%; margin: 2px 0 0 4px; padding: 0 6px; border: 1px solid var(--t); border-radius: 8px; background: color-mix(in srgb, var(--t) 14%, transparent); color: var(--text); font-size: 9px; line-height: 15px; text-transform: none; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.sprmini small { color: var(--dim); }
.cal .wk .sprmini { margin: 3px 0 0; display: block; }
.sprow .t .muted { font-size: 10px; }
button.trow { width: 100%; background: transparent; border: 1px solid transparent; text-align: left; padding: 3px 4px; margin: 0 -4px; width: calc(100% + 8px); }
button.trow:hover { border-color: var(--line); background: var(--raise); }
.csvbtn { font-size: 10px; letter-spacing: .1em; color: var(--accent); margin-right: 6px; }
.cards.mini { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 0; }
dialog h3.lab { margin: 6px 0 2px; }
dialog .dhead h2 .dot { margin-right: 8px; }
.sprow2 { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.stepper { flex-wrap: nowrap; align-items: center; gap: 6px; margin-top: 4px; }
.stepper button { width: 34px; flex: none !important; padding: 6px 0; text-align: center; }
.stepper #sp-weeks { min-width: 24px; text-align: center; color: #fff; font-size: 14px; }
.spcolors { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.spcolor { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.spcolor[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px var(--ink) inset; }
.spsum { display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
/* ---- Simple view: the week strip ---- */
.wstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wstrip .wd { width: auto; display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 4px 2px; border: 1px solid transparent; background: transparent; border-radius: 3px; text-align: center; }
.wstrip .wd:hover { border-color: var(--line); background: var(--raise); }
.wstrip .col { position: relative; display: block; height: 54px; background: var(--raise); border-radius: 2px; overflow: hidden; }
.wstrip .col b { position: absolute; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 45%, var(--raise)); }
.wstrip .met .col b { background: var(--accent); }
.wstrip .col .tg { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--warn); opacity: .9; z-index: 1; }
.wstrip .off .col { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--line-soft) 4px 5px); }
.wstrip .rest .col { opacity: .6; }
.wstrip .fut { opacity: .45; }
.wstrip .dl { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.wstrip .today .dl { color: var(--accent); font-weight: 600; }
.wstrip .today .col { outline: 1px solid var(--accent); }
.wstrip .hv { font-size: 10px; color: var(--text); white-space: nowrap; }
.wstrip .col em { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, var(--raise)) 0 3px, transparent 3px 6px); }
