/* Deliberate fixes to defects documented in the supplied capture package. */
.dc-title-row{flex-wrap:wrap;gap:10px}
.dc-title-row>div{flex:1 1 218px;min-width:0}
.dc-title-row h1{word-break:keep-all;overflow-wrap:anywhere}
.dc-title-row>.btn{flex:0 0 auto;margin-left:auto}
@media(max-width:360px){.dc-report .dc-title-row>div{flex-basis:100%}.dc-report .dc-title-row>.btn{margin-left:0}}
@media(max-height:480px) and (orientation:landscape){#app-header .header-main{min-height:46px}#bottom-nav{min-height:48px}.nav-item{padding-top:4px;padding-bottom:4px}.dc-report-footer{padding-top:5px;padding-bottom:5px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Keep workroom controls within the viewport and omit empty action bars. */
#mobile-shell [hidden], #app-sheet [hidden] { display:none !important; }
#mobile-shell > :is(header,main,footer,nav) { min-width:0; }
#bottom-nav .nav-item { min-width:0; }
#bottom-nav .nav-label { white-space:nowrap; }
.dc-report-footer > .btn, .sheet-footer > .btn { min-width:0; white-space:normal; word-break:keep-all; }
.sheet-footer { flex-wrap:wrap; }
.sheet-footer > .btn { flex:1 1 8rem; }
.dc-report-footer > .btn .icon { flex:none; }

.dc-episode-tools { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:6px; }
.episode-sort { display:inline-flex; min-width:0; }
.episode-sort select, .we-context-episode select {
  min-width:0; width:100%; min-height:36px; border:1px solid var(--line); border-radius:8px;
  padding:4px 7px; background:var(--surface); color:var(--text); font-size:16px;
}
.we-episode-head { flex-wrap:wrap; row-gap:4px; }
.we-episode-head .we-panel-tabs { flex-wrap:wrap; margin:0; justify-content:flex-end; }
.we-context-episode { min-width:0; display:block; }
.we-context-episode select { min-height:34px; }
.we-status { gap:4px; }
.we-status > :is(button,small) { min-width:0; }
.we-status :is(.we-word-hint,#writer-count) { text-overflow:ellipsis; overflow:hidden; display:block; }
.we-status #writer-count { max-width:44%; flex:0 1 auto; }
.we-status .we-status-stat, .we-status .we-status-timer { flex:none; }
.we-status > small { flex:0 1 auto; }
.we-dock .we-tool-button { min-width:0; white-space:normal; word-break:keep-all; }
.we-dock .we-tool-button .icon { flex:none; }

.dc-character-detail .dc-episode-history { list-style:none; padding:0; margin:0; }
.dc-episode-history li { grid-template-columns:minmax(0,1fr); gap:8px; padding:8px 0; }
.dc-episode-history li:has(> .dc-history-chapter) { grid-template-columns:auto minmax(0,1fr); }
.dc-episode-history li > p { min-width:0; margin:0; word-break:keep-all; overflow-wrap:anywhere; }
.dc-episode-history .dc-history-chapter {
  justify-self:start; align-self:start; white-space:nowrap; color:var(--dc-blue);
  font-size:calc(11px * var(--ui-scale,1)); padding:3px 6px;
  border-radius:6px; background:var(--dc-blue-bg);
}
.dc-character-meta .dc-info { min-width:0; }
.dc-character-meta dd { overflow-wrap:anywhere; word-break:keep-all; }
.dc-character-meta .dc-info-wide { grid-column:1 / -1; }
.dc-work-foot > span { min-width:0; overflow-wrap:anywhere; }

#app-sheet[data-view=writer-habits] .sheet-header { min-height:54px; }
#app-sheet[data-view=writer-habits] .sheet-body { padding-top:12px; }
#app-sheet[data-view=writer-habits] .we-panel-tabs { margin:0; }
#app-sheet[data-view=writer-habits] .we-habit-bars { padding:0; }

.pm-organizer-controls { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:6px; }
.pm-organizer-controls :is(select,input) { min-height:38px; padding-block:3px; border-radius:8px; }
.pm-organizer-controls .pm-search-input .icon { top:50%; transform:translateY(-50%); }
.pm-organizer-controls .pm-search-input input { padding-inline:29px 5px; }
.pm-age-controls { padding:9px; }
.pm-age-controls .field { font-size:12px; gap:3px; }
.pm-age-controls .btn { white-space:normal; word-break:keep-all; min-height:38px; padding:4px 7px; }
.pm .dc-work-tabs .dc-pill { min-height:36px; padding-block:4px; padding-inline:8px; }
.pm .dc-work-tabs .dc-pill .icon { width:14px; height:14px; flex:none; }

.dc-shortcuts { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px; margin-top:4px; }
.dc-shortcuts button {
  display:inline-flex; align-items:center; gap:5px; min-height:32px; border:1px solid var(--line);
  border-radius:8px; padding:3px 8px; background:var(--surface); color:var(--dc-navy,var(--text));
  font-weight:700; font-size:calc(11px * var(--ui-scale,1));
}
.dc-shortcuts .icon, .dc-activity-heading .icon { width:14px; height:14px; flex:none; }
.dc-shortcuts b {
  display:grid; place-items:center; min-width:17px; height:17px; padding:0 3px; border-radius:20px;
  background:var(--dc-blue); color:var(--surface); font-size:10px; line-height:1;
}
.dc-activity { display:grid; gap:8px; min-width:0; }
.dc-queue-summary { padding:9px 10px; border-radius:8px; background:var(--surface-2); color:var(--muted); }
.dc-queue-summary b { color:var(--text); }
.dc-queue-summary span { padding-inline:3px; }
.dc-activity-row {
  min-width:0; display:grid; gap:5px; padding:10px 11px; border:1px solid var(--line);
  border-inline-start:3px solid var(--activity-tone,var(--line)); border-radius:11px;
  background:var(--surface); overflow-wrap:anywhere;
}
.dc-activity-row:is([data-tone=success],[data-status=completed]) { --activity-tone:var(--dc-green,#257655); }
.dc-activity-row:is([data-tone=warning],[data-status=held],[data-status=canceled]) { --activity-tone:var(--dc-gold,#a26d20); }
.dc-activity-row:is([data-tone=error],[data-status=failed]) { --activity-tone:var(--dc-red,#b2404b); }
.dc-activity-row[data-status=running] { --activity-tone:var(--dc-blue); }
.dc-activity-heading, .dc-activity-heading strong { display:flex; align-items:center; gap:5px; }
.dc-activity-heading { flex-wrap:wrap; justify-content:space-between; color:var(--activity-tone,var(--muted)); font-size:calc(11px * var(--ui-scale,1)); }
.dc-activity-heading time { color:var(--muted); font-size:10px; }
.dc-activity-row :is(h3,p) { margin:0; line-height:1.55; }
.dc-activity-row h3 { font-size:calc(13px * var(--ui-scale,1)); }
.dc-activity-row p, .dc-activity-message { color:var(--muted); font-size:calc(12px * var(--ui-scale,1)); }
.dc-activity-controls { display:flex; flex-wrap:wrap; gap:5px; }
.dc-activity-controls .btn { min-height:34px; padding:3px 8px; }

.mobile-usage, .mobile-writing-statistics { display:grid; gap:10px; min-width:0; }
.usage-plan {
  display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:8px;
  padding:13px 14px; border-radius:12px; background:var(--primary); color:var(--on-primary);
}
.usage-plan strong { display:block; font-size:calc(20px * var(--ui-scale,1)); overflow-wrap:anywhere; }
.usage-plan :is(span,small) { font-size:12px; opacity:.84; }
.usage-detail { display:grid; min-width:0; gap:10px; padding:13px; border:1px solid var(--line); border-radius:12px; }
.usage-detail[data-kind=ink] { --usage-accent:var(--dc-blue); }
.usage-detail[data-kind=node] { --usage-accent:var(--dc-green,#257655); }
.usage-detail header, .usage-identity { display:flex; gap:6px; align-items:center; min-width:0; }
.usage-detail header { justify-content:space-between; flex-wrap:wrap; }
.usage-identity > span { display:grid; place-items:center; width:36px; height:36px; color:var(--usage-accent); border-radius:9px; background:var(--surface-2); }
.usage-identity h3 { margin:0; font-size:calc(16px * var(--ui-scale,1)); }
.usage-available { display:flex; flex-wrap:wrap; align-items:baseline; gap:5px; text-align:end; }
.usage-available span { font-size:11px; color:var(--muted); }
.usage-available strong { font-size:calc(21px * var(--ui-scale,1)); color:var(--usage-accent); }
.usage-periods { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.usage-period { padding:8px; border-radius:8px; background:var(--surface-2); min-width:0; }
.usage-period > div { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:3px; }
.usage-period span, .usage-period small { color:var(--muted); font-size:11px; }
.usage-period strong, .usage-extra dd { font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.usage-period progress {
  display:block; appearance:none; width:100%; height:5px; margin-top:7px; border:0; border-radius:9px;
  overflow:hidden; background:var(--line); accent-color:var(--usage-accent);
}
.usage-period progress::-webkit-progress-bar { background:var(--line); border-radius:9px; }
.usage-period progress::-webkit-progress-value { background:var(--usage-accent); border-radius:9px; }
.usage-period progress::-moz-progress-bar { background:var(--usage-accent); border-radius:9px; }
.usage-extra { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin:0; }
.usage-extra .dc-info { margin:0; padding:0; border:0; min-width:0; }
.usage-extra dd { margin:0; font-weight:750; }
.usage-message,.usage-timestamp { margin:0; color:var(--muted); font-size:11px; overflow-wrap:anywhere; line-height:1.5; }
.usage-timestamp { text-align:right; }

.mobile-writing-statistics {
  --studio-soft:var(--surface-2); --studio-panel:var(--surface); --studio-text:var(--text);
  --studio-muted:var(--muted); --studio-line:var(--line);
}
.mobile-writing-statistics .field { margin:0; font-weight:650; }
.mobile-writing-statistics .input { min-height:38px; padding-block:4px; min-width:0; width:100%; font-size:16px; }
.mobile-writing-statistics .writer-stat-summary { margin-bottom:13px; }
.mobile-writing-statistics .writer-stat-counts { table-layout:fixed; }
.mobile-writing-statistics .writer-stat-counts :is(th,td) { overflow-wrap:anywhere; }
@media (max-width:375px) {
  .we-dock .we-tool-button { flex-direction:column; gap:2px; }
  .usage-period { padding:6px; }
}
@media (max-height:480px) and (orientation:landscape) {
  .dc-shortcuts { margin-top:0; }
  .dc-shortcuts button { min-height:29px; }
}


.mobile-bell {position:relative;}
.mobile-bell b {position:absolute;top:0;right:-2px;padding:1px 4px;border-radius:9px;background:#244eae;color:white;font-size:10px;line-height:14px;min-width:15px;}
.mobile-bell b[hidden]{display:none;}
