:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-soft: #eef4f2;
  --text: #1e2a32;
  --muted: #64737d;
  --line: #d7e0dc;
  --accent: #b93636;
  --accent-strong: #8f2323;
  --teal: #246c73;
  --gold: #a56a12;
  --good: #1d7f53;
  --shadow: 0 8px 20px rgba(30, 42, 50, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans SC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

.app-header {
  padding: 20px max(18px, calc((100vw - 1280px) / 2 + 18px)) 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.app-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.header-title {
  min-width: 0;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(24px, 2.4vw, 34px);
}

h2 {
  font-size: 16px;
}

.app-shell {
  width: min(1280px, calc(100vw - 24px));
  margin: 12px auto 28px;
  display: grid;
  gap: 12px;
}

.app-shell > * {
  min-width: 0;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 12px;
  min-width: 0;
}

.assistant-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
  gap: 12px;
  min-width: 0;
}

.assistant-stack {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.section {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title.with-action {
  align-items: center;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.form-grid {
  display: grid;
  gap: 9px;
}

.contract-grid {
  grid-template-columns: minmax(240px, 1.5fr) repeat(5, minmax(132px, 1fr));
}

.wulfgard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gilberta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.assistant-grid {
  grid-template-columns: minmax(0, 1fr);
}

.perlica-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.laevatain-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

.laevatain-grid .field {
  width: max-content;
}

.laevatain-line {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 9px 12px;
  width: 100%;
  min-width: 0;
}

.laevatain-set-line {
  justify-content: flex-end;
}

.laevatain-grid input,
.laevatain-grid select {
  min-height: 32px;
}

.laevatain-grid input[type="number"] {
  width: 74px;
}

#laevatainPotential {
  width: 142px;
}

#laevatainAbilityExtension {
  width: 82px;
}

#laevatainComboLevel {
  width: 76px;
}

#laevatainWither {
  width: 146px;
}

#laevatainWeapon {
  width: 118px;
}

#laevatainArmor {
  width: 160px;
}

#laevatainGloves {
  width: 145px;
}

#laevatainAccessory1,
#laevatainAccessory2 {
  width: 170px;
}

.laevatain-skill-field {
  grid-column: span 2;
  width: 158px;
}

.laevatain-row-start {
  grid-column-start: 1;
}

.laevatain-set-field {
  width: max-content;
}

.level-triplet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.level-triplet span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.laevatain-grid .level-triplet input {
  min-width: 0;
  width: 42px;
  padding-inline: 5px;
  text-align: center;
}

.field,
.check-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field.wide {
  grid-column: span 2;
}

.field > span,
.check-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #cbd6d2;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}

input:disabled,
select:disabled {
  cursor: not-allowed;
  background: #f1f4f2;
  color: #89959d;
}

input:focus,
select:focus,
button:focus-visible,
.source-info-button:focus-visible {
  outline: 2px solid rgba(36, 108, 115, 0.35);
  outline-offset: 2px;
}

.suffix-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  border: 1px solid #cbd6d2;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.suffix-input input {
  border: 0;
  border-radius: 0;
}

.suffix-input span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.check-field {
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  padding-top: 20px;
}

.compact-check {
  padding-top: 0;
}

.check-field input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--accent);
}

.inline-check {
  display: inline-grid;
  grid-template-columns: 17px auto;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-check input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--accent);
}

.assistant-placeholder {
  min-height: 34px;
  display: grid;
  align-items: center;
  padding: 6px 9px;
  border: 1px dashed #cbd6d2;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #fbfcfa;
}

.primary-button,
.preset-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.primary-button {
  min-height: 34px;
  padding: 7px 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.preset-button {
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #cbd6d2;
  background: #fff;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.preset-button:hover {
  border-color: var(--teal);
  background: #eef7f5;
}

.preset-button.header-snapshot-button {
  min-width: 52px;
  min-height: 32px;
  padding: 0 11px;
}

.button-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 17px;
  line-height: 17px;
}

.burn-list {
  display: block;
  min-width: 0;
}

.burn-sequence-timeline {
  min-width: 0;
}

.burn-table-wrap {
  border-color: #cddbd6;
}

.burn-table,
.factor-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.burn-table {
  min-width: 1040px;
}

.burn-table th,
.burn-table td,
.factor-table th,
.factor-table td {
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.burn-table th,
.burn-table td {
  padding: 6px 7px;
  text-align: center;
  white-space: nowrap;
}

.burn-table th {
  background: #f1f5f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.burn-table-group-row th {
  padding: 5px 7px;
  background: #e7efeb;
  color: var(--text);
  border-right: 2px solid #9fb3ad;
  font-size: 11px;
  letter-spacing: 0;
}

.burn-table-group-row th:last-child {
  border-right: 0;
}

.burn-table th.group-end,
.burn-table td.group-end {
  border-right: 2px solid #aabbb5;
}

.burn-table tr:last-child td,
.factor-table tr:last-child td {
  border-bottom: 0;
}

.burn-index-cell {
  color: var(--teal);
  font-weight: 800;
}

.source-control {
  width: 82px;
  min-height: 30px;
  padding: 4px 6px;
}

.small-control {
  width: 78px;
  min-height: 30px;
  padding: 4px 6px;
}

.tiny-control {
  width: 54px;
  min-height: 30px;
  padding: 4px 6px;
  text-align: center;
}

.center-cell input[type="checkbox"] {
  display: block;
  width: 17px;
  min-height: 17px;
  margin: 0 auto;
  accent-color: var(--accent);
}

.icon-button {
  width: 30px;
  height: 30px;
  background: #fff;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.icon-button:hover {
  background: #f8e9e9;
}

.timeline-button {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.timeline-button:hover {
  background: #eef7f5;
}

.source-info {
  position: relative;
  flex: 0 0 auto;
}

.source-info-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #cbd6d2;
  border-radius: 50%;
  background: #fff;
  color: var(--teal);
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  list-style: none;
}

.source-info-button::-webkit-details-marker {
  display: none;
}

.source-info-button::marker {
  content: "";
}

.source-info-button:hover,
.source-info[open] .source-info-button {
  border-color: var(--teal);
  background: #eef7f5;
}

.source-info-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: min(360px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.source-info-popover p {
  display: grid;
  gap: 4px;
  margin: 0;
}

.source-info-popover p + p {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.source-info-popover span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.source-info-popover a {
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source-info-popover a:hover {
  color: var(--accent);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.summary-card {
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.summary-card b {
  display: block;
  margin-top: 3px;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.summary-card.good b {
  color: var(--good);
}

.summary-card.warn b {
  color: var(--gold);
}

.summary-card.danger b {
  color: var(--accent);
}

.table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.result-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  background: #fff;
}

.result-table th,
.result-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.result-table th {
  background: #f1f5f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.result-table th:first-child,
.result-table td:first-child,
.result-table th:nth-child(2),
.result-table td:nth-child(2),
.result-table th:nth-child(9),
.result-table td:nth-child(9),
.result-table th:last-child,
.result-table td:last-child {
  text-align: left;
}

.result-table tr:last-child td {
  border-bottom: 0;
}

.result-table tr.inactive {
  color: var(--muted);
  background: #fafafa;
}

.damage-hover {
  cursor: help;
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(36, 108, 115, 0.55);
}

.cap-percent {
  color: var(--accent);
  font-weight: 800;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-button:hover {
  color: var(--accent);
}

.factor-table {
  min-width: 0;
}

.factor-sections {
  display: grid;
  gap: 12px;
}

.factor-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.factor-section .table-wrap {
  border: 0;
  border-radius: 0;
}

.factor-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 12px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.factor-section-header h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.factor-section-header span {
  color: var(--muted);
  font-size: 12px;
}

.factor-section-header b {
  margin-left: auto;
  font-size: 13px;
  white-space: nowrap;
}

.factor-table th,
.factor-table td {
  padding: 8px 9px;
  text-align: left;
}

.factor-table th {
  background: #f1f5f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  width: 132px;
}

.factor-table td {
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 28, 34, 0.42);
}

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

.modal-dialog {
  width: min(780px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(18, 28, 34, 0.28);
}

.timeline-dialog {
  width: min(720px, 100%);
}

.snapshot-dialog {
  width: min(860px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.modal-body {
  max-height: calc(100vh - 130px);
  overflow: auto;
  padding: 12px 14px 14px;
}

.factor-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.factor-summary span {
  color: var(--muted);
  font-size: 12px;
}

.timeline-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.timeline-readonly {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.timeline-readonly h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.timeline-readonly p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.timeline-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.snapshot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  min-width: 0;
}

.snapshot-main {
  min-width: 0;
}

.snapshot-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
  margin-bottom: 10px;
}

.snapshot-name-field {
  min-width: 0;
}

.snapshot-side {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.snapshot-side h3 {
  margin: 0;
  font-size: 13px;
}

.snapshot-list {
  display: grid;
  gap: 8px;
}

.snapshot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.snapshot-row-main {
  min-width: 0;
}

.snapshot-row-main b,
.snapshot-row-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snapshot-row-main b {
  font-size: 13px;
}

.snapshot-row-main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.snapshot-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.snapshot-empty,
.snapshot-message,
.snapshot-error {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.snapshot-empty {
  border: 1px dashed #cbd6d2;
  color: var(--muted);
  background: #fbfcfa;
}

.snapshot-message {
  margin-bottom: 8px;
  border: 1px solid #c8dfd9;
  color: var(--teal);
  background: #eef7f5;
}

.snapshot-error {
  margin-bottom: 8px;
  border: 1px solid #efc3c0;
  color: var(--accent);
  background: #fff5f3;
}

.danger-button {
  color: var(--accent);
}

.danger-button:hover {
  border-color: var(--accent);
  background: #fff5f3;
}

.danger-primary-button {
  background: var(--accent);
}

.danger-primary-button:hover {
  background: #9d362f;
}

.timeline-visual {
  max-width: 100%;
  min-width: 0;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fbfcfa;
}

.timeline-visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

.timeline-visual-header b {
  font-size: 13px;
}

.timeline-visual-header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.timeline-visual-scroll {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.timeline-visual-canvas {
  display: grid;
  gap: 2px;
  min-width: calc(var(--timeline-label-width) + var(--timeline-track-width) + 16px);
  padding: 6px 8px 8px;
}

.timeline-buff-stack {
  display: grid;
  gap: 1px;
}

.timeline-visual-row {
  display: grid;
  grid-template-columns: var(--timeline-label-width) var(--timeline-track-width);
  align-items: center;
  min-height: 16px;
}

.timeline-visual-label {
  position: sticky;
  left: 0;
  z-index: 2;
  overflow: hidden;
  padding-right: 8px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-visual-track {
  position: relative;
  width: var(--timeline-track-width);
  min-height: 16px;
}

.timeline-buff-bar {
  position: absolute;
  top: 3px;
  height: 10px;
  border-radius: 0;
  opacity: 0.9;
}

.timeline-buff-origin {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px #fff;
  transform: translate(-50%, -50%);
  cursor: move;
}

.timeline-buff-stagger {
  background: #a56a12;
  color: #a56a12;
}

.timeline-buff-detonationUnit {
  background: #b93636;
  color: #b93636;
}

.timeline-buff-gilbertaUltimate {
  background: #2f7d4f;
  color: #2f7d4f;
}

.timeline-buff-gilbertaLongRestSet {
  background: #4f7f2b;
  color: #4f7f2b;
}

.timeline-buff-rossiMark {
  background: #7a6f64;
  color: #7a6f64;
}

.timeline-buff-perlicaConduct {
  background: #d29a13;
  color: #d29a13;
}

.timeline-buff-farewellAtk {
  background: #6d7f1d;
  color: #6d7f1d;
}

.timeline-buff-wulfgardFang {
  background: #c05a2b;
  color: #c05a2b;
}

.timeline-buff-emberSet {
  background: #7f372e;
  color: #7f372e;
}

.timeline-buff-delivery {
  background: #2d669f;
  color: #2d669f;
}

.timeline-axis-row {
  min-height: 36px;
  margin-top: 2px;
}

.timeline-axis-track {
  min-height: 36px;
}

.timeline-axis-line {
  position: absolute;
  top: 13px;
  right: 0;
  left: 0;
  height: 2px;
  border-radius: 0;
  background: #c4d0cc;
}

.timeline-time-tick {
  position: absolute;
  top: 5px;
  bottom: 8px;
  width: 1px;
  background: rgba(100, 115, 125, 0.22);
}

.timeline-time-tick span {
  position: absolute;
  top: 22px;
  left: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  transform: translateX(-50%);
  white-space: nowrap;
}

.timeline-damage-marker {
  position: absolute;
  top: 6px;
  width: 7px;
  height: 16px;
  border: 2px solid #fbfcfa;
  border-radius: 999px;
  transform: translateX(-50%);
  cursor: help;
}

.timeline-damage-marker.draggable {
  cursor: move;
}

.timeline-damage-marker.trigger {
  width: 9px;
  background: var(--accent);
}

.timeline-damage-marker.dot {
  background: var(--teal);
}

.timeline-damage-marker.combo {
  width: 9px;
  background: var(--gold);
}

.timeline-kill-marker {
  position: absolute;
  top: 18px;
  z-index: 4;
  width: 22px;
  height: 22px;
  color: var(--accent);
  font-size: 26px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
  text-shadow: 0 1px 0 #fff, 0 -1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff;
  transform: translateX(-50%);
  cursor: help;
}

.timeline-drag-ghost {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  width: 2px;
  background: rgba(30, 42, 50, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
  pointer-events: none;
  transform: translateX(-50%);
}

.timeline-drag-ghost::after {
  position: absolute;
  left: 50%;
  display: block;
  content: "";
  transform: translateX(-50%);
}

.timeline-drag-ghost.buff::after {
  top: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #1e2a32;
  transform: translate(-50%, -50%);
}

.timeline-drag-ghost.damage::after {
  top: 5px;
  width: 10px;
  height: 18px;
  border: 2px solid #fbfcfa;
  border-radius: 999px;
  background: rgba(185, 54, 54, 0.6);
}

.timeline-dragging,
.timeline-dragging * {
  cursor: move !important;
}

.instant-tooltip {
  position: fixed;
  z-index: 100;
  max-width: min(420px, calc(100vw - 20px));
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(30, 42, 50, 0.96);
  color: #fff;
  box-shadow: 0 10px 28px rgba(18, 28, 34, 0.24);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  white-space: pre-line;
}

.instant-tooltip.wide {
  max-width: min(900px, calc(100vw - 20px));
}

.instant-tooltip[hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .settings-row {
    grid-template-columns: 1fr;
  }

  .assistant-row {
    grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr);
  }

  .contract-grid,
  .wulfgard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .laevatain-grid {
    align-items: flex-start;
  }

  .gilberta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .summary-grid,
  .contract-grid,
  .wulfgard-grid,
  .gilberta-grid,
  .perlica-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assistant-row {
    grid-template-columns: 1fr;
  }

  .assistant-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field.wide {
    grid-column: auto;
  }

  .laevatain-skill-field {
    grid-column: span 2;
  }

  .timeline-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .snapshot-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-header {
    padding-inline: 12px;
  }

  .app-header-inner {
    gap: 10px;
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .app-shell {
    width: min(100vw - 16px, 1280px);
    margin-top: 8px;
  }

  .section {
    padding: 10px;
  }

  .contract-grid,
  .wulfgard-grid,
  .gilberta-grid,
  .assistant-row,
  .perlica-grid,
  .summary-grid,
  .check-field {
    padding-top: 0;
  }

  .assistant-row {
    grid-template-columns: 1fr;
  }

  .assistant-stack,
  .laevatain-grid {
    grid-template-columns: 1fr;
  }

  .laevatain-line {
    display: grid;
    grid-template-columns: 1fr;
  }

  .laevatain-set-line {
    justify-content: flex-start;
  }

  .laevatain-grid .field,
  .laevatain-skill-field,
  .laevatain-grid input[type="number"],
  .laevatain-grid select {
    width: 100%;
  }

  #laevatainPotential,
  #laevatainAbilityExtension,
  #laevatainComboLevel,
  #laevatainWither,
  #laevatainWeapon,
  #laevatainArmor,
  #laevatainGloves,
  #laevatainAccessory1,
  #laevatainAccessory2 {
    width: 100%;
  }

  .laevatain-skill-field {
    grid-column: auto;
  }

  .laevatain-set-field {
    grid-column: auto;
    justify-self: start;
  }

  .timeline-editor {
    grid-template-columns: 1fr;
  }

  .section-title.with-action,
  .snapshot-row,
  .snapshot-create {
    align-items: stretch;
  }

  .section-title.with-action {
    flex-wrap: wrap;
  }

  .snapshot-row,
  .snapshot-create {
    grid-template-columns: 1fr;
  }

  .section-actions,
  .snapshot-row-actions {
    justify-content: flex-start;
  }
}
