#list > .note,
#edit > .note,
#motifEffectEdit > .note {
  font-size: 0.85em;
  opacity: 0.75;
}
#edit {
  margin-bottom: 2em;
  scroll-margin-top: 4em;
}
#edit h2 {
  color: rgba(175, 255, 175, 0.95);
}
.table-scroll {
  overflow-x: auto;
  margin-bottom: 1em;
}
.motif-table {
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  background-color: rgba(40, 30, 25, 0.5);
}
.motif-table input,
.motif-table textarea {
  -webkit-user-select: text;
     -moz-user-select: text;
      -ms-user-select: text;
          user-select: text;
}
.motif-table,
.motif-table * {
  font-size: 13px;
  line-height: 1.6em;
}
.motif-table thead th,
.motif-table .caption th {
  background-color: rgba(24, 16, 12, 0.8);
}
.motif-table th,
.motif-table td {
  padding: 0.2em 0.3em;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  vertical-align: top;
}
.motif-table th,
.motif-table .part,
.motif-table .equipment {
  white-space: nowrap;
}
.motif-table .status {
  text-align: center;
  min-width: 2.5em;
}
.motif-table .status.zero {
  color: rgba(255, 255, 255, 0.2);
}
.motif-table .part {
  text-align: center;
}
.motif-table .part input {
  text-align: center;
}
.motif-table .effect {
  position: relative;
}
.motif-table .effect .effect-summary {
  width: 20em;
  min-height: 1.6em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.motif-table .effect .effect-detail {
  position: absolute;
  inset: auto;
  margin: 0;
  padding: 5px;
  width: 20em;
  max-width: calc(100vw - 2em);
  max-height: calc(100vh - 2em);
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: rgba(0, 0, 0, 0.95);
  color: inherit;
  -webkit-user-select: text;
     -moz-user-select: text;
      -ms-user-select: text;
          user-select: text;
}
.motif-table input[type="text"] {
  width: 12em;
}
.motif-table select {
  width: auto;
  text-align: left;
  -moz-text-align-last: left;
       text-align-last: left;
}
.motif-table input[type="number"] {
  width: 4.5em;
}
.motif-table textarea {
  width: 28em;
  height: 2em;
  resize: none;
  vertical-align: middle;
}
.motif-table input[type="text"],
.motif-table input[type="number"],
.motif-table select,
.motif-table textarea {
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  height: 2em;
  padding: 0.15em 0.3em;
  line-height: 1.6em;
}
.motif-table input.effect-input {
  width: 28em;
  text-overflow: ellipsis;
  cursor: text;
}
#list .motif-table {
  table-layout: fixed;
  width: calc(37em + var(--status-count) * 2.75em);
  border-left: none;
}
#list .part-column {
  width: 5em;
}
#list .equipment-column {
  width: 12em;
}
#list .status-column {
  width: 2.75em;
}
#list .effect-column {
  width: 20em;
}
#list .chara,
#list .part,
#list .equipment {
  position: sticky;
  z-index: 2;
  background-color: rgba(40, 30, 25, 0.8);
  backdrop-filter: blur(12px);
}
#list .chara,
#list .part {
  left: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}
#list .equipment {
  left: var(--part-width, 0px);
}
#list .chara a,
#list .equipment span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
#list .chara a {
  color: rgba(175, 255, 175, 0.95);
}
#list .part {
  overflow: hidden;
  text-overflow: ellipsis;
}
#list .caption .chara {
  z-index: 3;
  background-color: rgba(24, 16, 12, 0.8);
  text-align: left;
}
#list tr:hover td,
#list tr:has(.effect-detail:popover-open) td {
  background-color: rgba(95, 75, 45, 0.65);
}
#list tr:hover .part,
#list tr:has(.effect-detail:popover-open) .part,
#list tr:hover .equipment,
#list tr:has(.effect-detail:popover-open) .equipment {
  background-color: rgba(95, 75, 45, 0.9);
}
#list .caption:hover th {
  background-color: rgba(58, 39, 29, 0.8);
}
#list .equipment-row {
  cursor: pointer;
}
#list .equipment-row:focus-visible {
  outline: 2px solid rgba(255, 255, 150, 0.9);
  outline-offset: -2px;
}
#list .effect-summary {
  width: 100%;
}
#motifDetail,
#motifEffectEdit {
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  width: calc(100% - 2em);
  max-width: 560px;
  max-height: 90vh;
  max-height: 90dvh;
  margin: auto;
  padding: 1.25em;
  overflow: auto;
  -ms-scroll-chaining: none;
      overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.35);
  outline: none;
  background-color: rgba(16, 12, 10, 0.98);
  background-image: url(../../img/madara2.png);
  background-size: contain;
  color: inherit;
  text-align: left;
}
#motifDetail::-ms-backdrop, #motifEffectEdit::-ms-backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}
#motifDetail::backdrop,
#motifEffectEdit::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}
#motifDetail .detail-header,
#motifEffectEdit .detail-header {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: start;
      -ms-flex-align: start;
          align-items: flex-start;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  gap: 1em;
  margin-bottom: 1em;
}
#motifDetail .detail-header h2,
#motifEffectEdit .detail-header h2 {
  margin: 0;
  font-size: 1.1em;
  overflow-wrap: anywhere;
}
#motifDetail table,
#motifEffectEdit table {
  width: 100%;
  margin-bottom: 1em;
  border-collapse: separate;
  border-spacing: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  background-color: rgba(40, 30, 25, 0.5);
}
#motifDetail table th,
#motifEffectEdit table th,
#motifDetail table td,
#motifEffectEdit table td {
  padding: 0.35em 0.5em;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.9em;
  line-height: 1.6em;
}
#motifDetail table th,
#motifEffectEdit table th {
  background-color: rgba(24, 16, 12, 0.8);
  white-space: nowrap;
}
#motifDetail .detail-meta,
#motifEffectEdit .detail-meta {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  gap: 1em;
  margin-bottom: 1em;
  font-size: 0.9em;
  line-height: 1.6em;
}
#motifDetail .detail-meta .detail-chara,
#motifEffectEdit .detail-meta .detail-chara {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: rgba(175, 255, 175, 0.95);
}
#motifDetail .detail-status,
#motifEffectEdit .detail-status {
  table-layout: fixed;
}
#motifDetail .detail-status td.zero,
#motifEffectEdit .detail-status td.zero {
  color: rgba(255, 255, 255, 0.4);
}
#motifDetail .detail-status th,
#motifEffectEdit .detail-status th {
  width: 35%;
  white-space: normal;
  text-align: left;
}
#motifDetail .detail-status td,
#motifEffectEdit .detail-status td {
  width: 15%;
  text-align: right;
}
#motifDetail h3,
#motifEffectEdit h3 {
  margin: 1em 0 0.5em;
  padding: 0;
  font-size: 0.95em;
  text-align: left;
}
#motifDetail .detail-effects p,
#motifEffectEdit .detail-effects p {
  margin: 0 0 1.25em;
  font-size: 0.95em;
  line-height: 1.8em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#motifDetail .detail-effects p:last-child,
#motifEffectEdit .detail-effects p:last-child {
  margin-bottom: 0;
}
#motifDetail .detail-effects strong,
#motifEffectEdit .detail-effects strong {
  display: block;
  color: rgba(255, 255, 150, 0.9);
  font-size: inherit;
  font-weight: 600;
}
#motifEffectEdit textarea {
  -webkit-user-select: text;
     -moz-user-select: text;
      -ms-user-select: text;
          user-select: text;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  display: block;
  width: 100%;
  height: 18em;
  max-height: 55dvh;
  padding: 0.5em;
  font-size: 0.95em;
  line-height: 1.8em;
  resize: vertical;
}
#motifEffectEdit p {
  margin: 0.75em 0 0;
}
body:has(#motifDetail[open], #motifEffectEdit[open]) {
  overflow: hidden;
}
@media screen and (max-width: 519px) {
  #motifDetail,
  #motifEffectEdit {
    padding: 1em;
  }
}
