:root {
      --ink: #182026;
      --muted: #62717d;
      --line: #d8e2e8;
      --paper: #f7f9fb;
      --panel: #ffffff;
      --blue: #2563eb;
      --green: #0f9f6e;
      --red: #d13f3f;
      --yellow: #f6c453;
      --shadow: 0 18px 44px rgba(24, 32, 38, 0.12);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      overflow-x: hidden;
      color: var(--ink);
      font-family: Arial, "Noto Sans KR", sans-serif;
      background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.14), transparent 34%),
        linear-gradient(225deg, rgba(15, 159, 110, 0.13), transparent 36%),
        var(--paper);
    }

    button, select, textarea {
      font: inherit;
    }

    .app {
      width: min(980px, calc(100% - 28px));
      margin: 0 auto;
      padding: 22px 0;
    }

    header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 16px;
    }

    h1 {
      margin: 0;
      font-size: clamp(28px, 4vw, 44px);
      line-height: 1;
      letter-spacing: 0;
    }

    .subtitle {
      max-width: 580px;
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 15px;
      line-height: 1.45;
    }

    .status-pill {
      min-width: 120px;
      padding: 9px 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.8);
      color: var(--muted);
      text-align: center;
      white-space: nowrap;
    }

    .workspace {
      display: grid;
      grid-template-columns: 300px 1fr;
      gap: 14px;
      align-items: start;
    }

    .panel {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.88);
      box-shadow: var(--shadow);
    }

    .controls {
      padding: 14px;
    }

    .field {
      margin-bottom: 12px;
    }

    label {
      display: block;
      margin-bottom: 6px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 700;
    }

    select, textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      color: var(--ink);
      outline: none;
    }

    select {
      height: 40px;
      padding: 0 10px;
    }

    textarea {
      min-height: 86px;
      resize: vertical;
      padding: 10px;
      line-height: 1.4;
    }

    select:focus, textarea:focus {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }

    .swap-row {
      display: flex;
      align-items: center;
      justify-content: center;
      margin: -2px 0 10px;
    }

    .icon-btn {
      display: inline-grid;
      place-items: center;
      width: 36px;
      height: 36px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      color: var(--ink);
      cursor: pointer;
    }

    .icon-btn:hover {
      border-color: var(--blue);
      color: var(--blue);
    }

    .actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 12px;
    }

    .primary, .secondary {
      min-height: 40px;
      border: 0;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 700;
    }

    .primary {
      background: var(--blue);
      color: #fff;
    }

    .primary.recording {
      background: var(--red);
    }

    .secondary {
      border: 1px solid var(--line);
      background: #fff;
      color: var(--ink);
    }

    .hint {
      margin: 10px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }

    .conversation {
      min-height: 460px;
      padding: 14px;
    }

    .current {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-bottom: 12px;
    }

    .box {
      min-height: 165px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      padding: 13px;
    }

    .box-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 9px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 700;
    }

    .lang-tag {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 0 8px;
      border-radius: 8px;
      background: #edf4ff;
      color: #1747a6;
      font-size: 12px;
    }

    .text {
      margin: 0;
      font-size: 18px;
      line-height: 1.45;
      overflow-wrap: anywhere;
      white-space: pre-wrap;
    }

    .delivery-info {
      display: grid;
      gap: 6px;
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid var(--line);
    }

    .info-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 700;
    }

    .info-value {
      color: var(--ink);
      text-align: right;
    }

    .accuracy-panel {
      margin-top: 10px;
      border: 1px solid #f3d28b;
      border-radius: 8px;
      background: #fff8e8;
      padding: 10px;
    }

    .accuracy-title {
      margin: 0 0 6px;
      color: #7a4f00;
      font-size: 13px;
      font-weight: 700;
    }

    .accuracy-text {
      margin: 0;
      color: #4f3a15;
      font-size: 13px;
      line-height: 1.4;
      overflow-wrap: anywhere;
      white-space: pre-wrap;
    }

    .placeholder {
      color: #93a0aa;
    }

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

    h2 {
      margin: 0;
      font-size: 16px;
    }

    .history {
      display: grid;
      gap: 8px;
      max-height: 220px;
      overflow: auto;
      padding-right: 4px;
    }

    .entry {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      padding: 10px;
    }

    .entry-meta {
      margin-bottom: 8px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }

    .entry p {
      margin: 6px 0;
      line-height: 1.45;
    }

    .empty {
      border: 1px dashed var(--line);
      border-radius: 8px;
      color: var(--muted);
      padding: 16px;
      text-align: center;
    }

    @media (max-width: 840px) {
      .app {
        width: min(620px, calc(100% - 20px));
        padding: 14px 0 18px;
      }

      header, .workspace, .current {
        display: block;
      }

      header {
        margin-bottom: 12px;
      }

      h1 {
        font-size: 34px;
      }

      .subtitle {
        max-width: none;
        font-size: 14px;
      }

      .status-pill {
        margin-top: 12px;
        width: 100%;
      }

      .controls {
        margin-bottom: 14px;
      }

      .conversation {
        min-height: 0;
      }

      .box {
        min-height: 130px;
        margin-bottom: 10px;
      }

    }

    @media (max-width: 520px) {
      .app {
        width: 100%;
        padding: 10px;
      }

      header {
        margin-bottom: 10px;
      }

      h1 {
        font-size: 30px;
      }

      .subtitle {
        font-size: 13px;
        line-height: 1.4;
      }

      .panel {
        box-shadow: 0 10px 24px rgba(24, 32, 38, 0.08);
      }

      .controls,
      .conversation {
        padding: 12px;
      }

      .field {
        margin-bottom: 10px;
      }

      select {
        height: 42px;
      }

      textarea {
        min-height: 72px;
      }

      .actions {
        gap: 7px;
      }

      .primary,
      .secondary {
        min-height: 42px;
        font-size: 14px;
      }

      .box {
        min-height: auto;
        padding: 12px;
      }

      .box-title {
        font-size: 12px;
      }

      .text {
        font-size: 17px;
      }

      .delivery-info {
        margin-top: 10px;
      }

      .accuracy-panel {
        padding: 9px;
      }

      .toolbar {
        margin-top: 4px;
      }

      .history {
        max-height: 170px;
      }
    }

    @media (max-width: 360px) {
      .app {
        padding: 8px;
      }

      h1 {
        font-size: 27px;
      }

      .subtitle {
        font-size: 12px;
      }

      .actions {
        grid-template-columns: 1fr;
      }

      .text {
        font-size: 16px;
      }
    }
