body:has(#crafting-panel:not([hidden])) #ck-notifications { display: none; }

body #crafting-panel.ck-dock.management-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  inset: calc(var(--ck-play-top) + 6px) max(6px, env(safe-area-inset-right))
    calc(var(--ck-play-bottom) + 6px) max(6px, env(safe-area-inset-left)) !important;
  width: min(1040px, calc(100% - 12px)) !important;
  height: min(670px, calc(100dvh - var(--ck-play-top) - var(--ck-play-bottom) - 12px));
  max-height: calc(100dvh - var(--ck-play-top) - var(--ck-play-bottom) - 12px) !important;
  margin: auto !important;
  overflow: hidden !important;
  background: #202925 !important;
  color: #efe9d8;
}
#crafting-panel > .ck-panel-heading { flex: none; }
body:has(.ck-location:not([hidden])) #crafting-panel.ck-dock:not([hidden]) { z-index: 14002; }
#crafting-panel .panel-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ck-pattern-notice {
  margin: 0 0 8px;
  color: #ffdfab;
}
.ck-pattern-workspace {
  display: grid;
  grid-template-columns: minmax(230px, 29%) minmax(0, 1fr);
  min-height: 0;
  border: 1px solid #687060;
  border-radius: 6px;
  background: #202b26;
}
.ck-pattern-book, .ck-pattern-sheet {
  min-width: 0;
  min-height: 0;
  padding: 14px;
}
.ck-pattern-book {
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid #596253;
  background: #1e2824;
}
.ck-pattern-sheet { overflow: auto; padding: 12px 22px; }
.ck-pattern-sheet p { margin: 5px 0; }
.ck-pattern-tabs, .ck-pattern-hint, .ck-pattern-actions, .ck-pattern-pages {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.ck-pattern-tabs { border-bottom: 1px solid #687060; padding-bottom: 6px; }
#crafting-panel button, #crafting-panel input, #crafting-panel select {
  min-height: 48px !important;
  min-width: 48px;
}
#crafting-panel :is(button, input, select, h3):focus-visible {
  outline: 2px solid #fff1cb !important;
  outline-offset: -3px;
}
.ck-pattern-filters { display: grid; gap: 6px; padding-block: 7px; }
.ck-pattern-filters label { display: grid; gap: 2px; color: #d1d5c4; }
.ck-pattern-filters :is(input, select) { box-sizing: border-box; width: 100%; }
.ck-pattern-rows { overflow: auto; min-height: 0; }
#crafting-panel button.ck-pattern-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 60px !important;
  margin-block: 3px;
  text-align: start;
  border-radius: 3px;
}
.ck-pattern-row small, .ck-pattern-materials small { display: block; color: #d1d5c4; }
#crafting-panel .ck-pattern-row[aria-current] { background: #384b3f !important; border-color: #abb79b !important; }
#crafting-panel .ck-pattern-row.is-recommended { border-color: #d3ac70 !important; }
.ck-pattern-recommendation { color: #f3ce91 !important; }
.ck-pattern-glyph {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  min-height: 38px;
  background: #3a493f;
  border: 1px solid #697763;
  border-radius: 4px;
  color: #f3ce91;
  font-size: 20px;
}
.ck-pattern-plan-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "meta back" "title back";
  column-gap: 12px;
  align-items: center;
}
.ck-pattern-plan-header .ck-pattern-meta { grid-area: meta; }
.ck-pattern-heading { grid-area: title; }
.ck-pattern-back { grid-area: back; margin-bottom: 6px; }
.ck-pattern-meta { color: #d1d5c4; }
.ck-pattern-heading {
  margin: 3px 0 7px;
  color: #f0e6cc;
  font: normal clamp(1.55rem, 3vw, 2.4rem)/1.12 Georgia, serif;
}
.ck-pattern-drawing {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: clamp(160px, 28dvh, 236px);
  background: #e3cfa4;
  border: 1px solid #b6935d;
  border-radius: 5px;
  touch-action: none;
  user-select: none;
  cursor: crosshair;
}
.ck-pattern-drawing.is-finished { touch-action: auto; cursor: default; }
.ck-pattern-paper-border, .ck-pattern-guides { fill: none; stroke: #8b7048; stroke-width: 1; }
.ck-pattern-guides { stroke-dasharray: 3 6; }
.ck-pattern-outline { fill: none; stroke: #574124; stroke-width: 2.3; stroke-linejoin: round; }
.is-crafting .ck-pattern-outline { animation: ck-pattern-settle 220ms ease-out both; }
@keyframes ck-pattern-settle {
  from { stroke: #8a5d31; }
  to { stroke: #384c37; }
}
.is-finished .ck-pattern-outline { fill: #b98949; stroke: #483116; }
.ck-pattern-outline text, .ck-pattern-mark text {
  fill: #493116;
  stroke: none;
  text-anchor: middle;
  dominant-baseline: middle;
  font: bold 18px system-ui, sans-serif;
}
.ck-pattern-outline text { font-size: 27px; }
.ck-pattern-mark circle { fill: #f1e0b8; stroke: #594324; stroke-width: 2; stroke-dasharray: 4 3; }
.ck-pattern-mark.is-marked circle { fill: #384c37; stroke: #384c37; stroke-dasharray: none; }
.ck-pattern-mark.is-marked text { fill: #fff4da; }
.ck-pattern-ink {
  fill: none;
  stroke: #384c37;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 150ms ease-out;
}
.ck-pattern-mark.is-marked .ck-pattern-ink { opacity: 1; }
.ck-pattern-hint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-block: 5px;
}
.ck-pattern-hint p { color: #ead3a8; }
.ck-pattern-materials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-block: 6px;
}
#crafting-panel .ck-pattern-materials button {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: start;
}
.ck-pattern-materials b {
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  min-height: 25px;
  border: 1px dashed currentColor;
  border-radius: 50%;
}
.ck-pattern-materials [aria-pressed=true] b { border-style: solid; }
#crafting-panel .ck-pattern-materials [aria-pressed=true] small { color: #382a15; }
.ck-pattern-shortage { color: #ffcf9e; }
.ck-pattern-progress { min-height: 1.4em; color: #f1dbac; }
.ck-pattern-actions { margin-block: 6px max(2px, env(safe-area-inset-bottom)); }
.ck-pattern-actions .ck-primary { margin-inline-start: auto; }
@media (max-width: 700px) {
  body #crafting-panel.ck-dock.management-panel:not([hidden]) {
    top: calc(var(--ck-play-top) + 42px) !important;
    height: auto;
  }
  .ck-pattern-workspace { display: flex; flex-direction: column; }
  .ck-pattern-book { border-inline-end: 0; }
  .ck-pattern-sheet { padding: 0 9px 10px; }
  .ck-pattern-placeholder, .ck-pattern-workspace.has-plan .ck-pattern-book { display: none; }
  .ck-pattern-drawing { height: clamp(140px, calc(100dvh - var(--ck-play-top) - var(--ck-play-bottom) - 518px), 238px); }
  .ck-pattern-plan-header { display: contents; }
  .ck-pattern-back { position: sticky; top: 0; z-index: 1; background: #202b26; padding-block: 6px; }
}
@media (max-width: 345px) {
  .ck-pattern-materials { grid-template-columns: 1fr; }
}
html[data-ck-large-text] .ck-pattern-materials { grid-template-columns: 1fr; }
@media (prefers-reduced-motion: reduce) {
  .ck-pattern-ink { transition: none; }
  .is-crafting .ck-pattern-outline { animation: none; }
}
