
  :root {
    --bg: #e7eef4;
    --panel: #ffffff;
    --panel-soft: #f0f6fa;
    --line: #c9d6e3;
    --text: #2c3e50;
    --muted: #4d6277;
    --brand: #2980b9;
    --brand-hover: #1f5f8b;
    --danger: #c0392b;
    --ok: #1f8a52;
    --radius: 12px;
    --shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  }

  * {
    box-sizing: border-box;
  }

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

  body {
    margin: 0;
    padding: 0;
    font-family: "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
      radial-gradient(900px 500px at -10% -20%, rgba(41, 128, 185, 0.16), transparent 60%),
      radial-gradient(700px 440px at 120% 0%, rgba(31, 95, 139, 0.16), transparent 58%),
      var(--bg);
  }

  .shell {
    width: min(680px, calc(100% - 24px));
    margin: 28px auto 40px;
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 26px 22px;
  }

  .result-shell {
    width: min(980px, calc(100% - 24px));
  }

  h1 {
    margin: 0 0 14px;
    text-align: center;
    color: var(--text);
    font-size: 30px;
    letter-spacing: 0.02em;
  }

  h2 {
    margin: 0 0 10px;
    font-size: 21px;
  }

  p {
    margin: 8px 0;
    line-height: 1.65;
  }

  .muted {
    color: var(--muted);
  }

  .instructions {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 18px;
  }

  .instructions ol {
    margin: 10px 0 0 18px;
    padding: 0;
    line-height: 1.7;
  }

  .form-group {
    display: grid;
    gap: 12px;
  }

  label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-weight: 600;
  }

  label span {
    width: 92px;
    flex-shrink: 0;
  }

  input {
    flex: 1;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  input:focus {
    border-color: rgba(41, 128, 185, 0.65);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
  }

  .button-group {
    display: grid;
    gap: 10px;
    margin-top: 16px;
  }

  button,
  a.button {
    width: 100%;
    border: none;
    border-radius: 8px;
    background: var(--brand);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 11px 14px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, transform 0.05s;
  }

  button:hover,
  a.button:hover {
    background: var(--brand-hover);
  }

  button:active,
  a.button:active {
    transform: translateY(1px);
  }

  button.secondary,
  a.button.secondary {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--line);
  }

  button.secondary:hover,
  a.button.secondary:hover {
    background: #f6f9fc;
  }

  button[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
  }

  .status {
    min-height: 20px;
    margin-top: 8px;
    color: var(--muted);
  }

  .status.error {
    color: var(--danger);
  }

  .status.ok {
    color: var(--ok);
  }

  .result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
  }

  .result-footer .status {
    margin-top: 0;
    flex: 1;
  }

  .tiny-toggle {
    width: auto;
    min-width: 138px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f7fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.2;
  }

  .tiny-toggle:hover {
    background: #edf3f8;
    color: #334e68;
  }

  .tiny-toggle.active {
    background: #e3f0f9;
    border-color: #b9d0e1;
    color: #1f5f8b;
  }

  .modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s;
    padding: 12px;
  }

  .modal.show {
    opacity: 1;
    pointer-events: auto;
  }

  .modal-content {
    width: min(430px, 100%);
    background: #ffffff;
    border-radius: 10px;
    padding: 20px 18px;
    position: relative;
    text-align: center;
    animation: modal-enter 0.25s ease-out;
    border: 1px solid var(--line);
  }

  .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #7f8c8d;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
  }

  .modal-close:hover {
    color: #2c3e50;
    background: #f3f4f6;
  }

  .fade-text {
    opacity: 0;
    margin-bottom: 10px;
    transition: opacity 0.8s ease-in;
  }

  #oracleLoading {
    display: none;
    margin-top: 8px;
    font-style: italic;
    color: #7f8c8d;
  }

  .header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
  }

  .header-row h1 {
    margin: 0;
    text-align: left;
    font-size: 44px;
    line-height: 1.2;
  }

  .icon-btn {
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f1f6fa;
    color: #2c3e50;
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.05s;
  }

  .icon-btn:hover {
    background: #e3edf5;
  }

  .icon-btn:active {
    transform: translateY(1px);
  }

  .icon-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
  }

  .markdown {
    line-height: 1.72;
    font-size: 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 14px;
    background: #ffffff;
    overflow-wrap: break-word;
  }

  .markdown h1,
  .markdown h2,
  .markdown h3,
  .markdown h4 {
    text-align: left;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    color: #1f2f40;
  }

  .markdown p {
    margin: 0.6em 0;
  }

  .markdown pre {
    padding: 10px;
    border-radius: 8px;
    overflow: auto;
    background: #f5f7fa;
    border: 1px solid var(--line);
  }

  .markdown blockquote {
    margin: 0.8em 0;
    padding: 0.4em 0.9em;
    border-left: 3px solid #aac0d2;
    color: #435b72;
    background: #f7fafc;
  }

  @keyframes modal-enter {
    from {
      opacity: 0;
      transform: translateY(8px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  @media (max-width: 640px) {
    .shell {
      padding: 18px 14px;
      margin-top: 18px;
    }

    h1 {
      font-size: 25px;
    }

    label {
      display: grid;
      gap: 6px;
    }

    label span {
      width: auto;
    }

    .header-row {
      align-items: flex-start;
    }

    .header-row h1 {
      font-size: 34px;
    }

    .result-footer {
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
    }

    .tiny-toggle {
      align-self: flex-end;
    }
  }
