@font-face { font-family: 'Heebo'; font-weight: 400; font-display: swap; src: url(fonts/heebo-hebrew-400-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 500; font-display: swap; src: url(fonts/heebo-hebrew-500-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 700 800; font-display: swap; src: url(fonts/heebo-hebrew-700-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 400; font-display: swap; src: url(fonts/heebo-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Heebo'; font-weight: 500; font-display: swap; src: url(fonts/heebo-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Heebo'; font-weight: 700 800; font-display: swap; src: url(fonts/heebo-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }

:root {
  --bg: #0F1226; --bg2: #151936; --card: #1B2045; --card2: #232957; --line: #2E3566; --ink: #F4F5FF; --ink2: #B6BAE0; --ink3: #8189BD;
  --amber: #FFB547; --amberInk: #2A1B00; --mint: #5EE6B8; --rose: #FF7A93; --r: 22px;
  font-family: 'Heebo', system-ui, sans-serif; color: var(--ink); color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(900px 500px at 85% -10%, #3A2E7A55, transparent 60%),
  radial-gradient(700px 420px at 0% 0%, #FFB54718, transparent 60%), var(--bg);
  color: var(--ink); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 10px; }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 36px 24px 90px; }
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 30px; }
.logo { width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(145deg, #FFC766, #FF9A3D); display: grid; place-items: center; box-shadow: 0 10px 30px #FF9A3D44; }
.logo svg { width: 28px; height: 28px; }
.top h1 { margin: 0; font-size: 34px; line-height: 1.1; letter-spacing: -.01em; font-weight: 800; }
.top .sub { color: var(--ink3); font-size: 15px; }
.grow { flex: 1; }
.search { position: relative; flex: 1 1 280px; max-width: 460px; }
.search input { width: 100%; height: 52px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--bg2); padding: 0 48px 0 16px; font-size: 17px; }
.search input::placeholder { color: var(--ink3); }
.search input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px #FFB54722; }
.search svg { position: absolute; inset-inline-start: auto; right: 16px; top: 15px; width: 22px; height: 22px; color: var(--ink3); pointer-events: none; }
.search kbd { position: absolute; left: 14px; top: 14px; padding: 2px 9px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink3); font-size: 14px; font-family: inherit; }
.btn { display: inline-flex; align-items: center; gap: 9px; height: 52px; padding: 0 22px; border-radius: 18px; border: 0; background: var(--amber); color: var(--amberInk); font-weight: 800; font-size: 17px; transition: transform .12s, box-shadow .12s; box-shadow: 0 8px 24px #FFB54733; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 30px #FFB54744; }
.btn svg { width: 20px; height: 20px; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: none; border: 1.5px solid var(--line); font-weight: 600; }
.btn.ghost:hover { background: var(--card2); }
.btn.small { height: 42px; padding: 0 16px; font-size: 15px; border-radius: 14px; }
.btn.danger { background: var(--rose); color: #3A0010; box-shadow: none; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: -6px 0 26px; color: var(--ink2); font-size: 15px; }
.stats b { color: var(--ink); font-weight: 800; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); }
.dot.p { background: var(--rose); }

.group h2 { margin: 0 0 14px; display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; }
.group h2 span { font-size: 14px; font-weight: 600; color: var(--ink3); padding: 2px 11px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }
.group h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to left, transparent, var(--line)); }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px 22px; align-items: start; }
.grid { display: flex; flex-direction: column; gap: 14px; }
.group { margin-bottom: 0; }

.tile { position: relative; border-radius: var(--r); background: linear-gradient(160deg, var(--card2), var(--card)); border: 1.5px solid var(--line); transition: transform .16s, border-color .16s, box-shadow .16s; overflow: hidden; }
.tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--h) 70%, #fff 0%); box-shadow: 0 18px 40px #00000055, 0 0 0 1px var(--h) inset; }
.tile::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--h); opacity: .9; }
.tile .go { display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; row-gap: 6px; align-items: start; padding: 20px 20px 18px; color: inherit; text-decoration: none; }
.tile .go > * { grid-column: 2; }
.tile .go > .mono { grid-column: 1; grid-row: 1 / span 3; }
.tile .mono { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; font-weight: 800; background: color-mix(in srgb, var(--h) 22%, transparent); color: var(--h); border: 1.5px solid color-mix(in srgb, var(--h) 45%, transparent); }
.tile .nm { font-size: 20px; font-weight: 800; line-height: 1.25; }
.tile .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; align-items: center; }
.tile .chip { font-size: 13.5px; padding: 3px 11px; border-radius: 999px; background: #ffffff12; color: var(--ink2); }
.tile .chip.priv { background: #FF7A9322; color: var(--rose); display: inline-flex; gap: 5px; align-items: center; }
.tile .chip.priv svg { width: 13px; height: 13px; }
.tile .chip.ai { background: #5EE6B822; color: var(--mint); }
.tile .note { color: var(--ink3); font-size: 14.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .ed { position: absolute; top: 14px; left: 14px; width: 40px; height: 40px; border-radius: 13px; border: 1px solid var(--line); background: #0F122688; backdrop-filter: blur(6px); display: grid; place-items: center; color: var(--ink2); opacity: 0; transition: opacity .15s; }
.tile:hover .ed, .tile:focus-within .ed { opacity: 1; }
.tile .ed:hover { color: var(--ink); background: var(--card2); }
.tile .ed svg { width: 19px; height: 19px; }
@media (hover: none) { .tile .ed { opacity: 1; } }

.empty { text-align: center; padding: 70px 20px; border: 2px dashed var(--line); border-radius: 28px; color: var(--ink2); }
.empty h2 { margin: 0 0 8px; color: var(--ink); font-size: 24px; }
.empty .btn { margin-top: 18px; }
.foot { display: flex; gap: 12px; flex-wrap: wrap; color: var(--ink3); font-size: 15px; margin-top: 10px; }
.linkbtn { background: none; border: 0; color: var(--ink2); text-decoration: underline; padding: 4px; }

/* חלון הוספה ועריכה */
.veil { position: fixed; inset: 0; background: #05061299; backdrop-filter: blur(4px); z-index: 20; animation: fade .15s; }
.sheet { position: fixed; z-index: 21; top: 0; bottom: 0; inset-inline-start: 0; width: min(520px, 100%); background: var(--bg2); border-inline-end: 1px solid var(--line); box-shadow: 30px 0 80px #000a; display: flex; flex-direction: column; animation: slide .2s ease-out; }
.sheet header { display: flex; align-items: center; gap: 12px; padding: 22px 24px 14px; }
.sheet header h3 { margin: 0; flex: 1; font-size: 24px; font-weight: 800; }
.sheet .x { width: 42px; height: 42px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; }
.sheet .x svg { width: 18px; height: 18px; }
.sheet form { padding: 6px 24px 28px; display: flex; flex-direction: column; gap: 18px; overflow: auto; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .field .lbl { font-size: 15px; font-weight: 700; color: var(--ink2); }
.field input, .field textarea { min-height: 50px; border-radius: 15px; border: 1.5px solid var(--line); background: var(--card); padding: 10px 15px; font-size: 17px; width: 100%; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px #FFB54722; }
.field input.bad { border-color: var(--rose); }
.fmsg { color: var(--rose); font-size: 14.5px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 16px; background: var(--card); border: 1.5px solid var(--line); }
.seg button { height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--ink2); font-weight: 600; }
.seg button.on { background: var(--amber); color: var(--amberInk); font-weight: 800; }
.hint { color: var(--ink3); font-size: 14.5px; margin: 0; }
.acts { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

.toast { position: fixed; z-index: 40; bottom: 26px; left: 50%; transform: translateX(-50%); padding: 13px 20px; border-radius: 16px; background: var(--ink); color: var(--bg); font-weight: 700; box-shadow: 0 14px 40px #0008; animation: pop .2s; }

/* כניסה */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate main { width: min(440px, 100%); padding: 34px 30px; border-radius: 30px; background: linear-gradient(160deg, var(--card2), var(--card)); border: 1.5px solid var(--line); box-shadow: 0 30px 80px #0008; display: flex; flex-direction: column; gap: 20px; }
.gate .brand { display: flex; align-items: center; gap: 14px; }
.gate h1 { margin: 0; font-size: 28px; }
.gate form { display: flex; flex-direction: column; gap: 16px; }
.gate .err { min-height: 22px; color: var(--rose); font-size: 15px; }
.gate .btn { justify-content: center; width: 100%; }

@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(-30px); opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 10px); } }
@media (max-width: 640px) {
  .wrap { padding: 22px 16px 80px; }
  .top h1 { font-size: 28px; }
  .search { order: 5; flex: 1 1 100%; max-width: none; }
  .search kbd { display: none; }
  .groups { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
