/* =========================================================================
   ROZZYHUB PASTE
   ========================================================================= */

:root{
  --bg:#080b10;
  --panel:#0d1219;
  --panel-2:#111823;
  --panel-3:#151d29;
  --line:#1d2735;
  --line-strong:#2a3646;
  --text:#e9eef7;
  --text-dim:#c3ccd9;
  --muted:#7b889b;
  --muted-2:#5b6778;
  --accent:#7c5cff;
  --accent-2:#9a86ff;
  --accent-soft:rgba(124,92,255,.14);
  --accent-line:rgba(124,92,255,.45);
  --danger:#ff6472;
  --danger-soft:rgba(255,100,114,.12);
  --ok:#4ade80;
  --radius:12px;
  --topbar-h:56px;
}

*{box-sizing:border-box}

html,body{
  height:100%;
  margin:0;
}

body{
  background:var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  font-size:14px;
  overflow:hidden;
  -webkit-text-size-adjust:100%;
  -webkit-tap-highlight-color:transparent;
}

button,input,textarea{
  font:inherit;
  color:inherit;
}

button{
  cursor:pointer;
  touch-action:manipulation;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible,
label:focus-visible{
  outline:2px solid var(--accent-line);
  outline-offset:2px;
}

svg{
  width:18px;
  height:18px;
  flex:none;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.hidden{
  display:none!important;
}

kbd{
  display:inline-block;
  padding:2px 5px;
  border:1px solid var(--line-strong);
  border-bottom-width:2px;
  border-radius:5px;
  background:var(--panel-2);
  font-family:inherit;
  font-size:10px;
  color:var(--text-dim);
}

::-webkit-scrollbar{
  width:9px;
  height:9px;
}

::-webkit-scrollbar-track{
  background:transparent;
}

::-webkit-scrollbar-thumb{
  background:#212c3b;
  border-radius:99px;
  border:2px solid transparent;
  background-clip:padding-box;
}

::-webkit-scrollbar-thumb:hover{
  background:#2e3b4e;
  background-clip:padding-box;
}

/* =========================================================================
   APP SHELL
   ========================================================================= */

.app{
  height:100vh;
  height:100dvh;
  display:grid;
  grid-template-columns:288px minmax(0,1fr) 300px;
  background:
    radial-gradient(900px 500px at 18% -10%,rgba(124,92,255,.10),transparent 65%),
    radial-gradient(700px 500px at 100% 0,rgba(77,145,255,.06),transparent 60%),
    var(--bg);
  overflow:hidden;
}

/* =========================================================================
   TOPBAR (mobile only)
   ========================================================================= */

.topbar{
  display:none;
  align-items:center;
  gap:10px;
  height:calc(var(--topbar-h) + env(safe-area-inset-top));
  padding:env(safe-area-inset-top) 10px 0;
  border-bottom:1px solid var(--line);
  background:rgba(11,15,21,.92);
  backdrop-filter:blur(12px);
  z-index:40;
}

.topbar .brand{
  margin:0;
  flex:1;
  min-width:0;
}

.brand--compact b{
  font-size:14px;
}

.brand--compact small{
  font-size:10px;
}

.icon-btn{
  width:38px;
  height:38px;
  flex:none;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel-2);
  color:var(--text-dim);
}

.icon-btn:hover{
  background:var(--panel-3);
  color:var(--text);
}

.icon-btn--accent{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
  box-shadow:0 6px 18px rgba(124,92,255,.35);
}

.icon-btn--accent:hover{
  background:var(--accent-2);
  border-color:var(--accent-2);
}

.drawer-close{
  display:none;
}

/* =========================================================================
   SIDEBAR
   ========================================================================= */

.sidebar{
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:18px 14px;
  background:rgba(12,17,24,.92);
  border-right:1px solid var(--line);
  backdrop-filter:blur(10px);
}

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

.brand{
  display:flex;
  align-items:center;
  gap:11px;
  margin:2px 6px 8px;
  min-width:0;
}

.sidebar-head .brand{
  margin:2px 0 6px;
}

.logo{
  width:38px;
  height:38px;
  flex:none;
  border-radius:11px;
  background:linear-gradient(135deg,var(--accent),#4d91ff);
  display:grid;
  place-items:center;
  font-weight:850;
  font-size:19px;
  color:#fff;
  box-shadow:0 8px 22px rgba(124,92,255,.32);
}

.brand b{
  display:block;
  font-size:15px;
  line-height:1.2;
}

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

.new-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  border:0;
  border-radius:11px;
  padding:12px 14px;
  background:linear-gradient(135deg,var(--accent),#6b4cff);
  color:#fff;
  font-weight:750;
  font-size:13px;
  box-shadow:0 10px 26px rgba(124,92,255,.28);
  transition:transform .12s ease,box-shadow .18s ease,filter .18s ease;
}

.new-btn svg{
  width:17px;
  height:17px;
  stroke-width:2.1;
}

.new-btn:hover{
  filter:brightness(1.08);
  box-shadow:0 12px 30px rgba(124,92,255,.4);
}

.new-btn:active{
  transform:translateY(1px) scale(.995);
}

.search{
  position:relative;
}

.search-icon{
  position:absolute;
  left:11px;
  top:50%;
  width:16px;
  height:16px;
  transform:translateY(-50%);
  color:var(--muted-2);
  pointer-events:none;
}

.search input{
  width:100%;
  border:1px solid var(--line);
  outline:0;
  background:#080d13;
  color:var(--text);
  padding:10px 11px 10px 34px;
  border-radius:10px;
  font-size:13px;
  transition:border-color .16s ease,box-shadow .16s ease;
}

.search input::placeholder{
  color:var(--muted-2);
}

.search input:focus{
  border-color:var(--accent-line);
  box-shadow:0 0 0 3px var(--accent-soft);
}

.notes{
  flex:1;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:3px;
  margin-right:-3px;
}

.note{
  position:relative;
  padding:11px 11px 11px 13px;
  border:1px solid transparent;
  border-radius:10px;
  margin-bottom:3px;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease;
}

.note::before{
  content:"";
  position:absolute;
  left:3px;
  top:50%;
  width:3px;
  height:0;
  border-radius:99px;
  background:var(--accent);
  transform:translateY(-50%);
  transition:height .18s ease;
}

.note:hover{
  background:rgba(255,255,255,.035);
}

.note.active{
  background:var(--accent-soft);
  border-color:rgba(124,92,255,.22);
}

.note.active::before{
  height:22px;
}

.note-title-row{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}

.note-title{
  min-width:0;
  flex:1;
  font-size:13px;
  font-weight:680;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.note-lock{
  flex:none;
  font-size:10px;
  line-height:1;
  opacity:.85;
}

.note-date{
  font-size:10px;
  color:var(--muted-2);
  margin-top:5px;
}

.no-notes{
  text-align:center;
  color:var(--muted-2);
  font-size:12px;
  padding:26px 8px;
  line-height:1.6;
}

.side-bottom{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border-top:1px solid var(--line);
  padding-top:11px;
  color:var(--muted);
  font-size:11px;
}

.side-bottom button{
  display:flex;
  align-items:center;
  gap:6px;
  border:0;
  background:none;
  color:var(--muted);
  font-size:11px;
  padding:4px 6px;
  border-radius:7px;
}

.side-bottom button svg{
  width:13px;
  height:13px;
}

.side-bottom button:hover{
  color:var(--text);
  background:rgba(255,255,255,.05);
}

.drawer-backdrop{
  display:none;
}

/* =========================================================================
   MAIN / EMPTY
   ========================================================================= */

.main{
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
}

.empty{
  margin:auto;
  text-align:center;
  padding:34px 24px;
  max-width:440px;
}

.empty-icon{
  width:62px;
  height:62px;
  border-radius:18px;
  background:linear-gradient(160deg,#1a2130,#121822);
  border:1px solid var(--line);
  color:#a592ff;
  display:grid;
  place-items:center;
  margin:0 auto 16px;
  font-size:26px;
  box-shadow:0 18px 40px rgba(0,0,0,.35);
}

.empty h1{
  font-size:25px;
  margin:0 0 9px;
  letter-spacing:-.01em;
}

.empty p{
  color:var(--muted);
  font-size:13px;
  line-height:1.65;
  margin:0 0 20px;
}

.empty .new-btn{
  width:auto;
  margin:0 auto;
  padding:12px 20px;
}

.empty-hint{
  margin:18px 0 0!important;
  font-size:11px;
  color:var(--muted-2);
}

/* =========================================================================
   EDITOR
   ========================================================================= */

.editor{
  width:100%;
  height:100%;
  min-height:0;
  display:flex;
  flex-direction:column;
}

.editor-head{
  flex:none;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:14px;
  padding:20px 28px 14px;
  border-bottom:1px solid var(--line);
}

.editor-head>input{
  flex:1 1 260px;
  min-width:0;
  background:transparent;
  border:0;
  outline:0;
  color:var(--text);
  font-size:23px;
  font-weight:760;
  letter-spacing:-.015em;
  padding:2px 0;
}

.editor-head>input::placeholder{
  color:#485463;
}

.editor-head>input:disabled{
  color:var(--muted);
  cursor:default;
}

.actions{
  display:flex;
  align-items:center;
  gap:7px;
  flex:none;
  margin-left:auto;
}

.status{
  font-size:10px;
  color:var(--muted-2);
  margin-right:5px;
  white-space:nowrap;
}

.status::before{
  content:"";
  display:inline-block;
  width:5px;
  height:5px;
  margin-right:6px;
  border-radius:50%;
  background:var(--ok);
  vertical-align:middle;
  opacity:.85;
}

.btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid var(--line);
  background:var(--panel-2);
  color:var(--text-dim);
  border-radius:9px;
  padding:8px 10px;
  font-size:11px;
  font-weight:600;
  transition:background .15s ease,color .15s ease,border-color .15s ease;
}

.btn svg{
  width:15px;
  height:15px;
}

.btn:hover{
  background:var(--panel-3);
  color:var(--text);
  border-color:var(--line-strong);
}

.btn:disabled{
  opacity:.4;
  cursor:not-allowed;
}

.btn:disabled:hover{
  background:var(--panel-2);
  color:var(--text-dim);
  border-color:var(--line);
}

.btn.delete:hover{
  color:var(--danger);
  border-color:#55323a;
  background:var(--danger-soft);
}

#content{
  flex:1;
  min-height:0;
  width:100%;
  resize:none;
  border:0;
  outline:0;
  background:transparent;
  color:#dbe3ee;
  padding:20px 28px;
  font:14px/1.8 "SFMono-Regular",Consolas,"Liberation Mono",monospace;
  tab-size:2;
  overflow-y:auto;
}

#content::placeholder{
  color:#46505f;
}

#content[readonly]{
  color:#96a1b1;
  cursor:default;
}

/* =========================================================================
   ATTACHMENTS DOCK
   ========================================================================= */

.dock{
  flex:none;
  border-top:1px solid var(--line);
  background:linear-gradient(180deg,rgba(17,24,35,.55),rgba(9,13,19,.85));
  padding:0 28px;
  padding-bottom:env(safe-area-inset-bottom);
}

.dock-head{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 0;
}

.dock-toggle{
  display:flex;
  align-items:center;
  gap:8px;
  flex:1;
  min-width:0;
  border:0;
  background:none;
  padding:5px 0;
  color:var(--muted);
  font-size:10px;
  font-weight:750;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.dock-toggle:hover{
  color:var(--text-dim);
}

.dock-toggle .dock-chevron{
  width:14px;
  height:14px;
  transition:transform .18s ease;
}

.dock-toggle .dock-clip{
  width:15px;
  height:15px;
  color:var(--accent-2);
}

.dock-count{
  display:inline-grid;
  place-items:center;
  min-width:19px;
  height:19px;
  padding:0 6px;
  border-radius:99px;
  background:var(--accent-soft);
  border:1px solid rgba(124,92,255,.25);
  color:#b6a6ff;
  font-size:10px;
  font-weight:700;
  letter-spacing:0;
}

.dock.collapsed .dock-chevron{
  transform:rotate(-90deg);
}

.dock.collapsed .dock-body{
  display:none;
}

.upload-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  flex:none;
  border:1px solid rgba(124,92,255,.35);
  background:rgba(124,92,255,.10);
  color:#b3a2ff;
  border-radius:8px;
  padding:7px 11px;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease;
}

.upload-btn svg{
  width:14px;
  height:14px;
  stroke-width:2.1;
}

.upload-btn:hover{
  background:rgba(124,92,255,.18);
  border-color:rgba(124,92,255,.55);
}

.upload-btn.disabled{
  opacity:.4;
  pointer-events:none;
}

.dock-body{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:min(30vh,240px);
  overflow-y:auto;
  padding-bottom:10px;
}

.drop-zone{
  flex:none;
  border:1px dashed var(--line-strong);
  border-radius:10px;
  padding:10px 13px;
  color:var(--muted-2);
  background:rgba(8,13,19,.6);
  font-size:10.5px;
  text-align:center;
  transition:border-color .18s ease,background .18s ease,color .18s ease;
}

.drop-zone.dragging{
  border-color:var(--accent-2);
  background:rgba(124,92,255,.10);
  color:#c8beff;
}

.drop-zone.disabled{
  opacity:.45;
  cursor:not-allowed;
}

.files-list{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-height:0;
}

.files-empty{
  color:var(--muted-2);
  font-size:11px;
  padding:10px 2px;
}

.file-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding:7px 9px;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--panel);
  transition:background .15s ease,border-color .15s ease;
}

.file-row:hover{
  background:var(--panel-2);
  border-color:var(--line-strong);
}

.file-icon{
  width:33px;
  height:33px;
  flex:none;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#182031;
  color:#a08dff;
  font-size:9px;
  font-weight:800;
  letter-spacing:.03em;
}

.file-info{
  min-width:0;
  flex:1;
}

.file-name{
  font-size:11.5px;
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.file-meta{
  color:var(--muted-2);
  font-size:9.5px;
  margin-top:3px;
}

.file-actions{
  display:flex;
  gap:4px;
  flex:none;
}

.file-actions button,
.file-actions a{
  border:1px solid var(--line);
  background:var(--panel-2);
  color:var(--text-dim);
  border-radius:7px;
  padding:5px 8px;
  font-size:9.5px;
  font-weight:600;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  transition:background .15s ease,color .15s ease;
}

.file-actions button:hover,
.file-actions a:hover{
  color:#fff;
  background:var(--panel-3);
}

.file-actions .file-delete:hover{
  color:var(--danger);
  border-color:#55323a;
  background:var(--danger-soft);
}

.file-actions button:disabled{
  opacity:.4;
  cursor:not-allowed;
}

.dock-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-top:1px solid var(--line);
  padding:7px 0;
  color:var(--muted-2);
  font-size:10px;
}

/* =========================================================================
   RIGHT COLUMN
   ========================================================================= */

.right{
  min-height:0;
  overflow-y:auto;
  padding:18px 16px;
  background:rgba(12,17,24,.92);
  border-left:1px solid var(--line);
  backdrop-filter:blur(10px);
}

.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  margin-bottom:10px;
}

.card--hero{
  background:linear-gradient(160deg,rgba(124,92,255,.13),rgba(13,18,25,.6) 60%);
  border-color:rgba(124,92,255,.22);
}

.card-label{
  display:block;
  color:var(--muted-2);
  letter-spacing:.16em;
  font-size:8.5px;
  font-weight:700;
  margin-bottom:10px;
}

.card h2{
  font-size:15px;
  margin:0 0 7px;
}

.card p,
.card li{
  font-size:11px;
  line-height:1.7;
  color:var(--muted);
}

.card p{
  margin:0;
}

.card ul{
  padding-left:16px;
  margin:0;
}

.card ul li::marker{
  color:#55489c;
}

.card code{
  font-size:12px;
  color:#a996ff;
  background:rgba(124,92,255,.10);
  border:1px solid rgba(124,92,255,.2);
  border-radius:6px;
  padding:3px 7px;
}

.shortcuts{
  list-style:none;
  padding:0!important;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.shortcuts li{
  display:flex;
  align-items:center;
  gap:5px;
}

.shortcuts li span{
  margin-left:auto;
  color:var(--muted-2);
  font-size:10px;
}

/* =========================================================================
   MODALS
   ========================================================================= */

.password-modal,
.file-modal{
  position:fixed;
  inset:0;
  z-index:2000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.password-modal.hidden,
.file-modal.hidden{
  display:none!important;
}

.password-backdrop,
.file-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(3,5,9,.76);
  backdrop-filter:blur(7px);
  animation:fadeIn .18s ease;
}

.password-box{
  position:relative;
  width:min(430px,100%);
  max-height:calc(100dvh - 40px);
  overflow-y:auto;
  background:#0c1118;
  border:1px solid var(--line-strong);
  border-radius:16px;
  box-shadow:0 40px 120px rgba(0,0,0,.65);
  animation:popIn .2s cubic-bezier(.2,.9,.3,1.1);
}

.password-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:16px 17px;
  border-bottom:1px solid var(--line);
}

.password-head>div{
  min-width:0;
}

.password-head span{
  display:block;
  color:var(--muted-2);
  letter-spacing:.16em;
  font-size:8px;
  font-weight:700;
  margin-bottom:5px;
}

.password-head h2{
  margin:0;
  font-size:15px;
}

.modal-close{
  width:32px;
  height:32px;
  flex:none;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--panel-2);
  color:#aab3bf;
  font-size:20px;
  line-height:1;
  padding:0;
}

.modal-close:hover{
  color:#fff;
  background:var(--panel-3);
}

.password-body{
  padding:17px;
  margin:0;
}

.password-body p{
  color:var(--muted);
  font-size:12px;
  line-height:1.65;
  margin:0 0 14px;
}

.password-body label{
  display:block;
  color:var(--muted);
  font-size:10px;
  font-weight:600;
  margin-bottom:6px;
}

.password-body input{
  width:100%;
  border:1px solid var(--line);
  outline:0;
  background:#080d13;
  color:var(--text);
  padding:11px 12px;
  border-radius:9px;
  font-size:14px;
  transition:border-color .16s ease,box-shadow .16s ease;
}

.password-body input:focus{
  border-color:var(--accent-line);
  box-shadow:0 0 0 3px var(--accent-soft);
}

.password-error{
  margin-top:10px;
  color:#ff8b95;
  background:rgba(255,100,114,.09);
  border:1px solid rgba(255,100,114,.28);
  border-radius:8px;
  padding:9px 10px;
  font-size:10.5px;
  line-height:1.5;
}

.password-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:7px;
  padding:12px 15px;
  border-top:1px solid var(--line);
}

.password-actions button{
  border:1px solid var(--line);
  background:var(--panel-2);
  color:var(--text-dim);
  border-radius:9px;
  padding:9px 13px;
  font-size:11px;
  font-weight:600;
}

.password-actions button:hover{
  background:var(--panel-3);
  color:#fff;
}

.password-actions .password-primary{
  background:linear-gradient(135deg,var(--accent),#6b4cff);
  border-color:transparent;
  color:#fff;
  font-weight:700;
}

.password-actions .password-primary:hover{
  filter:brightness(1.08);
}

.password-actions .danger-password{
  color:#ff8b95;
  border-color:rgba(255,100,114,.3);
}

.password-actions button:disabled{
  opacity:.55;
  cursor:wait;
}

/* =========================================================================
   FILE PREVIEW MODAL
   ========================================================================= */

.file-modal-box{
  position:relative;
  width:min(1000px,100%);
  max-height:min(85vh,800px);
  display:flex;
  flex-direction:column;
  background:#0c1118;
  border:1px solid var(--line-strong);
  border-radius:16px;
  box-shadow:0 40px 120px rgba(0,0,0,.65);
  overflow:hidden;
  animation:popIn .2s cubic-bezier(.2,.9,.3,1.1);
}

.file-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:14px 17px;
  border-bottom:1px solid var(--line);
}

.file-modal-head>div{
  min-width:0;
}

.file-modal-head span{
  display:block;
  color:var(--muted-2);
  font-size:8px;
  font-weight:700;
  letter-spacing:.16em;
  margin-bottom:4px;
}

.file-modal-head h2{
  margin:0;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.file-preview{
  flex:1;
  min-height:220px;
  overflow:auto;
  background:#080d13;
}

.image-preview{
  display:block;
  max-width:100%;
  max-height:calc(85vh - 150px);
  margin:auto;
  object-fit:contain;
}

.preview-loading{
  min-height:280px;
  display:grid;
  place-items:center;
  color:var(--muted);
  font-size:12px;
}

.code-preview{
  margin:0;
  padding:18px;
  min-height:100%;
  color:#dbe3ee;
  font:12px/1.7 "SFMono-Regular",Consolas,"Liberation Mono",monospace;
  white-space:pre;
  tab-size:2;
}

.code-preview code{
  font:inherit;
}

.no-preview{
  min-height:300px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  text-align:center;
  padding:30px;
}

.no-preview-icon{
  width:55px;
  height:55px;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:#182031;
  color:#a08dff;
  font-size:20px;
  font-weight:800;
  margin-bottom:14px;
}

.no-preview h3{
  margin:0 0 6px;
  font-size:15px;
}

.no-preview p{
  color:var(--muted);
  font-size:11px;
  max-width:380px;
  line-height:1.65;
  margin:0 0 17px;
}

.no-preview button{
  border:0;
  border-radius:8px;
  background:var(--accent);
  color:#fff;
  padding:9px 13px;
  font-size:11px;
  font-weight:700;
}

.file-modal-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  padding:11px 15px;
  border-top:1px solid var(--line);
  padding-bottom:calc(11px + env(safe-area-inset-bottom));
}

.file-modal-actions button,
.download-file-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  background:var(--panel-2);
  color:var(--text-dim);
  border-radius:9px;
  padding:9px 12px;
  font-size:10.5px;
  font-weight:600;
  cursor:pointer;
  text-decoration:none;
}

.file-modal-actions button:hover,
.download-file-btn:hover{
  background:var(--panel-3);
  color:#fff;
}

.download-file-btn{
  background:linear-gradient(135deg,var(--accent),#6b4cff);
  border-color:transparent;
  color:#fff;
}

.download-file-btn:hover{
  filter:brightness(1.08);
  background:linear-gradient(135deg,var(--accent),#6b4cff);
}

/* =========================================================================
   TOAST
   ========================================================================= */

.toast{
  position:fixed;
  left:50%;
  bottom:22px;
  bottom:calc(22px + env(safe-area-inset-bottom));
  z-index:3000;
  max-width:min(420px,calc(100vw - 32px));
  padding:11px 15px;
  border:1px solid var(--line-strong);
  border-radius:10px;
  background:#131a25;
  color:var(--text-dim);
  font-size:12px;
  line-height:1.5;
  box-shadow:0 20px 50px rgba(0,0,0,.55);
  opacity:0;
  transform:translate(-50%,14px);
  pointer-events:none;
  transition:opacity .2s ease,transform .2s ease;
}

.toast.show{
  opacity:1;
  transform:translate(-50%,0);
}

.toast--error{
  border-color:rgba(255,100,114,.4);
  color:#ffb3ba;
}

.toast--success{
  border-color:rgba(74,222,128,.35);
  color:#b7f5cd;
}

@keyframes fadeIn{
  from{opacity:0}
  to{opacity:1}
}

@keyframes popIn{
  from{opacity:0;transform:translateY(10px) scale(.985)}
  to{opacity:1;transform:none}
}

/* =========================================================================
   RESPONSIVE — TABLET
   ========================================================================= */

@media(max-width:1120px){
  .app{
    grid-template-columns:260px minmax(0,1fr);
  }

  .right{
    display:none;
  }
}

/* =========================================================================
   RESPONSIVE — MOBILE
   ========================================================================= */

@media(max-width:760px){

  .app{
    display:flex;
    flex-direction:column;
  }

  .topbar{
    display:flex;
    position:relative;
    z-index:40;
  }

  .sidebar{
    position:fixed;
    top:var(--rz-banner-offset,0px);
    bottom:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    left:0;
    z-index:70;
    width:min(86vw,330px);
    padding:calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    background:#0b1017;
    border-right:1px solid var(--line-strong);
    box-shadow:30px 0 80px rgba(0,0,0,.5);
    transform:translateX(-104%);
    transition:transform .22s cubic-bezier(.3,.8,.3,1);
  }

  .sidebar.open{
    transform:none;
  }

  .sidebar-head .brand{
    margin:0;
  }

  .drawer-close{
    display:grid;
  }

  .drawer-backdrop{
    display:block;
    position:fixed;
    top:var(--rz-banner-offset,0px);
    right:0;
    bottom:0;
    left:0;
    z-index:65;
    background:rgba(2,4,8,.62);
    backdrop-filter:blur(2px);
    animation:fadeIn .18s ease;
  }

  .main{
    flex:1;
    min-height:0;
  }

  .editor-head{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    padding:14px 14px 11px;
  }

  .editor-head>input{
    flex:0 0 auto;
    font-size:19px;
    width:100%;
  }

  .actions{
    gap:6px;
    overflow-x:auto;
    overflow-y:hidden;
    padding-bottom:2px;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
  }

  .actions::-webkit-scrollbar{
    display:none;
  }

  .status{
    order:-1;
  }

  .btn{
    padding:7px 9px;
    font-size:10.5px;
    white-space:nowrap;
  }

  #content{
    padding:14px 16px;
    font-size:16px;
    line-height:1.65;
  }

  .dock{
    padding:0 14px;
  }

  .dock-body{
    max-height:34vh;
  }

  .upload-btn span{
    display:none;
  }

  .upload-btn{
    padding:8px 10px;
  }

  .upload-btn svg{
    width:16px;
    height:16px;
  }

  .file-row{
    align-items:flex-start;
    flex-wrap:wrap;
  }

  .file-info{
    flex:1 1 120px;
  }

  .file-actions{
    flex:1 1 100%;
    justify-content:flex-end;
  }

  .file-actions button,
  .file-actions a{
    flex:1;
    justify-content:center;
    padding:7px 10px;
    font-size:10px;
  }

  .empty{
    padding:24px 18px;
  }

  .empty h1{
    font-size:22px;
  }

  /* inputs 16px+ prevents iOS zoom-on-focus */
  .search input,
  .password-body input{
    font-size:16px;
  }

  .password-modal{
    align-items:flex-end;
    padding:0;
  }

  .password-box{
    width:100%;
    max-height:calc(100dvh - 12px);
    border-radius:18px 18px 0 0;
    border-bottom:0;
    padding-bottom:env(safe-area-inset-bottom);
    animation:sheetIn .22s cubic-bezier(.2,.9,.3,1);
  }

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

  .password-actions button{
    flex:1;
    padding:11px 13px;
    font-size:12px;
  }

  .password-head{
    padding:15px 16px;
  }

  .password-body{
    padding:15px 16px;
  }

  .file-modal{
    padding:10px;
  }

  .file-modal-box{
    max-height:calc(100dvh - 20px);
    border-radius:14px;
  }

  .image-preview{
    max-height:calc(100dvh - 170px);
  }

  .file-modal-actions button,
  .file-modal-actions .download-file-btn{
    flex:1;
  }

  .toast{
    bottom:calc(14px + env(safe-area-inset-bottom));
    font-size:12px;
  }
}

@keyframes sheetIn{
  from{transform:translateY(100%)}
  to{transform:none}
}

/* =========================================================================
   VERY SMALL SCREENS
   ========================================================================= */

@media(max-width:400px){

  .btn-label{
    display:none;
  }

  .btn{
    padding:8px;
  }

  .btn svg{
    width:16px;
    height:16px;
  }

  .btn.delete .btn-label{
    display:inline;
  }

  .status{
    font-size:9.5px;
  }
}

@media(prefers-reduced-motion:reduce){

  *,
  *::before,
  *::after{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}

/* =========================================================================
   CATALOG TABS (Notatki Web vs Rozszerzenie)
   ========================================================================= */

.catalog-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.catalog-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.catalog-tab svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.catalog-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.catalog-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.35);
}

.catalog-tab.active svg {
  stroke: #fff;
}

.tab-count {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 700;
}

.catalog-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.note-tag-rh {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(124, 92, 255, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(124, 92, 255, 0.35);
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

