.mtg-app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 100%; }
.mtg-input-card, .mtg-panel {
  background: #121826;
  border: 1px solid #253149;
  border-radius: 12px;
  padding: 18px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.mtg-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mtg-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.mtg-chip { background: #192234; color: #cbd5e1; border: 1px solid #2e3d59; border-radius: 8px; padding: 6px 11px; font-size: 0.82rem; font-weight: 500; cursor: pointer; }
.mtg-chip:hover { border-color: #38bdf8; color: #edf2f7; }
.mtg-select { background: #192234; color: #edf2f7; border: 1px solid #2e3d59; border-radius: 8px; padding: 7px 10px; font-size: 0.86rem; max-width: 100%; }
.mtg-textarea { width: 100%; min-height: 170px; background: #0b0f17; color: #edf2f7; border: 1px solid #253149; border-radius: 10px; padding: 12px 14px; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; line-height: 1.5; resize: vertical; }
.mtg-textarea:focus { outline: none; border-color: #38bdf8; }
.mtg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.mtg-btn { background: #38bdf8; color: #0b0f17; border: none; border-radius: 9px; padding: 10px 20px; font-weight: 700; font-size: 0.94rem; cursor: pointer; }
.mtg-btn:hover { background: #7dd3fc; }
.mtg-btn:disabled { opacity: 0.55; cursor: wait; }
.mtg-btn-sec { background: transparent; color: #94a3b8; border: 1px solid #2e3d59; border-radius: 9px; padding: 9px 14px; font-size: 0.86rem; cursor: pointer; }
.mtg-status { font-size: 0.86rem; color: #94a3b8; }
.mtg-status.err { color: #f87171; }
.mtg-results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; max-width: 100%; }
.mtg-results[hidden] { display: none; }
.mtg-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.mtg-kpi { background: #121826; border: 1px solid #253149; border-radius: 12px; padding: 14px 16px; min-width: 0; }
.mtg-kpi-label { font-size: 0.78rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.mtg-kpi-val { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 1.55rem; font-weight: 700; margin-top: 4px; }
.mtg-kpi-sub { font-size: 0.78rem; color: #94a3b8; margin-top: 2px; }
.mtg-buy-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: #121826; border: 1px solid #253149; border-radius: 12px; padding: 14px 18px; min-width: 0; }
.mtg-buy-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mtg-buy-title { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700; font-size: 1rem; color: #edf2f7; }
.mtg-buy-sub { font-size: 0.84rem; color: #94a3b8; }
.mtg-buy-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mtg-buy-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 16px; border-radius: 9px; font-weight: 700; font-size: 0.88rem; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s; }
.mtg-buy-btn:hover { text-decoration: none; }
.mtg-buy-tcg { background: #38bdf8; color: #0b0f17; border: 1px solid #38bdf8; }
.mtg-buy-tcg:hover { background: #7dd3fc; border-color: #7dd3fc; }
.mtg-buy-ck { background: #192234; color: #edf2f7; border: 1px solid #38bdf8; }
.mtg-buy-ck:hover { background: #253149; }
.mtg-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mtg-panel-head h2 { margin: 0; }
.mtg-card-buy { display: flex; gap: 6px; white-space: nowrap; }
.mtg-mini-buy { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 0.76rem; font-weight: 600; background: #38bdf8; color: #0b0f17; text-decoration: none; }
.mtg-mini-buy:hover { background: #7dd3fc; text-decoration: none; }
.mtg-mini-ck { background: #192234; color: #edf2f7; border: 1px solid #2e3d59; }
.mtg-mini-ck:hover { background: #253149; border-color: #38bdf8; }
.mtg-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.mtg-panel h2 { margin: 0 0 12px; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 1.08rem; }
.mtg-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 155px; padding-top: 16px; }
.mtg-bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.mtg-bar-num { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: #cbd5e1; }
.mtg-bar-fill { width: 100%; max-width: 38px; background: linear-gradient(180deg, #38bdf8, #6366f1); border-radius: 6px 6px 2px 2px; min-height: 4px; }
.mtg-bar-lbl { font-size: 0.78rem; color: #94a3b8; font-weight: 600; }
.mtg-color-rows { display: grid; gap: 10px; }
.mtg-color-row { display: grid; grid-template-columns: 78px 1fr 115px; align-items: center; gap: 10px; font-size: 0.85rem; }
.mtg-color-track { background: #0b0f17; border-radius: 6px; height: 10px; overflow: hidden; display: flex; }
.mtg-color-pip { height: 100%; }
.mtg-color-meta { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: #cbd5e1; text-align: right; }
.mtg-hyp-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; font-size: 0.85rem; color: #cbd5e1; }
.mtg-hyp-controls input { width: 64px; background: #0b0f17; color: #edf2f7; border: 1px solid #2e3d59; border-radius: 6px; padding: 5px 8px; font-family: 'JetBrains Mono', monospace; }
.mtg-table-wrap { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mtg-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.mtg-table th, .mtg-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #1e293b; }
.mtg-table th { color: #94a3b8; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }
.mtg-mono { font-family: 'JetBrains Mono', monospace; }
.mtg-tag { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 0.74rem; background: #192234; border: 1px solid #2e3d59; color: #cbd5e1; }
.mtg-roles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
@media (max-width: 820px) {
  .mtg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtg-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .mtg-color-row { grid-template-columns: 64px 1fr; gap: 6px; }
  .mtg-color-meta { grid-column: 1 / -1; text-align: left; }
  .mtg-buy-btns { width: 100%; }
  .mtg-buy-btn { flex: 1 1 140px; }
}