/* All selectors are scoped to the plugin root. */
.lsim-storage-root[hidden] { display: none !important; }
.lsim-root {
  --lsim-ink: #162c35;
  --lsim-muted: #5d727a;
  --lsim-accent: #81f2c2;
  box-sizing: border-box;
  max-width: 1120px;
  margin: 32px auto;
  padding: clamp(18px, 4vw, 38px);
  border: 1px solid #dae5e4;
  border-radius: 22px;
  color: var(--lsim-ink);
  background: #f5f9f7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  text-align: left;
}
.lsim-root *, .lsim-root *::before, .lsim-root *::after { box-sizing: border-box; }
.lsim-root [hidden] { display: none !important; }
.lsim-root .lsim-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.lsim-root .lsim-eyebrow { color: #376455; letter-spacing: .16em; font-size: 11px; font-weight: 750; }
.lsim-root .lsim-title { margin: 7px 0 0; padding: 0; border: 0; color: var(--lsim-ink); font-size: clamp(22px, 3.4vw, 32px); line-height: 1.45; letter-spacing: -.035em; font-weight: 750; }
.lsim-root .lsim-badge { flex-shrink: 0; margin-top: 4px; padding: 4px 10px; border: 1px solid #c8dad3; border-radius: 7px; color: #4b6d60; background: #eaf3ed; font-size: 11px; font-weight: 650; }
.lsim-root .lsim-intro { margin: 12px 0 24px; color: var(--lsim-muted); max-width: 730px; font-size: 14px; }
.lsim-root .lsim-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.lsim-root .lsim-selector { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lsim-root .lsim-selector label { margin: 0; color: #435e63; font-size: 12px; font-weight: 650; }
.lsim-root .lsim-select { appearance: auto; width: auto; min-width: 126px; height: 36px; padding: 5px 10px; border: 1px solid #c9d8d4; border-radius: 7px; color: #243f41; background: #fff; font: inherit; font-size: 13px; box-shadow: none; }
.lsim-root .lsim-level { color: #61796f; font-size: 11px; }
.lsim-root button { min-height: 36px; margin: 0; border: 1px solid transparent; border-radius: 7px; padding: 6px 12px; font: inherit; font-size: 12px; font-weight: 600; line-height: 1.5; text-decoration: none; text-transform: none; letter-spacing: normal; cursor: pointer; box-shadow: none; transition: background-color .15s, border-color .15s; }
.lsim-root button:disabled, .lsim-root select:disabled { cursor: default; opacity: .48; }
.lsim-root button:focus-visible, .lsim-root input:focus-visible, .lsim-root select:focus-visible, .lsim-root summary:focus-visible { outline: 2px solid #248664; outline-offset: 3px; }
.lsim-root .lsim-reset { color: #536d63; border-color: #cedbd5; background: transparent; white-space: nowrap; }
.lsim-root .lsim-reset:hover:not(:disabled) { background: #e8f0eb; border-color: #acc9ba; }
.lsim-root .lsim-frame { overflow: hidden; border: 1px solid #293e42; border-radius: 12px; background: #101a20; box-shadow: 0 12px 32px #153b2912; }
.lsim-root .lsim-frame-bar { display: flex; align-items: center; gap: 16px; height: 43px; padding: 0 18px; border-bottom: 1px solid #2a373e; background: #1b282f; color: #97aeb7; }
.lsim-root .lsim-lights { display: flex; gap: 6px; }
.lsim-root .lsim-lights i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #b36b6b; }
.lsim-root .lsim-lights i:nth-child(2) { background: #b8a66c; }
.lsim-root .lsim-lights i:nth-child(3) { background: #6b9f8a; }
.lsim-root .lsim-session-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.lsim-root .lsim-local-label { margin-left: auto; color: #829b95; font-size: 8px; letter-spacing: .12em; white-space: nowrap; }
.lsim-root .lsim-output { min-height: 260px; height: min(45vh, 430px); max-height: 620px; overflow: auto; padding: 22px 20px 12px; scrollbar-color: #40545a #101a20; }
.lsim-root .lsim-line { margin: 0 0 8px; padding: 0; border: 0; border-radius: 0; color: #d6e3e5; background: none; font: 13px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; box-shadow: none; }
.lsim-root .lsim-line-command { margin-top: 13px; margin-bottom: 4px; color: var(--lsim-accent); }
.lsim-root .lsim-line-error { color: #ffb0a4; }
.lsim-root .lsim-line-muted { color: #98aeb7; }
.lsim-root .lsim-line-welcome { color: #a4bbba; }
.lsim-root .lsim-command-form { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 9px; margin: 0; padding: 12px 20px 16px; background: #101a20; }
.lsim-root .lsim-prompt { margin: 0; max-width: 100%; color: var(--lsim-accent); font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.lsim-root .lsim-command-input { display: block; flex: 1 1 160px; width: auto; min-width: 80px; height: 35px; margin: 0; border: 0; border-bottom: 1px solid #3b5652; border-radius: 0; padding: 2px 1px; color: #eef7f5; background: #101a20; caret-color: var(--lsim-accent); font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; box-shadow: none; }
.lsim-root .lsim-command-input::placeholder { color: #708d91; opacity: 1; font-size: 12px; }
.lsim-root .lsim-command-input:focus-visible { outline-offset: 3px; outline-color: #547c6f; }
.lsim-root .lsim-run { color: #173b2e; background: #8de4bd; border-color: #8de4bd; white-space: nowrap; }
.lsim-root .lsim-run:hover:not(:disabled) { color: #173b2e; background: #b0f2d4; border-color: #b0f2d4; }
.lsim-root .lsim-shortcuts { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 15px; border-top: 1px solid #29383d; background: #152128; }
.lsim-root .lsim-key { min-height: 33px; border-color: #32434a; padding: 4px 9px; color: #9fb5bb; background: #1b2a31; font-size: 10px; font-weight: 450; }
.lsim-root .lsim-key:hover:not(:disabled) { background: #283d43; border-color: #50666b; }
.lsim-root .lsim-status-row { display: flex; align-items: center; gap: 12px; min-height: 39px; margin-top: 7px; }
.lsim-root .lsim-status { color: #657b74; font-size: 11px; }
.lsim-root .lsim-status-saved::before { content: "●"; margin-right: 6px; color: #458563; font-size: 8px; }
.lsim-root .lsim-status-warning { color: #80602d; }
.lsim-root .lsim-status-error { color: #ab453b; }
.lsim-root .lsim-reconnect { flex-shrink: 0; min-height: 30px; padding: 3px 9px; color: #526c60; background: #e7f0e9; border-color: #bdcfc3; font-size: 10px; }
.lsim-root .lsim-help { margin-top: 9px; padding-top: 12px; border-top: 1px solid #dce7df; color: #61776b; font-size: 12px; }
.lsim-root .lsim-help summary { cursor: pointer; font-weight: 600; }
.lsim-root .lsim-help p { margin: 10px 0 0; color: #61776b; font-size: 12px; }
.lsim-root .lsim-fatal { color: #a94038; }
.lsim-root .lsim-credentials { margin: 6px 0 12px; color: #61776b; font-size: 11px; }
.lsim-root.lsim-compact-intro { padding-top: 20px; }
.lsim-root .lsim-editor { color: #d6e3e5; background: #101a20; }
.lsim-root .lsim-editor-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #2a3a40; background: #15252c; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.lsim-root .lsim-editor-path { flex: 1; overflow-wrap: anywhere; color: #b9d6d0; }
.lsim-root .lsim-editor-modified { flex-shrink: 0; color: #d6c389; font-size: 11px; }
.lsim-root .lsim-editor-text { display: block; width: 100%; min-height: 290px; height: min(46vh, 440px); resize: vertical; margin: 0; padding: 18px 16px; border: 0; border-radius: 0; color: #e3eeed; background: #101a20; font: 14px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans Mono", monospace; tab-size: 4; white-space: pre; overflow: auto; caret-color: #8de4bd; box-shadow: none; scrollbar-color: #40545a #101a20; }
.lsim-root .lsim-editor-text:read-only { cursor: text; }
.lsim-root .lsim-editor-text:focus-visible { outline: 1px solid #3d6958; outline-offset: -1px; }
.lsim-root .lsim-editor-status { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 12px; border-top: 1px solid #2a3a40; background: #1a2c33; color: #a1b8b6; font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.lsim-root .lsim-editor-mode { flex-shrink: 0; color: #92e0b9; font-weight: 700; }
.lsim-root .lsim-editor-message { flex: 1; overflow-wrap: anywhere; }
.lsim-root .lsim-editor-position { margin-left: auto; color: #a5bdbd; white-space: nowrap; }
.lsim-root .lsim-ex-form { display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 12px; border-top: 1px solid #34474c; background: #132128; }
.lsim-root .lsim-ex-label { margin: 0; color: #a3ecc4; font: 16px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.lsim-root .lsim-ex-input { flex: 1; width: 100%; min-width: 50px; height: 34px; margin: 0; padding: 4px; border: 0; border-bottom: 1px solid #436558; border-radius: 0; color: #e5efed; background: #132128; font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; box-shadow: none; }
.lsim-root .lsim-editor-controls, .lsim-root .lsim-editor-recovery { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid #29383d; background: #152128; }
.lsim-root .lsim-editor-tip { margin-left: auto; color: #90aaa7; font-size: 10px; }
.lsim-root .lsim-editor-recovery { color: #dfd6b4; background: #2d3029; font-size: 11px; }
.lsim-root .lsim-editor-recovery > span { flex: 1 1 180px; }
.lsim-storage-root .lsim-storage-title { margin: 0 0 10px; color: #244b3d; font-size: 21px; line-height: 1.5; }
.lsim-storage-root .lsim-storage-intro, .lsim-storage-root .lsim-storage-note { margin: 8px 0; color: #61776b; font-size: 12px; }
.lsim-storage-root .lsim-storage-count { margin: 16px 0; color: #315c48; font-weight: 650; }
.lsim-storage-root .lsim-storage-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lsim-storage-root .lsim-storage-field { display: flex; flex-direction: column; gap: 7px; color: #536d63; font-size: 12px; }
.lsim-storage-root .lsim-storage-field select { width: 100%; min-width: 0; }
.lsim-storage-root .lsim-storage-name { height: 36px; width: 100%; min-width: 0; margin: 0; padding: 5px 10px; border: 1px solid #c9d8d4; border-radius: 7px; background: #fff; color: #243f41; font: inherit; font-size: 13px; box-shadow: none; }
.lsim-storage-root .lsim-storage-current { margin: 16px 0; padding: 10px 12px; border-radius: 7px; color: #345c49; background: #e7f1ea; font-size: 12px; overflow-wrap: anywhere; }
.lsim-storage-root .lsim-storage-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lsim-storage-root .lsim-storage-message { min-height: 24px; margin: 12px 0 0; color: #315c48; font-size: 12px; overflow-wrap: anywhere; }
.lsim-storage-root .lsim-storage-error { color: #ab453b; }
.lsim-root .lsim-pager-text { min-height: 290px; max-height: 480px; overflow: auto; margin: 0; padding: 18px 16px; border: 0; color: #d6e3e5; background: #101a20; font: 13px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.lsim-root .lsim-pager-text:focus-visible { outline: 1px solid #3d6958; outline-offset: -1px; }
@media (max-width: 600px) {
  .lsim-root { margin: 20px auto; padding: 16px 12px; border-radius: 14px; }
  .lsim-root .lsim-header { gap: 8px; }
  .lsim-root .lsim-title { font-size: 21px; }
  .lsim-root .lsim-badge { font-size: 9px; padding: 3px 6px; }
  .lsim-root .lsim-intro { font-size: 12px; margin-bottom: 18px; }
  .lsim-root .lsim-toolbar { align-items: flex-end; gap: 8px; }
  .lsim-root .lsim-selector { gap: 6px; }
  .lsim-root .lsim-level { flex-basis: 100%; }
  .lsim-root .lsim-reset { font-size: 10px; padding: 5px 7px; }
  .lsim-root .lsim-frame-bar { padding: 0 11px; gap: 10px; }
  .lsim-root .lsim-local-label { display: none; }
  .lsim-root .lsim-output { padding: 15px 11px 8px; min-height: 220px; height: 38vh; }
  .lsim-root .lsim-line { font-size: 12px; }
  .lsim-root .lsim-command-form { padding: 9px 11px 13px; }
  .lsim-root .lsim-prompt { flex-basis: 100%; font-size: 11px; }
  .lsim-root .lsim-command-input { font-size: 16px; }
  .lsim-root .lsim-shortcuts { padding: 8px; gap: 4px; }
  .lsim-root .lsim-key { padding: 4px 6px; min-height: 36px; font-size: 9px; }
  .lsim-root .lsim-status-row { align-items: flex-start; padding-top: 4px; }
  .lsim-root .lsim-editor-text { font-size: 16px; padding: 12px; min-height: 260px; }
  .lsim-root .lsim-ex-input { font-size: 16px; }
  .lsim-root .lsim-editor-tip { flex-basis: 100%; margin-left: 0; }
  .lsim-root .lsim-editor-bar { padding: 8px 12px; }
  .lsim-root .lsim-editor-status { flex-wrap: wrap; gap: 5px 8px; }
  .lsim-storage-root .lsim-storage-fields { grid-template-columns: 1fr; }
  .lsim-storage-root .lsim-storage-name, .lsim-storage-root .lsim-storage-field select { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .lsim-root button { transition: none; } }
