/* Authored paper and wood come from CounterUI.skin; CSS handles only layout,
   text, selection and finite feedback. This modal does not inherit game scaling. */
.craft-entry { position:absolute; left:84px; top:360px; width:146px; min-height:42px; pointer-events:auto; display:flex; align-items:center; justify-content:center; gap:12px; font-size:17px!important; }
.craft-button { position:relative; isolation:isolate; border:0; padding:9px 13px; background:transparent; color:#faedcf; font:inherit; font-size:15px; line-height:1.45; cursor:pointer; }
.craft-button:disabled { color:#61523d; cursor:default; }
.craft-button:disabled > .raster-surface { opacity:.35; }
.craft-button:focus-visible { outline:3px solid #345f50; outline-offset:3px; }
.craft-button:hover:not(:disabled) > .raster-surface { filter:brightness(1.12); }
.craft-overlay { position:fixed; inset:0; z-index:300; padding:20px; display:flex; flex-direction:column; align-items:center; overflow:auto; background:rgba(15,24,20,.77); color:#314a3b; font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif; font-size:16px; line-height:1.55; overscroll-behavior:contain; scrollbar-color:#a58a5b #26392e; }
.craft-overlay[hidden] { display:none!important; }
.craft-workbook { position:relative; isolation:isolate; width:min(960px,100%); margin-block:auto; padding:22px 26px 20px; flex:none; }
.craft-workbook > .raster-surface { z-index:-1; }
.craft-workbook p,.craft-workbook h2,.craft-workbook h3,.craft-workbook h4 { margin:0; }
.craft-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding-bottom:16px; border-bottom:1px solid #bb9f71; }
.craft-eyebrow { font-size:13px; color:#7e6343; letter-spacing:2px; }
.craft-heading h2 { font-family:"Songti SC","STSong","Noto Serif CJK SC",serif; font-size:32px; font-weight:600; line-height:1.4; letter-spacing:3px; color:#773d2a; }
.craft-heading > p:last-child { font-size:14px; color:#63533c; }
.craft-close { min-height:42px; flex:none; margin-top:6px; }
.craft-content { display:grid; grid-template-columns:235px minmax(0,1fr); gap:28px; padding:20px 0; }
.craft-sidebar { min-width:0; padding-right:20px; border-right:1px solid #bb9f71; }
.craft-course-summary { display:none; }
.craft-syllabus-heading { display:flex; align-items:baseline; justify-content:space-between; gap:8px; margin-bottom:10px; }
.craft-syllabus-heading h3 { font-size:17px; }
.craft-course-progress { font-size:13px; white-space:nowrap; color:#745c3f; }
.craft-courses { display:grid; gap:6px; }
.craft-courses h4 { font-family:"Songti SC","STSong","Noto Serif CJK SC",serif; margin-top:10px; font-size:19px; font-weight:600; color:#755135; }
.craft-courses h4:first-child { margin-top:0; }
.craft-course { display:grid; grid-template-columns:34px minmax(0,1fr); gap:2px 7px; padding:8px 10px; text-align:left; min-height:60px; }
.craft-course > strong { font-size:15px; font-weight:600; min-width:0; }
.craft-course-tier { grid-row:span 2; align-self:center; font-size:13px; color:#e9cf99; }
.craft-course-record { grid-column:2; font-size:12px; color:#efdcb7; }
.craft-course[aria-current="true"] { outline:2px solid #35634c; outline-offset:1px; }
.craft-course[aria-current="true"] > .raster-surface { filter:brightness(1.14); }
.craft-course:disabled .craft-course-tier,.craft-course:disabled .craft-course-record { color:#66563d; }
.craft-side-note { margin-top:14px!important; font-size:13px; line-height:1.7; color:#756144; }
.craft-play { min-width:0; }
.craft-level-heading { display:flex; align-items:center; gap:12px; margin-bottom:13px; min-height:66px; }
.craft-ticket-thumb { width:39px; height:54px; object-fit:contain; image-rendering:auto; flex:none; }
.craft-level-heading h3 { font-size:23px; font-weight:600; line-height:1.4; color:#3a563e; }
.craft-goal { margin-top:3px!important; font-size:14px; line-height:1.5; color:#62523d; }
.craft-tools { display:flex; gap:10px; margin-bottom:10px; }
.craft-tool { display:flex; flex:1; align-items:center; justify-content:center; gap:10px; padding:10px 12px; min-height:61px; text-align:left; }
.craft-tool > span:not(.raster-surface) { display:flex; flex-direction:column; gap:2px; }
.craft-tool strong { font-size:17px; line-height:1.3; }
.craft-tool small { font-size:12px; color:#eedbb5; }
.craft-tool:disabled small { color:#66563d; }
.craft-tool-art { width:33px; height:29px; object-fit:contain; image-rendering:auto; }
.craft-tool[aria-pressed="true"] { outline:2px solid #35634c; outline-offset:1px; }
.craft-counters { display:flex; justify-content:space-between; gap:12px; margin:12px 0 9px; font-size:15px; font-weight:600; font-variant-numeric:tabular-nums; }
.craft-counters.is-low .craft-steps { color:#9b3e2b; }
.craft-grid { display:grid; grid-template-columns:repeat(var(--craft-cols,4),minmax(0,1fr)); gap:7px; padding:9px; border:1px solid #ae9369; background:#e4d5b4; }
.craft-cell { position:relative; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:3px; min-width:0; min-height:62px; padding:5px 2px; border:1px solid #a98f68; background:#f5e9cc; color:#334f3d; font:inherit; line-height:1.2; touch-action:manipulation; transition:background-color .15s ease,color .15s ease; }
.craft-cell-symbol { font-size:22px; font-weight:600; line-height:1.15; }
.craft-cell-label { font-size:12px; line-height:1.3; }
.craft-cell[data-kind="protected"] { color:#844f3c; border:1px dashed #9d7259; background:#e6d4b4; }
.craft-cell[data-kind="blank"] { color:#716954; background:#e9dfc6; }
.craft-cell.is-start:not(.is-cleared) { box-shadow:inset 0 0 0 2px #58765b; }
.craft-cell.is-pending { background:#f5cf89; color:#674920; box-shadow:inset 0 0 0 2px #997139; }
.craft-cell.is-cleared { background:#d0ddc3; color:#3d5f47; border-color:#90a58a; }
.craft-cell.is-last { border-color:#426647; box-shadow:inset 0 0 0 2px #426647; }
.craft-cell.is-next { border:2px dashed #426647; }
.craft-cell:focus-visible { outline:3px solid #315c49; outline-offset:2px; z-index:1; }
.craft-cell:hover:not(:disabled) { border-color:#2c533b; }
.craft-cell:disabled { cursor:default; }
.craft-notice { margin:10px 0 8px!important; min-height:44px; font-size:14px; line-height:1.55; color:#40583f; }
.craft-rules { font-size:13px; color:#6e5c43; line-height:1.55; }
.craft-rules summary { cursor:pointer; color:#775439; font-size:14px; padding:3px 0; }
.craft-rules summary:focus-visible { outline:2px solid #345f50; outline-offset:2px; }
.craft-rules ul { padding-left:20px; margin:5px 0 0; }
.craft-rules li + li { margin-top:3px; }
.craft-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:12px; }
.craft-actions .craft-button { min-height:42px; min-width:108px; }
.craft-result { position:relative; padding:12px 0 0 0; margin-top:12px; border-top:1px solid #b69c71; }
.craft-result h4 { font-size:19px; color:#8d5035; }
.craft-result.is-won { padding-left:42px; }
.craft-result.is-won h4 { color:#385f42; }
.craft-result p { font-size:14px; color:#65543e; margin-top:3px; }
.craft-result-art { position:absolute; left:0; top:12px; width:30px; height:34px; object-fit:contain; image-rendering:auto; }
.craft-unlock { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:10px; padding-top:10px; border-top:1px solid #c0aa81; }
.craft-unlock .craft-unlock-copy { margin:0; font-size:14px; color:#36583d; }
.craft-unlock-button { flex:none; min-height:42px; font-size:14px; }
.craft-footer { border-top:1px solid #bb9f71; padding-top:15px; }
.craft-assist-heading { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:10px; }
.craft-assist-heading h3 { font-size:17px; }
.craft-assist-heading p { font-size:13px; color:#715e42; }
.craft-assists { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.craft-assist { display:flex; flex-direction:column; align-items:flex-start; text-align:left; gap:2px; padding:11px 13px; min-height:90px; }
.craft-assist strong { font-size:16px; }
.craft-assist > span:not(.raster-surface) { font-size:13px; }
.craft-assist-state { font-size:12px; color:#ebd4aa; }
.craft-assist:disabled .craft-assist-state { color:#6a5539; }
.craft-assist[aria-pressed="true"] { outline:2px solid #35634c; outline-offset:1px; }
.craft-storage-note { font-size:12px; color:#746044; margin-top:10px!important; }
.craft-storage-note.is-warning { color:#963d2b; }
body.reduced-motion .craft-cell { transition:none; }
@media (prefers-reduced-motion:reduce) { .craft-cell { transition:none; } }
@media (max-width:720px) {
  .craft-overlay { padding:10px; }
  .craft-workbook { padding:19px 18px; }
  .craft-header { gap:12px; padding-bottom:12px; }
  .craft-heading h2 { font-size:27px; }
  .craft-heading > p:last-child { font-size:13px; max-width:220px; }
  .craft-close { font-size:13px; padding:8px 10px; }
  .craft-content { display:flex; flex-direction:column; gap:16px; padding:15px 0; }
  .craft-sidebar { padding:0 0 14px; border-right:0; border-bottom:1px solid #bb9f71; }
  .craft-course-summary { display:list-item; cursor:pointer; padding:3px 0; color:#654d32; font-size:15px; }
  .craft-course-index[open] .craft-course-summary { margin-bottom:12px; }
  .craft-course-summary:focus-visible { outline:2px solid #345f50; outline-offset:3px; }
  .craft-syllabus-heading { margin-bottom:7px; }
  .craft-courses { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .craft-courses h4 { grid-column:1 / -1; font-size:17px; margin-top:3px; }
  .craft-course { min-height:58px; padding:8px; grid-template-columns:29px minmax(0,1fr); gap:2px 4px; }
  .craft-course strong { font-size:14px; }
  .craft-course-record { font-size:11px; }
  .craft-side-note { margin-top:8px!important; font-size:12px; }
  .craft-level-heading h3 { font-size:21px; }
  .craft-assist-heading { align-items:flex-start; flex-direction:column; gap:2px; }
  .craft-assists { grid-template-columns:1fr; gap:7px; }
  .craft-assist { display:grid; grid-template-columns:64px minmax(0,1fr); min-height:62px; gap:2px 10px; }
  .craft-assist strong { grid-row:span 2; align-self:center; }
  .craft-assist-state { grid-column:2; }
  .craft-unlock { flex-direction:column; align-items:flex-start; }
}
@media (max-width:390px) {
  .craft-workbook { padding:16px 12px; }
  .craft-tools { gap:7px; }
  .craft-tool { gap:7px; padding:9px 7px; }
  .craft-tool-art { width:24px; height:24px; }
  .craft-tool small { font-size:11px; }
  .craft-cell { min-height:53px; }
  .craft-cell-symbol { font-size:20px; }
  .craft-grid { gap:5px; padding:7px; }
}
