@layer shared-space {
  #shared { display: grid; min-width: 0; gap: 16px; }
  #shared[hidden] { display: none; }
  .shared-start { max-width: 43rem; padding: clamp(20px,4vw,34px); }
  .shared-start h2 { margin-block: 14px 8px; font-size: clamp(24px,4vw,32px); line-height: 1.12; }
  .shared-start p { max-width: 46ch; color: var(--muted); line-height: 1.55; }
  .shared-start .shared-buttons { margin-top: 20px; }
  .shared-start p.hint { margin-top: 12px; }
  .shared-symbol {
    display: inline-grid; place-items: center; flex: none; width: 43px; height: 43px;
    border: 1px solid var(--line); border-radius: 14px; color: var(--accent-dark);
    background: color-mix(in srgb,var(--accent-light) 45%,var(--surface));
  }
  .shared-symbol svg { width: 23px; height: 23px; }
  .shared-buttons, .shared-list-head, .shared-identity, .shared-toolbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  }
  .shared-toolbar { justify-content: space-between; row-gap: 14px; }
  .shared-identity { flex-wrap: nowrap; gap: 11px; }
  .shared-status { color: var(--muted); font-size: 13px; margin-top: 2px; }
  :is(#shared,#dialog-inner) [data-shared-action] { min-height: 44px; }
  :is(#shared,#dialog-inner) [data-shared-action] svg { flex: none; }
  .shared-lists { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,20rem),1fr)); gap: 16px; align-items: start; }
  .shared-list { min-width: 0; }
  .shared-list-head { justify-content: space-between; margin-bottom: 13px; }
  .shared-list-head h2 { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; }
  .shared-list-head h2 svg { color: var(--accent-dark); width: 19px; height: 19px; }
  .shared-row { padding-inline: 0; border-bottom: 1px solid var(--line); }
  .shared-row:last-child { border-bottom: 0; }
  .shared-row .task-text { min-width: 0; }
  .shared-row .task-name, .shared-picker strong, .shared-diff strong { overflow-wrap: anywhere; }
  .shared-import { justify-self: start; }
  .shared-settings section { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
  .shared-settings h3 { font-size: 16px; }
  .shared-settings .hint, #shared-invite .hint { margin-block: 6px 12px; }
  #shared-invite .shared-buttons { margin-bottom: 12px; }
  #shared-invite-key { font: 600 17px/1.45 var(--mono); resize: none; overflow-wrap: anywhere; }
  .shared-error { margin-block: 9px; color: var(--text); font-size: 14px; }
  .shared-error:empty { display: none; }
  .shared-picker { max-height: 47dvh; overflow: auto; overscroll-behavior: contain; }
  .shared-picker fieldset { padding: 0; border: 0; min-width: 0; }
  .shared-picker legend { margin: 14px 0 4px; font-weight: 650; }
  .shared-picker label { display: flex; gap: 12px; min-height: 46px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); }
  .shared-picker input { width: 19px; height: 19px; flex: none; }
  .shared-picker :is(strong,small), .shared-diff :is(strong,small) { display: block; }
  .shared-picker small, .shared-diff small { font-size: 12px; color: var(--muted); }
  .shared-diff { display: grid; gap: 12px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .shared-conflict { padding-block: 12px; border-bottom: 1px solid var(--line); }
  .shared-conflict:last-child { border: 0; }
  .shared-conflict .shared-buttons { margin-top: 10px; }
  .shared-notice { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
  #shared-errand-form :is(input[type=date],input[type=time]) { box-sizing: border-box; min-inline-size: 0; max-inline-size: 100%; width: 100%; }
  @media (max-width: 380px) {
    .shared-list-head .secondary { padding-inline: 10px; }
    #shared-errand-form .form-grid { grid-template-columns: minmax(0,1fr); }
  }
}
