    :root{
      --bg:#0b0d12;
      --panel:#12151c;
      --panel-2:#171b23;
      --border:#262c37;
      --border-soft:#202631;
      --text:#f4f7fb;
      --muted:#95a0b1;
      --accent:#8b93ff;
      --accent-2:#6f78f7;
      --success:#7ddf9c;
      --danger:#ff8b8b;
      --code:#0d1016;
      --shadow:0 18px 45px rgba(0,0,0,.28);
    }

    *{box-sizing:border-box}
    html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}
    body{
      font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
      min-height:100vh;
      background:
        radial-gradient(circle at top left, rgba(139,147,255,.08), transparent 34%),
        var(--bg);
    }

    button,input,textarea{font:inherit}
    button{cursor:pointer}

    .app-shell{
      min-height:100vh;
      display:grid;
      grid-template-columns:260px minmax(0,1fr);
    }

    .floating-image-placeholder{
      width:100%;
      pointer-events:none;
    }

    .floating-image-placeholder img{
      display:block;
      width:100%;
      height:auto;
    }

    .sidebar{
      position:sticky;
      top:0;
      height:100vh;
      padding:22px 16px;
      border-right:1px solid var(--border);
      background:rgba(10,12,17,.92);
      backdrop-filter:blur(18px);
      display:flex;
      flex-direction:column;
      gap:22px;
    }

    .brand{
      display:flex;
      align-items:center;
      gap:11px;
      padding:0 8px;
    }

    .brand-mark{
      width:38px;
      height:38px;
      border-radius:12px;
      overflow:hidden;
      flex:0 0 auto;
    }

    .brand-mark img{
      width:100%;
      height:100%;
      object-fit:contain;
      display:block;
    }

    .brand-text strong{
      display:block;
      font-size:15px;
      letter-spacing:.2px;
    }

    .brand-text span{
      display:block;
      color:var(--muted);
      font-size:12px;
      margin-top:2px;
    }

    .nav-section-title{
      color:#6f798b;
      text-transform:uppercase;
      letter-spacing:.12em;
      font-size:10px;
      font-weight:800;
      padding:0 10px;
      margin-bottom:7px;
    }

    .nav{
      display:flex;
      flex-direction:column;
      gap:6px;
    }

    .nav-item{
      width:100%;
      border:1px solid transparent;
      background:transparent;
      color:#b9c1cf;
      border-radius:10px;
      padding:10px 11px;
      display:flex;
      align-items:center;
      gap:10px;
      text-align:left;
      transition:.16s ease;
    }

    .nav-item:hover{
      background:#151922;
      color:#fff;
    }

    .nav-item.active{
      background:#1a1f2b;
      border-color:#32394a;
      color:#fff;
      box-shadow:inset 0 0 0 1px rgba(139,147,255,.08);
    }

    .nav-icon{
      width:24px;
      height:24px;
      display:grid;
      place-items:center;
      border-radius:7px;
      background:#0e1117;
      color:#aab2ff;
      font-size:13px;
      flex:0 0 auto;
    }

    .nav-copy strong{
      display:block;
      font-size:13px;
      line-height:1.25;
    }

    .nav-copy span{
      display:block;
      font-size:11px;
      color:#7e8899;
      margin-top:2px;
    }

    .sidebar-footer{
      margin-top:auto;
      padding:12px;
      border:1px solid var(--border-soft);
      border-radius:12px;
      color:#788294;
      font-size:11px;
      line-height:1.45;
      background:#0e1117;
    }

    .logout-button{
      width:100%;
      border:1px solid var(--border-soft);
      background:#0e1117;
      color:#b9c1cf;
      border-radius:10px;
      padding:10px 11px;
      display:flex;
      align-items:center;
      gap:10px;
      text-align:left;
      transition:.16s ease;
    }

    .logout-button:hover{
      color:#fff;
      border-color:#3a4353;
      background:#171b23;
    }

    .login-page{
      min-height:100vh;
      padding:24px;
      display:grid;
      place-items:center;
      background:
        radial-gradient(circle at 18% 12%,rgba(139,147,255,.13),transparent 32%),
        radial-gradient(circle at 82% 88%,rgba(111,120,247,.08),transparent 30%);
    }

    .login-card{
      width:min(100%,430px);
      padding:28px;
      border:1px solid var(--border);
      border-radius:20px;
      background:linear-gradient(145deg,rgba(23,27,35,.98),rgba(15,18,24,.98));
      box-shadow:0 28px 70px rgba(0,0,0,.42);
    }

    .login-brand{
      display:flex;
      align-items:center;
      gap:14px;
    }

    .login-logo{
      width:50px;
      height:50px;
      flex:0 0 auto;
      overflow:hidden;
      border-radius:15px;
      background:#0d1016;
      box-shadow:inset 0 0 0 1px rgba(255,255,255,.04);
    }

    .login-logo img{
      width:100%;
      height:100%;
      display:block;
      object-fit:contain;
    }

    .login-eyebrow{
      display:block;
      margin-bottom:4px;
      color:#8b93ff;
      font-size:10px;
      font-weight:800;
      letter-spacing:.14em;
      text-transform:uppercase;
    }

    .login-brand h1{
      margin:0;
      font-size:21px;
      letter-spacing:-.02em;
    }

    .login-description{
      margin:22px 0 20px;
      color:var(--muted);
      font-size:13px;
      line-height:1.55;
    }

    .login-form{
      display:flex;
      flex-direction:column;
      gap:15px;
    }

    .login-field label{
      display:block;
      margin-bottom:7px;
      color:#d6dcea;
      font-size:12px;
      font-weight:800;
    }

    .login-field input[aria-invalid="true"]{
      border-color:var(--danger);
      box-shadow:0 0 0 3px rgba(255,139,139,.08);
    }

    .password-control{
      position:relative;
    }

    .password-control input{
      padding-right:64px;
    }

    .password-toggle{
      position:absolute;
      top:50%;
      right:8px;
      transform:translateY(-50%);
      border:0;
      padding:6px 8px;
      border-radius:7px;
      background:transparent;
      color:#aab2ff;
      font-size:11px;
      font-weight:800;
    }

    .password-toggle:hover{
      background:#1a1f29;
      color:#fff;
    }

    .remember-option{
      width:max-content;
      display:flex;
      align-items:center;
      gap:8px;
      color:#9ba5b6;
      font-size:11px;
      cursor:pointer;
    }

    .remember-option input{
      width:15px;
      height:15px;
      accent-color:var(--accent);
    }

    .login-error{
      min-height:17px;
      color:var(--danger);
      font-size:11px;
    }

    .login-submit{
      width:100%;
      border:0;
      border-radius:10px;
      padding:12px 15px;
      background:linear-gradient(180deg,#939aff,#747df3);
      color:#0c0f14;
      font-size:12px;
      font-weight:900;
      transition:.16s ease;
    }

    .login-submit:hover{
      filter:brightness(1.06);
      transform:translateY(-1px);
    }

    .login-footer{
      margin-top:20px;
      padding-top:16px;
      border-top:1px solid var(--border-soft);
      display:flex;
      align-items:center;
      justify-content:center;
      gap:7px;
      color:#737e90;
      font-size:10px;
    }

    .login-status-dot{
      width:6px;
      height:6px;
      border-radius:50%;
      background:#7ddf9c;
      box-shadow:0 0 9px rgba(125,223,156,.55);
    }

    .main{
      min-width:0;
      padding:26px 30px 40px;
    }

    .topbar{
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:16px;
      margin-bottom:24px;
    }

    .title-wrap h1{
      margin:0;
      font-size:26px;
      letter-spacing:-.02em;
    }

    .title-wrap p{
      margin:6px 0 0;
      color:var(--muted);
      font-size:13px;
    }

    .pill{
      border:1px solid var(--border);
      background:#10141b;
      color:#9ba5b6;
      padding:8px 11px;
      border-radius:999px;
      font-size:11px;
      white-space:nowrap;
    }

    .tool-page{display:none}
    .tool-page.active{display:block}

    .hero-card{
      background:linear-gradient(145deg,#151925,#11151d);
      border:1px solid var(--border);
      border-radius:16px;
      padding:20px;
      box-shadow:var(--shadow);
      margin-bottom:16px;
    }

    .field-label{
      display:block;
      margin-bottom:8px;
      font-size:12px;
      font-weight:800;
      color:#d6dcea;
      letter-spacing:.01em;
    }

    input, textarea{
      width:100%;
      border:1px solid #303745;
      background:var(--code);
      color:var(--text);
      border-radius:10px;
      outline:none;
      padding:12px 13px;
    }

    input:focus,textarea:focus{
      border-color:var(--accent);
      box-shadow:0 0 0 3px rgba(139,147,255,.10);
    }

    textarea{
      min-height:320px;
      resize:vertical;
      font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace;
      font-size:12.5px;
      line-height:1.6;
      tab-size:4;
    }

    .hint{
      color:#7f899a;
      font-size:11px;
      line-height:1.5;
      margin-top:8px;
    }

    .hint code{
      color:#bbc1ff;
      font-family:"SFMono-Regular",Consolas,monospace;
    }

    .toolbar{
      display:flex;
      gap:9px;
      flex-wrap:wrap;
      margin-top:12px;
      align-items:center;
    }

    .btn{
      border:0;
      border-radius:9px;
      padding:9px 13px;
      font-size:12px;
      font-weight:800;
    }

    .btn-primary{
      background:linear-gradient(180deg,#939aff,#747df3);
      color:#0c0f14;
    }

    .btn-primary:hover{filter:brightness(1.04)}

    .btn-secondary{
      background:#1a1f29;
      color:#d8deea;
      border:1px solid #303744;
    }

    .btn-secondary:hover{background:#202631}

    .status{
      margin-left:auto;
      color:var(--success);
      font-size:11px;
      min-height:16px;
    }

    .grid-2{
      display:grid;
      grid-template-columns:minmax(0,1fr) minmax(0,1fr);
      gap:16px;
    }

    .output-card{
      background:var(--panel);
      border:1px solid var(--border);
      border-radius:14px;
      padding:16px;
      min-width:0;
    }

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

    .output-head h2{
      margin:0;
      font-size:14px;
    }

    .output-card textarea{
      min-height:360px;
    }

    .placeholder{
      border:1px dashed #2f3744;
      border-radius:16px;
      padding:42px 22px;
      text-align:center;
      background:#10131a;
      color:#7f899a;
    }

    .placeholder strong{
      display:block;
      color:#c8ceda;
      font-size:15px;
      margin-bottom:6px;
    }

    .welcome-grid{
      display:grid;
      grid-template-columns:repeat(3,minmax(0,1fr));
      gap:14px;
    }

    .mini-card{
      border:1px solid var(--border);
      border-radius:14px;
      background:var(--panel);
      padding:16px;
    }

    .mini-card .mini-icon{
      width:34px;height:34px;border-radius:10px;
      display:grid;place-items:center;
      background:#0d1016;color:#adb4ff;
      margin-bottom:12px;
    }

    .mini-card strong{display:block;font-size:13px}
    .mini-card p{margin:6px 0 0;color:#7f899a;font-size:11px;line-height:1.5}

    .mini-card-link{
      width:100%;
      text-align:left;
      color:inherit;
      font:inherit;
      cursor:pointer;
      transition:.16s ease;
    }

    .mini-card-link:hover{
      transform:translateY(-2px);
      border-color:#3a4353;
      background:#161b24;
      box-shadow:0 10px 24px rgba(0,0,0,.18);
    }

    .mini-card-link:focus-visible{
      outline:2px solid var(--accent);
      outline-offset:2px;
    }


    .json-tabs{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
    }

    .json-tab{
      border:1px solid #303744;
      background:#151922;
      color:#9da7b8;
      border-radius:9px;
      padding:9px 13px;
      font-size:12px;
      font-weight:800;
    }

    .json-tab:hover{
      background:#1b202a;
      color:#fff;
    }

    .json-tab.active{
      background:#252b3b;
      border-color:#4a5273;
      color:#fff;
      box-shadow:inset 0 0 0 1px rgba(139,147,255,.10);
    }

    .json-tool{display:none}
    .json-tool.active{display:block}

    .json-result{
      margin-top:14px;
      border:1px solid var(--border);
      border-radius:10px;
      padding:12px 14px;
      font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace;
      font-size:12px;
      line-height:1.5;
      white-space:pre-wrap;
      word-break:break-word;
      background:#0d1016;
    }

    .json-result.neutral{
      color:#8f99aa;
    }

    .json-result.success{
      color:#8de2a7;
      border-color:rgba(125,223,156,.35);
      background:rgba(125,223,156,.06);
    }

    .json-result.error{
      color:#ff9d9d;
      border-color:rgba(255,139,139,.38);
      background:rgba(255,139,139,.06);
    }


    .required-panel{
      margin-top:14px;
      border:1px solid var(--border);
      border-radius:12px;
      background:#0f1218;
      overflow:hidden;
      display:none;
    }

    .required-panel.visible{
      display:block;
    }

    .required-panel-head{
      padding:11px 13px;
      border-bottom:1px solid var(--border-soft);
      display:flex;
      justify-content:space-between;
      gap:12px;
      align-items:center;
    }

    .required-panel-head strong{
      font-size:12px;
    }

    .required-panel-head span{
      color:var(--muted);
      font-size:10px;
    }

    .required-field-list{
      max-height:280px;
      overflow:auto;
    }

    .required-field-row{
      padding:10px 13px;
      border-bottom:1px solid var(--border-soft);
      display:grid;
      grid-template-columns:minmax(0,1fr) auto;
      align-items:center;
      gap:12px;
    }

    .required-field-row:last-child{
      border-bottom:0;
    }

    .required-field-path{
      display:block;
      font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace;
      font-size:11px;
      color:#dce2ec;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
    }

    .required-field-type{
      display:block;
      color:var(--muted);
      font-size:10px;
      margin-top:3px;
    }

    .switch{
      position:relative;
      display:inline-flex;
      align-items:center;
      gap:8px;
      cursor:pointer;
      user-select:none;
    }

    .switch input{
      position:absolute;
      opacity:0;
      pointer-events:none;
    }

    .switch-track{
      width:34px;
      height:19px;
      border-radius:999px;
      background:#2b313d;
      border:1px solid #3a4250;
      position:relative;
      transition:.16s ease;
      flex:0 0 auto;
    }

    .switch-track::after{
      content:"";
      position:absolute;
      width:13px;
      height:13px;
      border-radius:50%;
      top:2px;
      left:2px;
      background:#a6afbe;
      transition:.16s ease;
    }

    .switch input:checked + .switch-track{
      background:#656ee6;
      border-color:#8189fb;
    }

    .switch input:checked + .switch-track::after{
      transform:translateX(15px);
      background:#fff;
    }

    .switch-label{
      font-size:10px;
      color:var(--muted);
    }


    .image-input-card{
      margin-bottom:14px;
      border:1px dashed #333b49;
      border-radius:12px;
      background:#0f1218;
      padding:14px;
    }

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

    .image-input-head strong{
      font-size:12px;
    }

    .image-input-head span{
      color:var(--muted);
      font-size:10px;
    }

    .image-upload-row{
      display:flex;
      gap:10px;
      flex-wrap:wrap;
      align-items:center;
    }

    .image-file-input{
      display:none;
    }

    .image-preview-wrap{
      display:none;
      margin-top:12px;
      border:1px solid var(--border-soft);
      border-radius:10px;
      overflow:hidden;
      background:#090b0f;
      max-height:260px;
    }

    .image-preview-wrap.visible{
      display:block;
    }

    .image-preview-wrap img{
      display:block;
      width:100%;
      max-height:260px;
      object-fit:contain;
      background:#090b0f;
    }

    .ocr-progress{
      margin-top:10px;
      color:var(--muted);
      font-size:10px;
      min-height:14px;
      line-height:1.4;
    }

    .btn:disabled{
      opacity:.45;
      cursor:not-allowed;
      filter:none;
    }


    .input-format-badge{
      display:inline-flex;
      align-items:center;
      min-height:22px;
      padding:3px 8px;
      border-radius:999px;
      border:1px solid var(--border);
      background:#11151c;
      color:var(--muted);
      font-size:10px;
      font-weight:700;
    }

    @media(max-width:980px){
      .app-shell{grid-template-columns:1fr}
      .sidebar{
        position:relative;
        height:auto;
        border-right:0;
        border-bottom:1px solid var(--border);
      }
      .nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
      .sidebar-footer{display:none}
      .grid-2,.welcome-grid{grid-template-columns:1fr}
      .main{padding:20px 16px 34px}
    }
