:root {
      --ink: #18201d;
      --muted: #66706b;
      --paper: #f4f1ea;
      --card: rgba(255, 255, 255, .68);
      --line: rgba(24, 32, 29, .14);
      --acid: #d9ff68;
      --green: #1c4d3a;
      --red: #b53a2f;
      --shadow: 0 24px 80px rgba(28, 77, 58, .12);
    }

    * { box-sizing: border-box; }

    html { min-width: 320px; }

    body {
      min-height: 100vh;
      margin: 0;
      color: var(--ink);
      background:
        radial-gradient(circle at 80% 6%, rgba(217, 255, 104, .64), transparent 27rem),
        radial-gradient(circle at 4% 88%, rgba(82, 143, 116, .16), transparent 30rem),
        var(--paper);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      -webkit-font-smoothing: antialiased;
    }

    body::before {
      position: fixed;
      inset: 0;
      z-index: -1;
      content: "";
      opacity: .22;
      background-image:
        linear-gradient(rgba(24, 32, 29, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(24, 32, 29, .08) 1px, transparent 1px);
      background-size: 42px 42px;
      mask-image: linear-gradient(to bottom, black, transparent 78%);
    }

    button, input, select { font: inherit; }

    .page {
      width: min(1180px, calc(100% - 40px));
      min-height: 100vh;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
    }

    .header {
      height: 92px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--line);
    }

    .brand {
      display: inline-flex;
      align-items: center;
      gap: 11px;
      color: var(--ink);
      font-size: 20px;
      font-weight: 760;
      letter-spacing: -.04em;
    }

    .brand-mark {
      position: relative;
      width: 34px;
      height: 34px;
      overflow: hidden;
      border-radius: 50%;
      background: var(--green);
    }

    .brand-mark::after {
      position: absolute;
      top: 15px;
      left: 6px;
      width: 24px;
      height: 4px;
      border-radius: 10px;
      background: var(--acid);
      content: "";
      transform: rotate(-28deg);
    }

    .status {
      display: flex;
      align-items: center;
      gap: 9px;
      color: var(--muted);
      font-size: 13px;
    }

    .status::before {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #58a76c;
      box-shadow: 0 0 0 4px rgba(88, 167, 108, .13);
      content: "";
    }

    main {
      flex: 1;
      display: grid;
      grid-template-columns: minmax(0, .92fr) minmax(480px, 1.08fr);
      gap: clamp(46px, 8vw, 108px);
      align-items: center;
      padding: 72px 0 80px;
    }

    .eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      margin: 0 0 24px;
      color: var(--green);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .12em;
      text-transform: uppercase;
    }

    .eyebrow::before {
      width: 28px;
      height: 2px;
      background: currentColor;
      content: "";
    }

    h1 {
      max-width: 610px;
      margin: 0;
      font-size: clamp(58px, 6.2vw, 92px);
      font-weight: 780;
      line-height: .91;
      letter-spacing: -.075em;
    }

    h1 span {
      position: relative;
      display: inline-block;
      color: var(--green);
      z-index: 0;
    }

    h1 span::after {
      position: absolute;
      right: -.04em;
      bottom: .02em;
      left: .02em;
      z-index: -1;
      height: .22em;
      background: var(--acid);
      content: "";
      transform: rotate(-1.5deg);
    }

    .lead {
      max-width: 470px;
      margin: 30px 0 0;
      color: var(--muted);
      font-size: 17px;
      line-height: 1.65;
    }

    .benefits {
      display: flex;
      flex-wrap: wrap;
      gap: 12px 22px;
      margin-top: 38px;
      color: #4a5550;
      font-size: 13px;
    }

    .benefits span { display: flex; align-items: center; gap: 8px; }
    .benefits span::before { content: "✓"; color: var(--green); font-weight: 900; }

    .card {
      position: relative;
      padding: clamp(28px, 4vw, 50px);
      border: 1px solid rgba(255, 255, 255, .8);
      border-radius: 28px;
      background: var(--card);
      box-shadow: var(--shadow);
      backdrop-filter: blur(18px);
    }

    .card::before {
      position: absolute;
      top: 18px;
      right: 18px;
      width: 52px;
      height: 52px;
      border: 1px solid var(--line);
      border-radius: 50%;
      content: "↗";
      display: grid;
      place-items: center;
      color: var(--green);
      font-size: 23px;
    }

    .card-kicker {
      margin: 0 0 9px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 650;
      letter-spacing: .02em;
    }

    h2 {
      margin: 0 74px 31px 0;
      font-size: clamp(27px, 3vw, 38px);
      line-height: 1.1;
      letter-spacing: -.045em;
    }

    .mode-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 5px;
      margin-bottom: 27px;
      padding: 5px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: rgba(255, 255, 255, .46);
    }

    .mode-tab {
      min-height: 44px;
      padding: 0 14px;
      border: 0;
      border-radius: 9px;
      color: var(--muted);
      background: transparent;
      font-size: 13px;
      font-weight: 750;
      cursor: pointer;
      transition: color .18s, background .18s, box-shadow .18s;
    }

    .mode-tab:hover { color: var(--ink); }
    .mode-tab:disabled { cursor: wait; opacity: .65; }
    .mode-tab[aria-selected="true"] {
      color: var(--green);
      background: #fff;
      box-shadow: 0 3px 12px rgba(28, 77, 58, .09);
    }

    .mode-tab:focus-visible,
    .copy:focus-visible,
    .qr-toggle:focus-visible,
    .qr-link:focus-visible,
    .submit:focus-visible {
      outline: 3px solid rgba(28, 77, 58, .22);
      outline-offset: 2px;
    }

    label {
      display: block;
      margin-bottom: 10px;
      font-size: 13px;
      font-weight: 700;
    }

    .input-wrap { position: relative; }

    input, select {
      width: 100%;
      height: 62px;
      outline: none;
      border: 1px solid var(--line);
      border-radius: 14px;
      color: var(--ink);
      background: rgba(255, 255, 255, .75);
      font-size: 16px;
      transition: border-color .2s, box-shadow .2s, background .2s;
    }

    input { padding: 0 18px 0 50px; }
    select {
      padding: 0 46px 0 18px;
      appearance: none;
      background-image:
        linear-gradient(45deg, transparent 50%, var(--green) 50%),
        linear-gradient(135deg, var(--green) 50%, transparent 50%);
      background-position:
        calc(100% - 20px) 27px,
        calc(100% - 15px) 27px;
      background-size: 5px 5px, 5px 5px;
      background-repeat: no-repeat;
      cursor: pointer;
    }

    input::placeholder { color: #99a09c; }
    input:hover, select:hover { background-color: #fff; }
    input:focus, select:focus { border-color: var(--green); background-color: #fff; box-shadow: 0 0 0 4px rgba(28, 77, 58, .09); }
    input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 4px rgba(181, 58, 47, .08); }

    .link-icon {
      position: absolute;
      top: 50%;
      left: 18px;
      color: var(--green);
      transform: translateY(-50%);
      pointer-events: none;
    }

    .hint {
      min-height: 20px;
      margin: 8px 2px 4px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }

    .hint.error { color: var(--red); }

    .mode-note {
      margin: 17px 0 0;
      padding: 12px 14px;
      border-radius: 11px;
      color: var(--muted);
      background: rgba(28, 77, 58, .055);
      font-size: 12px;
      line-height: 1.45;
    }

    .mode-note[hidden] { display: none; }

    .custom-fields {
      margin-top: 19px;
      padding-top: 21px;
      border-top: 1px solid var(--line);
    }

    .custom-fields[hidden] { display: none; }

    .custom-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.3fr) minmax(150px, .7fr);
      gap: 14px;
    }

    .code-input { padding-left: 168px; }

    .code-prefix {
      position: absolute;
      top: 50%;
      left: 18px;
      max-width: 140px;
      overflow: hidden;
      color: var(--muted);
      font-size: 13px;
      text-overflow: ellipsis;
      white-space: nowrap;
      transform: translateY(-50%);
      pointer-events: none;
    }

    .code-prefix::after {
      margin-left: 3px;
      color: var(--green);
      content: "/";
      font-weight: 800;
    }

    .field-hint {
      min-height: 17px;
      margin-bottom: 0;
    }

    .submit {
      width: 100%;
      height: 62px;
      margin-top: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      border: 0;
      border-radius: 14px;
      color: white;
      background: var(--green);
      box-shadow: 0 9px 22px rgba(28, 77, 58, .2);
      font-size: 15px;
      font-weight: 750;
      cursor: pointer;
      transition: transform .18s, box-shadow .18s, background .18s;
    }

    .submit:hover { background: #143d2e; box-shadow: 0 12px 28px rgba(28, 77, 58, .25); transform: translateY(-2px); }
    .submit:active { transform: translateY(0); }
    .submit:disabled { cursor: wait; opacity: .72; transform: none; }

    .spinner {
      display: none;
      width: 18px;
      height: 18px;
      border: 2px solid rgba(255, 255, 255, .35);
      border-top-color: white;
      border-radius: 50%;
      animation: spin .75s linear infinite;
    }

    .submit.loading .spinner { display: block; }
    .submit.loading .arrow { display: none; }

    .result {
      display: none;
      margin-top: 22px;
      padding-top: 22px;
      border-top: 1px solid var(--line);
      animation: reveal .35s ease both;
    }

    .result.visible { display: block; }

    .result-label {
      margin-bottom: 9px;
      color: var(--green);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    .result-row { display: flex; gap: 9px; }

    .short-url {
      min-width: 0;
      flex: 1;
      height: 54px;
      padding: 0 16px;
      display: flex;
      align-items: center;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 12px;
      color: var(--green);
      background: rgba(217, 255, 104, .25);
      font-weight: 700;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .copy {
      width: 54px;
      height: 54px;
      flex: 0 0 54px;
      display: grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 12px;
      color: var(--ink);
      background: #fff;
      cursor: pointer;
      transition: color .2s, border-color .2s, transform .2s;
    }

    .copy:hover { color: var(--green); border-color: var(--green); transform: translateY(-1px); }
    .copy.copied { color: white; border-color: var(--green); background: var(--green); }

    .qr-toggle {
      width: 54px;
      height: 54px;
      flex: 0 0 54px;
      display: grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 12px;
      color: var(--green);
      background: #fff;
      font-size: 13px;
      font-weight: 900;
      letter-spacing: -.03em;
      cursor: pointer;
      transition: color .2s, border-color .2s, background .2s, transform .2s;
    }

    .qr-toggle:hover,
    .qr-toggle.active {
      border-color: var(--green);
      color: white;
      background: var(--green);
      transform: translateY(-1px);
    }

    .qr-toggle:disabled {
      cursor: not-allowed;
      opacity: .55;
      transform: none;
    }

    .qr-panel {
      margin-top: 14px;
      padding: 16px;
      display: grid;
      grid-template-columns: 132px minmax(0, 1fr);
      gap: 15px;
      align-items: center;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: rgba(255, 255, 255, .58);
      animation: reveal .28s ease both;
    }

    .qr-panel[hidden] { display: none; }

    .qr-image {
      width: 132px;
      height: 132px;
      display: block;
      border: 8px solid #fff;
      border-radius: 14px;
      background: #fff;
      box-shadow: 0 10px 28px rgba(28, 77, 58, .12);
    }

    .qr-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 9px;
    }

    .qr-link {
      min-height: 42px;
      padding: 0 14px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--line);
      border-radius: 11px;
      color: var(--green);
      background: #fff;
      font-size: 13px;
      font-weight: 760;
      text-decoration: none;
      transition: border-color .2s, transform .2s;
    }

    .qr-link:hover {
      border-color: var(--green);
      transform: translateY(-1px);
    }

    footer {
      min-height: 65px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      border-top: 1px solid var(--line);
      color: var(--muted);
      font-size: 12px;
    }

    footer span:last-child { text-align: right; }

    @keyframes spin { to { transform: rotate(360deg); } }
    @keyframes reveal { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

    @media (max-width: 900px) {
      main { grid-template-columns: 1fr; gap: 50px; padding-top: 58px; }
      .intro { text-align: center; }
      .eyebrow { justify-content: center; }
      h1, .lead { margin-left: auto; margin-right: auto; }
      .benefits { justify-content: center; }
      .card { width: min(620px, 100%); margin: 0 auto; }
    }

    @media (min-width: 901px) and (max-width: 1050px) {
      .custom-grid { grid-template-columns: 1fr; gap: 8px; }
    }

    @media (max-width: 540px) {
      .page { width: min(100% - 24px, 1180px); }
      .header { height: 72px; }
      .status { font-size: 0; }
      h1 { font-size: clamp(50px, 17vw, 68px); }
      .lead { margin-top: 23px; font-size: 15px; }
      .benefits { margin-top: 27px; gap: 9px 15px; }
      main { gap: 38px; padding: 45px 0 55px; }
      .card { padding: 25px 20px; border-radius: 22px; }
      .card::before { display: none; }
      h2 { margin-right: 0; }
      input, select, .submit { height: 58px; }
      .mode-tabs { margin-bottom: 23px; }
      .custom-grid { grid-template-columns: 1fr; gap: 8px; }
      .code-input { padding-left: 146px; }
      .code-prefix { max-width: 120px; font-size: 12px; }
      .qr-panel { grid-template-columns: 1fr; justify-items: center; }
      .qr-actions { justify-content: center; }
      footer { padding: 18px 0; flex-direction: column; justify-content: center; }
      footer span:last-child { text-align: center; }
    }

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