:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #15202b;
  background: #f2f5f7;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f2f5f7;
}

button,
input {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 24px;
  width: min(1152px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 0;
  align-items: start;
}

.controls {
  display: grid;
  gap: 16px;
}

.intro h1,
.panel h2,
.intro p,
.panel p,
.safety p {
  margin: 0;
}

.brand-icon {
  display: block;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 8px;
}

.intro h1 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
}

.intro p {
  margin-top: 10px;
  color: #5d6b78;
  font-size: 14px;
  line-height: 1.7;
}

.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 13px;
  color: #15202b;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button-outline {
  border-color: #ccd5dc;
}

.button:hover {
  background: #f7f9fa;
}

.button:focus-visible,
.mode:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(0, 125, 148, 0.24);
  outline-offset: 2px;
}

.telegram {
  margin-top: 16px;
}

.panel {
  border: 1px solid #d8e0e5;
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(18, 32, 43, 0.04);
}

.panel h2 {
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.4;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 40px;
  border: 1px solid #cbd5dc;
  border-radius: 6px;
  padding: 0 11px;
  color: #15202b;
  background: #fff;
  text-transform: uppercase;
}

input:focus {
  border-color: #007d94;
}

.hint {
  margin-top: 10px !important;
  color: #697783;
  font-size: 12px;
  line-height: 1.6;
}

.mode-list {
  display: grid;
  gap: 8px;
}

.mode {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  gap: 12px;
  border: 1px solid #d4dde3;
  border-radius: 6px;
  padding: 10px 12px;
  color: #15202b;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.mode:hover {
  background: #f7f9fa;
}

.mode.active {
  border-color: #007d94;
  background: #eaf7f8;
}

.mode-mark {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #fff;
  background: #007d94;
  font-size: 11px;
  font-weight: 800;
}

.terminal-mark {
  color: #d8f7ed;
  background: #233342;
}

.mode strong,
.mode small {
  display: block;
}

.mode strong {
  font-size: 14px;
}

.mode small {
  margin-top: 4px;
  color: #697783;
  font-size: 12px;
}

.safety {
  border: 1px solid #e4b653;
  border-radius: 6px;
  padding: 15px 16px;
  color: #5f4300;
  background: #fff7dc;
  font-size: 13px;
  line-height: 1.65;
}

.safety p {
  margin-top: 3px;
}

.output-panel {
  min-width: 0;
  padding: 22px;
}

.output-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.output-header h2 {
  margin-bottom: 5px;
}

.output-header p {
  color: #697783;
  font-size: 13px;
  line-height: 1.6;
}

pre {
  min-height: 500px;
  max-height: calc(100vh - 160px);
  margin: 18px 0 0;
  overflow: auto;
  border: 1px solid #1e2b38;
  border-radius: 6px;
  padding: 18px;
  color: #eff7f8;
  background: #111b25;
  font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 840px) {
  .shell {
    grid-template-columns: 1fr;
    width: min(680px, calc(100% - 28px));
    padding: 24px 0;
  }

  pre {
    min-height: 420px;
    max-height: none;
  }
}

@media (max-width: 480px) {
  .shell {
    width: min(100% - 20px, 680px);
    gap: 14px;
    padding: 16px 0 24px;
  }

  .panel,
  .output-panel {
    padding: 16px;
  }

  .output-header {
    align-items: stretch;
    flex-direction: column;
  }

  .output-header .button {
    align-self: flex-start;
  }
}
