:root{
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",sans-serif;
  color:#f4f6f8;background:#090b10;font-synthesis:none;
  --bg:#090b10;--surface:rgba(20,23,30,.76);--surface-solid:#151920;
  --border:rgba(255,255,255,.075);--border-strong:rgba(255,255,255,.14);
  --muted:#858c99;--text:#f4f6f8;--accent:#f1f3f6;--accent-text:#111319;
  --danger:#ff6b78;--success:#68d391
}
*{box-sizing:border-box}
html{min-height:100%;background:var(--bg)}
body{min-height:100vh;margin:0;overflow-x:hidden;background:
radial-gradient(circle at 10% 0%,rgba(64,88,132,.2),transparent 35%),
radial-gradient(circle at 100% 100%,rgba(59,44,93,.16),transparent 35%),var(--bg)}
button,input,textarea,select{font:inherit}
button{-webkit-tap-highlight-color:transparent}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{
  outline:2px solid rgba(255,255,255,.55);outline-offset:2px
}
.hidden{display:none!important}
.glass{
  background:var(--surface);border:1px solid var(--border);
  box-shadow:0 24px 70px rgba(0,0,0,.3);
  backdrop-filter:blur(28px) saturate(140%);
  -webkit-backdrop-filter:blur(28px) saturate(140%)
}
.ambient{position:fixed;border-radius:999px;filter:blur(90px);opacity:.17;pointer-events:none}
.ambient-one{width:380px;height:380px;background:#5278b8;top:-190px;left:-100px}
.ambient-two{width:340px;height:340px;background:#6b4a8e;right:-170px;bottom:-170px}
.auth-view{min-height:100vh;display:grid;place-items:center;padding:max(24px,env(safe-area-inset-top)) 20px max(24px,env(safe-area-inset-bottom))}
.auth-card{width:min(430px,100%);padding:38px;border-radius:32px;text-align:center}
.brand-mark,.mini-mark{
  display:grid;place-items:center;background:linear-gradient(145deg,#fff,#cfd4dd);
  color:#111319;font-weight:800;box-shadow:0 14px 30px rgba(0,0,0,.35)
}
.brand-mark{width:64px;height:64px;border-radius:22px;margin:0 auto 24px;font-size:22px}
.mini-mark{width:42px;height:42px;border-radius:15px;flex:0 0 auto}
.eyebrow{margin:0 0 8px;color:#747c89;font-size:11px;font-weight:800;letter-spacing:.16em}
h1,h2,h3,p{margin-top:0}
h1{margin-bottom:10px;font-size:clamp(30px,5vw,42px);letter-spacing:-.04em}
h2{margin-bottom:8px;font-size:clamp(28px,4vw,42px);letter-spacing:-.035em}
h3{margin-bottom:0;font-size:20px;letter-spacing:-.02em}
.muted{color:var(--muted);line-height:1.55}
.auth-form,.stack-form{display:grid;gap:14px}
.auth-form{margin-top:28px;text-align:left}
label{display:grid;gap:8px;color:#a7adb7;font-size:12px;font-weight:700}
input,textarea,select{
  width:100%;border:1px solid rgba(255,255,255,.08);background:rgba(8,10,15,.72);
  color:var(--text);border-radius:16px;padding:14px 15px;
  transition:border-color .2s,background .2s,transform .2s
}
input::placeholder,textarea::placeholder{color:#555d69}
input:focus,textarea:focus,select:focus{border-color:rgba(255,255,255,.24);background:rgba(13,16,22,.88)}
textarea{min-height:130px;resize:vertical;line-height:1.6}
select{appearance:none;background-image:
  linear-gradient(45deg,transparent 50%,#777f8c 50%),
  linear-gradient(135deg,#777f8c 50%,transparent 50%);
  background-position:calc(100% - 17px) 50%,calc(100% - 12px) 50%;
  background-size:5px 5px,5px 5px;background-repeat:no-repeat;padding-right:34px
}
.primary-button,.secondary-button,.text-button,.icon-button,.nav-button,
.filter-chip,.direction-button,.editor-tool-button{
  border:0;cursor:pointer;transition:transform .18s ease,background .18s ease,color .18s ease,
  border-color .18s ease,opacity .18s ease
}
.primary-button{
  min-height:48px;padding:0 20px;border-radius:16px;background:var(--accent);
  color:var(--accent-text);font-weight:800;box-shadow:0 12px 26px rgba(0,0,0,.25)
}
.primary-button:hover{background:#fff;transform:translateY(-1px)}
.primary-button:active{transform:scale(.98)}
.primary-button:disabled{opacity:.5;cursor:wait}
.primary-button.compact{min-height:42px;padding:0 18px;border-radius:14px}
.button-plus{font-size:20px;line-height:0;margin-right:5px;font-weight:500}
.secondary-button{
  min-height:42px;padding:0 16px;border-radius:14px;background:#262b34;color:#d9dde3;font-weight:700
}
.secondary-button:hover{background:#303641}
.secondary-button.danger{color:#ff9099}
.text-button{margin-top:18px;background:transparent;color:#9ba2ad;font-weight:700}
.text-button:hover{color:#fff}
.text-button.inline{margin:0;padding:0;font-size:12px}
.form-message{min-height:20px;margin:16px 0 0;color:#ff8d98;font-size:13px;line-height:1.4}
.form-message.success{color:#7fdca4}
.app-shell{
  width:min(1440px,100%);min-height:100vh;margin:0 auto;
  padding:max(18px,env(safe-area-inset-top)) 20px max(24px,env(safe-area-inset-bottom))
}
.toolbar{
  position:sticky;top:max(14px,env(safe-area-inset-top));z-index:20;min-height:70px;
  display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:20px;
  padding:12px 14px;border-radius:24px
}
.toolbar-brand{display:flex;align-items:center;gap:12px;min-width:0}
.toolbar-brand div:last-child{display:grid;gap:2px;min-width:0}
.toolbar-brand strong{font-size:14px}
.toolbar-brand span{color:#777f8c;font-size:11px;white-space:nowrap}
.nav-tabs{
  display:flex;gap:3px;padding:4px;border:1px solid rgba(255,255,255,.06);
  border-radius:16px;background:rgba(5,7,11,.54)
}
.nav-button{
  min-width:88px;height:38px;padding:0 15px;border-radius:13px;background:transparent;
  color:#808894;font-size:13px;font-weight:750
}
.nav-button:hover{color:#fff;background:#222730}
.nav-button.active{color:#fff;background:#2a303a;box-shadow:inset 0 1px rgba(255,255,255,.05)}
.toolbar-actions{justify-self:end;display:flex;gap:6px}
.icon-button{
  width:42px;height:42px;display:grid;place-items:center;border-radius:14px;
  background:#232832;color:#e5e8ed
}
.icon-button:hover{background:#303641;transform:translateY(-1px)}
.icon-button svg,.editor-tool-button svg{
  width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round
}
.danger-hover:hover{color:#ff8a95}
.page{display:none;padding:28px 2px 0;animation:pageIn .32s ease}
.active-page{display:block}
@keyframes pageIn{from{opacity:0;transform:translateY(7px)}}
.hero-card{
  position:relative;overflow:hidden;min-height:300px;display:flex;flex-direction:column;
  justify-content:center;padding:clamp(30px,6vw,72px);border-radius:32px
}
.hero-card::after{
  content:"";position:absolute;width:340px;height:340px;border-radius:50%;
  background:radial-gradient(circle,rgba(105,132,180,.16),transparent 65%);
  right:-80px;top:-100px;pointer-events:none
}
.hero-card>p:not(.eyebrow){max-width:650px;color:#8c939f;font-size:16px;line-height:1.6}
.system-status{
  width:min(520px,100%);display:grid;grid-template-columns:auto 1fr auto;align-items:center;
  gap:10px;margin-top:28px;padding:13px 16px;border:1px solid rgba(255,255,255,.07);
  border-radius:16px;background:rgba(6,8,12,.48);color:#aeb4bd;font-size:12px
}
.status-dot{width:9px;height:9px;border-radius:50%;background:var(--success);box-shadow:0 0 16px rgba(104,211,145,.55)}
#clockText{color:#69717e;font-family:"SFMono-Regular",Consolas,monospace}
.dashboard-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) repeat(2,minmax(170px,.48fr));
  gap:18px;margin-top:18px
}
.panel{border-radius:26px;padding:24px;min-width:0}
.panel-heading{display:flex;justify-content:space-between;margin-bottom:20px}
.stat-panel{display:flex;min-height:180px;flex-direction:column;justify-content:center}
.stat-panel strong{font-size:54px;letter-spacing:-.06em}
.stat-panel span{color:#777f8c;font-size:13px}
.mini-list{display:grid;gap:8px;margin-top:18px}
.mini-task{display:flex;align-items:center;gap:9px;color:#9da4af;font-size:12px}
.mini-task::before{content:"";width:7px;height:7px;border:1px solid #707986;border-radius:50%}
.page-heading{display:flex;align-items:end;justify-content:space-between;gap:20px;padding:18px 8px 22px}
.page-heading h2{margin:0}
.page-subtitle{margin:9px 0 0;color:#737b87;font-size:13px;line-height:1.5}
.notes-command-bar{
  display:grid;grid-template-columns:minmax(260px,1fr) auto auto;align-items:center;gap:12px;
  padding:12px;border-radius:22px;margin-bottom:12px
}
.note-search{
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;
  min-height:44px;padding:0 13px;border:1px solid rgba(255,255,255,.07);
  border-radius:15px;background:rgba(7,9,14,.55)
}
.note-search:focus-within{border-color:rgba(255,255,255,.18);background:rgba(10,13,19,.82)}
.note-search svg{width:18px;height:18px;fill:none;stroke:#747d89;stroke-width:1.8;stroke-linecap:round}
.note-search input{min-width:0;border:0;background:transparent;padding:0;border-radius:0}
.note-search input:focus{background:transparent;border:0;outline:0}
.note-search kbd{
  padding:4px 7px;border:1px solid rgba(255,255,255,.08);border-radius:7px;
  background:#20252d;color:#717985;font-family:inherit;font-size:10px;font-weight:700
}
.note-filter-group{
  display:flex;gap:4px;padding:4px;border:1px solid rgba(255,255,255,.06);
  border-radius:15px;background:rgba(7,9,14,.5)
}
.filter-chip{
  min-height:36px;padding:0 13px;border-radius:11px;background:transparent;color:#747d89;
  font-size:12px;font-weight:750
}
.filter-chip:hover{color:#fff;background:#232832}
.filter-chip.active{color:#f7f8fa;background:#2d333d}
.filter-chip span{font-size:9px;margin-right:5px}
.sort-control{
  display:grid;grid-template-columns:auto auto;align-items:center;gap:8px;color:#737b87;
  font-size:11px;text-transform:uppercase;letter-spacing:.08em
}
.sort-control select{min-width:150px;height:44px;padding-top:0;padding-bottom:0;border-radius:14px;text-transform:none;letter-spacing:0;font-size:12px}
.notes-results-row{
  display:flex;align-items:center;justify-content:space-between;min-height:34px;padding:0 8px 8px;
  color:#666f7b;font-size:12px
}
.notes-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.note-card{
  position:relative;min-height:250px;display:flex;flex-direction:column;padding:22px;
  border:1px solid var(--border);border-radius:25px;background:rgba(20,23,30,.72);
  box-shadow:0 20px 55px rgba(0,0,0,.2);cursor:pointer;overflow:hidden;
  transition:transform .2s,border-color .2s,background .2s
}
.note-card::after{
  content:"";position:absolute;inset:auto -70px -90px auto;width:180px;height:180px;border-radius:50%;
  background:radial-gradient(circle,rgba(105,132,180,.08),transparent 70%);pointer-events:none
}
.note-card:hover{transform:translateY(-3px);border-color:rgba(255,255,255,.14);background:rgba(25,29,37,.88)}
.note-card[dir="rtl"]{text-align:right}
.note-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}
.note-card-type{color:#5f6874;font-size:10px;font-weight:800;letter-spacing:.13em;text-transform:uppercase}
.note-pin-button{
  position:relative;z-index:2;width:34px;height:34px;border:0;border-radius:11px;background:#222730;
  color:#606a76;cursor:pointer;transition:.18s
}
.note-pin-button:hover{background:#303641;color:#e7eaf0}
.note-pin-button.active{color:#f1f3f6;background:#353c47}
.note-card h3{margin:0 0 12px;font-size:21px;line-height:1.35;overflow-wrap:anywhere}
.note-card-preview{
  margin:0;color:#858d99;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;
  overflow:hidden;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical
}
.note-card-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:16px}
.note-card[dir="rtl"] .note-card-tags{justify-content:flex-start}
.note-tag{
  max-width:100%;padding:5px 8px;border:1px solid rgba(255,255,255,.065);
  border-radius:9px;background:#20252d;color:#858d99;font-size:10px;overflow:hidden;text-overflow:ellipsis
}
.note-card-footer{
  display:flex;align-items:end;justify-content:space-between;gap:12px;margin-top:auto;padding-top:20px;
  color:#565f6b;font-size:10px
}
.note-card-footer time{line-height:1.45}
.note-card-footer .word-count{white-space:nowrap}
.font-modern{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",sans-serif}
.font-arabic{font-family:"Geeza Pro","Noto Sans Arabic",Tahoma,Arial,"Segoe UI",sans-serif}
.font-classic{font-family:Georgia,"Times New Roman","Noto Naskh Arabic",serif}
.font-mono{font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace}
.size-small{font-size:14px}.size-medium{font-size:16px}.size-large{font-size:19px}
.note-card.font-arabic h3,.note-card.font-classic h3{letter-spacing:0}
.note-card[dir="rtl"] .note-card-type{letter-spacing:.05em}
.note-dialog{
  width:min(900px,calc(100% - 28px));max-height:min(900px,calc(100vh - 28px));
  padding:0;border:1px solid rgba(255,255,255,.1);border-radius:30px;
  background:#151920;color:var(--text);box-shadow:0 40px 120px rgba(0,0,0,.65)
}
.note-dialog::backdrop{background:rgba(0,0,0,.68);backdrop-filter:blur(14px)}
.note-dialog form{display:grid;gap:14px;padding:24px;max-height:calc(100vh - 30px);overflow:auto}
.dialog-heading,.dialog-actions{display:flex;align-items:center;gap:10px}
.dialog-heading{justify-content:space-between;margin-bottom:2px}
.dialog-heading>div{min-width:0}
.note-date-line{margin:7px 0 0;color:#616a76;font-size:11px;line-height:1.45}
.note-editor-tools{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:9px;
  border:1px solid rgba(255,255,255,.07);border-radius:17px;background:rgba(8,10,15,.5)
}
.editor-tool-button{
  min-height:38px;display:flex;align-items:center;justify-content:center;gap:7px;padding:0 12px;
  border:1px solid transparent;border-radius:12px;background:#222730;color:#9098a4;font-size:11px;font-weight:750
}
.editor-tool-button:hover{color:#fff;background:#303641}
.editor-tool-button.active{color:#fff;background:#353c47;border-color:rgba(255,255,255,.08)}
.editor-tool-button.icon-only{width:38px;padding:0}
.pin-symbol{font-size:9px}
.editor-select{display:grid;grid-template-columns:auto auto;align-items:center;gap:7px;color:#666f7b;font-size:10px;text-transform:uppercase;letter-spacing:.08em}
.editor-select select{width:auto;min-width:105px;height:38px;padding-top:0;padding-bottom:0;border-radius:12px;text-transform:none;letter-spacing:0;font-size:11px}
.direction-control{display:flex;padding:3px;border-radius:12px;background:#0d1015;border:1px solid rgba(255,255,255,.055)}
.direction-button{
  min-width:46px;height:32px;padding:0 9px;border-radius:9px;background:transparent;color:#66707c;font-size:10px;font-weight:800
}
.direction-button:hover{color:#fff}
.direction-button.active{color:#fff;background:#2d333d}
.editor-actions-mini{display:flex;gap:5px;margin-left:auto}
.note-title-input{
  min-height:58px;padding:10px 2px;border:0;border-bottom:1px solid rgba(255,255,255,.08);
  border-radius:0;background:transparent;font-size:clamp(24px,4vw,34px);font-weight:750;letter-spacing:-.035em
}
.note-title-input:focus{border-color:rgba(255,255,255,.2);background:transparent}
.tags-field{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:10px;padding:0 2px}
.tags-field>span{color:#68717d;font-size:10px;text-transform:uppercase;letter-spacing:.08em}
.tags-field input{min-height:40px;padding:9px 12px;border-radius:12px;font-size:12px}
.note-content-editor{
  min-height:360px;padding:20px;border-radius:20px;background:rgba(7,9,14,.58);
  line-height:1.85;white-space:pre-wrap
}
.note-content-editor[dir="rtl"]{text-align:right}
.note-content-editor[dir="ltr"]{text-align:left}
.editor-status-row{
  display:flex;justify-content:space-between;gap:12px;color:#59626e;font-size:10px;padding:0 4px
}
#draftStatus.saved{color:#70b98c}
.dialog-spacer{flex:1}
.dialog-actions{margin-top:4px}
.task-entry{display:grid;grid-template-columns:1fr auto;gap:10px;padding:12px;border-radius:20px}
.task-entry input{border:0;background:transparent}
.tasks-list{display:grid;gap:10px;margin-top:16px}
.task-row{
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;padding:15px 16px;
  border:1px solid var(--border);border-radius:18px;background:rgba(20,23,30,.68);
  transition:background .2s,opacity .2s
}
.task-row:hover{background:rgba(27,31,39,.85)}
.task-check{
  width:23px;height:23px;border:1px solid #59616e;border-radius:8px;display:grid;
  place-items:center;background:transparent;color:#101318;cursor:pointer
}
.task-row.completed{opacity:.56}
.task-row.completed .task-check{border-color:#dce1e7;background:#dce1e7}
.task-row.completed .task-title{text-decoration:line-through}
.task-delete{border:0;background:transparent;color:#626b77;cursor:pointer;font-size:19px}
.task-delete:hover{color:#ff7e8a}
.empty-state{
  min-height:310px;display:grid;place-items:center;align-content:center;margin-top:12px;
  border-radius:28px;text-align:center
}
.empty-icon{
  width:54px;height:54px;display:grid;place-items:center;margin-bottom:18px;
  border-radius:18px;background:#282e37;color:#a7aeb8;font-weight:800
}
.empty-state p{color:#707885}
.toast{
  position:fixed;z-index:100;left:50%;bottom:max(24px,env(safe-area-inset-bottom));
  transform:translate(-50%,20px);max-width:calc(100% - 32px);padding:12px 16px;
  border:1px solid rgba(255,255,255,.1);border-radius:14px;background:rgba(27,31,39,.96);
  color:#e8ebef;box-shadow:0 18px 55px rgba(0,0,0,.45);opacity:0;pointer-events:none;
  transition:opacity .22s,transform .22s
}
.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:1100px){
  .dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .notes-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .notes-command-bar{grid-template-columns:1fr auto}
  .sort-control{grid-column:1/-1;justify-self:end}
}
@media(max-width:760px){
  .app-shell{padding-left:12px;padding-right:12px}
  .toolbar{grid-template-columns:1fr auto;min-height:64px;border-radius:20px}
  .toolbar-brand span{display:none}
  .nav-tabs{
    position:fixed;z-index:30;left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));
    justify-content:stretch;padding:5px;border:1px solid rgba(255,255,255,.09);
    background:rgba(15,18,24,.93);box-shadow:0 18px 60px rgba(0,0,0,.55);
    backdrop-filter:blur(24px)
  }
  .nav-button{flex:1;min-width:0}
  .page{padding-bottom:86px}
  .hero-card{min-height:330px;border-radius:27px;padding:30px 24px}
  .dashboard-grid,.notes-grid{grid-template-columns:1fr}
  .panel{border-radius:23px}
  .page-heading{padding-inline:4px;align-items:flex-start}
  .notes-heading{display:grid}
  .notes-heading .primary-button{justify-self:start}
  .notes-command-bar{grid-template-columns:1fr;padding:10px}
  .note-filter-group{justify-content:stretch}
  .filter-chip{flex:1}
  .sort-control{grid-column:auto;width:100%;grid-template-columns:auto 1fr}
  .sort-control select{min-width:0}
  .note-search kbd{display:none}
  .note-card{min-height:225px}
  .note-dialog{width:100%;height:100%;max-height:none;border-radius:0;border:0}
  .note-dialog form{max-height:100vh;min-height:100vh;padding:max(18px,env(safe-area-inset-top)) 16px max(18px,env(safe-area-inset-bottom))}
  .note-editor-tools{align-items:stretch}
  .editor-select{flex:1}
  .editor-select select{min-width:0;width:100%}
  .editor-actions-mini{margin-left:0}
  .note-content-editor{min-height:42vh}
}
@media(max-width:470px){
  .auth-card{padding:30px 22px;border-radius:27px}
  .toolbar-brand strong{font-size:13px}
  .toolbar-actions .icon-button{width:39px;height:39px}
  .system-status{grid-template-columns:auto 1fr}
  #clockText{display:none}
  .task-entry{grid-template-columns:1fr}
  .task-entry button{width:100%}
  .dialog-actions{flex-wrap:wrap}
  .direction-control{order:4;width:100%}
  .direction-button{flex:1}
  .editor-status-row{display:grid}
  .tags-field{grid-template-columns:1fr}
}
