/* Commands and item details */

.summon-table code,
.summon-info-popup code {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* Warning and acknowledgement */

.summon-warning {
  border-left: 3px solid #dfb85b;
  background: #fff9e9;
  color: #796345;
  font-size: 14px;
  margin: 0 0 18px;
  padding: 12px 18px;
}

.summon-warning p {
  margin-bottom: 0;
}

#read-warning {
  border: 0;
  padding: 0;
  background: transparent;
  color: #796345;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: inherit;
}

.summon-warning-dialog {
  width: min(480px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px 30px;
  border: 0;
  border-top: 5px solid var(--pink);
  background: white;
  color: var(--body);
  box-shadow: 8px 12px 40px #24395a40;
  font:
    300 16px/24px Roboto,
    sans-serif;
}

.summon-warning-dialog::backdrop {
  background: #27385199;
  backdrop-filter: blur(4px);
}

.summon-warning-dialog h2 {
  margin: 0 0 18px;
  color: var(--navy);
  font:
    700 30px/34px Astroneer,
    sans-serif;
}

.summon-warning-dialog p {
  margin: 0 0 14px;
}

.summon-warning-dialog strong {
  color: var(--purple);
}

.summon-warning-actions {
  margin-top: 22px;
  text-align: right;
}

.summon-warning-actions button {
  border: 0;
  padding: 10px 14px;
  background: var(--purple);
  color: white;
  font:
    400 14px/20px Roboto,
    sans-serif;
  cursor: pointer;
}

.summon-warning-actions button:hover {
  background: var(--pink);
}

.summon-warning-dialog :focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}

/* Instructions and list introduction */

.summon-help > summary {
  width: fit-content;
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.summon-help[open] > summary {
  margin-bottom: 16px;
}

.summon-how-to {
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 21px;
}

.summon-how-to ol {
  margin-bottom: 10px;
}

.summon-how-to li,
.summon-how-to ul {
  margin-bottom: 0;
}

.summon-how-to > ol > li:first-child {
  margin-bottom: 2px;
}

.summon-intro {
  font-size: calc(13px + 1pt);
}

.summon-intro > p {
  margin: 0 0 8px;
}

/* Risk levels */

.summon-table tr[data-risk='low'],
.summon-risk-legend [data-risk='low'] {
  --risk-color: #3db131;
}

.summon-table tr[data-risk='medium'],
.summon-risk-legend [data-risk='medium'] {
  --risk-color: #e3bd4d;
}

.summon-table tr[data-risk='high'],
.summon-risk-legend [data-risk='high'] {
  --risk-color: #d84b76;
}

.summon-risk-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-bottom: 12px;
  color: var(--navy);
  font-size: 14px;
  line-height: 18px;
}

.summon-risk-legend [data-risk]::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 12px;
  margin-right: 5px;
  background: var(--risk-color);
  vertical-align: -1px;
}

.summon-table .summon-risk {
  position: absolute;
  inset: 0 auto 1px 0;
  width: 10px;
  padding: 0;
  border: 0;
  border-left: 10px solid var(--risk-color);
  background: transparent;
  cursor: help;
}

.summon-table .summon-risk:hover:not(:disabled) {
  border-color: var(--risk-color);
  background: transparent;
}

.summon-risk-label {
  color: var(--navy);
  font-weight: 700;
}

/* Filters and result rows */

.summon-filters {
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.7fr) minmax(145px, 0.8fr) 100px auto;
}

.paper .summon-table {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: calc(13px + 1pt);
  line-height: 17px;
  display: table;
  margin: 0;
}

.summon-name-column {
  width: 32%;
}

.summon-copy-column {
  width: 5.5rem;
}

.paper .summon-table th,
.paper .summon-table td {
  padding: 7px 8px;
  vertical-align: top;
}

.paper .summon-table td {
  border-top: 1px solid white;
  border-bottom: 1px solid #e7eaf2;
  padding-bottom: 8px;
  box-shadow: inset 0 -1px white;
}

.summon-table tr > td:first-child {
  position: relative;
  padding-left: 22px;
}

.summon-table th {
  background: var(--lightblue);
  font:
    700 calc(14px + 1pt)/18px Astroneer,
    sans-serif;
  color: var(--blue);
}

.summon-table tr:hover td {
  background: color-mix(in srgb, var(--risk-color) 10%, white);
}

.summon-name {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--navy);
  font-weight: 700;
}

.summon-variant {
  color: #8a8fa1;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.summon-table code {
  padding: 2px 5px;
  line-height: 16px;
}

.summon-table .summon-note {
  margin: 6px 0 0;
  color: var(--pink);
  font-size: 12px;
  line-height: 16px;
}

.summon-table td:last-child > button {
  padding: 4px 7px;
  background: #e9f5ff;
  width: 100%;
  white-space: nowrap;
}

/* Item information icons and popup */

.summon-table .summon-info {
  flex: 0 0 auto;
  border: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--blue);
  font:
    calc(14px + 1pt)/18px 'Segoe UI Symbol',
    sans-serif;
  cursor: help;
}

.catalog .summon-info:hover:not(:disabled),
.summon-info[aria-expanded='true'] {
  background: transparent;
  color: var(--purple);
}

.summon-info-popup {
  position: fixed;
  inset: auto;
  width: min(320px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  overflow-y: auto;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #dce5f2;
  background: white;
  box-shadow: 6px 10px 28px #33517e26;
  color: var(--body);
  font:
    300 calc(13px + 1pt)/18px Roboto,
    sans-serif;
}

.summon-info-title {
  margin-bottom: 8px;
  color: var(--blue);
  font:
    700 calc(19px + 1pt)/23px Astroneer,
    sans-serif;
}

.summon-info-title::before {
  content: '✦';
  margin-right: 6px;
  color: var(--yellow);
  font-family: 'Segoe UI Symbol', sans-serif;
}

.summon-info-popup p {
  margin: 0 0 8px;
}

.summon-category {
  color: var(--navy);
}

.summon-info-popup code {
  padding: 5px;
  background: #f3f6fb;
  color: var(--purple);
}

/* Copy notification */

.catalog .summon-copy-status {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 6;
  max-width: min(360px, 85vw);
  margin: 0;
  padding: 10px 16px;
  color: white;
  background: var(--navy);
  box-shadow: 4px 4px 0 #33517e22;
  font-size: calc(12px + 1pt);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.45s ease,
    visibility 0s linear 0.45s;
}

.summon-copy-status.is-visible {
  opacity: 1;
  visibility: visible;
  transition: none;
}

/* Accessibility and responsive layout */

@media (prefers-reduced-motion: reduce) {
  .catalog .summon-copy-status {
    transition: none;
  }
}

@media (max-width: 700px) {
  .summon-name-column {
    width: 36%;
  }
}
