:root {
  color-scheme: light;
  --bg-top: #eff8f6;
  --bg-bottom: #f7eee2;
  --panel: rgba(255, 250, 244, 0.92);
  --panel-edge: rgba(19, 64, 78, 0.12);
  --text: #16323d;
  --muted: #5a747d;
  --accent: #e26d3d;
  --accent-strong: #bc4a1d;
  --accent-soft: rgba(226, 109, 61, 0.14);
  --teal-soft: rgba(53, 117, 111, 0.14);
  --shadow: 0 28px 70px rgba(22, 50, 61, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      circle at top left,
      rgba(226, 109, 61, 0.18),
      transparent 32%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(53, 117, 111, 0.22),
      transparent 28%
    ),
    linear-gradient(145deg, var(--bg-top), var(--bg-bottom));
}

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

.toolbar {
  position: relative;
  z-index: 2;
  padding: 1rem 1rem 0.85rem;
  background: linear-gradient(
    180deg,
    rgba(255, 250, 244, 0.96),
    rgba(255, 250, 244, 0.84)
  );
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--panel-edge);
  box-shadow: 0 12px 30px rgba(22, 50, 61, 0.05);
}

.toolbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
  min-height: 3rem;
}

.toolbar__title {
  position: absolute;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

button {
  border: 1px solid rgba(19, 64, 78, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
}

button {
  padding: 0.7rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease;
  box-shadow: 0 10px 18px rgba(22, 50, 61, 0.05);
}

button:hover,
button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(226, 109, 61, 0.45);
  box-shadow: 0 10px 22px rgba(226, 109, 61, 0.16);
}

.status {
  margin: 0 0 0 auto;
  padding: 0.72rem 0.92rem;
  border-radius: 14px;
  background: var(--teal-soft);
  color: #1d5b5a;
  font-size: 0.9rem;
  font-weight: 600;
}

.status[data-tone="error"] {
  background: rgba(188, 74, 29, 0.12);
  color: #8f3512;
}

.editor-shell {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0.9rem;
  border: 1px solid var(--panel-edge);
  border-radius: 28px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.app-footer {
  display: flex;
  justify-content: center;
  padding: 0 1rem 1rem;
}

.app-footer__link {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 120ms ease;
}

.app-footer__link:hover,
.app-footer__link:focus-visible {
  color: var(--accent-strong);
}

#editor {
  position: absolute;
  inset: 0;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 15px;
  line-height: 1.65;
}

.ace_github {
  background: linear-gradient(180deg, #f3efe9, #f8f4ee) !important;
  color: var(--text) !important;
}

.ace_scroller {
  position: relative;
}

.editor-block-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.editor-block {
  position: absolute;
  left: 18px;
  right: 18px;
  border-radius: 20px;
  background: rgba(255, 242, 232, 0.38);
  box-shadow:
    inset 0 0 0 1px rgba(226, 109, 61, 0.24),
    0 18px 30px rgba(22, 50, 61, 0.14);
}

.ace_content,
.ace_text-layer {
  position: relative;
  z-index: 2;
}

.ace_github .ace_gutter {
  background: rgba(243, 237, 231, 0.9) !important;
  color: rgba(22, 50, 61, 0.52) !important;
  border-right: 1px solid rgba(19, 64, 78, 0.1) !important;
  position: relative;
  z-index: 2;
}

.ace_github .ace_marker-layer .ace_active-line,
.ace_github .ace_gutter-active-line {
  background: rgba(226, 109, 61, 0.08) !important;
}

.ace_github .ace_cursor {
  color: #d04e22 !important;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.empty-state[hidden] {
  display: none;
}

.empty-state p {
  max-width: 36rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.empty-state p + p {
  margin-top: 0.8rem;
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .toolbar {
    padding: 0.9rem 0.8rem 0.75rem;
  }

  .toolbar__title {
    position: static;
    transform: none;
    order: -1;
    width: 100%;
    text-align: center;
  }

  .status {
    width: 100%;
  }

  .status {
    margin-left: 0;
  }

  .editor-shell {
    margin: 0.7rem;
    border-radius: 22px;
  }

  .app-footer {
    padding-bottom: 0.9rem;
  }
}
