/* ====================================================================
   Configuration Studio — page styles.
   Uses the global design tokens from styles.css (--bone, --sumi, --akane,
   --display, --serif, --mono, --rule, --gutter, --content-max, ...). Square
   corners, crimson primary action, mono editorial labels: the Resonic house
   style, and a sibling to screen-studio.css.
   ==================================================================== */

.page-configuration-studio {
  background: var(--bone);
  color: var(--sumi);
}

.cs-shell {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 88px) var(--gutter) clamp(64px, 12vh, 140px);
}

/* --- brand / header --- */
.cs-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--sumi);
  text-decoration: none;
  transition: opacity 0.25s ease;
}
.cs-brand:hover {
  opacity: 0.7;
}
.cs-brand__mark {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}
.cs-brand__txt {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.cs-brand__name {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 20px;
}
.cs-brand__sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pencil);
}

/* --- intro --- */
.cs-intro {
  margin-top: clamp(32px, 6vh, 56px);
}
.cs-intro .eyebrow {
  margin-bottom: 18px;
}
.cs-title {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.cs-lede {
  margin: 14px 0 0;
  max-width: 52ch;
  font-family: var(--serif);
  font-size: var(--fs-lede, 21px);
  color: var(--sumi-soft);
}

/* --- panels --- */
.cs-panel {
  margin-top: clamp(32px, 5vh, 48px);
  padding-top: clamp(28px, 4vh, 40px);
  border-top: 0.5px solid var(--rule-soft);
}
.cs-panel__label {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--akane);
}
.cs-helptext {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--pencil);
}

/* --- model picker --- */
.cs-models {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 720px) {
  .cs-models {
    grid-template-columns: repeat(2, 1fr);
  }
}
.cs-model {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: left;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  background: rgba(244, 238, 224, 0.4);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease,
    transform 0.15s ease;
}
.cs-model:hover:not(:disabled) {
  border-color: var(--akane);
  transform: translateY(-2px);
}
.cs-model:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cs-model.is-active {
  border-color: var(--akane);
  background: linear-gradient(
    135deg,
    rgba(244, 238, 224, 0.5) 60%,
    rgba(179, 36, 25, 0.06) 100%
  );
  box-shadow: inset 3px 0 0 0 var(--akane);
}
.cs-model__img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  object-position: center;
  margin-bottom: 12px;
  filter: drop-shadow(0 3px 6px rgba(20, 17, 13, 0.18));
}
@media (max-width: 720px) {
  .cs-model__img {
    height: 120px;
  }
}
.cs-model__name {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.05;
  color: var(--sumi);
}
.cs-model__sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pencil);
}

/* --- buttons (mirrors screen-studio .ss-btn) --- */
.cs-btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 18px 32px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--sumi);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.cs-btn:hover:not(:disabled) {
  border-color: var(--akane);
  color: var(--akane);
}
.cs-btn--primary {
  border-color: var(--akane);
  background: var(--akane);
  color: var(--bone);
  box-shadow: 0 8px 22px -8px rgba(179, 36, 25, 0.45);
}
.cs-btn--primary:hover:not(:disabled) {
  background: var(--akane-deep);
  border-color: var(--akane-deep);
  color: var(--bone);
}
.cs-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
@keyframes cs-btn-pulse {
  0%,
  100% {
    box-shadow: 0 8px 22px -8px rgba(179, 36, 25, 0.45),
      0 0 0 0 rgba(179, 36, 25, 0.55);
  }
  50% {
    box-shadow: 0 8px 22px -8px rgba(179, 36, 25, 0.45),
      0 0 0 14px rgba(179, 36, 25, 0);
  }
}
.cs-btn--pulse:not(:disabled) {
  animation: cs-btn-pulse 1.6s ease-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .cs-btn--pulse {
    animation: none;
  }
}
.cs-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

/* --- connection indicator --- */
.cs-conn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rule);
  box-shadow: 0 0 0 3px rgba(20, 17, 13, 0.05);
}
.cs-conn-dot.is-on {
  background: var(--akane);
  box-shadow: 0 0 0 3px rgba(179, 36, 25, 0.18);
}
.cs-conn-state {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sumi-soft);
}

/* --- status + note lines --- */
.cs-status {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--sumi-soft);
}
.cs-status--error {
  color: var(--akane);
}
.cs-status--good {
  color: var(--sumi);
}
.cs-note {
  margin: 12px 0 0;
  max-width: 60ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.55;
  color: var(--pencil);
}

/* --- the board --- */
.cs-board-scroll {
  overflow-x: auto;
  padding: 8px 0 16px;
  /* faint baseline so the board sits on a "desk" */
  margin-top: 4px;
}
.cs-board {
  position: relative;
  /* size set inline from the parsed layout (in px) */
}
.cs-cap {
  position: absolute;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 5px 6px;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f6f0e2 0%, #ece1cb 100%);
  box-shadow: 0 1px 0 rgba(20, 17, 13, 0.1);
  transition: background 0.06s ease, border-color 0.06s ease,
    box-shadow 0.06s ease, transform 0.06s ease;
  overflow: hidden;
}
.cs-cap__label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--pencil);
  user-select: none;
}
.cs-cap.is-unmapped {
  background: repeating-linear-gradient(
    45deg,
    #efe7d6,
    #efe7d6 5px,
    #e8dec8 5px,
    #e8dec8 10px
  );
}
.cs-cap.is-unmapped .cs-cap__label {
  opacity: 0.45;
}
/* KEY TESTER highlight — a pressed switch. */
.cs-cap.is-down {
  background: linear-gradient(180deg, #c33024 0%, var(--akane) 100%);
  border-color: var(--akane-deep);
  box-shadow: 0 0 0 1px var(--akane-deep),
    0 6px 16px -4px rgba(179, 36, 25, 0.55);
  transform: translateY(1px);
}
.cs-cap.is-down .cs-cap__label {
  color: var(--bone);
  opacity: 0.92;
}
@media (prefers-reduced-motion: reduce) {
  .cs-cap {
    transition: none;
  }
}

/* --- legend --- */
.cs-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--pencil);
}
.cs-legend__chip {
  display: inline-block;
  width: 16px;
  height: 12px;
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.cs-legend__chip--key {
  background: linear-gradient(180deg, #f6f0e2 0%, #ece1cb 100%);
}
.cs-legend__chip--down {
  background: var(--akane);
  border-color: var(--akane-deep);
}
.cs-legend__sep {
  width: 1px;
  height: 12px;
  background: var(--rule);
  margin: 0 6px;
}

/* --- unsupported-browser gate --- */
.cs-gate {
  margin-top: clamp(40px, 7vh, 72px);
  padding: clamp(28px, 5vh, 48px);
  border: 1px solid var(--rule);
  background: rgba(244, 238, 224, 0.4);
  max-width: 60ch;
}
.cs-gate__kanji {
  margin: 0 0 12px;
  font-family: var(--jp);
  font-size: 56px;
  line-height: 1;
  color: var(--akane);
  opacity: 0.85;
}
.cs-gate__title {
  margin: 0 0 14px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.1;
  color: var(--sumi);
}
.cs-gate__body {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--sumi-soft);
}
.cs-gate__body:last-child {
  margin-bottom: 0;
}
.cs-gate__body em {
  font-style: italic;
  color: var(--sumi);
}
.cs-gate__body strong {
  font-weight: 600;
  color: var(--sumi);
}
.cs-gate__body a {
  color: var(--akane);
  text-decoration: none;
  border-bottom: 1px solid rgba(179, 36, 25, 0.3);
}
.cs-gate__body a:hover {
  border-bottom-color: var(--akane);
}

/* --- footer --- */
.cs-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: clamp(48px, 9vh, 96px);
  padding-top: 24px;
  border-top: 0.5px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.cs-foot a {
  color: var(--pencil);
  text-decoration: none;
  transition: color 0.2s ease;
}
.cs-foot a:hover {
  color: var(--akane);
}

/* ====================================================================
   PHASE 2 — remap: mode toggle, layer tabs, clickable caps, keycode picker
   ==================================================================== */

/* --- mode toggle + layer tabs --- */
.cs-modebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.cs-modetoggle {
  display: inline-flex;
  border: 1px solid var(--rule);
}
.cs-modetoggle button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 18px;
  background: transparent;
  color: var(--sumi-soft);
  border: none;
  border-right: 1px solid var(--rule);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.cs-modetoggle button:last-child {
  border-right: none;
}
.cs-modetoggle button:hover:not(.is-on) {
  color: var(--akane);
}
.cs-modetoggle button.is-on {
  background: var(--akane);
  color: var(--bone);
}
.cs-layers {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cs-layers__lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pencil);
}
.cs-layer {
  min-width: 30px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--sumi);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.cs-layer:hover:not(.is-on) {
  border-color: var(--akane);
}
.cs-layer.is-on {
  background: var(--akane);
  color: var(--bone);
  border-color: var(--akane);
}

/* --- clickable caps (remap mode) --- */
button.cs-cap {
  font: inherit;
  margin: 0;
  color: inherit;
}
.cs-cap.is-clickable {
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cs-cap.is-clickable .cs-cap__label {
  font-size: 10px;
  text-align: center;
  color: var(--sumi);
}
.cs-cap.is-clickable:hover {
  border-color: var(--akane);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -4px rgba(179, 36, 25, 0.4);
  z-index: 2;
}
.cs-cap.is-selected,
.cs-cap.is-selected:hover {
  border-color: var(--akane-deep);
  background: linear-gradient(180deg, #fff7ec 0%, #f3e7d0 100%);
  box-shadow: 0 0 0 2px var(--akane), 0 6px 16px -4px rgba(179, 36, 25, 0.5);
  transform: translateY(-1px);
  z-index: 3;
}
.cs-cap.is-selected .cs-cap__label {
  color: var(--akane-deep);
  font-weight: 700;
}

.cs-helptext--dim {
  color: var(--pencil);
  font-style: italic;
}

/* --- remap head + keycode picker --- */
.cs-remap {
  margin-top: 18px;
}
.cs-remap__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--sumi);
}
.cs-remap__head strong {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--akane);
}
.cs-remap__close {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--sumi);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cs-remap__close:hover {
  border-color: var(--akane);
  color: var(--akane);
}
.cs-picker {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--rule);
  background: rgba(244, 238, 224, 0.4);
}
.cs-picker__gname {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--akane);
}
.cs-picker__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cs-kc {
  min-width: 38px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--sumi);
  background: linear-gradient(180deg, #f6f0e2 0%, #ece1cb 100%);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.cs-kc:hover:not(:disabled) {
  border-color: var(--akane);
  color: var(--akane);
  transform: translateY(-1px);
}
.cs-kc:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- keycode picker search --- */
.cs-picker__search {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  background: var(--bone);
  color: var(--sumi);
  width: 100%;
  max-width: 260px;
}
.cs-picker__search:focus {
  outline: none;
  border-color: var(--akane);
}
.cs-picker__search::placeholder {
  color: var(--pencil);
  opacity: 0.7;
}
.cs-picker__empty {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--pencil);
}

/* ====================================================================
   PHASE 3 — macros: slot list, buffer meter, step editor, preview
   ==================================================================== */

.cs-macro {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 24px;
  margin-top: 4px;
  align-items: start;
}
@media (max-width: 720px) {
  .cs-macro {
    grid-template-columns: 1fr;
  }
}

/* --- left rail: slot list --- */
.cs-macro-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--rule);
  background: rgba(244, 238, 224, 0.4);
  padding: 8px;
}
.cs-macro-slot {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cs-macro-slot:hover:not(.is-on) {
  background: rgba(20, 17, 13, 0.04);
}
.cs-macro-slot.is-on {
  background: linear-gradient(
    90deg,
    rgba(179, 36, 25, 0.08) 0%,
    rgba(179, 36, 25, 0) 100%
  );
  border-left-color: var(--akane);
}
.cs-macro-slot__id {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--sumi);
}
.cs-macro-slot.is-on .cs-macro-slot__id {
  color: var(--akane);
}
.cs-macro-slot__preview {
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.3;
  color: var(--pencil);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-macro-slot__preview.is-empty {
  font-style: italic;
  opacity: 0.6;
}

/* --- buffer-usage meter --- */
.cs-macro-meter {
  margin-top: 10px;
  padding: 10px 12px 4px;
  border-top: 0.5px solid var(--rule-soft);
}
.cs-macro-meter__track {
  height: 2px;
  background: var(--rule-soft);
  overflow: hidden;
}
.cs-macro-meter__fill {
  height: 100%;
  background: var(--akane);
  opacity: 0.55;
  transition: width 0.2s ease;
}
.cs-macro-meter.is-over .cs-macro-meter__fill {
  opacity: 1;
}
.cs-macro-meter__label {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--pencil);
}
.cs-macro-meter.is-over .cs-macro-meter__label {
  color: var(--akane);
}
.cs-macro-meter__warn {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  line-height: 1.4;
  color: var(--akane);
}

/* --- right column: step editor --- */
.cs-macro-editor {
  min-width: 0;
}
.cs-macro-editor__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.cs-macro-editor__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--sumi);
}
.cs-macro-editor__title strong {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--akane);
}

.cs-macro-steps {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid var(--rule);
}
.cs-macro-step {
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--rule-soft);
  background: rgba(244, 238, 224, 0.3);
}
.cs-macro-step:last-child {
  border-bottom: none;
}
.cs-macro-step__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.cs-macro-step__tag {
  min-width: 56px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--akane);
}
.cs-macro-step__text {
  flex: 1 1 160px;
  min-width: 120px;
  font-family: var(--serif);
  font-size: 15px;
  padding: 7px 10px;
  border: 1px solid var(--rule);
  background: var(--bone);
  color: var(--sumi);
}
.cs-macro-step__text:focus {
  outline: none;
  border-color: var(--akane);
}
.cs-macro-step__kc {
  min-width: 56px;
}
.cs-macro-step__delay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cs-macro-step__num {
  width: 76px;
  font-family: var(--mono);
  font-size: 13px;
  padding: 7px 8px;
  border: 1px solid var(--rule);
  background: var(--bone);
  color: var(--sumi);
}
.cs-macro-step__num:focus {
  outline: none;
  border-color: var(--akane);
}
.cs-macro-step__num:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cs-macro-step__unit {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--pencil);
}
.cs-macro-step__ctrls {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}
.cs-macro-step__btn {
  width: 28px;
  height: 28px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--sumi);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cs-macro-step__btn:hover:not(:disabled) {
  border-color: var(--akane);
  color: var(--akane);
}
.cs-macro-step__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.cs-macro-step__btn--rm:hover:not(:disabled) {
  border-color: var(--akane);
  color: var(--bone);
  background: var(--akane);
}
.cs-macro-step__note {
  margin-top: 8px;
}
.cs-macro-step__picker {
  margin-top: 10px;
}

/* --- add-step bar --- */
.cs-macro-addbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.cs-macro-add {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 14px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--sumi-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cs-macro-add:hover:not(:disabled) {
  border-color: var(--akane);
  color: var(--akane);
}
.cs-macro-add:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cs-macro-add--cancel {
  color: var(--pencil);
}

/* --- preview + byte view --- */
.cs-macro-preview {
  padding: 12px 14px;
  border: 1px solid var(--rule);
  background: rgba(244, 238, 224, 0.4);
  margin-bottom: 16px;
}
.cs-macro-preview__line {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--sumi);
  word-break: break-word;
}
.cs-macro-preview__toggle {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--pencil);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.cs-macro-preview__toggle:hover {
  color: var(--akane);
  border-bottom-color: var(--akane);
}
.cs-macro-bytes {
  margin: 10px 0 0;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: var(--pencil);
  background: rgba(20, 17, 13, 0.04);
  white-space: pre-wrap;
  word-break: break-all;
}

/* --- footer actions --- */
.cs-macro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.cs-macro-actions .cs-btn {
  padding: 12px 22px;
}
.cs-macro-confirm {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.cs-macro-confirm__q {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--akane);
}
