:root {
  --ink: #18312b;
  --ink-soft: #50645e;
  --ink-faint: #788a85;
  --paper: #f4f1ea;
  --paper-deep: #ece8df;
  --surface: #fffdf9;
  --surface-raised: #ffffff;
  --line: #d8d3c8;
  --line-strong: #c5bfb3;
  --accent: #db6b31;
  --accent-dark: #b95122;
  --accent-pale: #fff0e7;
  --teal: #2f725f;
  --teal-dark: #1b4f42;
  --editor: #14231f;
  --editor-raised: #192c27;
  --editor-line: #2a413a;
  --editor-text: #e7eee9;
  --editor-muted: #82978f;
  --success: #4d9a7b;
  --danger: #b4473c;
  --danger-pale: #fff0ee;
  --shadow: 0 18px 55px rgba(39, 45, 39, 0.09), 0 2px 8px rgba(39, 45, 39, 0.05);
  --font-ui: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-code: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --editor-zoom: 1;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-ui);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(219, 107, 49, 0.09), transparent 24rem),
    linear-gradient(180deg, #f8f5ef 0, var(--paper) 24rem, #efece5 100%);
}

button,
select,
textarea {
  font: inherit;
}

button,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

kbd {
  display: inline-flex;
  min-width: 1.7rem;
  min-height: 1.45rem;
  align-items: center;
  justify-content: center;
  padding: 0.05rem 0.35rem;
  border: 1px solid #d0cbc0;
  border-bottom-color: #b9b2a5;
  border-radius: 5px;
  background: #faf8f3;
  box-shadow: 0 1px 0 #d6d0c4;
  color: #596861;
  font-family: var(--font-code);
  font-size: 0.7rem;
  line-height: 1;
}

.page-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.site-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 4vw;
  color: #f8f5ef;
  background: var(--ink);
  border-bottom: 4px solid var(--accent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffa16d;
}

.brand-mark svg {
  width: 27px;
  height: 27px;
  stroke-width: 1.8;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-family: var(--font-code);
  font-size: 1.28rem;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.brand-copy small {
  margin-top: 0.25rem;
  color: #abc0b9;
  font-size: 0.72rem;
  letter-spacing: 0.035em;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #dbe7e2;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-dot,
.status-light {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #75c69c;
  box-shadow: 0 0 0 3px rgba(117, 198, 156, 0.13);
}

.version-label {
  color: #9eb2ab;
  font-family: var(--font-code);
  font-size: 0.7rem;
}

.button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  padding: 0.58rem 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.button:focus-visible,
.icon-button:focus-visible,
.clear-button:focus-visible,
.error-close:focus-visible,
.dialog-close:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #f6a171;
  outline-offset: 2px;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button-small {
  min-height: 34px;
  padding: 0.45rem 0.72rem;
  font-size: 0.73rem;
}

.button-ghost {
  border-color: rgba(255, 255, 255, 0.18);
  color: #dce8e3;
  background: transparent;
}

.button-ghost:hover {
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.button-primary {
  min-width: 92px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 7px 16px rgba(203, 89, 34, 0.2);
}

.button-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 9px 20px rgba(203, 89, 34, 0.25);
}

.button-secondary {
  border-color: var(--line);
  color: #41554f;
  background: #fff;
}

.button-secondary:hover {
  border-color: #b9b1a5;
  background: #faf8f3;
}

.main-content {
  width: min(1460px, calc(100% - 8vw));
  margin: 0 auto;
  padding: 2.7rem 0 1.2rem;
  flex: 1;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.7rem;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 750px;
  margin: 0;
  color: #1a342d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.intro-copy {
  max-width: 690px;
  margin: 0.85rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.shortcut-hint {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  padding-bottom: 0.15rem;
  color: var(--ink-faint);
  font-size: 0.7rem;
  white-space: nowrap;
}

.shortcut-hint span:first-child {
  margin-right: 0.25rem;
}

.key-plus {
  padding: 0 0.1rem;
}

.workspace {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.file-bar {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem 0 0;
  border-bottom: 1px solid var(--line);
  background: #f8f5ef;
}

.file-tab {
  align-self: stretch;
  display: flex;
  min-width: 175px;
  align-items: center;
  gap: 0.55rem;
  padding: 0 1.15rem;
  border-right: 1px solid var(--line);
  color: #344a43;
  background: var(--surface);
  font-family: var(--font-code);
  font-size: 0.76rem;
  font-weight: 600;
}

.file-tab svg {
  width: 17px;
  height: 17px;
  color: #769188;
}

.saved-indicator {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: #99aaa4;
  transition: background 180ms ease;
}

.saved-indicator.is-saved {
  background: var(--success);
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 0.38rem;
}

.select-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: 0.25rem;
  color: var(--ink-faint);
  font-size: 0.7rem;
  font-weight: 600;
}

.select-wrap select {
  max-width: 195px;
  min-height: 32px;
  padding: 0.3rem 1.8rem 0.3rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #425750;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #778881 50%),
    linear-gradient(135deg, #778881 50%, transparent 50%);
  background-position:
    calc(100% - 12px) 13px,
    calc(100% - 8px) 13px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  appearance: none;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #6d7d77;
  background: transparent;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.icon-button:hover {
  border-color: #ded9cf;
  color: #2e4c43;
  background: #fff;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
}

.panel {
  min-width: 0;
  padding: 1.15rem;
}

.editor-panel {
  border-right: 1px solid var(--line);
}

.console-panel {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: #fcfaf6;
}

.panel-heading {
  display: flex;
  min-height: 47px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.12rem 0.75rem;
}

.panel-heading h2 {
  margin: 0;
  color: #253f37;
  font-size: 0.94rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.panel-kicker {
  margin-bottom: 0.18rem;
  color: #8b9b95;
  font-size: 0.58rem;
  letter-spacing: 0.13em;
}

.editor-heading-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-controls {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #d9d4c9;
  border-radius: 6px;
  background: #fff;
}

.history-button {
  display: grid;
  width: 29px;
  height: 27px;
  place-items: center;
  padding: 0;
  border: 0;
  color: #5f756d;
  background: transparent;
}

.history-button + .history-button {
  border-left: 1px solid #e4dfd5;
}

.history-button svg {
  width: 15px;
  height: 15px;
}

.history-button:hover:not(:disabled) {
  color: #263f37;
  background: #f3f0e9;
}

.history-button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid #f6a171;
  outline-offset: -2px;
}

.history-button:disabled {
  cursor: default;
  opacity: 0.32;
}

.language-badge {
  padding: 0.22rem 0.45rem;
  border: 1px solid #d9d4c9;
  border-radius: 5px;
  color: #7c8c86;
  background: #f8f5ef;
  font-family: var(--font-code);
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.error-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #ebc7c2;
  border-radius: 7px;
  background: var(--danger-pale);
}

.error-banner[hidden] {
  display: none;
}

.error-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-size: 0.72rem;
  font-weight: 800;
}

.error-copy {
  min-width: 0;
}

.error-copy strong {
  display: block;
  margin-bottom: 0.15rem;
  color: #8c352d;
  font-size: 0.76rem;
}

.error-copy pre {
  overflow: auto;
  max-height: 9rem;
  margin: 0;
  color: #7d3f38;
  font-family: var(--font-code);
  font-size: 0.67rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.error-close,
.dialog-close {
  align-self: start;
  padding: 0;
  border: 0;
  color: #a36d67;
  background: transparent;
  font-size: 1.3rem;
  line-height: 1;
}

.code-frame {
  display: grid;
  overflow: hidden;
  grid-template-columns: 46px minmax(0, 1fr);
  height: clamp(350px, 50vh, 570px);
  border: 1px solid #263d36;
  border-radius: 9px;
  background: var(--editor);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 3px 12px rgba(11, 25, 20, 0.12);
}

.line-numbers,
.code-highlight,
#code-input {
  margin: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;
  font-family: var(--font-code);
  font-size: calc(0.9rem * var(--editor-zoom));
  line-height: 1.72;
  tab-size: 2;
}

.line-numbers {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  padding-right: 0.75rem;
  padding-left: 0.45rem;
  border-right: 1px solid var(--editor-line);
  color: #617970;
  background: #11201c;
  text-align: right;
  user-select: none;
}

.line-number {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  line-height: 1.72;
  text-align: right;
}

.line-number.has-error {
  color: #f19b91;
  background: rgba(180, 71, 60, 0.16);
}

.code-editor {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: var(--editor);
}

.error-line-highlight {
  position: absolute;
  z-index: 0;
  right: 0;
  left: 0;
  border-left: 2px solid rgba(241, 116, 104, 0.72);
  background: rgba(180, 71, 60, 0.16);
  pointer-events: none;
}

.error-line-highlight[hidden] {
  display: none;
}

.code-highlight,
#code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 1rem 1.15rem 1rem 1rem;
  border: 0;
  font-family: var(--font-code);
  font-size: calc(0.9rem * var(--editor-zoom));
  line-height: 1.72;
  letter-spacing: 0.005em;
  tab-size: 2;
  white-space: pre;
}

.code-highlight {
  z-index: 1;
  overflow: hidden;
  color: var(--editor-text);
  background: transparent;
  pointer-events: none;
}

.code-highlight code {
  font: inherit;
  color: inherit;
}

#code-input {
  z-index: 2;
  min-height: 0;
  resize: none;
  overflow: auto;
  outline: none;
  color: transparent;
  background: transparent;
  caret-color: #f79a62;
  -webkit-text-fill-color: transparent;
}

#code-input::selection {
  color: transparent;
  background: rgba(86, 144, 122, 0.5);
  -webkit-text-fill-color: transparent;
}

.code-editor:focus-within {
  box-shadow: inset 0 0 0 1px rgba(244, 147, 91, 0.36);
}

#code-input:focus-visible {
  outline: none;
}

.snippet-menu {
  position: absolute;
  z-index: 4;
  right: 0.85rem;
  bottom: 0.85rem;
  left: 0.85rem;
  overflow: hidden;
  border: 1px solid #436259;
  border-radius: 8px;
  background: #1b302a;
  box-shadow: 0 16px 36px rgba(3, 14, 10, 0.38);
}

.snippet-menu[hidden] {
  display: none;
}

.snippet-menu-header {
  display: flex;
  min-height: 31px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.38rem 0.62rem;
  border-bottom: 1px solid #355149;
  color: #a9bcb5;
  background: #203a32;
  font-family: var(--font-ui);
  font-size: 0.6rem;
}

.snippet-menu-header > span:first-child {
  color: #f1aa7c;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.snippet-menu-header > span:last-child {
  white-space: nowrap;
}

.snippet-menu-header kbd {
  min-width: 1.2rem;
  min-height: 1.15rem;
  margin: 0 0.08rem;
  padding: 0;
  border-color: #48675e;
  border-bottom-color: #5d7c72;
  color: #c6d5cf;
  background: #253f37;
  box-shadow: none;
  font-size: 0.57rem;
}

.snippet-options {
  max-height: 190px;
  overflow: auto;
}

.snippet-option {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(7.3rem, auto) minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-top: 1px solid rgba(113, 145, 134, 0.13);
  color: #d8e4df;
  background: transparent;
  text-align: left;
}

.snippet-option:first-child {
  border-top: 0;
}

.snippet-option:hover,
.snippet-option.is-active {
  background: #29473d;
}

.snippet-option:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid #f3a372;
  outline-offset: -2px;
}

.snippet-label {
  overflow: hidden;
  color: #86c4ff;
  font-family: var(--font-code);
  font-size: 0.69rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snippet-description {
  overflow: hidden;
  color: #9aada6;
  font-family: var(--font-code);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snippet-option.is-active .snippet-label {
  color: #b4dcff;
}

.snippet-option.is-active .snippet-description {
  color: #c5d5cf;
}

.snippet-option kbd {
  margin-left: 0.35rem;
}

.token-keyword {
  color: #7fb8ff;
  font-weight: 600;
}

.token-type {
  color: #c8a9ff;
}

.token-builtin {
  color: #83d5b5;
}

.token-boolean {
  color: #f2c879;
}

.token-string {
  color: #f3ae7e;
}

.token-number {
  color: #efcb83;
}

.token-comment {
  color: #78958b;
  font-style: italic;
}

.token-operator {
  color: #e69364;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.85rem;
}

.editor-stats {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #8a9993;
  font-family: var(--font-code);
  font-size: 0.62rem;
  white-space: nowrap;
}

.stats-divider {
  width: 1px;
  height: 11px;
  background: #d6d1c7;
}

.editor-actions {
  display: flex;
  gap: 0.5rem;
}

.console-heading {
  align-items: center;
}

.console-tools {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.run-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #7c8b85;
  font-size: 0.64rem;
  font-weight: 600;
}

.run-status .status-light {
  width: 6px;
  height: 6px;
  background: #a8b3af;
  box-shadow: none;
}

.run-status[data-state="success"] {
  color: var(--teal);
}

.run-status[data-state="success"] .status-light {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(77, 154, 123, 0.12);
}

.run-status[data-state="error"] {
  color: var(--danger);
}

.run-status[data-state="error"] .status-light {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 71, 60, 0.11);
}

.run-status[data-state="running"] .status-light {
  background: var(--accent);
  animation: pulse 900ms ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.36;
  }
}

.clear-button {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.3rem 0.42rem;
  border: 0;
  border-radius: 5px;
  color: #85938e;
  background: transparent;
  font-size: 0.63rem;
  font-weight: 600;
}

.clear-button svg {
  width: 13px;
  height: 13px;
}

.clear-button:hover {
  color: #40574f;
  background: #f1eee7;
}

.console-output {
  position: relative;
  overflow: auto;
  height: clamp(350px, 50vh, 570px);
  padding: 0.85rem 1rem;
  border: 1px solid #263d36;
  border-radius: 9px;
  color: #dce8e2;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 100% 1.72em,
    var(--editor);
  font-family: var(--font-code);
  font-size: 0.9rem;
  line-height: 1.72;
  scrollbar-color: #466158 #14231f;
}

.console-panel.is-waiting-input .console-output {
  padding-bottom: 5.9rem;
}

.console-input-form {
  position: absolute;
  z-index: 6;
  right: 1.15rem;
  bottom: 1.15rem;
  left: 1.15rem;
  padding: 0.65rem;
  border: 1px solid #53766b;
  border-radius: 8px;
  background: #203a32;
  box-shadow: 0 12px 28px rgba(3, 14, 10, 0.4);
}

.console-input-form[hidden] {
  display: none;
}

.console-input-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.45rem;
  color: #95aaa2;
  font-size: 0.61rem;
}

.console-input-heading > span:first-child {
  color: #f3ab7c;
  font-family: var(--font-code);
  font-size: 0.68rem;
  font-weight: 700;
}

.console-input-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.4rem;
  align-items: center;
}

.console-input-chevron {
  color: #f09a67;
  font-family: var(--font-code);
  font-size: 0.9rem;
}

#console-input-field {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 0.65rem;
  border: 1px solid #4d6d63;
  border-radius: 5px;
  outline: none;
  color: #eef5f2;
  background: #152a23;
  font-family: var(--font-code);
  font-size: 0.78rem;
}

#console-input-field:focus {
  border-color: #e7915e;
  box-shadow: 0 0 0 2px rgba(231, 145, 94, 0.16);
}

.console-input-send,
.console-input-cancel {
  height: 34px;
  padding: 0 0.7rem;
  border: 1px solid transparent;
  border-radius: 5px;
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 700;
}

.console-input-send {
  color: #fff;
  background: var(--accent);
}

.console-input-send:hover {
  background: var(--accent-dark);
}

.console-input-cancel {
  border-color: #4a675e;
  color: #b5c5bf;
  background: transparent;
}

.console-input-cancel:hover {
  color: #fff;
  background: #2a463c;
}

.console-empty {
  display: flex;
  height: 100%;
  min-height: 210px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #82958e;
  text-align: center;
}

.console-empty-mark {
  margin-bottom: 0.85rem;
  color: #d98150;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.console-empty p {
  margin: 0 0 0.35rem;
  color: #b4c3bd;
  font-family: var(--font-ui);
  font-size: 0.75rem;
}

.console-empty > span {
  font-size: 0.66rem;
}

.console-empty kbd {
  border-color: #365049;
  border-bottom-color: #4a665d;
  color: #b5c6c0;
  background: #1c332c;
  box-shadow: 0 1px 0 #0d1b17;
}

.console-line {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #e6eee9;
  white-space: pre-wrap;
  animation: log-in 160ms ease-out both;
}

@keyframes log-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
}

.identifier-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: center;
  margin: 0.9rem 0 0;
  color: #7c8984;
  font-size: 0.7rem;
}

.identifier-note svg {
  width: 14px;
  height: 14px;
}

.identifier-note code {
  padding: 0.08rem 0.25rem;
  border: 1px solid #ddd7cc;
  border-radius: 4px;
  color: #4f655d;
  background: #fbf9f4;
  font-family: var(--font-code);
}

.site-footer {
  display: flex;
  width: min(1460px, calc(100% - 8vw));
  margin: 0 auto;
  padding: 0.7rem 0 1.4rem;
  justify-content: space-between;
  gap: 1rem;
  color: #8b928d;
  font-size: 0.64rem;
}

.guide-dialog {
  width: min(820px, calc(100% - 2rem));
  max-height: min(760px, calc(100vh - 3rem));
  padding: 0;
  overflow: hidden;
  border: 1px solid #d5cfc4;
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(18, 39, 32, 0.26);
}

.guide-dialog::backdrop {
  background: rgba(13, 31, 26, 0.58);
  backdrop-filter: blur(3px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.4rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #f8f5ef;
}

.dialog-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 600;
}

.dialog-close {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  color: #677771;
  font-size: 1.6rem;
}

.dialog-close:hover {
  background: #ece8df;
}

.guide-body {
  max-height: calc(100vh - 11rem);
  overflow: auto;
  padding: 1.2rem 1.4rem 1.4rem;
}

.guide-intro {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.55;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.guide-grid article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.guide-grid h3 {
  margin: 0;
  padding: 0.65rem 0.8rem 0.55rem;
  border-bottom: 1px solid #e4dfd5;
  color: #355249;
  font-size: 0.73rem;
}

.guide-grid pre {
  min-height: 108px;
  margin: 0;
  padding: 0.8rem;
  overflow: auto;
  color: #dce8e2;
  background: var(--editor);
  font-family: var(--font-code);
  font-size: 0.68rem;
  line-height: 1.6;
}

.guide-grid code {
  font-family: inherit;
}

.guide-tip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding: 0.75rem 0.85rem;
  border-radius: 7px;
  color: #586b64;
  background: var(--accent-pale);
  font-size: 0.68rem;
}

.guide-tip strong {
  margin-right: 0.25rem;
  color: #8b4b2c;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 1.4rem;
  bottom: 1.4rem;
  max-width: min(370px, calc(100vw - 2.8rem));
  padding: 0.7rem 0.9rem;
  border: 1px solid #315047;
  border-radius: 7px;
  opacity: 0;
  color: #edf3f0;
  background: #203b33;
  box-shadow: 0 12px 30px rgba(20, 35, 31, 0.22);
  font-size: 0.72rem;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: #85392f;
  background: #7f382f;
}

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

  .editor-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .code-frame,
  .console-output {
    height: 390px;
  }

  .shortcut-hint {
    display: none;
  }
}

@media (min-width: 1200px) {
  .intro h1 {
    max-width: none;
    font-size: clamp(2rem, 2.7vw, 2.8rem);
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 68px;
    padding: 0 4.5vw;
  }

  .brand-copy small,
  .version-label,
  .offline-pill {
    display: none;
  }

  .main-content {
    width: calc(100% - 1.2rem);
    padding-top: 1.6rem;
  }

  .intro {
    margin-bottom: 1.2rem;
  }

  .intro h1 {
    font-size: 1.8rem;
  }

  .intro-copy {
    font-size: 0.82rem;
  }

  .file-bar {
    align-items: stretch;
    flex-direction: column;
    padding: 0;
  }

  .file-tab {
    min-height: 44px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .file-actions {
    overflow-x: auto;
    padding: 0.45rem 0.6rem;
  }

  .select-wrap {
    margin-right: auto;
  }

  .select-wrap span {
    display: none;
  }

  .select-wrap select {
    max-width: 165px;
  }

  .workspace-grid {
    display: block;
  }

  .panel {
    padding: 0.85rem;
  }

  .code-frame,
  .console-output {
    height: 350px;
  }

  .console-input-form {
    right: 0.85rem;
    bottom: 0.85rem;
    left: 0.85rem;
  }

  .console-input-heading > span:last-child {
    display: none;
  }

  .editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .button {
    min-height: 41px;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .identifier-note {
    align-items: flex-start;
    text-align: center;
  }

  .site-footer {
    width: calc(100% - 1.2rem);
    flex-direction: column;
    gap: 0.2rem;
  }
}

@media (max-width: 430px) {
  .site-header {
    gap: 0.6rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .button-small {
    padding: 0.45rem 0.55rem;
  }

  .button-small svg {
    display: none;
  }

  .panel-heading {
    align-items: center;
  }

  .console-tools {
    gap: 0.45rem;
  }

  .code-frame {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .line-numbers,
  .code-highlight,
  #code-input {
    font-size: calc(0.82rem * var(--editor-zoom));
  }

  .editor-stats {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
