.shared-main { width: min(42rem, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1rem, 4vw, 3rem) 0; }
.shared-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 1.4rem; padding: clamp(1.1rem, 4vw, 2rem); box-shadow: 0 .75rem 2rem var(--shadow); }
.shared-panel h1 { font: 400 clamp(2.1rem, 6vw, 3.5rem)/1.04 var(--serif); margin: 0 0 1rem; overflow-wrap: anywhere; }
.shared-panel h2 { font: 400 1.65rem/1.2 var(--serif); margin: 0 0 .55rem; }
.shared-panel form { display: grid; gap: .65rem; margin-top: .8rem; }
.shared-panel form button { justify-self: start; }
.shared-panel p { margin: .55rem 0; }
.shared-timer { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; padding-bottom: .5rem; }
#progress { display: block; width: 100%; height: .75rem; accent-color: var(--accent); margin-bottom: 1rem; }
.task-filters { display: flex; flex-wrap: wrap; align-items: end; gap: .35rem 1rem; }
.shared-panel .task-search { flex: 1 1 100%; max-width: 24rem; min-width: 0; }
.shared-panel .task-select { width: min(100%, 15rem); min-width: 0; }
.task-select select { min-width: 0; text-overflow: ellipsis; }
.shared-panel .task-filter { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; cursor: pointer; }
.task-filter input { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--accent); }
#tasks { list-style: none; padding: 0; margin: 0; }
#tasks li, #import-tasks label, #preset-tasks label { border-bottom: 1px solid var(--line); }
.shared-panel .task { display: flex; align-items: flex-start; gap: .7rem; min-height: 44px; padding: .55rem 0; font-size: 1rem; overflow-wrap: anywhere; }
.shared-panel .task input { min-height: initial; min-width: 1.2rem; width: 1.2rem; height: 1.2rem; margin-top: .2rem; accent-color: var(--accent); }
.task-copy { display: grid; gap: .15rem; min-width: 0; }
.task-assignee, .task-due { color: var(--muted); font-size: .875rem; }
.task-due-overdue { color: var(--ink); font-weight: 700; }
.task input:checked + .task-copy .task-name { text-decoration: line-through; color: var(--muted); }
.owner-panel { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.link-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .55rem; margin: .35rem 0 .75rem; }
details summary { cursor: pointer; padding: .55rem 0; color: var(--accent); }
fieldset { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: .65rem; }
#status { margin: .55rem .25rem; color: var(--muted); min-height: 1.5rem; }
@media(max-width: 420px) { .link-row { grid-template-columns: 1fr; } .link-row button { justify-self: start; } }

#live-checklist { grid-column: 1 / -1; width: min(45rem, 100%); justify-self: center; }
#live-checklist #status:empty { display: none; }

#tasks li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: center; }
#tasks li button { padding-inline: .6rem; }
@media (max-width: 520px) {
  #tasks li { grid-template-columns: minmax(0, 1fr); gap: .15rem; padding-bottom: .5rem; }
  #tasks li button { justify-self: end; max-width: 100%; }
}
.shared-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; padding-block: .35rem; background: var(--surface); }
.shared-progress { flex: 1 1 8rem; min-width: 0; }
.shared-toolbar progress { margin-bottom: .35rem !important; }
#undo-actions:not(:empty) { position: fixed; z-index: 4; inset-inline: 0; bottom: 1rem; display: grid; justify-items: center; padding-inline: .75rem; pointer-events: none; }
#undo-actions .actions { margin-top: .25rem; padding: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; align-items: center; pointer-events: auto; }
.shared-panel dialog { --dialog-width: 32rem; }
#task-paste-lines { width: 100%; resize: vertical; }
#task-paste-preview h3 { margin: 0; font-size: 1rem; }
#task-paste-items { max-height: 12rem; margin: .35rem 0 0; padding-inline-start: 1.6rem; overflow: auto; overflow-wrap: anywhere; }
#task-paste-error:empty { display: none; }
#live + #join-app-actions { grid-column: 1 / -1; justify-self: center; }
@media (max-width: 600px) {
  .shared-toolbar { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .shared-toolbar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: .5rem;
  }
  .shared-toolbar .shared-progress { grid-column: 1 / -1; }
  .shared-toolbar > button { min-width: 0; padding-inline: .5rem; overflow-wrap: anywhere; }
}

.task-assignment-items {
  display: grid;
  gap: .35rem;
  max-height: 45vh;
  overflow: auto;
}

#checklist-qr-image {
  display: block;
  width: min(100%, 16rem);
  height: auto;
  margin: .75rem auto;
}
#tasks .linked-task {
  outline: 2px solid var(--accent);
  border-radius: .5rem;
}

#task-copy-selection { max-height: 16rem; overflow: auto; padding-inline: .25rem; margin-block: .65rem; }
#task-copy-selection label { display: flex; align-items: center; gap: .65rem; min-height: 44px; overflow-wrap: anywhere; }
#task-copy-selection input { flex: none; }

.task-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3rem; }
#tasks .task-row-actions button { min-height: 44px; }
#tasks .task-order { min-width: 44px; }
#task-paste-items label { display: flex; align-items: center; gap: .5rem; margin-block: .2rem; }
#task-paste-items input { width: auto; flex: none; }
#reload-shared-board { margin-block-end: .5rem; }

#batch-due-preview, #completed-preview { max-height: 13rem; overflow: auto; }
#my-task-actions { flex-wrap: wrap; }

#tasks li.shared-task-section { display: flex; flex-wrap: wrap; gap: .4rem; padding-block: .45rem; }
#tasks .shared-task-section h3 { margin: 0 auto 0 0; }
#tasks .shared-task-section button { min-height: 44px; text-align: start; }
