@font-face { font-family: Inter; src: url("../assets/fonts/Inter-Variable.ttf") format("truetype"); font-style: normal; font-weight: 400 700; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../assets/fonts/DMMono-Regular.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../assets/fonts/DMMono-Medium.ttf") format("truetype"); font-style: normal; font-weight: 500; font-display: swap; }
    :root {
      color-scheme: light;
      --page: #f7f8fa;
      --text: #1d2735;
      --border: #e4e8ee;
      --muted: #7b8594;
      --blue: #2563eb;
      --blue-text: #225fbc;
      --blue-soft: #e6efff;
      --blue-border: #c6d8f6;
      font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      -webkit-font-smoothing: antialiased;
    }
    *, *::before, *::after { box-sizing: border-box; }
    html, body { width: 100%; min-width: 280px; min-height: 100%; margin: 0; }
    body { background: var(--page); color: var(--text); }
    button, input, textarea { font: inherit; }
    button { cursor: pointer; }
    button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
      outline: 3px solid #aac2f7; outline-offset: 2px;
    }
    [hidden] { display: none !important; }
    /* Application shell */
    .app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
    .topbar {
      height: 72px; min-height: 72px; display: flex; align-items: center;
      justify-content: space-between; gap: 12px; padding: 0 24px;
      background: #fff; border-bottom: 1px solid var(--border);
    }
    .brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
    .brand-icon {
      display: grid; place-items: center; flex: 0 0 35px; width: 35px; height: 35px;
      border: 1px solid #dce5f7; border-radius: 11px;
      background: #f1f5fd; color: #2b61b8;
    }
    .brand-icon svg { width: 20px; height: 20px; }
    .brand h1 {
      margin: 0; font-size: 17px; line-height: 1.3; letter-spacing: -.035em;
      font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .topbar-note { color: #8b97a8; font-size: 12px; white-space: nowrap; }
    .app-main { display: flex; flex: 1; min-height: 0; padding: 18px 20px 0; }
    .workspace {
      flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px; min-width: 0; min-height: 0;
    }
    /* Workspace panels and separator choices */
    .panel {
      display: flex; flex-direction: column; min-width: 0; min-height: 0;
      overflow: hidden; border: 1px solid #e1e6ed; border-radius: 16px;
      background: #fff; box-shadow: 0 5px 24px rgba(29, 45, 67, .028);
    }
    .panel-heading {
      display: flex; align-items: center; justify-content: space-between; gap: 10px;
      height: 51px; min-height: 51px; padding: 0 17px;
      border-bottom: 1px solid #e9ecf1;
    }
    .panel-title { margin: 0; color: #303d4d; font-size: 13px; font-weight: 600; }
    .panel-detail { color: #9ba4b1; font-size: 11px; font-variant-numeric: tabular-nums; }
    .parser-toolbar {
      display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
      padding: 12px 17px; min-height: 61px; border-bottom: 1px solid #e9ecf1;
    }
    .toolbar-label { color: #8390a2; font-size: 11px; font-weight: 600; white-space: nowrap; }
    .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
    .chip, .manage-button {
      display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
      height: 32px; padding: 0 11px; border: 1px solid #dfe5ee;
      border-radius: 8px; background: #fff; color: #536276;
      font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
      transition: background .15s, border-color .15s, color .15s;
    }
    .chip:hover, .manage-button:hover { background: #f4f7fc; border-color: #cbd9ef; }
    .chip[aria-pressed="true"] {
      background: var(--blue-soft); border-color: var(--blue-border); color: var(--blue-text);
    }
    .chip[aria-pressed="true"]:hover { background: #dce9ff; }
    .manage-button { width: 32px; padding: 0; background: #f8fafc; color: #64748b; }
    .manage-button svg { display: block; width: 16px; height: 16px; }
    .manage-button[aria-expanded="true"] { background: var(--blue-soft); border-color: var(--blue-border); color: var(--blue-text); }
    /* Text editors and copy action */
    .text-surface { flex: 1 1 0; width: 100%; min-width: 0; min-height: 0; margin: 0; }
    .input-area, .output-area {
      display: block; overflow: auto; resize: none; outline: none;
      padding: 21px 22px 28px; border: 0; border-radius: 0;
      background: #fff; color: #344258;
      font: 13px/1.85 "DM Mono", Consolas, "Liberation Mono", monospace;
      white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
      scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent;
    }
    .input-area:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #b6cbf5; }
    .input-area::placeholder, .output-area.empty { color: #9aa5b3; }
    .input-area::-webkit-scrollbar, .output-area::-webkit-scrollbar { width: 9px; height: 9px; }
    .input-area::-webkit-scrollbar-thumb, .output-area::-webkit-scrollbar-thumb { background: #cbd5e1; border: 2px solid #fff; border-radius: 20px; }
    .copy {
      display: inline-flex; align-items: center; justify-content: center; gap: 7px;
      height: 32px; padding: 0 11px; border: 1px solid #dfe5ee;
      border-radius: 9px; background: #fff; color: #4f5d70;
      font-size: 11px; font-weight: 600;
      transition: background .15s, border-color .15s;
    }
    .copy:hover:not(:disabled) { background: #f6f8fc; border-color: #cfd9e9; }
    .copy:disabled { opacity: .45; cursor: not-allowed; }
    .copy svg { width: 14px; height: 14px; }
    .footer {
      flex: 0 0 auto; padding: 11px 12px 13px; text-align: center;
      color: var(--muted); font-size: 12px; line-height: 18px;
    }
    .footer a { color: inherit; text-decoration: none; transition: color .15s; }
    .footer a:hover { color: var(--blue); }
    /* Shared separator manager */
    .popover {
      position: fixed; z-index: 30; width: 290px; max-width: calc(100vw - 24px);
      padding: 17px; border: 1px solid #dce3ed; border-radius: 12px;
      background: #fff; color: #344258;
      box-shadow: 0 16px 45px rgba(27,42,63,.19), 0 2px 6px rgba(27,42,63,.08);
    }
    .popover-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
    .popover-heading { display: inline-flex; align-items: center; gap: 7px; }
    .popover-title { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.025em; }
    .info-wrap { display: inline-flex; position: relative; }
    .info-button {
      display: grid; place-items: center; width: 19px; height: 19px;
      border: 0; border-radius: 50%; background: transparent; color: #8b98aa; padding: 0;
    }
    .info-button:hover, .info-button:focus-visible { color: var(--blue); background: #eef3ff; }
    .info-button svg { width: 15px; height: 15px; }
    .info-tooltip {
      pointer-events: none; position: absolute; z-index: 3; top: 28px; left: -109px;
      width: 238px; padding: 9px 10px; border: 1px solid #dce3ed; border-radius: 8px;
      background: #fff; color: #536276; box-shadow: 0 6px 18px rgba(27, 42, 63, .12);
      font-size: 11px; font-weight: 400; line-height: 1.5;
      opacity: 0; visibility: hidden;
    }
    .info-button:hover + .info-tooltip,
    .info-button:focus + .info-tooltip { opacity: 1; visibility: visible; }
    .close-popover {
      display: grid; place-items: center; height: 27px; width: 27px; padding: 0;
      border: 0; border-radius: 7px; background: transparent; color: #8b98aa;
    }
    .close-popover:hover { background: #eef3fa; color: #4f5d70; }
    .close-popover svg { width: 16px; height: 16px; }
    .add-form { display: flex; gap: 7px; }
    .value-input {
      flex: 1; min-width: 0; height: 36px; padding: 0 10px;
      border: 1px solid #dce3ed; border-radius: 8px;
      background: #fff; color: #273449;
      font: 12px "DM Mono", Consolas, monospace;
    }
    .value-input:focus { border-color: #7da9f2; outline: none; box-shadow: 0 0 0 2px rgba(69,127,223,.12); }
    .save-button {
      height: 36px; padding: 0 13px; border: 1px solid var(--blue); border-radius: 8px;
      background: var(--blue); color: #fff; font-size: 11px; font-weight: 600;
    }
    .save-button:hover { background: #1d57cf; }
    .error { margin: 6px 0 0; color: #ba4747; font-size: 11px; }
    .saved-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e8ecf2; }
    .saved-title { margin-bottom: 8px; color: #8390a2; font-size: 11px; font-weight: 600; }
    .saved-list { display: grid; gap: 6px; max-height: 210px; overflow-y: auto; }
    .saved-row {
      display: flex; align-items: center; justify-content: space-between;
      min-height: 36px; border: 1px solid #e4e9f0; border-radius: 8px;
      background: #fafbfd; overflow: hidden;
    }
    .saved-value {
      padding: 0 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis;
      white-space: nowrap; font: 12px "DM Mono", Consolas, monospace;
    }
    .remove-button {
      display: grid; place-items: center; flex: 0 0 36px; width: 36px;
      height: 35px; padding: 0; border: 0; border-left: 1px solid #e4e9f0;
      background: transparent; color: #8b98aa;
      transition: background .15s, color .15s;
    }
    .remove-button svg { display: block; width: 13px; height: 13px; }
    .remove-button:hover, .remove-button:focus-visible { background: #eef2f7; color: #475569; }
    /* Responsive sizing and motion preferences */
    @media (hover: none), (pointer: coarse) {
      .saved-row { min-height: 44px; }
      .remove-button { flex-basis: 44px; width: 44px; height: 43px; }
    }
    @media (min-width: 821px) { .app { height: 100vh; height: 100dvh; } }
    @media (max-width: 820px) {
      .topbar { height: 63px; min-height: 63px; padding: 0 16px; }
      .app-main { padding: 12px 12px 0; }
      .workspace { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 330px; align-content: start; }
      .panel { height: 330px; min-height: 330px; }
      .panel-heading { height: 47px; min-height: 47px; }
      .footer { padding: 10px 12px 12px; }
    }
    @media (max-width: 530px) {
      .topbar { padding: 0 12px; }
      .brand-icon { flex-basis: 31px; width: 31px; height: 31px; border-radius: 9px; }
      .brand h1 { font-size: 15px; }
      .topbar-note { display: none; }
      .parser-toolbar { padding: 11px 13px; gap: 8px; }
      .panel-heading { padding: 0 13px; }
      .input-area, .output-area { padding: 16px 14px 23px; font-size: 12px; }
      .chip, .manage-button { height: 30px; border-radius: 7px; }
      .manage-button { width: 30px; }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { transition: none !important; }
    }
