:root {
  --cf-ink: #0d1117;
  --cf-panel: #111827;
  --cf-panel-2: #161b22;
  --cf-border: #30363d;
  --cf-text: #e6edf3;
  --cf-muted: #8b949e;
  --cf-cyan: #22d3ee;
  --cf-blue: #58a6ff;
  --cf-green: #3fb950;
  --cf-amber: #d29922;
  --cf-red: #f85149;
  --cf-shadow: 0 18px 80px rgba(0, 0, 0, .38);
}

html {
  color-scheme: dark;
}

body {
  background:
    radial-gradient(circle at 15% 0%, rgba(34, 211, 238, .08), transparent 32rem),
    linear-gradient(180deg, #0d1117 0%, #0b111a 52%, #0d1117 100%);
}

.mono,
.code-font,
.editor-font {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.studio-panel {
  border: 1px solid var(--cf-border);
  background: rgba(22, 27, 34, .82);
  box-shadow: var(--cf-shadow);
}

.editor-shell {
  border: 1px solid var(--cf-border);
  background: var(--cf-ink);
}

.editor-scrollbar,
.scrollbar-thin,
textarea,
pre {
  scrollbar-color: #30363d #0d1117;
  scrollbar-width: thin;
}

.editor-scrollbar::-webkit-scrollbar,
.scrollbar-thin::-webkit-scrollbar,
textarea::-webkit-scrollbar,
pre::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.editor-scrollbar::-webkit-scrollbar-track,
.scrollbar-thin::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track {
  background: #0d1117;
}

.editor-scrollbar::-webkit-scrollbar-thumb,
.scrollbar-thin::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb {
  background: #30363d;
  border: 2px solid #0d1117;
  border-radius: 999px;
}

.editor-scrollbar::-webkit-scrollbar-thumb:hover,
.scrollbar-thin::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover,
pre::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

.conversion-btn,
.tool-tab,
.quick-action {
  position: relative;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

.conversion-btn:hover,
.tool-tab:hover,
.quick-action:hover {
  transform: translateY(-1px);
}

.conversion-btn.is-active,
.tool-tab.is-active,
.quick-action.is-active,
.tab-active {
  border-color: rgba(34, 211, 238, .72) !important;
  background: rgba(34, 211, 238, .1) !important;
  color: var(--cf-text) !important;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .08);
}

.conversion-btn.is-active::before,
.tool-tab.is-active::before,
.quick-action.is-active::before,
.tab-active::before {
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 3px;
  content: "";
  border-radius: 6px 0 0 6px;
  background: linear-gradient(180deg, var(--cf-cyan), var(--cf-blue));
}

.regex-match {
  border-radius: 3px;
  background: rgba(210, 153, 34, .25);
  box-shadow: inset 0 -1px 0 rgba(210, 153, 34, .75);
  color: #fff8c5;
}

.regex-match.is-current {
  background: rgba(34, 211, 238, .24);
  box-shadow: inset 0 -1px 0 rgba(34, 211, 238, .85);
  color: #cffafe;
}

.regex-error {
  border-color: rgba(248, 81, 73, .62) !important;
  box-shadow: 0 0 0 3px rgba(248, 81, 73, .12);
}

.readability-gauge {
  position: relative;
  height: .75rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  background: linear-gradient(90deg, #f85149 0%, #d29922 42%, #3fb950 72%, #22d3ee 100%);
}

.readability-gauge::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), transparent);
  pointer-events: none;
}

.readability-gauge__marker {
  position: absolute;
  top: 50%;
  left: var(--score, 0%);
  width: 4px;
  height: 1.15rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(13, 17, 23, .72), 0 0 18px rgba(255, 255, 255, .46);
  transform: translate(-50%, -50%);
}

.readability-score-low {
  color: #ffa198;
}

.readability-score-medium {
  color: #f2cc60;
}

.readability-score-high {
  color: #7ee787;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: grid;
  width: min(24rem, calc(100vw - 2rem));
  gap: .75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: .75rem;
  border: 1px solid rgba(34, 211, 238, .28);
  border-radius: 8px;
  background: rgba(13, 17, 23, .94);
  box-shadow: 0 14px 60px rgba(0, 0, 0, .38);
  color: var(--cf-text);
  padding: .8rem .9rem;
  pointer-events: auto;
  transform: translateY(.75rem);
  opacity: 0;
  animation: toast-in .18s ease forwards;
}

.toast--success {
  border-color: rgba(63, 185, 80, .38);
}

.toast--error {
  border-color: rgba(248, 81, 73, .42);
}

.toast--warning {
  border-color: rgba(210, 153, 34, .42);
}

.toast__icon {
  display: grid;
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 6px;
  background: rgba(34, 211, 238, .1);
  color: var(--cf-cyan);
}

.toast--success .toast__icon {
  background: rgba(63, 185, 80, .12);
  color: var(--cf-green);
}

.toast--error .toast__icon {
  background: rgba(248, 81, 73, .12);
  color: var(--cf-red);
}

.toast--warning .toast__icon {
  background: rgba(210, 153, 34, .12);
  color: var(--cf-amber);
}

.toast__title {
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.25rem;
}

.toast__message {
  margin-top: .1rem;
  font-size: .75rem;
  line-height: 1rem;
  color: var(--cf-muted);
}

.toast.is-leaving {
  animation: toast-out .16s ease forwards;
}

.mobile-nav {
  display: none;
}

.mobile-nav.is-open {
  display: block;
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(.75rem);
  }
}

@media (max-width: 767px) {
  .toast-region {
    right: .75rem;
    bottom: .75rem;
    width: calc(100vw - 1.5rem);
  }
}
