/* ============================================================
   Mac Usta · i2c.css — I²C tezgâhı (sealed)
   IMSProg ilhamlı layout — toolbar + sol parametre/oto + sağ hex.
   ============================================================ */

.i2c-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  margin-bottom: 12px;
}

.i2c-tool {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font: 14px/1 inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, transform 80ms, border-color 120ms, box-shadow 120ms;
  box-shadow: 0 1px 0 rgba(14,27,48,.04);
}
.i2c-tool:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 0 2px 8px rgba(14,27,48,.18);
}
.i2c-tool:active { transform: translateY(1px); }
.i2c-tool[disabled] { opacity: 0.45; cursor: not-allowed; }
.i2c-tool-ico { font-size: 17px; opacity: 0.9; }
.i2c-tool-lbl { letter-spacing: 0.02em; font-weight: 500; }

.i2c-tool-sep {
  width: 1px; height: 26px;
  background: var(--rule);
  margin: 0 6px;
}
.i2c-tool-spacer { flex: 1; }

.i2c-status {
  font: 12px/1 var(--font-mono, ui-monospace, monospace);
  color: var(--muted);
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.i2c-status em { font-style: normal; color: var(--ink); }
.i2c-status.online em { color: #1f9d55; }

.i2c-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 14px;
  align-items: start;
}

/* ----- sol panel ---------------------------------------- */
.i2c-side {
  display: flex; flex-direction: column; gap: 12px;
}
.i2c-side .panel { padding: 14px; }

.i2c-field {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.i2c-field label {
  font: 12px/1 inherit;
  color: var(--muted);
}
.i2c-field select {
  width: 100%;
  padding: 5px 8px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font: 13px/1.2 var(--font-mono, ui-monospace, monospace);
}
.i2c-field select:focus { outline: 1px solid var(--ink); }

.i2c-check {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
  font: 13px/1.2 inherit;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.i2c-check input { accent-color: #1f9d55; }

.i2c-go { width: 100%; padding: 9px 14px; font-weight: 600; }

.i2c-scan-strip { padding: 12px 14px; }
.i2c-scan-strip .panel-head { margin-bottom: 8px; }
.i2c-scan-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 3px;
  font: 11px/1 var(--font-mono, ui-monospace, monospace);
}
@media (max-width: 980px) {
  .i2c-scan-grid { grid-template-columns: repeat(8, 1fr); }
}
.i2c-scan-cell {
  text-align: center;
  padding: 5px 0;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--muted);
}
.i2c-scan-cell.hit {
  background: #1f9d55;
  border-color: #1f9d55;
  color: #fff;
  font-weight: 600;
}
.i2c-scan-cell.reserved { opacity: 0.4; }

/* ----- sağ hex editör (IMSProg-stili tablo) ----------------- */
.i2c-main {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 480px;
  min-width: 0;        /* grid içinde taşmayı engeller */
}

.i2c-hex {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font: 12.5px/1.5 var(--font-mono, ui-monospace, monospace);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 64vh;
}
/* her satır: 88px addr + 16 byte hücresi + 1 ascii alanı */
.i2c-hex-head,
.i2c-hex-row {
  display: grid;
  grid-template-columns: 88px repeat(16, minmax(26px, 1fr)) minmax(140px, 200px);
  align-items: stretch;
}
.i2c-hex-head {
  background: var(--paper-2);
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: sticky; top: 0; z-index: 2;
}
.i2c-hex-head > * {
  padding: 8px 0;
  text-align: center;
  border-right: 1px solid var(--rule);
}
.i2c-hex-head > *:last-child { border-right: 0; }
.i2c-hex-body {
  overflow: auto;
  flex: 1 1 auto;
}
.i2c-hex-row {
  border-bottom: 1px solid rgba(14, 27, 48, .04);
}
.i2c-hex-row:hover { background: var(--paper-2); }
.i2c-hex-row > * {
  padding: 4px 2px;
  text-align: center;
  border-right: 1px solid rgba(14, 27, 48, .05);
}
.i2c-hex-row > *:last-child { border-right: 0; }
.i2c-hex-addr {
  color: var(--ink-mute);
  font-weight: 500;
  background: var(--paper-2);
}
.i2c-hex-cell.nul { color: rgba(14, 27, 48, .25); }
.i2c-hex-cell.ff  { color: rgba(14, 27, 48, .25); }
.i2c-hex-cell.mod { color: #c47600; font-weight: 600; }
.i2c-hex-ascii {
  text-align: left;
  padding-left: 10px;
  color: var(--ink-mute);
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}
.i2c-hex-empty {
  padding: 60px 0;
  text-align: center;
  color: var(--ink-mute);
}

.i2c-statusbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font: 12px/1 var(--font-mono, ui-monospace, monospace);
  color: var(--muted);
}
.i2c-stat em { font-style: normal; color: var(--ink); margin-left: 4px; }
.i2c-stat-grow {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  justify-content: flex-end;
}
.i2c-statusbar progress {
  width: 220px; height: 8px;
  appearance: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
}
.i2c-statusbar progress::-webkit-progress-bar { background: var(--paper); }
.i2c-statusbar progress::-webkit-progress-value { background: #1f9d55; transition: width 200ms; }
.i2c-statusbar progress::-moz-progress-bar { background: #1f9d55; }

@media (max-width: 980px) {
  .i2c-workspace { grid-template-columns: 1fr; }
}
