*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:var(--pl-font-family);background:var(--pl-surface-page);color:var(--pl-text-primary)}
button,input,select,textarea{font:inherit}
[hidden]{display:none!important}
.app-shell{min-height:100vh;display:grid;grid-template-columns:238px minmax(0,1fr)}
.sidebar{position:sticky;top:0;height:100vh;padding:24px 16px 18px;background:var(--pl-surface-primary);border-right:1px solid var(--pl-border-normal);display:flex;flex-direction:column;gap:24px}
.brand{display:flex;align-items:center;gap:10px;padding:2px 8px 12px}.brand img{width:166px;max-width:100%}
.nav{display:grid;gap:6px}.nav-link{display:flex;align-items:center;gap:11px;min-height:44px;padding:0 12px;border-radius:10px;color:var(--pl-text-secondary);text-decoration:none;font-weight:650;font-size:14px}.nav-link svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8}.nav-link:hover{background:var(--pl-surface-subtle);color:var(--pl-text-primary)}.nav-link.active{background:var(--pl-brand-soft);color:var(--pl-brand-active)}
.sidebar-foot{margin-top:auto;padding:14px;border:1px solid var(--pl-border-normal);border-radius:12px;background:var(--pl-surface-subtle)}.sidebar-foot strong{display:block;font-size:13px}.sidebar-foot span{display:block;margin-top:4px;color:var(--pl-text-muted);font-size:11px;line-height:1.45}
.main{min-width:0;padding:34px 38px 54px}.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:24px}.page-head h1{margin:0;font-size:30px;letter-spacing:-.03em}.page-head p{margin:6px 0 0;color:var(--pl-text-secondary);font-size:14px}
.surface{background:var(--pl-surface-primary);border:1px solid var(--pl-border-normal);border-radius:14px;box-shadow:var(--pl-shadow-sm)}
.toolbar{padding:18px;margin-bottom:16px}.toolbar-top{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:14px;align-items:center}.view-actions{display:flex;align-items:center;gap:10px}.search{min-width:0}.filters{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr)) auto;gap:10px;margin-top:14px;align-items:end}.filter-field{display:grid;gap:5px}.filter-field label{font-size:11px;font-weight:700;color:var(--pl-text-muted);text-transform:uppercase;letter-spacing:.05em}.clear-filter{align-self:end}
.status-strip{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-bottom:16px}.status-card{padding:14px 16px;border:1px solid var(--pl-border-normal);border-radius:12px;background:var(--pl-surface-primary);cursor:pointer;transition:.15s ease}.status-card:hover{border-color:var(--pl-border-strong);transform:translateY(-1px)}.status-card.active{border-color:#c7c8fb;background:var(--pl-brand-soft)}.status-card span{display:block;color:var(--pl-text-muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}.status-card strong{display:block;margin-top:5px;font-size:23px}
.table-shell{overflow:hidden}.table-scroll{overflow:auto}.ideas-table{width:100%;border-collapse:collapse;min-width:1030px}.ideas-table th{padding:12px 14px;text-align:left;background:var(--pl-surface-subtle);border-bottom:1px solid var(--pl-border-normal);font-size:10px;letter-spacing:.055em;text-transform:uppercase;color:var(--pl-text-muted);white-space:nowrap}.ideas-table td{padding:15px 14px;border-bottom:1px solid var(--pl-border-subtle);font-size:13px;vertical-align:middle}.ideas-table tr:last-child td{border-bottom:0}.ideas-table tbody tr{cursor:pointer}.ideas-table tbody tr:hover{background:#fbfbfd}.id-cell{font-variant-numeric:tabular-nums;color:var(--pl-text-muted);font-weight:700;white-space:nowrap}.idea-title{font-weight:720;color:var(--pl-text-primary);min-width:190px}.summary-cell{max-width:330px;color:var(--pl-text-secondary);line-height:1.4}.updated-cell{white-space:nowrap;color:var(--pl-text-muted)}.empty-state{padding:52px 20px;text-align:center;color:var(--pl-text-muted)}.empty-state strong{display:block;margin-bottom:6px;color:var(--pl-text-primary);font-size:16px}
.pill{display:inline-flex;align-items:center;min-height:26px;padding:4px 9px;border-radius:var(--pl-radius-pill);font-size:11px;font-weight:720;white-space:nowrap;background:var(--pl-surface-interactive);color:var(--pl-text-secondary)}.pill.status-INBOX{background:#eeeeff;color:#4c4dcc}.pill.status-EXPLORING{background:#eef5ff;color:#3478c7}.pill.status-PROGRESSED{background:#eaf7f0;color:#247b53}.pill.status-PARKED{background:#f2f2f4;color:#666b77}.pill.status-WONT_DO{background:#f5eeee;color:#8a5660}.pill.priority-HIGH{background:#fff0f2;color:#be344b}.pill.priority-MEDIUM{background:#fff6e6;color:#98620a}.pill.priority-LOW{background:#f0f2f5;color:#67707c}
.table-footer{display:flex;justify-content:space-between;gap:12px;padding:13px 16px;border-top:1px solid var(--pl-border-normal);color:var(--pl-text-muted);font-size:12px}
.dialog-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.dialog-grid .full{grid-column:1/-1}.field{display:grid;gap:6px}.field-label{font-size:11px;font-weight:700;color:var(--pl-text-secondary)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px}.detail-meta{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.dialog-note{color:var(--pl-text-muted);font-size:11px;margin:0}.login-wrap{min-height:100vh;display:grid;place-items:center;padding:24px}.login-card{width:min(440px,100%);padding:30px}.login-brand{display:flex;justify-content:center;margin-bottom:24px}.login-brand img{width:210px}.login-card h1{margin:0;text-align:center;font-size:24px}.login-card p{margin:8px 0 22px;text-align:center;color:var(--pl-text-secondary);font-size:13px}.login-form{display:grid;gap:14px}.login-error{padding:10px 12px;border-radius:9px;background:#fff0f2;color:#a72d42;font-size:12px}.login-help{margin-top:14px!important;font-size:11px!important;color:var(--pl-text-muted)!important}
.toast{position:fixed;right:24px;bottom:24px;z-index:1000;max-width:360px;padding:12px 15px;border:1px solid var(--pl-border-normal);border-radius:10px;background:var(--pl-surface-elevated);box-shadow:var(--pl-shadow-lg);font-size:12px}.toast.error{border-color:#f3bcc5;color:#a72d42}.toast.success{border-color:#bde3cd;color:#247b53}
wa-dialog{--width:min(760px,calc(100vw - 32px))}wa-dialog::part(dialog){max-height:calc(100dvh - 32px);border:1px solid var(--pl-border-normal);box-shadow:var(--pl-shadow-lg)}wa-dialog::part(body){overflow:auto}wa-input,wa-select,wa-textarea{width:100%}
.mobile-menu{display:none}
@media(max-width:920px){.app-shell{grid-template-columns:1fr}.sidebar{display:none}.main{padding:20px 16px 40px}.mobile-menu{display:inline-flex}.status-strip{grid-template-columns:repeat(2,1fr)}.filters{grid-template-columns:repeat(2,minmax(0,1fr))}.toolbar-top{grid-template-columns:1fr}.page-head{align-items:center}.dialog-grid,.detail-meta{grid-template-columns:1fr}.dialog-grid .full{grid-column:auto}}
@media(max-width:560px){.page-head h1{font-size:25px}.page-head p{font-size:12px}.status-strip{grid-template-columns:1fr 1fr}.filters{grid-template-columns:1fr}.table-footer{flex-direction:column}.main{padding-top:14px}}

/* 1.0.1 density + dialog refinement */
.app-shell{grid-template-columns:208px minmax(0,1fr)}
.sidebar{padding:18px 12px 14px;gap:16px}
.brand{padding:2px 6px 8px}.brand img{width:142px}
.nav{gap:3px}.nav-link{min-height:38px;padding:0 10px;border-radius:9px;font-size:13px}
.nav-link svg{width:18px;height:18px}
.sidebar-foot{padding:8px 8px 4px;border:0;border-radius:0;background:transparent}
.sidebar-foot strong,.sidebar-foot span{display:none}
.sidebar-foot a{font-size:12px}
.main{padding:24px 28px 42px}
.page-head{margin-bottom:16px}.page-head h1{font-size:27px}.page-head p{margin-top:4px;font-size:13px}
.surface{border-radius:11px;box-shadow:0 1px 2px rgba(25,30,50,.035)}
.status-strip{display:flex;gap:7px;margin-bottom:10px;flex-wrap:wrap}
.status-card{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:7px 12px;border-radius:9px}
.status-card span{font-size:10px}.status-card strong{margin:0;font-size:14px;line-height:1}
.toolbar{padding:12px;margin-bottom:10px}.toolbar-top{gap:10px}.view-actions{gap:7px}
.filters{gap:8px;margin-top:9px}.filter-field{gap:3px}.filter-field label{font-size:10px}
.ideas-table th{padding:9px 12px;font-size:9px}.ideas-table td{padding:10px 12px;font-size:12px}
.summary-cell{line-height:1.32}.pill{min-height:22px;padding:3px 7px;font-size:10px}
.table-footer{padding:9px 12px;font-size:11px}
.dialog-grid{gap:10px}.field{gap:4px}.field-label{font-size:10px}.required-mark{color:#be344b}
.dialog-note{margin-top:-1px;font-size:10px}
.dialog-actions{gap:6px}
wa-dialog{--width:min(700px,calc(100vw - 28px))}
wa-dialog::part(dialog){max-height:calc(100dvh - 24px);border-radius:12px}
wa-dialog::part(header){padding:14px 18px 10px}
wa-dialog::part(body){padding:10px 18px 12px;overflow:auto}
wa-dialog::part(footer){padding:10px 18px 14px;background:var(--pl-surface-primary);border-top:1px solid var(--pl-border-subtle)}
wa-input,wa-select,wa-textarea{--wa-form-control-height-small:34px}
@media(min-width:700px){wa-dialog::part(body){max-height:none;overflow:visible}}
@media(max-width:920px){.app-shell{grid-template-columns:1fr}.main{padding:18px 14px 34px}.status-strip{display:flex}.filters{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* 1.0.2 permanent delete UX */
.dialog-actions-split{width:100%;justify-content:space-between;align-items:center}
.dialog-actions-right{display:inline-flex;gap:6px;align-items:center;margin-left:auto}
.delete-confirmation{font-size:13px;line-height:1.5;color:var(--pl-text-secondary)}
.delete-confirmation p{margin:0 0 8px}
.delete-confirmation strong{color:var(--pl-text-primary)}
.delete-warning{color:#a72d42;font-weight:700}
#deleteDialog{--width:min(460px,calc(100vw - 28px))}
@media(max-width:560px){.dialog-actions-split{gap:10px}.dialog-actions-right{margin-left:0}}


/* 1.0.3: single-dialog destructive confirmation */
.delete-confirmation[hidden],
#deleteIdeaActions[hidden],
#normalIdeaActions[hidden],
#ideaForm[hidden] { display: none !important; }
.delete-confirmation { padding: .35rem .1rem .75rem; }
.delete-confirmation h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.delete-confirmation p { margin: .25rem 0; }
.delete-warning { font-weight: 650; }

/* 1.0.5: real-backlog density and scanability pass */
.app-shell{grid-template-columns:190px minmax(0,1fr)}
.sidebar{padding:16px 10px 12px;gap:13px}
.brand{padding:0 7px 7px}.brand img{width:132px}
.nav-link{min-height:34px;padding:0 9px;gap:9px;border-radius:8px;font-size:12.5px}
.nav-link svg{width:17px;height:17px}
.main{padding:20px 24px 34px}
.page-head{margin-bottom:12px;align-items:center}.page-head h1{font-size:25px}.page-head p{font-size:12px;margin-top:2px}
.surface{border-radius:9px;box-shadow:none}

/* Statuses are a compact filter strip, not dashboard cards. */
.status-strip{gap:5px;margin-bottom:8px}
.status-card{min-height:30px;padding:5px 9px;gap:7px;border-radius:7px;background:transparent}
.status-card:hover{transform:none;background:var(--pl-surface-primary)}
.status-card.active{background:var(--pl-brand-soft)}
.status-card span{font-size:9.5px;letter-spacing:.035em}
.status-card strong{font-size:11px;min-width:17px;text-align:center;padding:1px 5px;border-radius:99px;background:var(--pl-surface-interactive)}
.status-card.active strong{background:var(--pl-surface-primary)}

/* Compact toolbar. Search and filters should read as controls, not a large panel. */
.toolbar{padding:9px 10px;margin-bottom:8px}
.toolbar-top{grid-template-columns:minmax(220px,1fr) auto;gap:8px}
.filters{grid-template-columns:repeat(4,minmax(115px,1fr)) auto;gap:6px;margin-top:7px}
.filter-field{gap:2px}.filter-field label{font-size:8.5px;letter-spacing:.045em}
.view-actions{gap:5px}
wa-input,wa-select{--wa-form-control-height-small:31px}
#searchInput::part(base){min-height:32px}
#clearFiltersBtn::part(base){min-height:31px}

/* Denser list with predictable truncation for a real backlog. */
.ideas-table{min-width:980px;table-layout:fixed}
.ideas-table th{padding:7px 10px;font-size:8.5px}
.ideas-table td{padding:8px 10px;font-size:11.5px;height:44px}
.ideas-table th:nth-child(1){width:82px}
.ideas-table th:nth-child(2){width:27%}
.ideas-table th:nth-child(3){width:31%}
.ideas-table th:nth-child(4){width:115px}
.ideas-table th:nth-child(5){width:105px}
.ideas-table th:nth-child(6){width:108px}
.ideas-table th:nth-child(7){width:94px}
.ideas-table th:nth-child(8){width:82px}
.idea-title{min-width:0;font-weight:680;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.summary-cell{max-width:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.25}
.updated-cell{font-size:10.5px}
.pill{min-height:19px;padding:2px 6px;font-size:9.5px;font-weight:680}
.table-footer{padding:7px 10px;font-size:10px}
.ideas-table tbody tr:hover{background:var(--pl-surface-subtle)}

.sort-head{all:unset;display:inline-flex;align-items:center;gap:3px;cursor:pointer;color:inherit;font:inherit;letter-spacing:inherit;text-transform:inherit;white-space:nowrap}
.sort-head:hover,.sort-head.active{color:var(--pl-text-primary)}
.sort-mark{display:inline-block;min-width:8px;font-size:9px;line-height:1}

.sidebar-foot{padding:5px 8px 2px}.sidebar-foot a{font-size:10.5px}
.toast{right:18px;bottom:18px;padding:9px 11px;font-size:11px}

@media(max-width:1100px){
  .filters{grid-template-columns:repeat(2,minmax(130px,1fr)) auto}
  .clear-filter{grid-column:auto}
}
@media(max-width:920px){
  .app-shell{grid-template-columns:1fr}.main{padding:16px 12px 30px}
  .toolbar-top{grid-template-columns:1fr auto}.filters{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  .toolbar-top{grid-template-columns:1fr}.filters{grid-template-columns:1fr}
  .status-card{flex:1 1 auto;justify-content:space-between}
}

/* 1.0.6: use the same desktop rail as Plurivo 1.6.1.1. */
:root{
  --rail-width:84px;
  --panel:#ffffff;
  --panel-soft:#f8f8fb;
  --line:#e7e8ed;
  --text:#181922;
  --text-soft:#555966;
  --accent:#5b5ce2;
  --accent-soft:#eeeeff;
  --space-xs:4px;
  --space-sm:8px;
  --space-md:12px;
  --space-lg:16px;
  --radius-md:9px;
}
html,body{width:100%;min-height:100%;}
body{overflow:hidden;background:var(--pl-surface-page)}
.app-shell.deck{
  position:fixed;
  inset:8px;
  min-height:0;
  display:grid;
  grid-template-columns:var(--rail-width) minmax(0,1fr);
  min-width:0;
  overflow:hidden;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 18px 55px rgba(31,35,50,.08);
}
.rail{
  grid-column:1;
  grid-row:1;
  min-height:0;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  overflow:hidden;
  background:var(--panel-soft);
  border-right:1px solid var(--line);
}
.rail .brand{
  display:flex;
  align-items:center;
  min-height:44px;
  justify-content:center;
  padding:var(--space-lg) var(--space-xs) var(--space-md);
}
.brand-rail-logo{display:block;width:30px;height:30px;object-fit:contain}
.rail-nav{display:flex;flex-direction:column;gap:var(--space-xs);padding:0 var(--space-xs)}
.rail-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:var(--space-xs);
  padding:var(--space-sm) var(--space-xs);
  border:0;
  border-radius:var(--radius-md);
  background:none;
  color:var(--text-soft);
  font-size:10px;
  font-weight:600;
  line-height:1.1;
  text-decoration:none;
  cursor:pointer;
}
.rail-item:hover{background:var(--pl-surface-interactive,var(--panel-soft));color:var(--text)}
.rail-item.active,.rail-item[aria-expanded="true"]{background:var(--accent-soft);color:var(--accent)}
.ui-icon{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.rail-item>.ui-icon{width:24px;height:24px}
.rail-label{line-height:1.1}
.rail-footer{margin-top:auto;padding:0 var(--space-xs) var(--space-xs)}

/* Planning content now occupies the same shell position as Plurivo's main workspace. */
.main{
  grid-column:2;
  grid-row:1;
  min-width:0;
  min-height:0;
  height:100%;
  overflow:auto;
  padding:20px 24px 34px;
  background:var(--pl-surface-page);
}

/* Remove the old Planning wide-sidebar rules completely from the desktop result. */
.sidebar,.nav,.nav-link,.sidebar-foot{display:none!important}

@media(max-width:920px){
  body{overflow:auto}
  .app-shell.deck{position:relative;inset:auto;min-height:100vh;display:block;border:0;border-radius:0;box-shadow:none}
  .rail{display:none}
  .main{height:auto;min-height:100vh;padding:16px 12px 30px}
}


/* OneDrive backlog resync */
.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resync-body {
  display: grid;
  gap: 14px;
  min-width: min(460px, 78vw);
}

.resync-body p {
  margin: 0;
  color: var(--planning-text-muted, #667085);
  line-height: 1.5;
}

.resync-progress-wrap {
  display: grid;
  gap: 8px;
}

.resync-progress-wrap progress {
  width: 100%;
  height: 8px;
  accent-color: var(--wa-color-brand-600, #7156d9);
}

.resync-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.82rem;
}

.resync-progress-copy span {
  color: var(--planning-text-muted, #667085);
  text-align: right;
}

.resync-result {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
}

.resync-result.success {
  background: rgba(32, 154, 96, 0.09);
}

.resync-result.warning {
  background: rgba(196, 91, 71, 0.09);
}

@media (max-width: 760px) {
  .page-head-actions {
    gap: 6px;
  }

  .resync-progress-copy {
    display: grid;
    gap: 3px;
  }

  .resync-progress-copy span {
    text-align: left;
  }
}


/* 1.0.11 inline lookup editing */
.inline-edit-cell {
  overflow: visible;
}

.inline-row-select {
  width: 100%;
  min-width: 0;
  --wa-form-control-height-small: 24px;
  --wa-form-control-border-width: 0;
  --wa-form-control-border-radius-small: 999px;
  --wa-form-control-font-size-small: 9.5px;
}

.inline-row-select::part(combobox) {
  min-height: 22px;
  height: 22px;
  padding-inline: 7px 5px;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  background: var(--pl-surface-interactive);
  color: var(--pl-text-secondary);
  font-weight: 680;
  transition: background .12s ease, box-shadow .12s ease, opacity .12s ease;
}

.inline-row-select::part(display-input) {
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.inline-row-select::part(expand-icon) {
  font-size: 9px;
  margin-inline-start: 3px;
  opacity: .58;
}

.inline-row-select:hover::part(combobox),
.inline-row-select:focus-within::part(combobox) {
  box-shadow: inset 0 0 0 1px var(--pl-border-normal);
}

.inline-row-select.is-saving {
  opacity: .55;
  pointer-events: none;
}

/* Status colour treatment */
.inline-status.status-INBOX::part(combobox) {
  background: #eeeeff;
  color: #4c4dcc;
}
.inline-status.status-EXPLORING::part(combobox) {
  background: #eef5ff;
  color: #3478c7;
}
.inline-status.status-PROGRESSED::part(combobox) {
  background: #eaf7f0;
  color: #247b53;
}
.inline-status.status-PARKED::part(combobox) {
  background: #f2f2f4;
  color: #666b77;
}
.inline-status.status-WONT_DO::part(combobox) {
  background: #f5eeee;
  color: #8a5660;
}

/* Priority colour treatment */
.inline-priority.priority-HIGH::part(combobox) {
  background: #fff0f2;
  color: #be344b;
}
.inline-priority.priority-MEDIUM::part(combobox) {
  background: #fff6e6;
  color: #98620a;
}
.inline-priority.priority-LOW::part(combobox) {
  background: #f0f2f5;
  color: #67707c;
}

.ideas-table td:nth-child(4) .inline-row-select { max-width: 108px; }
.ideas-table td:nth-child(5) .inline-row-select { max-width: 100px; }
.ideas-table td:nth-child(6) .inline-row-select { max-width: 104px; }
.ideas-table td:nth-child(7) .inline-row-select { max-width: 90px; }


/* 1.0.12 inline select popup sizing and optimistic-save polish */
.inline-row-select {
  --wa-form-control-label-font-size-small: 9.5px;
}

/*
 * Web Awesome select popup should not inherit the narrow table-cell width.
 * Keep the closed control compact, but allow the option list to size for
 * the longest configured label.
 */
.inline-row-select::part(listbox) {
  width: max-content;
  min-width: max(100%, 150px);
  max-width: min(320px, 70vw);
  overflow-x: visible;
}

.inline-row-select::part(popup) {
  width: max-content;
  min-width: max(100%, 150px);
  max-width: min(320px, 70vw);
}

.inline-row-select::part(option) {
  white-space: nowrap;
}

.inline-row-select.is-saving::part(combobox) {
  opacity: .58;
}


/* 1.0.13 development roadmap handoff */
.roadmap-dialog::part(panel) {
  width: min(860px, calc(100vw - 32px));
}

.roadmap-body {
  display: grid;
  gap: 12px;
}

.roadmap-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.86rem;
}

.roadmap-summary span,
.roadmap-note {
  color: var(--pl-text-secondary);
}

.roadmap-note {
  margin: 0;
  font-size: 0.8rem;
}

#roadmapPreview::part(textarea) {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}


/* 1.0.14 structured roadmap preview */
.roadmap-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.roadmap-structured-preview {
  max-height: min(58vh, 620px);
  overflow: auto;
  padding-right: 4px;
}

.roadmap-area-group + .roadmap-area-group {
  margin-top: 18px;
}

.roadmap-area-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 2px;
  background: var(--pl-surface-page);
  border-bottom: 1px solid var(--pl-border-subtle);
  font-size: 0.84rem;
}

.roadmap-area-heading span {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--pl-surface-interactive);
  color: var(--pl-text-secondary);
  text-align: center;
  font-size: 0.7rem;
}

.roadmap-item-list {
  display: grid;
}

.roadmap-preview-item {
  display: grid;
  gap: 5px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--pl-border-subtle);
}

.roadmap-item-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.roadmap-item-id {
  color: var(--pl-brand-strong);
  font-size: 0.72rem;
  font-weight: 750;
}

.roadmap-item-meta {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--pl-surface-interactive);
  color: var(--pl-text-secondary);
  font-size: 0.68rem;
  font-weight: 650;
}

.roadmap-item-title {
  font-size: 0.88rem;
  line-height: 1.35;
}

.roadmap-preview-item p {
  margin: 0;
  max-width: 74ch;
  color: var(--pl-text-secondary);
  font-size: 0.79rem;
  line-height: 1.45;
}

.roadmap-empty {
  padding: 28px 8px;
  color: var(--pl-text-secondary);
  text-align: center;
}

.roadmap-markdown-panel {
  border-top: 1px solid var(--pl-border-subtle);
  padding-top: 12px;
}

@media (max-width: 720px) {
  .roadmap-toolbar {
    align-items: flex-start;
  }

  .roadmap-structured-preview {
    max-height: 52vh;
  }
}


/* 1.0.16 backlog controls */
.page-head-actions {
  flex-wrap: wrap;
}

#showClosedSwitch {
  margin-inline: 3px 5px;
  font-size: 0.76rem;
}

.select-col {
  width: 32px !important;
  min-width: 32px;
  padding-left: 8px !important;
  padding-right: 4px !important;
  text-align: center;
}

.row-check {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--pl-brand-strong);
  cursor: pointer;
}

/* Restore the original column sizing after adding the selection column. */
.ideas-table th:nth-child(1) { width: 32px; }
.ideas-table th:nth-child(2) { width: 82px; }
.ideas-table th:nth-child(3) { width: 27%; }
.ideas-table th:nth-child(4) { width: 31%; }
.ideas-table th:nth-child(5) { width: 115px; }
.ideas-table th:nth-child(6) { width: 105px; }
.ideas-table th:nth-child(7) { width: 108px; }
.ideas-table th:nth-child(8) { width: 94px; }
.ideas-table th:nth-child(9) { width: 82px; }

/* Inline selects moved one cell to the right with the checkbox column. */
.ideas-table td:nth-child(5) .inline-row-select { max-width: 108px; }
.ideas-table td:nth-child(6) .inline-row-select { max-width: 100px; }
.ideas-table td:nth-child(7) .inline-row-select { max-width: 104px; }
.ideas-table td:nth-child(8) .inline-row-select { max-width: 90px; }

.batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 8px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--pl-border-subtle);
  background: var(--pl-surface-subtle);
}

.batch-selection,
.batch-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-selection {
  white-space: nowrap;
  font-size: 0.78rem;
}

#batchField {
  width: 132px;
}

#batchValue {
  width: 176px;
}

#resultCount {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .batch-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-controls {
    flex-wrap: wrap;
  }

  #batchField,
  #batchValue {
    flex: 1 1 150px;
    width: auto;
  }
}


/* 1.0.17 header control grouping */
.page-head-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-view-controls,
.page-action-buttons {
  display: flex;
  align-items: center;
}

.page-action-buttons {
  gap: 8px;
}

.page-view-controls {
  padding-right: 2px;
}

#showClosedSwitch {
  margin: 0;
}

@media (max-width: 820px) {
  .page-head-actions {
    align-items: flex-end;
    gap: 8px;
  }

  .page-action-buttons {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}


/* 1.0.18 Planning user login */
.planning-user-login {
  width: min(390px, calc(100vw - 32px));
}

.planning-user-login h1 {
  margin-bottom: 18px;
}

.planning-user-login .login-form {
  gap: 12px;
}

.planning-user-login .login-form wa-button {
  width: 100%;
  margin-top: 2px;
}


/* 1.0.19 pagination */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-controls #pageLabel {
  min-width: 82px;
  text-align: center;
}

#pageSizeSelect {
  width: 122px;
}

/* 1.0.19 Config */
.config-main {
  padding-bottom: 40px;
}

.config-layout {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.config-nav {
  display: grid;
  gap: 4px;
}

.config-nav-item {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pl-text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.config-nav-item:hover {
  background: var(--pl-surface-interactive);
  color: var(--pl-text-primary);
}

.config-nav-item.active {
  background: var(--pl-accent-soft, #efedff);
  color: var(--pl-brand-strong, #6650d5);
}

.config-panel {
  overflow: hidden;
}

.config-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--pl-border-normal);
}

.config-panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.config-panel-head p {
  margin: 3px 0 0;
  color: var(--pl-text-muted);
  font-size: 11px;
}

.config-content {
  min-height: 180px;
}

.config-list {
  display: grid;
}

.config-row {
  display: grid;
  grid-template-columns: 64px minmax(200px, 1fr) 100px 70px;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--pl-border-subtle);
}

.config-row:last-child {
  border-bottom: 0;
}

.config-order,
.config-user-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.config-value,
.config-user-main {
  min-width: 0;
}

.config-code {
  display: block;
  margin-top: 3px;
  color: var(--pl-text-muted);
  font-size: 9px;
  letter-spacing: .03em;
}

.user-row {
  grid-template-columns: minmax(220px, 1fr) 140px 100px 210px;
}

.config-user-actions {
  justify-content: flex-end;
  gap: 6px;
}

@media (max-width: 900px) {
  .config-layout {
    grid-template-columns: 1fr;
  }

  .config-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
  }

  .config-nav-item {
    width: auto;
    white-space: nowrap;
  }

  .config-row,
  .user-row {
    grid-template-columns: 1fr;
  }

  .config-order,
  .config-user-actions {
    justify-content: flex-start;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-controls {
    width: 100%;
    flex-wrap: wrap;
  }
}


/* 1.0.22 Config access denied */
.config-access-denied {
  display: grid;
  justify-items: start;
  gap: 10px;
  max-width: 560px;
  padding: 28px;
}

.config-access-denied h2 {
  margin: 0;
  font-size: 18px;
}

.config-access-denied p {
  margin: 0 0 4px;
  color: var(--pl-text-secondary);
  font-size: 13px;
}

.config-access-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--pl-accent-soft, #efedff);
  color: var(--pl-brand-strong, #6650d5);
}

.config-access-icon .ui-icon {
  width: 20px;
  height: 20px;
}


/* 1.0.23 compact Config layout and save feedback */

.config-layout {
  grid-template-columns: 140px minmax(0, 900px);
  justify-content: start;
}

.config-panel {
  width: min(900px, 100%);
}

.config-row {
  grid-template-columns: 52px minmax(260px, 1fr) 92px 106px;
  gap: 8px;
  padding: 8px 10px;
}

.config-row .config-name {
  max-width: 520px;
}

.config-save-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.config-save-state {
  min-width: 34px;
  color: var(--pl-text-muted);
  font-size: 10px;
  font-weight: 650;
}

.user-row {
  grid-template-columns: minmax(240px, 1fr) 132px 92px 280px;
}

.config-user-main {
  max-width: 440px;
}

.config-user-actions {
  justify-content: flex-end;
}

.config-content {
  min-height: 0;
}

.config-panel-head {
  padding: 13px 14px;
}

.config-order wa-button::part(base) {
  min-width: 24px;
  padding-inline: 4px;
}

@media (min-width: 1200px) {
  .config-main {
    padding-right: 32px;
  }
}

@media (max-width: 1050px) {
  .config-layout {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  .config-panel {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .config-layout {
    grid-template-columns: 1fr;
  }

  .config-row,
  .user-row {
    grid-template-columns: 1fr;
  }

  .config-user-actions,
  .config-save-wrap {
    justify-content: flex-start;
  }
}


/* 1.0.24 grouped Config navigation */

.config-layout {
  grid-template-columns: 120px minmax(0, 760px);
  gap: 14px;
  align-items: start;
}

.config-panel {
  width: min(760px, 100%);
}

.config-nav {
  gap: 5px;
}

.config-nav-item {
  padding: 9px 10px;
  border-radius: 9px;
}

.config-tabs-wrap {
  padding: 12px 14px 0;
}

.config-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.config-tab {
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid var(--pl-border-normal);
  border-radius: 999px;
  background: var(--pl-surface-elevated);
  color: var(--pl-text-secondary);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.config-tab:hover {
  background: var(--pl-surface-interactive);
  color: var(--pl-text-primary);
}

.config-tab.active {
  border-color: var(--pl-brand-strong, #6650d5);
  background: var(--pl-accent-soft, #efedff);
  color: var(--pl-brand-strong, #6650d5);
}

.config-panel-head {
  padding: 12px 14px;
}

.config-read-list,
.config-users-list {
  padding: 0 10px 10px;
  gap: 5px;
}

.config-read-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 92px 36px;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid var(--pl-border-subtle);
  border-radius: 9px;
  background: var(--pl-surface-elevated);
}

.config-read-row:hover,
.config-user-row:hover {
  border-color: var(--pl-border-normal);
  background: var(--pl-surface-subtle);
}

.config-drag {
  display: grid;
  place-items: center;
  color: var(--pl-text-muted);
  font-size: 13px;
  cursor: grab;
  user-select: none;
}

.config-read-name-wrap {
  min-width: 0;
}

.config-read-name {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--pl-text-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: text;
}

.config-read-code {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--pl-surface-interactive);
  color: var(--pl-text-muted);
  font-size: 9px;
  font-weight: 650;
}

.config-inline-name {
  max-width: 360px;
}

.config-more {
  justify-self: end;
}

.config-user-row {
  display: grid;
  grid-template-columns: 34px minmax(160px, 1fr) 132px 92px 36px;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 7px 8px;
  border: 1px solid var(--pl-border-subtle);
  border-radius: 9px;
  background: var(--pl-surface-elevated);
}

.config-user-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pl-brand-strong, #6650d5);
  color: white;
  font-size: 10px;
  font-weight: 750;
}

.config-user-identity {
  min-width: 0;
}

.config-user-identity strong,
.config-user-identity span {
  display: block;
}

.config-user-identity strong {
  color: var(--pl-text-primary);
  font-size: 12px;
}

.config-user-identity span {
  margin-top: 2px;
  color: var(--pl-text-muted);
  font-size: 10px;
}

.config-user-name-edit {
  max-width: 260px;
}

@media (max-width: 900px) {
  .config-layout {
    grid-template-columns: 1fr;
  }

  .config-nav {
    display: flex;
    overflow-x: auto;
  }

  .config-nav-item {
    width: auto;
    white-space: nowrap;
  }

  .config-panel {
    width: 100%;
  }

  .config-read-row {
    grid-template-columns: 24px minmax(0, 1fr) 36px;
  }

  .config-read-row .config-active {
    grid-column: 2;
  }

  .config-user-row {
    grid-template-columns: 34px minmax(0, 1fr) 36px;
  }

  .config-user-row .user-role,
  .config-user-row .user-active {
    grid-column: 2;
  }
}


/* 1.0.25 reliable explicit list editing */

.config-read-row {
  grid-template-columns: 26px minmax(0, 1fr) 92px 104px;
}

.config-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.config-read-name {
  color: var(--pl-text-primary);
  font-size: 12px;
  font-weight: 700;
}

.config-read-row.is-editing {
  border-color: var(--pl-brand-strong, #6650d5);
  background: var(--pl-surface-elevated);
}

.config-read-row.is-editing .config-read-name-wrap {
  display: grid;
  gap: 3px;
}

.config-inline-name {
  width: 100%;
  max-width: 420px;
}

@media (max-width: 900px) {
  .config-read-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .config-read-row .config-active,
  .config-read-row .config-row-actions {
    grid-column: 2;
  }

  .config-row-actions {
    justify-content: flex-start;
  }
}


/* 1.0.26 Config UX consolidation */

.config-read-row {
  grid-template-columns: 26px minmax(0, 1fr) 92px 110px;
  min-height: 48px;
}

.config-read-row.is-editing {
  min-height: 54px;
  padding-block: 5px;
}

.config-read-row.is-editing .config-read-name-wrap {
  display: block;
}

.config-edit-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.config-edit-name-line .config-inline-name {
  width: min(320px, 100%);
  flex: 0 1 320px;
}

.config-edit-name-line .config-read-code {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

.config-row-actions {
  min-width: 0;
  gap: 5px;
}

.config-row-actions wa-button::part(base) {
  min-height: 30px;
}

.config-read-row.is-editing .config-active {
  align-self: center;
}

.config-user-row {
  grid-template-columns: 34px minmax(170px, 1fr) 132px 96px 38px;
  min-height: 54px;
}

.config-user-more,
.config-more {
  justify-self: end;
}

.config-user-row .user-role {
  width: 132px;
}

.config-user-row .user-active {
  justify-self: start;
}

/* Give rendered Web Awesome menus a compact admin-menu treatment. */
.config-more wa-menu,
.config-user-more wa-menu {
  min-width: 150px;
}

.config-more wa-menu-item,
.config-user-more wa-menu-item {
  font-size: 12px;
}

@media (max-width: 900px) {
  .config-read-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .config-edit-name-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .config-edit-name-line .config-inline-name {
    width: 100%;
    flex-basis: auto;
  }

  .config-user-row {
    grid-template-columns: 34px minmax(0, 1fr) 38px;
  }
}


/* 1.0.27 native Config action menus */
.config-native-menu {
  position: relative;
  justify-self: end;
}

.config-native-menu summary {
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border-radius: 7px;
  color: var(--pl-text-secondary);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.config-native-menu summary::-webkit-details-marker {
  display: none;
}

.config-native-menu summary:hover {
  background: var(--pl-surface-interactive);
  color: var(--pl-text-primary);
}

.config-native-menu-popover {
  position: absolute;
  z-index: 100;
  top: calc(100% + 4px);
  right: 0;
  min-width: 145px;
  padding: 5px;
  border: 1px solid var(--pl-border-normal);
  border-radius: 8px;
  background: var(--pl-surface-elevated);
  box-shadow: var(--pl-shadow-lg);
}

.config-native-menu-popover button {
  display: block;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--pl-text-primary);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.config-native-menu-popover button:hover:not(:disabled) {
  background: var(--pl-surface-interactive);
}

.config-native-menu-popover button:disabled {
  opacity: .4;
  cursor: default;
}


/* 1.0.28 stable Config row alignment */
.config-read-row {
  grid-template-columns: 26px minmax(0, 1fr) 92px 150px;
}

.config-row-actions {
  display: grid;
  grid-template-columns: 70px 70px;
  gap: 6px;
  align-items: center;
  justify-content: end;
  width: 146px;
}

.config-action-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.config-action-slot > wa-button {
  width: 100%;
}

.config-action-slot > wa-button::part(base) {
  width: 100%;
  justify-content: center;
}

.config-action-slot .config-native-menu {
  margin-left: auto;
}

.config-read-row.is-editing .config-edit-name-line {
  max-width: 430px;
}

.config-read-row.is-editing .config-inline-name {
  width: min(320px, 100%);
}

@media (max-width: 900px) {
  .config-read-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .config-row-actions {
    width: auto;
    grid-template-columns: 70px 70px;
    justify-content: start;
  }
}


/* 1.0.29 Config delete and menu direction */

.config-native-menu.open-up .config-native-menu-popover {
  top: auto;
  bottom: calc(100% + 4px);
}

.config-native-menu-popover button.danger {
  margin-top: 4px;
  border-top: 1px solid var(--pl-border-subtle);
  border-radius: 0 0 6px 6px;
  color: #b42318;
}

.config-native-menu-popover button.danger:hover {
  background: rgba(180, 35, 24, .07);
}


/* 1.0.30 Plurivo project-tab grammar
   Mirrors the main app project-detail .plan-tab treatment. */

.status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
}

.status-tab,
.plurivo-plan-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  gap: 9px;
  border: 1px solid var(--pl-border-normal);
  border-radius: 999px;
  background: var(--pl-surface-primary);
  color: var(--pl-text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.status-tab:hover,
.plurivo-plan-tab:hover {
  border-color: var(--pl-border-strong);
  background: var(--pl-surface-elevated);
  color: var(--pl-text-primary);
}

.status-tab.active,
.plurivo-plan-tab.active {
  border-color: var(--pl-brand-primary, #7057d9);
  background: var(--pl-brand-soft, #efedff);
  color: var(--pl-brand-primary, #7057d9);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pl-brand-primary, #7057d9) 24%, transparent);
}

.status-tab:focus-visible,
.plurivo-plan-tab:focus-visible {
  outline: 2px solid var(--pl-interaction-focus, var(--pl-brand-primary, #7057d9));
  outline-offset: 2px;
}

.status-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--pl-surface-interactive);
  color: var(--pl-text-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.status-tab.active .status-tab-count {
  background: color-mix(in srgb, var(--pl-brand-primary, #7057d9) 12%, transparent);
  color: var(--pl-brand-primary, #7057d9);
}

/* Override the earlier Config-tab approximation with the real main-app grammar. */
.config-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.config-tab {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--pl-border-normal);
  border-radius: 999px;
  background: var(--pl-surface-primary);
  color: var(--pl-text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.config-tab:hover {
  border-color: var(--pl-border-strong);
  background: var(--pl-surface-elevated);
  color: var(--pl-text-primary);
}

.config-tab.active {
  border-color: var(--pl-brand-primary, #7057d9);
  background: var(--pl-brand-soft, #efedff);
  color: var(--pl-brand-primary, #7057d9);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pl-brand-primary, #7057d9) 24%, transparent);
}

.config-tab:focus-visible {
  outline: 2px solid var(--pl-interaction-focus, var(--pl-brand-primary, #7057d9));
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .status-strip,
  .config-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
  }

  .status-strip::-webkit-scrollbar,
  .config-tabs::-webkit-scrollbar {
    display: none;
  }

  .status-tab,
  .config-tab {
    flex: 0 0 auto;
    min-height: 44px;
    padding-inline: 15px;
  }
}


/* ==========================================================================
   1.1.0 Mobile app presentation (< 768px)
   ==========================================================================
   The mobile shell is a separate set of markup, shown only below 768px.
   Above 768px it stays display:none and the existing desktop/tablet
   layout (unchanged) is what renders. Below 768px the desktop app-shell
   is hidden instead, so none of the narrow-desktop rules earlier in this
   file (920px/900px/760px/720px/560px breakpoints) apply to a hidden
   element any more — they continue to govern the 768–920px tablet zone
   exactly as before.
   ========================================================================== */

.mobile-shell,
.mobile-bottom-nav,
.mobile-sheet-backdrop,
.mobile-sheet,
.mobile-config-selects,
.mobile-account-section {
  display: none;
}

@media (max-width: 767.98px) {

  html, body {
    background: var(--pl-surface-page);
  }

  .app-shell.deck:not(.config-shell) {
    display: none;
  }

  .mobile-shell {
    display: block;
    min-height: 100vh;
    padding: 0 0 calc(74px + env(safe-area-inset-bottom, 0px));
    background: var(--pl-surface-page);
  }

  .mobile-view {
    display: block;
    padding: 18px 16px 8px;
  }

  .mobile-view[hidden] {
    display: none;
  }

  .mobile-view.mobile-view-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 60;
    overflow-y: auto;
    background: var(--pl-surface-page);
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  /* -------------------- Bottom navigation -------------------- */

  .mobile-bottom-nav {
    display: grid;
    /*
     * Two equal-width outer columns with the Add button in a middle
     * auto-sized column between them is what actually guarantees the +
     * sits at the physical horizontal centre of the bar — not flex
     * spacing, which only approximates centring and shifts if one side
     * has more/less content (e.g. Config being absent for non-owners).
     * Both 1fr columns stay equal width regardless of what's inside them,
     * so the centre column's position never moves.
     */
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--pl-surface-elevated);
    border-top: 1px solid var(--pl-border-normal);
    box-shadow: 0 -6px 18px rgba(20, 22, 32, 0.06);
  }

  .mobile-bottom-nav[hidden] {
    display: none;
  }

  .mobile-nav-side {
    display: flex;
    justify-content: center;
    min-width: 0;
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 56px;
    padding: 6px 4px;
    border: 0;
    background: transparent;
    color: var(--pl-text-muted);
    font: inherit;
    font-size: 10px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
  }

  .mobile-nav-btn .ui-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-nav-btn.active {
    color: var(--pl-brand-primary);
  }

  .mobile-nav-add {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    margin-top: -22px;
    border: 3px solid var(--pl-surface-elevated);
    border-radius: 999px;
    background: var(--pl-brand-primary);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(91, 92, 226, 0.38);
    cursor: pointer;
  }

  .mobile-nav-add:active {
    background: var(--pl-brand-active);
  }

  /* -------------------- Shared row list -------------------- */

  .mobile-row-list {
    display: flex;
    flex-direction: column;
    background: var(--pl-surface-elevated);
    border: 1px solid var(--pl-border-subtle);
    border-radius: var(--pl-radius-lg);
    overflow: hidden;
  }

  .mobile-item-row {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--pl-border-subtle);
    background: transparent;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
  }

  .mobile-item-row:last-child {
    border-bottom: 0;
  }

  .mobile-item-row.is-closed {
    opacity: 0.6;
  }

  .mobile-row-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }

  .mobile-row-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--pl-text-primary);
    line-height: 1.3;
  }

  .mobile-row-overflow {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--pl-text-muted);
    font-size: 15px;
    letter-spacing: 1px;
    cursor: pointer;
  }

  .mobile-row-meta {
    margin-top: 2px;
    color: var(--pl-text-muted);
    font-size: 11px;
  }

  .mobile-row-summary {
    margin-top: 4px;
    color: var(--pl-text-secondary);
    font-size: 12px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .mobile-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
  }

  .mobile-priority-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--pl-surface-interactive);
    color: var(--pl-text-secondary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .mobile-priority-pill.priority-HIGH {
    background: #fdeceb;
    color: var(--pl-state-danger);
  }

  .mobile-priority-pill.priority-MEDIUM {
    background: #fdf3e3;
    color: var(--pl-state-warning);
  }

  .mobile-priority-pill.priority-LOW {
    background: var(--pl-surface-interactive);
    color: var(--pl-text-muted);
  }

  .mobile-row-status {
    flex: 0 0 auto;
  }

  .mobile-row-status wa-select {
    --wa-form-control-height: 30px;
    min-width: 118px;
    font-size: 11px;
  }

  /* -------------------- Ideas (mobile landing view) -------------------- */

  .mobile-items-head h1 {
    margin: 0 0 2px;
    font-size: 24px;
    font-weight: 800;
    color: var(--pl-text-primary);
  }

  .mobile-items-subtitle {
    margin: 0 0 14px;
    color: var(--pl-text-muted);
    font-size: 12px;
  }

  .mobile-status-field {
    margin-bottom: 10px;
  }

  .mobile-status-field label,
  .mobile-field label {
    display: block;
    margin-bottom: 5px;
    color: var(--pl-text-secondary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .mobile-status-field wa-select {
    --wa-form-control-height: 46px;
    width: 100%;
    font-size: 14px;
  }

  .mobile-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }

  .mobile-search {
    flex: 1 1 auto;
    min-width: 0;
  }

  .mobile-filters-btn {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--pl-border-normal);
    border-radius: var(--pl-radius-md);
    background: var(--pl-surface-elevated);
    color: var(--pl-text-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .mobile-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--pl-brand-primary);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
  }

  .mobile-result-count {
    margin: 0 0 10px;
    color: var(--pl-text-muted);
    font-size: 11px;
  }

  .mobile-empty-state {
    padding: 34px 18px;
    border: 1px dashed var(--pl-border-normal);
    border-radius: var(--pl-radius-lg);
    text-align: center;
  }

  .mobile-empty-state strong {
    display: block;
    margin-bottom: 4px;
    color: var(--pl-text-primary);
    font-size: 14px;
  }

  .mobile-empty-state span {
    display: block;
    margin-bottom: 14px;
    color: var(--pl-text-muted);
    font-size: 12px;
  }

  .mobile-load-more-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
  }

  .mobile-load-more-label {
    color: var(--pl-text-muted);
    font-size: 11px;
  }

  /* -------------------- Skeleton loading -------------------- */

  .mobile-skeleton-row {
    padding: 14px;
    border-bottom: 1px solid var(--pl-border-subtle);
  }

  .mobile-skeleton-row:last-child {
    border-bottom: 0;
  }

  .mobile-skeleton-bar {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--pl-surface-interactive) 25%, var(--pl-surface-subtle) 37%, var(--pl-surface-interactive) 63%);
    background-size: 400% 100%;
    animation: mobile-skeleton-shimmer 1.4s ease infinite;
  }

  .mobile-skeleton-bar + .mobile-skeleton-bar {
    margin-top: 8px;
  }

  .mobile-skeleton-bar.w-60 { width: 60%; }
  .mobile-skeleton-bar.w-40 { width: 40%; }
  .mobile-skeleton-bar.w-90 { width: 90%; }

  @keyframes mobile-skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
  }

  /* -------------------- App bar (Detail / Edit / Add) -------------------- */

  .mobile-app-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    background: var(--pl-surface-elevated);
    border-bottom: 1px solid var(--pl-border-subtle);
  }

  .mobile-back-btn,
  .mobile-text-btn {
    border: 0;
    background: transparent;
    color: var(--pl-text-secondary);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    padding: 6px 2px;
    cursor: pointer;
  }

  .mobile-text-btn-brand {
    color: var(--pl-brand-primary);
    font-weight: 750;
  }

  .mobile-app-bar-title {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    color: var(--pl-text-primary);
    font-size: 13px;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-overflow-btn {
    border: 0;
    background: transparent;
    color: var(--pl-text-muted);
    font-size: 16px;
    letter-spacing: 1px;
    padding: 6px 4px;
    cursor: pointer;
  }

  /* -------------------- Item Detail -------------------- */

  .mobile-detail-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 16px 8px;
  }

  .mobile-detail-title {
    margin: 4px 2px 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--pl-text-primary);
    line-height: 1.3;
  }

  /* Status/Type/Priority/Area/Updated as one compact elevated group,
     rather than rows sitting directly on the grey page background. */
  .mobile-detail-meta {
    background: var(--pl-surface-elevated);
    border: 1px solid var(--pl-border-subtle);
    border-radius: var(--pl-radius-lg);
    padding: 2px 14px;
  }

  .mobile-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--pl-border-subtle);
  }

  .mobile-detail-row:last-of-type {
    border-bottom: 0;
  }

  .mobile-detail-label {
    color: var(--pl-text-muted);
    font-size: 12px;
    font-weight: 650;
  }

  .mobile-detail-value {
    color: var(--pl-text-primary);
    font-size: 13px;
    font-weight: 650;
    text-align: right;
  }

  /* Summary and Notes each get their own elevated section (only rendered
     when the field has a value — see renderMobileDetail). */
  .mobile-detail-block {
    background: var(--pl-surface-elevated);
    border: 1px solid var(--pl-border-subtle);
    border-radius: var(--pl-radius-lg);
    padding: 14px;
  }

  .mobile-detail-block h3 {
    margin: 0 0 6px;
    color: var(--pl-text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .mobile-detail-block p {
    margin: 0;
    color: var(--pl-text-secondary);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
  }

  .mobile-detail-actions {
    position: sticky;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--pl-surface-elevated);
    border-top: 1px solid var(--pl-border-subtle);
  }

  .mobile-detail-actions wa-button {
    width: 100%;
  }

  /* -------------------- Forms (Edit / Quick Add) -------------------- */

  .mobile-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .mobile-field wa-input,
  .mobile-field wa-select,
  .mobile-field wa-textarea {
    width: 100%;
  }

  .mobile-more-options-toggle {
    align-self: flex-start;
    border: 0;
    background: transparent;
    color: var(--pl-brand-primary);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    padding: 4px 0;
    cursor: pointer;
  }

  .mobile-more-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 2px;
  }

  .mobile-more-options[hidden] {
    display: none;
  }

  /* -------------------- Bottom sheets -------------------- */

  .mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 16, 24, 0.42);
  }

  .mobile-sheet-backdrop[hidden] {
    display: none;
  }

  .mobile-sheet {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    max-height: min(82vh, 640px);
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--pl-surface-elevated);
    border-radius: 18px 18px 0 0;
    box-shadow: var(--pl-shadow-lg);
  }

  .mobile-sheet[hidden] {
    display: none;
  }

  .mobile-sheet-handle {
    width: 36px;
    height: 4px;
    margin: 10px auto 4px;
    border-radius: 999px;
    background: var(--pl-border-strong);
  }

  .mobile-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 16px 10px;
  }

  .mobile-sheet-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 750;
    color: var(--pl-text-primary);
  }

  .mobile-sheet-close {
    border: 0;
    background: transparent;
    color: var(--pl-text-muted);
    font-size: 16px;
    padding: 4px;
    cursor: pointer;
  }

  .mobile-sheet-body {
    padding: 4px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .mobile-field-switch {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-sheet-actions {
    display: flex;
    gap: 10px;
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--pl-border-subtle);
  }

  .mobile-sheet-actions wa-button {
    flex: 1 1 0;
  }

  .mobile-actions-body {
    padding-top: 6px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 0;
  }

  .mobile-action-item {
    display: block;
    width: 100%;
    padding: 14px 4px;
    border: 0;
    border-bottom: 1px solid var(--pl-border-subtle);
    background: transparent;
    color: var(--pl-text-primary);
    font: inherit;
    font-size: 13.5px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
  }

  .mobile-action-item.danger {
    color: var(--pl-state-danger);
  }

  .mobile-action-item.mobile-action-cancel {
    border-bottom: 0;
    margin-top: 6px;
    color: var(--pl-text-muted);
    text-align: center;
  }

  .mobile-delete-body h2 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 750;
    color: var(--pl-text-primary);
  }

  .mobile-delete-body p {
    margin: 0;
    color: var(--pl-text-secondary);
    font-size: 13px;
    line-height: 1.4;
  }

  /* -------------------- Toast above the bottom nav -------------------- */

  .toast {
    left: 16px;
    right: 16px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }

  /* -------------------- Mobile Config -------------------- */

  /* .app-shell.deck:not(.config-shell) is set once, near the top of this
     media query, and already leaves .config-shell (this page) rendered. */

  .config-shell .rail {
    display: none;
  }

  .config-shell .main {
    padding: 0;
  }

  .config-main .page-head {
    display: none;
  }

  .mobile-config-head {
    padding: 18px 16px 4px;
  }

  .config-shell .mobile-config-selects {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 16px 0;
  }

  .mobile-config-selects wa-select {
    width: 100%;
  }

  #mobileConfigListSelectWrap[hidden] {
    display: none;
  }

  .config-layout {
    display: block;
    padding: 14px 16px 24px;
  }

  .config-nav,
  .config-tabs-wrap {
    display: none;
  }

  .config-panel {
    width: 100%;
  }

  .config-read-row,
  .config-user-row {
    grid-template-columns: 22px minmax(0, 1fr) auto !important;
    padding: 10px 10px !important;
  }

  .config-read-row .config-active,
  .config-user-row .user-role,
  .config-user-row .user-active {
    grid-column: 2 !important;
    justify-self: start !important;
  }

  /* -------------------- Account (Sign out, version) -------------------- */

  .config-shell .mobile-account-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 16px calc(74px + env(safe-area-inset-bottom, 0px));
    margin-top: 8px;
    border-top: 1px solid var(--pl-border-subtle);
  }

  .mobile-account-link {
    color: var(--pl-text-secondary);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
  }

  .mobile-version-label {
    color: var(--pl-text-muted);
    font-size: 11px;
  }
}
