.doku-panel {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(25,27,33,.94);
}
.doku-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.doku-settings { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px 0 15px; }
.difficulty-control { display: inline-flex; align-items: center; gap: 8px; color: #92929a; font-family: "DM Mono", monospace; font-size: 8px; letter-spacing: .08em; }
.difficulty-control select { min-width: 104px; min-height: 36px; padding: 0 25px 0 9px; border: 1px solid #45464e; border-radius: 4px; background: #202229; color: var(--gold-soft); font-family: "DM Sans", sans-serif; font-size: 11px; }
.difficulty-control select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.doku-eyebrow, .doku-stats, .doku-column-heading, .doku-row-heading, .doku-card-code, .doku-cell-error, .doku-legend, .doku-search-note {
  font-family: "DM Mono", monospace;
  letter-spacing: .06em;
}
.doku-eyebrow { color: var(--gold); font-size: 9px; }
.doku-date { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.doku-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 15px; color: #9999a0; font-size: 8px; }
.doku-stats strong { color: var(--gold-soft); font-size: 12px; font-weight: 500; }
.doku-board-wrap { overflow: hidden; border: 1px solid #33353d; border-radius: 5px; background: #15171c; }
.doku-board { display: grid; grid-template-columns: minmax(66px, .88fr) repeat(3, minmax(0, 1fr)); gap: 1px; background: #33353d; }
.doku-corner { background: #1e2026; }
.doku-column-heading, .doku-row-heading { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px 4px; background: #202229; color: #dedbd3; text-align: center; }
.doku-row-heading { color: var(--gold-soft); }
.doku-axis-label { color: #85868e; font-family: "DM Mono", monospace; font-size: 7px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.doku-axis-value { max-width: 100%; overflow: hidden; font-size: 10px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.doku-cell { position: relative; display: flex; min-width: 0; min-height: 100px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 7px; overflow: hidden; border: 0; background: #191b21; color: #85868e; font-family: "DM Mono", monospace; font-size: 8px; letter-spacing: .07em; cursor: pointer; transition: background .15s, color .15s; }
.doku-cell:hover:not(:disabled) { background: #27251f; color: var(--gold-soft); }
.doku-cell:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--gold); outline-offset: -3px; }
.doku-cell:disabled { cursor: default; }
.doku-cell-plus { color: #877044; font-size: 20px; line-height: 1; }
.doku-cell.is-solved { background: #265b46; color: #f4f1e9; box-shadow: inset 0 0 0 3px #55aa7c; }
.doku-cell-card-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.doku-cell.has-error .doku-cell-card-image { filter: grayscale(1); }
.doku-cell .doku-card-name { position: relative; z-index: 1; margin-top: auto; padding: 4px 2px; border-radius: 3px; background: rgba(15,17,21,.76); text-shadow: 0 1px 3px #000; }
.doku-card-name { display: -webkit-box; width: 100%; overflow: hidden; color: #f4f1e9; font-family: "DM Sans", sans-serif; font-size: 11px; font-weight: 600; line-height: 1.25; text-align: center; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.doku-card-code { color: #b2c9bc; font-size: 8px; }
.doku-cell.has-error { background: #522b29; color: #efaaa3; box-shadow: inset 0 0 0 3px #bd6158; }
.doku-cell-error { display: -webkit-box; max-width: 100%; overflow: hidden; color: #efc3be; font-size: 8px; line-height: 1.4; text-align: center; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.doku-feedback { min-height: 18px; margin: 12px 0 0; color: #b1b0b1; font-size: 11px; text-align: center; }
.doku-legend { display: flex; justify-content: center; gap: 17px; margin-top: 12px; color: #a7a6aa; font-size: 8px; }
.doku-legend span { display: inline-flex; align-items: center; gap: 6px; }
.doku-dialog { position: fixed; width: min(430px, calc(100vw - 32px)); max-height: min(680px, calc(100vh - 32px)); max-height: min(680px, calc(100dvh - 32px)); padding: 28px; overflow: visible; border: 1px solid #484039; border-radius: 7px; background: #1d1f25; color: var(--text); box-shadow: 0 20px 70px rgba(0,0,0,.6); }
.doku-dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(3px); }
.doku-dialog h2 { margin: 8px 30px 5px 0; color: #f2e7d3; font-size: 18px; }
.doku-requirement { margin: 0 0 15px; color: #aeadab; font-size: 11px; line-height: 1.5; }
.doku-search { position: relative; display: flex; align-items: center; gap: 8px; }
.doku-search input { width: 100%; min-width: 0; height: 44px; padding: 0 11px; border: 1px solid #42434a; border-radius: 4px; outline: 0; background: #15171c; color: var(--text); font-size: 12px; }
.doku-search input:focus { border-color: #92713b; box-shadow: 0 0 0 2px rgba(242,184,75,.08); }
.doku-search .dialog-done { width: auto; min-width: 105px; min-height: 42px; margin: 0; padding: 0 9px; font-size: 8px; }
.doku-suggestions { position: absolute; z-index: 5; top: calc(100% + 5px); right: 0; left: 0; max-height: min(44vh, 300px); margin: 0; padding: 4px; overflow-y: auto; border: 1px solid #3b3c44; border-radius: 4px; background: #202229; box-shadow: 0 12px 30px rgba(0,0,0,.4); list-style: none; }
.doku-suggestions[hidden] { display: none; }
.doku-suggestion { display: flex; min-height: 52px; flex-direction: column; justify-content: center; gap: 3px; padding: 7px 9px; border-radius: 3px; cursor: pointer; }
.doku-suggestion[aria-selected="true"], .doku-suggestion:hover, .doku-suggestion:focus-visible { outline: 0; background: #302c24; }
.doku-suggestion-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.doku-suggestion-title { overflow: hidden; color: #eee9df; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.doku-suggestion-details { color: #92929a; font-family: "DM Mono", monospace; font-size: 8px; line-height: 1.45; overflow-wrap: anywhere; }
.doku-suggestion-preview { display: none; width: 82px; max-height: 120px; margin: 3px auto 2px; border: 1px solid rgba(255,255,255,.14); border-radius: 3px; object-fit: contain; filter: grayscale(1); box-shadow: 0 7px 18px rgba(0,0,0,.35); }
.doku-suggestion[aria-selected="true"] .doku-suggestion-preview, .doku-suggestion:hover .doku-suggestion-preview, .doku-suggestion:focus-visible .doku-suggestion-preview { display: block; }
.doku-search-note { min-height: 14px; margin: 8px 0 0; color: #85868e; font-size: 8px; }
.doku-dialog .dialog-close { z-index: 1; }

@media (max-width: 650px) {
  .doku-panel { padding: 13px; }
  .doku-toolbar { align-items: flex-start; margin-bottom: 13px; }
  .doku-settings { align-items: flex-end; gap: 6px; margin: 0 0 12px; }
  .difficulty-control { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 7px; }
  .difficulty-control select { min-width: 94px; min-height: 36px; font-size: 10px; }
  .doku-stats { max-width: 142px; gap: 6px 10px; font-size: 7px; }
  .doku-stats strong { font-size: 11px; }
  .doku-board { grid-template-columns: minmax(52px, .77fr) repeat(3, minmax(0, 1fr)); }
  .doku-column-heading, .doku-row-heading { gap: 3px; padding: 6px 2px; }
  .doku-axis-label { font-size: 6px; }
  .doku-axis-value { font-size: 8px; }
  .doku-cell { min-height: clamp(76px, 24vw, 100px); padding: 5px 3px; font-size: 7px; }
  .doku-card-name { font-size: 9px; }
  .doku-card-code, .doku-cell-error { font-size: 7px; }
  .doku-legend { flex-wrap: wrap; gap: 8px 14px; font-size: 7px; }
  .doku-dialog { width: calc(100vw - 24px); padding: 23px 17px; overflow-y: auto; }
  .doku-search { flex-direction: column; align-items: stretch; }
  .doku-search .dialog-done { width: 100%; min-height: 42px; }
  .doku-suggestions { position: static; width: 100%; max-height: min(38dvh, 280px); margin-top: 2px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .doku-suggestion { min-height: 64px; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
  .doku-suggestion-copy { flex: 1; }
  .doku-suggestion-preview { display: block; width: 38px; height: 54px; flex: 0 0 auto; margin: 0; }
}
