:root {
    --bg: #1E2020;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --panel: #181818;
    --border: #2e2e2e;
    --border-focus: #7a7a7a;
    --glow: rgba(255, 255, 255, 0.01);
    --text: #f2f2f2;
    --muted: #7c7c7c;
    --warn: #e0a458;
    --font: "Iosevka", ui-monospace, "SF Mono", Consolas, monospace; /*sabse tagda font*/
    --s1: 8px; --s2: 16px; --s3: 24px;
    --radius: 0px;
    --box-h: 55px;
    --pad-top: 32px;
    --tab-w: 132px;
    --dur-fast: 0.15s;
    --dur: 0.3s;
    --dur-open: 0.5s;
    --dur-close: 0.22s;
    --dur-move: 0.5s;
    --dur-switch: 0.32s;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    :root { --dur-fast: 0.01s; --dur: 0.01s; --dur-open: 0.01s; --dur-close: 0.01s; --dur-move: 0.01s; --dur-switch: 0.01s; }
}

*, *::before, *::after { box-sizing: border-box; }
html { text-rendering: geometricPrecision; }

body {
    margin: 0;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
}

h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
button { font: inherit; color: inherit; cursor: pointer; }

/* search box  ki css*/
.stage {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--pad-top) var(--s2) var(--s3);
}

.search-container {
    flex: none;
    width: min(600px, 100%);
    transform: translateY(calc(50dvh - var(--pad-top) - var(--box-h) / 2));
    transition: transform var(--dur-move) var(--ease-in-out);
    will-change: transform;
}
body.ws-open .search-container { transform: none; }

input, textarea {
    width: 100%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input::-webkit-search-cancel-button { -webkit-appearance: none; }
input:focus, textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 20px 2px var(--glow); }

#search {
    height: var(--box-h);
    padding: 0 20px;
    font-size: 18px;
    background: #1c1c1c;
    caret-color: transparent;
}

/* workspace ki css*/
.workspace {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: grid;
    place-items: center;
    padding-top: 0;
    visibility: hidden;
    transition: visibility 0s linear var(--dur-close);
}
body.ws-open .workspace { visibility: visible; transition-delay: 0s; }

.app {
    width: min(940px, 100%);
    height: min(580px, 100%);
    display: grid;
    grid-template-columns: 220px 1fr;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--dur-close) var(--ease), transform var(--dur-close) var(--ease);
}
body.ws-open .app {
    opacity: 1;
    transform: none;
    transition: opacity var(--dur-open) var(--ease-out) 0.12s, transform var(--dur-open) var(--ease-out) 0.12s;
}

.side, .main {
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border);
}
.side { border-radius: var(--radius) 0 0 var(--radius); padding: var(--s2) var(--s1); }
.main { border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; }

/* sidebar and folder management */
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s1) var(--s1); }
.icon-btn, .remove {
    background: none; border: 0; color: var(--muted); line-height: 1;
    border-radius: 6px; padding: 2px 7px; font-size: 18px;
    transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.icon-btn:hover, .remove:hover, .icon-btn:focus-visible, .remove:focus-visible { color: var(--text); background: var(--surface-hover); outline: none; }
.folder-input { margin: 0 0 var(--s1); padding: 8px 10px; font-size: 14px; }

.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree { flex: 1; min-height: 0; overflow-y: auto; }
.tree ul { margin-left: 14px; padding-left: 4px; border-left: 1px solid var(--border); }
.t-row { display: flex; align-items: center; border-radius: 6px; transition: background var(--dur-fast) ease; }
.t-row:hover { background: var(--surface); }
.t-row.current { background: var(--surface-hover); }
.chev { flex: none; width: 22px; padding: 6px 0; font-size: 12px; text-align: center; background: none; border: 0; color: var(--muted); }
.chev:hover, .chev:focus-visible { color: var(--text); outline: none; }
.t-btn { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 6px 4px; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 6px; }
.t-row.current .t-btn, .t-btn:hover { color: var(--text); }
.t-btn:focus-visible { outline: 1px solid var(--border-focus); }
.count { flex: none; padding: 0 6px; font-size: 12px; color: var(--muted); }
.t-row .icon-btn { display: none; font-size: 14px; padding: 2px 6px; }
.t-row:hover .icon-btn, .t-row:focus-within .icon-btn { display: block; }
.t-row:hover .count, .t-row:focus-within .count { display: none; }


.main-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 0 var(--s3); border-bottom: 1px solid var(--border); }
.tabs { position: relative; display: flex; }
.tabs::after {
    content: ""; position: absolute; left: 0; bottom: -1px; width: var(--tab-w); height: 2px; background: var(--text);
    transition: transform var(--dur-switch) var(--ease-in-out);
}
.workspace[data-view="notes"] .tabs::after { transform: translateX(var(--tab-w)); }
.tab { width: var(--tab-w); padding: 16px 0 14px; background: none; border: 0; font-size: 15px; color: var(--muted); transition: color var(--dur-fast) ease; }
.tab[aria-selected="true"], .tab:hover { color: var(--text); }
.tab:focus-visible { outline: 1px solid var(--border-focus); outline-offset: -4px; border-radius: 6px; }
.tab kbd { margin-left: 8px; font: inherit; font-size: 11px; color: var(--muted); }
.crumb { min-width: 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.views { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.view {
    position: absolute; inset: 0; display: flex; flex-direction: column; padding: var(--s3) var(--s3) 0;
    opacity: 0; visibility: hidden; transform: translateX(-28px);
    transition: opacity var(--dur-close) var(--ease), transform var(--dur-close) var(--ease), visibility 0s linear var(--dur-close);
}
#view-notes { transform: translateX(28px); }
.view.on {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity var(--dur-switch) var(--ease-out) 0.05s, transform var(--dur-switch) var(--ease-out) 0.05s, visibility 0s;
}

.items { flex: 1; min-height: 0; margin: 0; padding: 0 2px var(--s3) 0; list-style: none; overflow-y: auto; align-content: start; }
.items li { transition: opacity var(--dur-fast) ease, transform var(--dur-fast) ease; }
.items li.leaving { opacity: 0; transform: translateX(8px); transition-duration: var(--dur-close); }
.items li.new { animation: item-in var(--dur) var(--ease-out) both; }
@keyframes item-in { from { opacity: 0; transform: translateY(6px); } }
.empty { margin: var(--s2) 0; text-align: center; color: var(--muted); font-size: 14px; }

/*  tasks ka section */
.add-bar { flex: none; display: flex; gap: var(--s1); margin-bottom: var(--s2); }
.add-bar #task-input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; font-size: 15px; }
.add-bar #task-due { flex: none; width: 150px; height: 46px; padding: 0 12px; font-size: 13px; color: var(--muted); }

.tasks li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 4px 0 4px 4px; border-bottom: 1px solid var(--border); }
.tasks li.done { opacity: 0.5; }
.tasks li.done .t-title { color: var(--muted); text-decoration: line-through; }
.tasks input[type="checkbox"] {
    width: 18px; height: 18px; margin: 0; padding: 0; cursor: pointer;
    border: 1.5px solid var(--muted); border-radius: 50%; background: transparent;
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.tasks input[type="checkbox"]:hover { border-color: var(--text); }
.tasks input[type="checkbox"]:checked {
    background: #cfcfcf url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
    border-color: #cfcfcf;
}
.tasks input[type="checkbox"]:focus-visible { outline: 1px solid var(--border-focus); outline-offset: 2px; box-shadow: none; }
.tasks .t-title { padding: 9px 0; font-size: 15px; background: none; border: 0; border-bottom: 1px solid transparent; border-radius: 0; }
.tasks .t-title:focus { border-bottom-color: var(--border-focus); box-shadow: none; }
.tasks .due { width: auto; padding: 4px 6px; font-size: 12px; color: var(--muted); background: none; border-color: transparent; border-radius: 6px; }
.tasks .due.empty { opacity: 0; }
.tasks li:hover .due, .tasks li:focus-within .due { opacity: 1; }
.tasks .due.overdue { color: var(--warn); }
.tasks .due:focus { box-shadow: none; }
.show-done { flex: none; align-self: flex-start; padding: 10px 0 14px; background: none; border: 0; color: var(--muted); font-size: 13px; }
.show-done:hover, .show-done:focus-visible { color: var(--text); outline: none; }

/* notes ka section */
.add-row {
    flex: none;
    display: block;
    width: min(610px, 100%);
    margin-bottom: var(--s2);
    padding: 12px 14px;

    background: var(--surface);
    border: 0px dashed var(--border);
    border-radius: 0px;

    color: var(--muted);
    font-size: 14px;
    text-align: left;

    transition:
        color var(--dur-fast) ease,
        background var(--dur-fast) ease,
        border-color var(--dur-fast) ease;
}
.add-row:hover { color: var(--text); background: var(--surface-hover); }
.add-row:focus-visible { outline: none; border-color: var(--border-focus); color: var(--text); }

.items.notes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.notes li { display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; line-height: 1.5; transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease; }
.notes li:hover { background: var(--surface-hover); }
.notes li:focus-within { border-color: var(--border-focus); }
.notes .remove { align-self: flex-end; opacity: 0; }
.notes li:hover .remove, .notes li:focus-within .remove { opacity: 1; }
.note-text { display: block; width: 100%; min-height: 64px; padding: 0; background: none; border: 0; border-radius: 0; font-size: 14px; line-height: 1.5; resize: none; overflow: hidden; }
.note-text:focus { border: 0; box-shadow: none; }

/* choti screens */
@media (max-width: 720px) {
    :root { --tab-w: 100px; }
    .app { grid-template-columns: 1fr; grid-template-rows: minmax(0, 32%) minmax(0, 1fr); height: min(640px, 100%); }
    .side { border-radius: var(--radius) var(--radius) 0 0; padding: var(--s1); }
    .main { border-left: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
    .main-head { padding: 0 var(--s2); }
    .tab kbd, .crumb { display: none; }
    .view { padding: var(--s2) var(--s2) 0; }
    .add-bar #task-due { width: 128px; }
    .items.notes { grid-template-columns: 1fr; }
}