  :root{
    --bg: #12141A;
    --panel: #191C24;
    --panel-2: #1F232D;
    --line: #2B303C;
    --text: #E9E7DF;
    --muted: #8C8F9C;
    --amber: #D9A441;
    --amber-dim: #7A6229;
    --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --serif: Georgia, 'Times New Roman', serif;
  }
  *{box-sizing:border-box;}
  html,body{height:100%;}
  body{
    margin:0;
    background:var(--bg);
    color:var(--text);
    font-family:var(--sans);
    display:flex;
    overflow:hidden;
  }
  .sidebar{
    width:270px;
    min-width:270px;
    background:var(--panel);
    border-right:1px solid var(--line);
    display:flex;
    flex-direction:column;
    padding:20px 16px;
    overflow-y:auto;
  }
  .brand{
    display:flex;
    align-items:baseline;
    gap:8px;
    margin-bottom:20px;
  }
  .brand .mark{
    font-family:var(--serif);
    font-size:26px;
    color:var(--amber);
    font-style:italic;
  }
  .brand .name{
    font-family:var(--serif);
    font-size:20px;
    letter-spacing:0.2px;
  }
  .new-chat{
    background:transparent;
    border:1px solid var(--line);
    color:var(--text);
    padding:9px 14px;
    border-radius:6px;
    font-size:13px;
    cursor:pointer;
    text-align:left;
    transition:border-color .15s ease, background .15s ease;
    width:100%;
  }
  .new-chat:hover{ border-color:var(--amber-dim); background:var(--panel-2); }
  .section-title{
    font-size:11px;
    color:var(--muted);
    text-transform:uppercase;
    letter-spacing:0.5px;
    margin:16px 0 8px;
  }
  .key-box{
    margin-bottom:16px;
    padding-bottom:16px;
    border-bottom:1px solid var(--line);
    display:flex;
    flex-direction:column;
    gap:8px;
  }
  .key-box label{
    font-size:11px;
    color:var(--muted);
  }
  .key-box input, .key-box select{
    background:var(--panel-2);
    border:1px solid var(--line);
    color:var(--text);
    padding:8px 10px;
    border-radius:6px;
    font-size:12.5px;
    font-family:var(--mono);
    outline:none;
    width:100%;
  }
  .key-box input:focus, .key-box select:focus{ border-color:var(--amber-dim); }
  .key-note{
    font-size:10.5px;
    color:var(--muted);
    line-height:1.5;
    margin:0;
  }
  .auth-row{ display:flex; gap:6px; }
  .auth-row .new-chat{ font-size:12px; padding:8px 10px; }
  .sidebar-foot{
    margin-top:auto;
    font-size:12px;
    color:var(--muted);
    line-height:1.6;
    border-top:1px solid var(--line);
    padding-top:14px;
  }
  .sidebar-foot code{
    font-family:var(--mono);
    color:var(--amber);
    font-size:11px;
  }
  .main{
    flex:1;
    display:flex;
    flex-direction:column;
    min-width:0;
  }
  .topbar{
    padding:14px 24px;
    border-bottom:1px solid var(--line);
    font-size:13px;
    color:var(--muted);
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
  }
  .topbar .model-tag{
    font-family:var(--mono);
    font-size:11px;
    padding:3px 8px;
    border:1px solid var(--line);
    border-radius:4px;
    color:var(--amber);
  }
  .mode-tabs{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
  }
  .mode-tab{
    background:transparent;
    border:1px solid var(--line);
    color:var(--muted);
    font-size:12.5px;
    padding:6px 11px;
    border-radius:7px;
    cursor:pointer;
    font-family:var(--sans);
    white-space:nowrap;
  }
  .mode-tab.active{
    border-color:var(--amber-dim);
    color:var(--amber);
    background:rgba(217,164,65,0.08);
  }
  .attach-btn{
    background:transparent;
    border:1px solid var(--line);
    color:var(--muted);
    width:34px;
    height:34px;
    border-radius:8px;
    cursor:pointer;
    font-size:15px;
    flex-shrink:0;
  }
  .attach-btn:hover{ border-color:var(--amber-dim); color:var(--text); }
  .attach-chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:var(--panel-2);
    border:1px solid var(--line);
    color:var(--muted);
    font-size:11.5px;
    font-family:var(--mono);
    padding:5px 10px;
    border-radius:6px;
  }
  .attach-chip button{
    background:none;
    border:none;
    color:var(--muted);
    cursor:pointer;
    font-size:12px;
    padding:0;
  }
  .attach-chip-row{
    max-width:760px;
    margin:0 auto 8px;
    padding:0 28px;
    display:flex;
  }
  .gen-image, .gen-video, .attach-thumb{
    max-width:min(420px, 100%);
    height:auto;
    border-radius:10px;
    border:1px solid var(--line);
    display:block;
    margin-top:6px;
  }
  .attach-thumb{ max-width:160px; }
  .progress-note{
    font-size:12.5px;
    color:var(--muted);
    margin-top:6px;
  }
  .remix-row{
    display:flex;
    gap:8px;
    margin-top:10px;
    max-width:420px;
  }
  .remix-row input{
    flex:1;
    background:var(--panel-2);
    border:1px solid var(--line);
    color:var(--text);
    border-radius:6px;
    padding:7px 10px;
    font-size:12.5px;
    outline:none;
  }
  .remix-row button{
    background:transparent;
    border:1px solid var(--line);
    color:var(--amber);
    border-radius:6px;
    font-size:12px;
    padding:0 12px;
    cursor:pointer;
  }
  .remix-row button:hover{ border-color:var(--amber-dim); }
  .chat{
    flex:1;
    overflow-y:auto;
    padding:32px 0 12px;
  }
  .chat-inner{
    max-width:760px;
    margin:0 auto;
    padding:0 28px;
  }
  .empty{
    max-width:560px;
    margin:8vh auto 0;
    text-align:center;
    padding:0 20px;
  }
  .empty h1{
    font-family:var(--serif);
    font-weight:400;
    font-size:30px;
    margin:0 0 10px;
    color:var(--text);
  }
  .empty p{
    color:var(--muted);
    font-size:14px;
    line-height:1.6;
    margin:0 0 26px;
  }
  .examples{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    text-align:left;
  }
  .ex-btn{
    background:var(--panel);
    border:1px solid var(--line);
    color:var(--text);
    padding:12px 14px;
    border-radius:8px;
    font-size:12.5px;
    line-height:1.4;
    cursor:pointer;
    transition:border-color .15s ease;
  }
  .ex-btn:hover{ border-color:var(--amber-dim); }
  .msg{
    display:flex;
    gap:14px;
    margin-bottom:26px;
    align-items:flex-start;
  }
  .avatar{
    width:26px;
    height:26px;
    min-width:26px;
    border-radius:5px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-family:var(--mono);
    font-size:11px;
    margin-top:2px;
  }
  .msg.user .avatar{ background:var(--panel-2); color:var(--muted); border:1px solid var(--line); }
  .msg.assistant .avatar{ background:rgba(217,164,65,0.12); color:var(--amber); border:1px solid var(--amber-dim); }
  .bubble{
    font-size:14.5px;
    line-height:1.65;
    color:var(--text);
    padding-top:2px;
    min-width:0;
    flex:1;
  }
  .bubble p{ margin:0 0 12px; }
  .bubble p:last-child{ margin-bottom:0; }
  .bubble pre{
    background:#0D0F14;
    border:1px solid var(--line);
    border-radius:8px;
    padding:14px 16px;
    overflow-x:auto;
    margin:10px 0;
    position:relative;
  }
  .bubble pre code{
    font-family:var(--mono);
    font-size:12.5px;
    background:transparent;
  }
  .bubble code:not(pre code){
    font-family:var(--mono);
    font-size:12.8px;
    background:var(--panel-2);
    padding:1px 5px;
    border-radius:4px;
    color:#E8C27E;
  }
  .copy-btn{
    position:absolute;
    top:8px;
    right:8px;
    background:var(--panel-2);
    border:1px solid var(--line);
    color:var(--muted);
    font-size:11px;
    padding:4px 9px;
    border-radius:5px;
    cursor:pointer;
    font-family:var(--sans);
  }
  .copy-btn:hover{ color:var(--text); border-color:var(--amber-dim); }
  .typing{
    display:inline-flex;
    gap:4px;
    padding-top:6px;
  }
  .typing span{
    width:5px; height:5px; border-radius:50%;
    background:var(--amber-dim);
    animation:blink 1.2s infinite ease-in-out;
  }
  .typing span:nth-child(2){ animation-delay:.15s; }
  .typing span:nth-child(3){ animation-delay:.3s; }
  @keyframes blink{ 0%,80%,100%{opacity:.25;} 40%{opacity:1;} }
  .error-box{
    background:rgba(226,75,74,0.08);
    border:1px solid #5A2A2A;
    color:#E8A6A6;
    padding:10px 14px;
    border-radius:8px;
    font-size:13px;
  }
  .input-area{
    border-top:1px solid var(--line);
    padding:16px 28px 20px;
  }
  .input-wrap{
    max-width:760px;
    margin:0 auto;
    display:flex;
    align-items:flex-end;
    gap:10px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:12px;
    padding:10px 10px 10px 16px;
  }
  .input-wrap:focus-within{ border-color:var(--amber-dim); }
  textarea{
    flex:1;
    background:transparent;
    border:none;
    outline:none;
    resize:none;
    color:var(--text);
    font-family:var(--sans);
    font-size:14px;
    line-height:1.5;
    max-height:180px;
    padding:6px 0;
  }
  textarea::placeholder{ color:var(--muted); }
  .send-btn{
    background:var(--amber);
    border:none;
    color:#20180A;
    width:34px;
    height:34px;
    border-radius:8px;
    cursor:pointer;
    font-size:15px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    transition:opacity .15s ease;
  }
  .send-btn:disabled{ opacity:.35; cursor:default; }
  .hint{
    text-align:center;
    font-size:11px;
    color:var(--muted);
    margin-top:10px;
  }
  ::-webkit-scrollbar{ width:8px; }
  ::-webkit-scrollbar-thumb{ background:var(--line); border-radius:8px; }

  /* Auth screen */
  .auth-screen{
    position:fixed;
    inset:0;
    background:var(--bg);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:50;
  }
  .auth-card{
    width:360px;
    max-width:90vw;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:14px;
    padding:28px 26px;
  }
  .auth-card .brand{ justify-content:center; margin-bottom:22px; }
  .auth-tabs{
    display:flex;
    border:1px solid var(--line);
    border-radius:8px;
    overflow:hidden;
    margin-bottom:18px;
  }
  .auth-tab{
    flex:1;
    background:transparent;
    border:none;
    color:var(--muted);
    padding:9px 0;
    font-size:13px;
    cursor:pointer;
    font-family:var(--sans);
  }
  .auth-tab.active{ background:rgba(217,164,65,0.1); color:var(--amber); }
  .auth-card label{
    font-size:11px;
    color:var(--muted);
    display:block;
    margin:10px 0 6px;
  }
  .auth-card input{
    width:100%;
    background:var(--panel-2);
    border:1px solid var(--line);
    color:var(--text);
    padding:9px 11px;
    border-radius:7px;
    font-size:13px;
    outline:none;
  }
  .auth-card input:focus{ border-color:var(--amber-dim); }
  .auth-submit{
    width:100%;
    margin-top:16px;
    background:var(--amber);
    border:none;
    color:#20180A;
    padding:10px 0;
    border-radius:8px;
    font-size:13.5px;
    font-weight:600;
    cursor:pointer;
  }
  .auth-guest{
    width:100%;
    margin-top:10px;
    background:transparent;
    border:1px solid var(--line);
    color:var(--muted);
    padding:9px 0;
    border-radius:8px;
    font-size:12.5px;
    cursor:pointer;
  }
  .auth-guest:hover{ border-color:var(--amber-dim); color:var(--text); }
  .auth-msg{
    font-size:11.5px;
    color:var(--muted);
    margin-top:12px;
    text-align:center;
    min-height:14px;
  }
  .gear-btn{
    position:fixed;
    top:16px;
    right:20px;
    background:var(--panel);
    border:1px solid var(--line);
    color:var(--muted);
    width:36px;
    height:36px;
    border-radius:9px;
    cursor:pointer;
    font-size:15px;
    z-index:60;
  }
  .gear-btn:hover{ border-color:var(--amber-dim); color:var(--amber); }
  .menu-btn{
    display:none;
    position:fixed;
    top:16px;
    left:16px;
    background:var(--panel);
    border:1px solid var(--line);
    color:var(--muted);
    width:36px;
    height:36px;
    border-radius:9px;
    cursor:pointer;
    font-size:15px;
    z-index:60;
  }
  .menu-btn:hover{ border-color:var(--amber-dim); color:var(--amber); }
  .sidebar-backdrop{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.5);
    z-index:39;
  }

  /* Admin modal */
  .admin-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.55);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:100;
  }
  .admin-card{
    width:400px;
    max-width:92vw;
    max-height:86vh;
    overflow-y:auto;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:14px;
    padding:24px;
  }
  .admin-card h2{
    font-family:var(--serif);
    font-weight:400;
    font-size:20px;
    margin:0 0 4px;
  }
  .admin-card .admin-sub{
    font-size:12px;
    color:var(--muted);
    margin:0 0 18px;
  }
  .admin-close{
    float:right;
    background:transparent;
    border:1px solid var(--line);
    color:var(--muted);
    width:26px;
    height:26px;
    border-radius:6px;
    cursor:pointer;
  }
  .account-box{
    padding-bottom:16px;
    margin-bottom:16px;
    border-bottom:1px solid var(--line);
    font-size:12.5px;
    color:var(--muted);
  }
  .account-box b{ color:var(--text); }

  /* ===== Responsive: tablet ===== */
  @media (max-width:900px){
    .sidebar{ width:240px; min-width:240px; }
    .chat-inner, .attach-chip-row{ padding:0 18px; }
    .input-area{ padding:14px 18px 18px; }
    .topbar{ padding:12px 18px 12px 56px; }
  }

  /* ===== Responsive: telefon ===== */
  @media (max-width:640px){
    .menu-btn{ display:block; }
    .gear-btn{ top:16px; right:16px; }
    body{ overflow:hidden; }
    .sidebar{
      position:fixed;
      inset:0 auto 0 0;
      width:82vw;
      max-width:300px;
      min-width:0;
      z-index:40;
      transform:translateX(-100%);
      transition:transform .2s ease;
      box-shadow:2px 0 18px rgba(0,0,0,0.4);
    }
    .sidebar.open{ transform:translateX(0); }
    .sidebar-backdrop.open{ display:block; }
    .main{ width:100%; }
    .topbar{ padding:12px 56px 12px 56px; gap:8px; }
    .topbar > span:first-child{ display:none; }
    .mode-tabs{ order:1; width:100%; justify-content:center; }
    .model-tag{ order:0; }
    .chat{ padding:24px 0 10px; }
    .chat-inner, .attach-chip-row{ padding:0 14px; }
    .empty{ margin-top:4vh; }
    .empty h1{ font-size:24px; }
    .examples{ grid-template-columns:1fr; }
    .input-area{ padding:12px 14px 16px; }
    .input-wrap{ padding:8px 8px 8px 12px; }
    .admin-card{ width:92vw; padding:20px; }
    .auth-card{ width:92vw; padding:22px 18px; }
    .bubble{ font-size:14px; }
  }
