 :root{
      --bg:#05070c;
      --panel:#0c0f16;
      --panel2:#111520;
      --line:#1a2030;
      --text:#f3f5fb;
      --muted:#939ab0;
      --accent:#9b6dff;
      --radius:22px;
      --success:#4ade80;
      --danger:#fb7185;
    }

    *{box-sizing:border-box}

    html,body{
      margin:0;
      background:
        radial-gradient(circle at 50% 20%, rgba(80,100,255,.09), transparent 28%),
        linear-gradient(180deg, #06080d 0%, #000000 100%);
      color:var(--text);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    }

    body{ min-height:100vh; }

    .app{
      min-height:100vh;
      display:flex;
      flex-direction:column;
    }

    .topbar{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:16px;
      padding:4px 27px;
      border-bottom:1px solid rgba(255, 255, 255, 0.571);
      background:rgba(4,6,10,.78);
      backdrop-filter:blur(14px);
      position:sticky;
      top:0;
      z-index:20;
    }

    .brand{
      display:flex;
      flex-direction:column;
      gap:4px;
    }

    .brand h1{
      margin:0;
      font-size:22px;
      font-weight:800;
      letter-spacing:-.02em;
    }

    .brand h1 span{
      background:linear-gradient(90deg,#ffffff 0%, #b389ff 55%, #67d6ff 100%);
      -webkit-background-clip:text;
      background-clip:text;
      color:transparent;
    }

    .brand p{
      margin:0;
      color:var(--muted);
      font-size:14px;
    }

    .topbar-actions{
      display:flex;
      align-items:center;
      gap:12px;
      flex-wrap:wrap;
      justify-content:flex-end;
    }

    .upload-btn,
    .ghost-btn,
    .primary-btn,
    .danger-btn{
    appearance:none;
    border:1px solid rgba(255,255,255,.12);
    border-radius:6px;
    padding:4px 10px;
    font-weight:700;
    cursor:pointer;
    text-align:center;
    font-size:13px;
    transition:.26s ease;
    }

    .user-pill{
    display:flex;
    align-items:center;
    gap:8px;
    padding:7px 9px 7px 11px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.04);
    color:#dce2f0;
    }

    .pill-mini-btn{
    border:none;
    background:rgba(255,255,255,.08);
    color:#fff;
    border-radius:999px;
    padding:7px 10px;
    font-weight:700;
    cursor:pointer;
    font-size:12px;
    }

    .upload-btn{
      background:linear-gradient(180deg, #f8f8fb 0%, #26cb8c 100%);
      color:#3f4557;
      min-width:190px;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.8),
        0 10px 30px rgba(0,0,0,.2);
    }

    .upload-btn:hover{ filter:brightness(1.1); }

    .ghost-btn{
      background:linear-gradient(180deg, #f8f8fb 0%, #e7e8ee 100%);
      text-decoration: none;
      color:#3f4557;
      min-width:100px;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.8),
        0 10px 30px rgba(0,0,0,.2);
    }

    .ghost-btn:hover{ filter:brightness(1.1); }

    .primary-btn{
      background:linear-gradient(180deg, #b48cff 0%, #8b5cf6 100%);
      color:#fff;
      border-color:rgba(255,255,255,.16);
      box-shadow:0 10px 26px rgba(139,92,246,.25);
    }

    .primary-btn:hover{ transform:translateY(-1px); }

    .danger-btn{
      background:rgba(255,255,255,.04);
      color:#ffd7df;
      border-color:rgba(251,113,133,.24);
    }

    .danger-btn:hover{
      background:rgba(251,113,133,.08);
    }

    .user-pill{
      display:flex;
      align-items:center;
      gap:10px;
      padding:8px 10px 8px 12px;
      border-radius:999px;
      border:1px solid rgba(255,255,255,.08);
      background:rgba(255,255,255,.04);
      color:#dce2f0;
    }

    .user-pill strong{
      font-size:14px;
      max-width:180px;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
    }

    .pill-mini-btn{
      border:none;
      background:rgba(255,255,255,.08);
      color:#fff;
      border-radius:999px;
      padding:8px 12px;
      font-weight:700;
      cursor:pointer;
    }

    .main{
      flex:1;
      display:grid;
      place-items:start center;
      padding:28px 28px 180px;
    }

    .stage{
      width:min(1280px, 100%);
      display:flex;
      flex-direction:column;
      align-items:center;
      gap:22px;
    }

    .status{
      width:min(860px, 100%);
      padding:12px 16px;
      border-radius:16px;
      font-size:14px;
      color:#dfe5f4;
      border:1px solid rgba(255,255,255,.08);
      background:rgba(255,255,255,.04);
      display:none;
    }

    .status.show{ display:block; }

    .toolbar-top{
      display:flex;
      align-items:center;
      gap:12px;
      padding:8px;
      border:1px solid rgba(255,255,255,.06);
      background:rgba(10,13,20,.7);
      backdrop-filter:blur(14px);
      border-radius:999px;
      box-shadow:0 14px 40px rgba(0,0,0,.35);
      flex-wrap:wrap;
      justify-content:center;
    }

    .tab{
      appearance:none;
      border:none;
      background:transparent;
      color:#a7adc0;
      padding:12px 18px;
      border-radius:999px;
      font-weight:700;
      cursor:pointer;
      font-size:15px;
    }

    .tab.active{
      background:#f2f3f7;
      color:#151925;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.85),
        0 8px 20px rgba(0,0,0,.22);
    }

    .icon-btn{
      width:42px;
      height:42px;
      border-radius:999px;
      border:none;
      background:transparent;
      color:#9ea5ba;
      cursor:pointer;
      font-size:20px;
    }

    .icon-btn:hover{
      background:rgba(255,255,255,.06);
      color:#fff;
    }

    .viewer-wrap{
      width:100%;
      display:grid;
      place-items:center;
      min-height:640px;
    }

    .slab-scene{
      position:relative;
      width:min(430px, 72vw);
      aspect-ratio:1220 / 2048;
      transform:translateZ(0);
      filter:drop-shadow(0 30px 55px rgba(0,0,0,.45));
    }

    .slab-scene::before{
      content:"";
      position:absolute;
      inset:-26px -34px -42px -34px;
      border-radius:38px;
      background:
        radial-gradient(circle at 50% 0%, rgba(130,150,255,.12), transparent 44%),
        radial-gradient(circle at 50% 100%, rgba(110,80,255,.10), transparent 36%);
      filter:blur(26px);
      z-index:0;
      pointer-events:none;
    }

    .slab-base{
      position:absolute;
      inset:0;
      width:100%;
      height:100%;
      object-fit:cover;
      border-radius:28px;
      z-index:1;
      display:block;
      user-select:none;
      -webkit-user-drag:none;
      transition:opacity .18s ease;
    }

    .guard-svg{
      position:absolute;
      inset:0;
      width:100%;
      height:100%;
      z-index:2;
      overflow:visible;
      pointer-events:none;
    }

    .caption{
      color:#9098b0;
      font-size:14px;
      letter-spacing:.02em;
      text-align:center;
    }

    .panel-grid{
      width:min(1180px, 100%);
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:18px;
      align-items:start;
    }

    .panel{
      border:1px solid rgba(255,255,255,.07);
      background:rgba(11,14,21,.7);
      backdrop-filter:blur(18px);
      border-radius:24px;
      padding:18px;
      box-shadow:
        0 18px 60px rgba(0,0,0,.22),
        inset 0 1px 0 rgba(255,255,255,.04);
    }

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

    .panel-title{
      font-size:16px;
      font-weight:800;
      letter-spacing:-.02em;
    }

    .panel-sub{
      font-size:12px;
      color:#8f97ae;
    }

    .inline-form{
      display:flex;
      gap:10px;
      flex-wrap:wrap;
      margin-bottom:14px;
    }

    .text-input,
    .password-input{
      appearance:none;
      border:1px solid rgba(255,255,255,.08);
      background:rgba(255,255,255,.04);
      color:#eef2ff;
      border-radius:14px;
      padding:12px 14px;
      font-size:14px;
      min-width:180px;
      outline:none;
    }

    .text-input:focus,
    .password-input:focus{
      border-color:rgba(180,140,255,.6);
      box-shadow:0 0 0 3px rgba(180,140,255,.12);
    }

    .empty{
      color:#8f97ae;
      font-size:14px;
      padding:18px;
      border:1px dashed rgba(255,255,255,.10);
      border-radius:18px;
      text-align:center;
      background:rgba(255,255,255,.02);
    }

    .saved-list,
    .feed-list{
      display:grid;
      gap:12px;
      max-height:420px;
      overflow:auto;
      padding-right:4px;
    }

    .card-item{
      display:grid;
      grid-template-columns:68px 1fr auto;
      gap:12px;
      align-items:center;
      padding:12px;
      border-radius:18px;
      border:1px solid rgba(255,255,255,.06);
      background:rgba(255,255,255,.03);
    }

    .mini-guard{
      width:68px;
      height:112px;
      border-radius:16px;
      position:relative;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.22),
        0 8px 20px rgba(0,0,0,.25);
    }

    .mini-guard::after{
      content:"";
      position:absolute;
      inset:8px;
      border-radius:12px;
      box-shadow:inset 0 0 0 2px rgba(0,0,0,.35);
      background:rgba(255,255,255,.03);
    }

    .item-main{
      min-width:0;
      display:grid;
      gap:4px;
    }

    .item-title{
      font-size:14px;
      font-weight:800;
      color:#eef2ff;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
    }

    .item-meta{
      font-size:12px;
      color:#8f97ae;
      line-height:1.4;
    }

    .item-actions{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
      justify-content:flex-end;
    }

    .tiny-btn{
      appearance:none;
      border:1px solid rgba(255,255,255,.08);
      background:rgba(255,255,255,.04);
      color:#e4e9f8;
      border-radius:12px;
      padding:9px 12px;
      font-size:12px;
      font-weight:800;
      cursor:pointer;
    }

    .tiny-btn:hover{ background:rgba(255,255,255,.08); }

    .tiny-btn.primary{
      background:linear-gradient(180deg, #b48cff 0%, #8b5cf6 100%);
      color:white;
      border-color:rgba(255,255,255,.14);
    }

    .tiny-btn.danger{
      color:#ffd7df;
      border-color:rgba(251,113,133,.24);
    }

    .dock{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    transform:none;
    width:100%;
    z-index:40;
    border-top:1px solid rgba(255,255,255,.07);
    border-left:none;
    border-right:none;
    border-bottom:none;
    background:rgba(6,10,18,.96);
    backdrop-filter:blur(18px);
    border-radius:1px 1px 0 0;
    padding:10px 16px 10px;
    box-shadow:
        0 -14px 50px rgba(0,0,0,.38),
        inset 0 1px 0 rgba(255,255,255,.04);
    }

    .dock-grid {
    display:grid;
    grid-template-columns: 320px 1fr 520px;
    gap:16px;
    align-items:start;
    max-width:1600px;
    margin:0 auto;
    }

    .dock-block {
    min-width:0;
    }

    .dock-label {
    font-size:11px;
    font-weight:800;
    color:#8f97ae;
    text-transform:uppercase;
    letter-spacing:.12em;
    margin-bottom:6px;

    }
    .segmented{
    display:inline-flex;
    padding:5px;
    gap:5px;
    border-radius:4px;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.06);
    margin-bottom:10px;
    }

    .seg-btn{
    appearance:none;
    border:none;
    background:transparent;
    color:#a7adc0;
    padding: 5px 13px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 10px;
    min-width: 88px;
    }

    .seg-btn.active{
    background:#f2f3f7;
    color:#151925;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.85),
        0 5px 12px rgba(0,0,0,.16);
    }

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

    .color-chip{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    min-width:0;
    padding:5px 10px;
    background:rgba(0, 0, 0, 0.04);
    border:1px solid rgba(255,255,255,.06);
    border-radius:16px;
    flex:1;
    }

    .color-chip span{
    font-size:12px;
    color:#b7bdd0;
    min-width:50%;
    }

    input[type="color"]{
    width:25px;
    height:25px;
    background: #000;
    }

    input[type="color"]::-webkit-color-swatch{
    border:none;
    border-radius:15px;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.22),
        0 4px 12px rgba(0,0,0,.22);
    }

    .sliders{
    display:grid;
    gap:8px;
    }

    .slider-row{
    display:grid;
    grid-template-columns: 72px 1fr 44px;
    gap:10px;
    align-items:center;
    }

    .slider-row label{
    font-size:12px;
    color:#c0c6d8;
    }

    .slider-val{
    text-align:right;
    color:#8b93a8;
    font-size:12px;
    font-variant-numeric:tabular-nums;
    }

    .preset-row{
    display:flex;
    gap:10px;
    overflow-x:auto;
    padding-bottom:2px;
    }

    .preset-row::-webkit-scrollbar{
    display:none;
    }

    .preset{
    appearance:none;
    border:none;
    cursor:pointer;
    padding:10px 8px;
    border-radius:16px;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.06);
    color:#d6dbeb;
    display:grid;
    gap:8px;
    justify-items:center;
    transition:.16s ease;
    flex:0 0 auto;
    }

    .preset:hover{
    transform:translateY(-1px);
    background:rgba(255,255,255,.07);
    }

    .preset-swirl{
    width:25px;
    height:25px;
    border-radius:999px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.28),
        0 4px 10px rgba(0,0,0,.24);
    }

    .preset span{
    font-size:10px;
    color:#98a0b6;
    line-height:1;
    }

    .hidden{ display:none !important; }

    .modal{
      position:fixed;
      inset:0;
      z-index:80;
      background:rgba(0,0,0,.55);
      display:grid;
      place-items:center;
      padding:20px;
    }

    .modal-card{
      width:min(440px, 100%);
      border:1px solid rgba(255,255,255,.08);
      background:rgba(11,14,21,.95);
      backdrop-filter:blur(18px);
      border-radius:24px;
      padding:20px;
      box-shadow:0 30px 90px rgba(0,0,0,.45);
    }

    .modal-title{
      margin:0 0 8px;
      font-size:20px;
      font-weight:800;
      letter-spacing:-.02em;
    }

    .modal-note{
      margin:0 0 16px;
      color:#8f97ae;
      font-size:14px;
      line-height:1.5;
    }

    .modal-stack{
      display:grid;
      gap:12px;
    }

    .modal-actions{
      display:flex;
      gap:10px;
      margin-top:16px;
      flex-wrap:wrap;
    }

    @media (max-width: 1100px){
      .panel-grid{
        grid-template-columns:1fr;
      }

      .dock{
        position:static;
        transform:none;
        width:min(960px, calc(100vw - 24px));
        margin:0 auto 22px;
      }

      .main{ padding-bottom:28px; }

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

    @media (max-width: 760px){
      .topbar{
        padding:16px;
        flex-direction:column;
        align-items:stretch;
      }

      .topbar-actions{
        justify-content:stretch;
      }

      .upload-btn,
      .ghost-btn,
      .primary-btn,
      .danger-btn{
        width:100%;
      }

      .user-pill{
        width:100%;
        justify-content:space-between;
      }

      .main{
        padding:18px 14px 24px;
      }

      .dock{
        width:calc(100vw - 16px);
      }

      .slider-row{
        grid-template-columns:88px 1fr 44px;
      }

      .preset-row{
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .card-item{
        grid-template-columns:56px 1fr;
      }

      .item-actions{
        grid-column:1 / -1;
        justify-content:flex-start;
      }

      .mini-guard{
        width:56px;
        height:92px;
      }
    }
    .topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.feed-rail{
  position:fixed;
  top:88px;
  right:12px;
  width:78px;
  max-height:calc(100vh - 250px);
  z-index:25;
  border:1px solid rgba(255,255,255,.07);
  background:rgba(11,14,21,.82);
  backdrop-filter:blur(18px);
  border-radius:18px;
  padding:10px 8px;
  box-shadow:
    0 18px 60px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.04);
  display:flex;
  flex-direction:column;
  gap:10px;
}

.feed-rail-title{
  font-size:11px;
  font-weight:800;
  line-height:1.1;
}

.feed-rail-sub{
  font-size:9px;
  color:#8f97ae;
  line-height:1.2;
  margin-top:4px;
}

.feed-rail-list{
  overflow:auto;
  display:grid;
  gap:8px;
}

.feed-card{
  appearance:none;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.04);
  border-radius:14px;
  padding:7px 5px;
  cursor:pointer;
  display:grid;
  justify-items:center;
  gap:6px;
}

.feed-thumb{
  width:42px;
  height:68px;
  border-radius:10px;
  position:relative;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.24),
    0 6px 14px rgba(0,0,0,.22);
}

.feed-thumb::after{
  content:"";
  position:absolute;
  inset:5px;
  border-radius:8px;
  box-shadow:inset 0 0 0 2px rgba(0,0,0,.28);
  background:rgba(255,255,255,.03);
}

.feed-user{
  font-size:10px;
  font-weight:700;
  color:#dde3f3;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:center;
}

@media (max-width: 1100px){
  .dock{
    padding:12px 14px calc(12px + env(safe-area-inset-bottom));
    border-radius:18px 18px 0 0;
  }

  .dock-grid{
    grid-template-columns:1fr;
    gap:12px;
  }

  .feed-rail{
    top:auto;
    right:auto;
    left:0;
    bottom:112px;
    transform:none;
    width:100%;
    max-height:none;
    border-left:none;
    border-right:none;
    border-radius:18px 18px 0 0;
    padding:10px 12px;
  }

  .feed-rail-list{
    display:flex;
    overflow-x:auto;
    overflow-y:hidden;
    gap:8px;
    padding-bottom:2px;
  }

  .feed-card{
    min-width:68px;
    flex:0 0 auto;
  }

  .feed-thumb{
    width:36px;
    height:58px;
  }

  .main{
    padding:18px 14px 230px;
  }
}

@media (max-width: 760px){
  .topbar{
    padding:12px 12px 10px;
    flex-direction:column;
    align-items:stretch;
  }

  .topbar-actions{
    justify-content:stretch;
    gap:8px;
  }

  .topbar-actions > *{
    width:100%;
  }

  .user-pill{
    width:100%;
    justify-content:space-between;
  }

  .viewer-wrap{
    min-height:420px;
  }

  .slab-scene{
    width:min(300px, 74vw);
  }

  .dock{
    padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .dock-grid{
    gap:10px;
  }

  .segmented{
    width:100%;
    justify-content:center;
  }

  .seg-btn{
    flex:1;
    min-width:0;
    padding:8px 10px;
    font-size:12px;
  }

  .color-row{
    gap:8px;
  }

  .color-chip{
    padding:7px 8px;
    border-radius:14px;
  }

  .color-chip span{
    font-size:11px;
  }

  input[type="color"]{
    width:36px;
    height:36px;
  }

  .slider-row{
    grid-template-columns: 62px 1fr 40px;
    gap:8px;
  }

  .slider-row label,
  .slider-val{
    font-size:11px;
  }

  .preset{
    min-width:82px;
    padding:8px 6px;
    border-radius:14px;
  }

  .preset-swirl{
    width:28px;
    height:28px;
  }

  .preset span{
    font-size:11px;
  }

  .feed-rail{
    bottom:152px;
    padding:8px 10px;
  }

  .feed-card{
    min-width:62px;
    padding:6px 4px;
  }

  .feed-thumb{
    width:32px;
    height:52px;
    border-radius:9px;
  }

  .feed-user{
    font-size:9px;
  }

  .main{
    padding:14px 10px 248px;
  }
}