:root{--primary: #1f4e79;--primary-dark: #163a5a;--border: #dde3ea;--surface: #ffffff;--surface-muted: #f5f7fa;--text-main: #142030;--text-muted: #5a6878;--shadow-soft: 0 10px 28px rgba(22,58,90,.08);--dmk-amber: #c26a0a;--dmk-amber-soft: #fdf1e3;--dmk-green: #2e7d4f;--dmk-green-soft: #e7f4ec;--dmk-red: #b42318;--dmk-red-soft: #fdecea;--dmk-radius: 14px;}
.dmk-byline{display: flex;flex-wrap: wrap;justify-content: space-between;gap: 6px 16px;margin: 0 0 22px;padding: 10px 0;border-top: 1px solid var(--border);border-bottom: 1px solid var(--border);font-size: 13px;color: var(--text-muted);}
.dmk-byline a{color: var(--primary-dark);font-weight: 600;text-decoration: none;}
.dmk-byline a:hover{text-decoration: underline;}
.dmk-tool{display: grid;grid-template-columns: minmax(0, 1fr);gap: 1.25rem;margin-bottom: 2rem;color: var(--text-main);}
@media (min-width: 992px){.dmk-tool{grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);align-items: start;}.dmk-side{position: sticky;top: 1rem;}}
.dmk-work,.dmk-result,.dmk-history{background: var(--surface);border: 1px solid var(--border);border-radius: var(--dmk-radius);box-shadow: var(--shadow-soft);padding: 1.25rem;}
.dmk-side{display: flex;flex-direction: column;gap: 1rem;min-width: 0;}
.dmk-lbl{display: block;font-size: .8rem;font-weight: 700;letter-spacing: .04em;text-transform: uppercase;color: var(--text-muted);margin-bottom: .4rem;}
.dmk-q{width: 100%;border: 0;border-bottom: 2px solid var(--border);padding: .4rem 0 .6rem;font-size: 1.35rem;font-weight: 600;color: var(--text-main);background: transparent;}
.dmk-q:focus{outline: none;border-bottom-color: var(--primary);}
.dmk-bar{display: flex;flex-wrap: wrap;justify-content: space-between;align-items: center;gap: .75rem;margin: 1.1rem 0 .5rem;}
.dmk-modes{display: inline-flex;flex-wrap: wrap;gap: 3px;padding: 3px;border: 1px solid var(--border);border-radius: 12px;background: var(--surface-muted);}
.dmk-mode{border: 0;background: transparent;padding: .5rem .9rem;border-radius: 9px;font-size: .88rem;font-weight: 600;color: var(--text-muted);cursor: pointer;}
.dmk-mode:hover{color: var(--text-main);}
.dmk-mode.is-on{background: var(--surface);color: var(--primary-dark);box-shadow: 0 1px 4px rgba(20,32,48,.12);}
.dmk-bar-tools{display: flex;gap: .5rem;}
.dmk-ghost{border: 1px solid var(--border);background: var(--surface);color: var(--primary-dark);padding: .45rem .85rem;border-radius: 9px;font-size: .85rem;font-weight: 600;cursor: pointer;}
.dmk-ghost:hover{border-color: var(--primary);background: var(--surface-muted);}
.dmk-btn{border: 0;background: var(--primary);color: #ffffff;padding: .55rem 1rem;border-radius: 9px;font-size: .9rem;font-weight: 700;cursor: pointer;}
.dmk-btn:hover{background: var(--primary-dark);}
.dmk-btn:focus-visible,.dmk-ghost:focus-visible,.dmk-mode:focus-visible,.dmk-add:focus-visible,.dmk-x:focus-visible{outline: 3px solid rgba(31,78,121,.35);outline-offset: 2px;}
.dmk-block{padding-top: 1rem;margin-top: 1rem;border-top: 1px dashed var(--border);}
.dmk-block-head{display: flex;justify-content: space-between;align-items: baseline;gap: .5rem;margin-bottom: .5rem;}
.dmk-block-head h2,.dmk-flip h2{font-size: 1.05rem;font-weight: 700;margin: 0;color: var(--text-main);}
.dmk-hint{font-size: .75rem;color: var(--text-muted);white-space: nowrap;}
.dmk-note{font-size: .85rem;color: var(--text-muted);margin: 0 0 .75rem;}
.dmk-rows{display: flex;flex-direction: column;gap: .5rem;}
.dmk-row{display: flex;align-items: center;gap: .5rem;}
.dmk-row-key{flex: 0 0 1.75rem;height: 1.75rem;border-radius: 50%;background: var(--surface-muted);border: 1px solid var(--border);display: flex;align-items: center;justify-content: center;font-size: .75rem;font-weight: 700;color: var(--primary-dark);}
.dmk-in,.dmk-sel{border: 1px solid var(--border);border-radius: 9px;padding: .5rem .7rem;font-size: .95rem;color: var(--text-main);background: var(--surface);min-width: 0;}
.dmk-in{flex: 1 1 auto;width: 100%;}
.dmk-sel{flex: 0 0 auto;}
.dmk-in:focus,.dmk-sel:focus{outline: none;border-color: var(--primary);box-shadow: 0 0 0 3px rgba(31,78,121,.15);}
.dmk-x{flex: 0 0 2.2rem;height: 2.2rem;border: 1px solid var(--border);border-radius: 9px;background: var(--surface);color: var(--dmk-red);font-size: 1.1rem;line-height: 1;cursor: pointer;}
.dmk-x:hover{background: var(--dmk-red-soft);}
.dmk-x:disabled{opacity: .35;cursor: not-allowed;}
.dmk-add{margin-top: .6rem;border: 1px dashed var(--border);background: transparent;color: var(--primary);padding: .45rem .8rem;border-radius: 9px;font-size: .85rem;font-weight: 600;cursor: pointer;}
.dmk-add:hover{border-style: solid;background: var(--surface-muted);}
.dmk-add:disabled{opacity: .45;cursor: not-allowed;}
.dmk-matrix-wrap{overflow-x: auto;border: 1px solid var(--border);border-radius: 10px;}
.dmk-matrix{width: 100%;border-collapse: collapse;font-size: .88rem;}
.dmk-matrix th,.dmk-matrix td{padding: .45rem .5rem;border-bottom: 1px solid var(--border);text-align: center;}
.dmk-matrix thead th{background: var(--surface-muted);font-weight: 700;color: var(--text-main);vertical-align: bottom;}
.dmk-matrix thead small{display: block;font-weight: 600;color: var(--dmk-amber);}
.dmk-matrix tbody th{text-align: left;font-weight: 600;position: sticky;left: 0;background: var(--surface);min-width: 8rem;overflow-wrap: anywhere;}
.dmk-matrix tbody tr:last-child th,.dmk-matrix tbody tr:last-child td{border-bottom: 0;}
.dmk-cell{width: 3.4rem;border: 1px solid var(--border);border-radius: 7px;padding: .35rem .2rem;text-align: center;font-size: .95rem;font-weight: 600;color: var(--text-main);}
.dmk-cell:focus{outline: none;border-color: var(--primary);box-shadow: 0 0 0 3px rgba(31,78,121,.15);}
.dmk-cell:placeholder-shown{background: var(--dmk-amber-soft);}
.dmk-empty{padding: 1rem;font-size: .88rem;color: var(--text-muted);text-align: center;}
.dmk-pc{display: grid;grid-template-columns: minmax(0, 1fr);gap: .75rem;}
@media (min-width: 768px){.dmk-pc{grid-template-columns: repeat(2, minmax(0, 1fr));}}
.dmk-pc-card{border: 1px solid var(--border);border-radius: 10px;padding: .75rem;background: var(--surface-muted);}
.dmk-pc-card h3{font-size: .95rem;font-weight: 700;margin: 0 0 .5rem;overflow-wrap: anywhere;}
.dmk-pc-lines{display: flex;flex-direction: column;gap: .4rem;}
.dmk-pc-line{display: flex;gap: .35rem;align-items: center;}
.dmk-pc-line .dmk-in{font-size: .88rem;padding: .4rem .55rem;}
.dmk-pc-line .dmk-sel{font-size: .82rem;padding: .4rem .3rem;}
.dmk-pc-line .dmk-x{flex-basis: 2rem;height: 2rem;}
.dmk-pc-line.is-pro .dmk-in{border-left: 3px solid var(--dmk-green);}
.dmk-pc-line.is-con .dmk-in{border-left: 3px solid var(--dmk-red);}
.dmk-pc-adds{display: flex;gap: .4rem;margin-top: .5rem;}
.dmk-pc-adds .dmk-add{margin: 0;}
.dmk-flip{text-align: center;}
.dmk-flip .dmk-note{margin-top: .35rem;}
.dmk-flip-out{margin-top: 1rem;}
.dmk-coin{display: inline-flex;align-items: center;justify-content: center;width: 5.5rem;height: 5.5rem;border-radius: 50%;background: radial-gradient(circle at 35% 30%, #f6d48b, #c58a1c);color: #4a3205;font-weight: 800;font-size: 1.6rem;box-shadow: inset 0 -4px 0 rgba(0,0,0,.15), 0 6px 16px rgba(197,138,28,.35);margin-bottom: .75rem;}
.dmk-coin.is-spin{animation: dmk-spin .6s ease-out;}
@keyframes dmk-spin{0%{transform: rotateY(0) scale(.8);}100%{transform: rotateY(1080deg) scale(1);}}
@media (prefers-reduced-motion: reduce){.dmk-coin.is-spin{animation: none;}}
.dmk-flip-pick{font-size: 1.15rem;font-weight: 700;margin: 0 0 .75rem;overflow-wrap: anywhere;}
.dmk-flip-ask{font-size: .9rem;color: var(--text-muted);margin: .75rem 0 .5rem;}
.dmk-chips{display: flex;flex-wrap: wrap;justify-content: center;gap: .4rem;}
.dmk-chip{border: 1px solid var(--border);background: var(--surface);border-radius: 999px;padding: .4rem .85rem;font-size: .85rem;font-weight: 600;color: var(--text-main);cursor: pointer;}
.dmk-chip:hover{border-color: var(--primary);}
.dmk-chip.is-on{background: var(--primary);border-color: var(--primary);color: #ffffff;}
.dmk-result-head{display: flex;justify-content: space-between;align-items: center;gap: .5rem;margin-bottom: .75rem;}
.dmk-result-head h2,.dmk-history h2{font-size: 1.05rem;font-weight: 700;margin: 0;}
.dmk-tag{font-size: .72rem;font-weight: 700;text-transform: uppercase;letter-spacing: .05em;color: var(--primary-dark);background: var(--surface-muted);border: 1px solid var(--border);border-radius: 999px;padding: .2rem .6rem;}
.dmk-verdict{border-radius: 10px;padding: .7rem .85rem;margin-bottom: .9rem;font-size: .9rem;line-height: 1.45;}
.dmk-verdict strong{display: block;font-size: 1rem;margin-bottom: .15rem;}
.dmk-verdict--clear{background: var(--dmk-green-soft);color: #1d5636;}
.dmk-verdict--lean{background: var(--dmk-amber-soft);color: #7a4306;}
.dmk-verdict--close{background: var(--dmk-red-soft);color: #8a1c13;}
.dmk-verdict--none{background: var(--surface-muted);color: var(--text-muted);}
.dmk-rank{list-style: none;margin: 0;padding: 0;display: flex;flex-direction: column;gap: .6rem;}
.dmk-rank li{display: grid;grid-template-columns: 1.5rem minmax(0, 1fr) auto;gap: .15rem .5rem;align-items: center;}
.dmk-rank-pos{font-weight: 800;color: var(--text-muted);font-size: .85rem;}
.dmk-rank-name{font-weight: 600;font-size: .92rem;overflow-wrap: anywhere;}
.dmk-rank-val{font-weight: 700;font-size: .9rem;font-variant-numeric: tabular-nums;}
.dmk-rank-bar{grid-column: 2 / 4;height: 8px;border-radius: 99px;background: var(--surface-muted);overflow: hidden;}
.dmk-rank-bar span{display: block;height: 100%;border-radius: 99px;background: var(--primary);transition: width .25s;}
.dmk-rank li:first-child .dmk-rank-bar span{background: var(--dmk-amber);}
.dmk-rank-sub{grid-column: 2 / 4;font-size: .75rem;color: var(--text-muted);}
.dmk-swing{margin-top: 1rem;padding-top: .85rem;border-top: 1px dashed var(--border);font-size: .85rem;}
.dmk-swing h3{font-size: .85rem;font-weight: 700;text-transform: uppercase;letter-spacing: .04em;color: var(--text-muted);margin: 0 0 .4rem;}
.dmk-swing ul{margin: 0;padding-left: 1.1rem;}
.dmk-swing li{margin-bottom: .25rem;}
.dmk-swing p{margin: 0;}
.dmk-warn{margin-top: .75rem;font-size: .8rem;color: var(--dmk-amber);font-weight: 600;}
.dmk-actions{display: flex;flex-wrap: wrap;gap: .5rem;margin-top: 1rem;padding-top: 1rem;border-top: 1px solid var(--border);}
.dmk-hist-list{display: flex;flex-direction: column;gap: .5rem;max-height: 260px;overflow-y: auto;margin-top: .6rem;}
.dmk-hist-item{display: flex;justify-content: space-between;align-items: center;gap: .5rem;border: 1px solid var(--border);border-radius: 10px;padding: .55rem .7rem;}
.dmk-hist-item h3{font-size: .88rem;font-weight: 600;margin: 0;overflow-wrap: anywhere;}
.dmk-hist-meta{font-size: .75rem;color: var(--text-muted);margin: .1rem 0 0;}
.dmk-hist-btns{display: flex;gap: .3rem;flex-shrink: 0;}
.dmk-hist-btns button{border: 1px solid var(--border);background: var(--surface);border-radius: 7px;padding: .25rem .5rem;font-size: .75rem;font-weight: 600;cursor: pointer;color: var(--primary-dark);}
.dmk-hist-btns button[data-act="del-hist"]{color: var(--dmk-red);}
.dmk-hist-none{font-size: .85rem;color: var(--text-muted);margin: .5rem 0 0;}
.dmk-toast{position: fixed;left: 50%;bottom: 1.25rem;transform: translate(-50%, 1rem);background: var(--text-main);color: #ffffff;padding: .6rem 1rem;border-radius: 10px;font-size: .88rem;opacity: 0;pointer-events: none;transition: opacity .2s, transform .2s;z-index: 1000;}
.dmk-toast.is-on{opacity: 1;transform: translate(-50%, 0);}
.dmk-article{margin: 0 auto 2rem;color: var(--text-main);line-height: 1.7;}
.dmk-sec{margin-bottom: 2.25rem;}
.dmk-sec h2{font-size: 1.45rem;font-weight: 700;margin: 0 0 .75rem;}
.dmk-sec p,.dmk-sec li{font-size: 1rem;}
.dmk-code{background: #142030;color: #e6edf5;border-radius: 10px;padding: .9rem 1rem;font-size: .9rem;overflow-x: auto;margin: 0 0 1rem;}
.dmk-code code{color: inherit;background: none;}
.dmk-table-wrap{overflow-x: auto;margin: 0 0 1rem;border: 1px solid var(--border);border-radius: 10px;}
.dmk-table{width: 100%;border-collapse: collapse;font-size: .9rem;}
.dmk-table caption{caption-side: bottom;font-size: .8rem;color: var(--text-muted);padding: .5rem .75rem;}
.dmk-table th,.dmk-table td{padding: .55rem .6rem;border-bottom: 1px solid var(--border);text-align: center;}
.dmk-table thead th{background: var(--surface-muted);vertical-align: bottom;}
.dmk-table thead small{color: var(--dmk-amber);font-weight: 700;}
.dmk-table tbody th{text-align: left;font-weight: 600;}
.dmk-table tbody tr:last-child th,.dmk-table tbody tr:last-child td{border-bottom: 0;}
.dmk-bands{list-style: none;padding: 0;margin: 0;display: flex;flex-direction: column;gap: .5rem;}
.dmk-band{display: inline-block;min-width: 9.5rem;font-size: .8rem;font-weight: 700;border-radius: 999px;padding: .2rem .7rem;margin-right: .5rem;}
.dmk-band--clear{background: var(--dmk-green-soft);color: #1d5636;}
.dmk-band--lean{background: var(--dmk-amber-soft);color: #7a4306;}
.dmk-band--close{background: var(--dmk-red-soft);color: #8a1c13;}
.dmk-steps{padding-left: 1.25rem;}
.dmk-steps li{margin-bottom: .6rem;}
.dmk-sec--limits{background: var(--surface-muted);border: 1px solid var(--border);border-radius: var(--dmk-radius);padding: 1.25rem 1.5rem;}
.dmk-sec--limits ul{margin-bottom: .75rem;}
.dmk-closing{display: grid;grid-template-columns: minmax(0, 1fr);gap: 1.25rem;align-items: start;margin-top: 1rem;}
.dmk-closing > section{margin: 0;min-width: 0;}
@media (min-width: 992px){.dmk-closing{grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);}}
@media (max-width: 575px){.dmk-q{font-size: 1.1rem;}.dmk-bar{flex-direction: column;align-items: stretch;}.dmk-modes{display: flex;}.dmk-mode{flex: 1 1 auto;padding: .5rem .5rem;}.dmk-bar-tools{justify-content: flex-end;}.dmk-band{display: block;margin: 0 0 .2rem;min-width: 0;width: max-content;}}