/* Snote — mobile.css
 * Mobilný shell: horizontálny pager 3 panelov (Skúšanie · Poznámky · Graf),
 * pevné spodné menu s ikonami, prepínanie swipom.
 * CELÉ scopnuté pod html.is-mobile → na desktope nulový efekt.
 */

html.is-mobile, html.is-mobile body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* desktopová chrome preč — mobil má vlastný shell */
html.is-mobile #topbar,
html.is-mobile #hintbar,
html.is-mobile #mini-card,
html.is-mobile #inbox-tray,
html.is-mobile #scrim { display: none !important; }

html.is-mobile main { position: static; }

/* ============ mobil-only: oranžovú na čiernu ============
 * Inak mobil používa tvoju uloženú tému (vrátane bieleho pozadia).
 * Oba akcenty (--accent aj --accent-2) → čierna: menu, skúšanie, zvýraznenia.
 * Odznak má biely text. Len pod html.is-mobile — desktop a témy nedotknuté. */
html.is-mobile { --accent: #111111; --accent-2: #111111; --badge-ink: #ffffff; }

/* tlačidlá na čiernom akcente: biely text/plus */
html.is-mobile #m-fab,
html.is-mobile #m-notes-fab,
html.is-mobile .m-btn-primary { background: #111111; color: #ffffff; }
html.is-mobile .m-btn-primary.ghost { background: transparent; color: var(--text); }

/* ============ shell ============ */

#m-shell {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg, #0b1016);
  color: var(--text, #e8eef4);
  font-family: var(--font-ui, system-ui, sans-serif);
  overflow: hidden;
}

/* javisko = výrez, v ňom sa posúva 300% široký track */
#m-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
#m-track { display: flex; height: 100%; transition: transform .28s cubic-bezier(.2, .9, .3, 1); }
#m-track.dragging { transition: none; }
.m-pane { flex: 0 0 100%; height: 100%; overflow: hidden; position: relative; }

/* ============ spodné menu (pevné, ikony) ============ */

#m-tabs {
  flex: 0 0 auto;
  display: flex;
  background: var(--surface, #0e141b);
  border-top: 1px solid var(--line, rgba(128,128,128,.2));
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 5;
}
#m-tabs button {
  flex: 1 1 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-faint, #65788a);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 9px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  padding-bottom: 8px;
}
#m-tabs button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#m-tabs button.active { color: var(--accent, #5fd4b4); }
#m-tabs .tab-badge {
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent-2, #ecb36b);
  color: var(--badge-ink, #1a1206);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ============ pane: Skúšanie ============ */

#pane-review { display: flex; flex-direction: column; }
.m-rev-start {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}
.m-rev-start.hidden { display: none; }
.rs-num { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rs-num b { font-family: var(--font-read, serif); font-size: 64px; font-weight: 600; line-height: 1; color: var(--accent, #5fd4b4); }
.rs-num span { font-size: 14px; color: var(--text-soft, #9fb0c0); }
.rs-num.zero b { color: var(--text-soft, #9fb0c0); }
.m-btn-primary {
  background: var(--accent, #5fd4b4);
  color: #06120e;
  border: none;
  border-radius: 999px;
  padding: 14px 30px;
  font-size: 16px;
  font-weight: 700;
}
.m-btn-primary:active { transform: scale(.97); }
.m-btn-primary.ghost { background: transparent; color: var(--text, #e8eef4); border: 1px solid var(--line, rgba(128,128,128,.3)); }
#m-ai-status { font-size: 13px; margin: -8px 0 0; }
.m-ai-cfg { background: transparent; border: none; color: var(--text-soft, #9fb0c0); font-size: 13px; text-decoration: underline; padding: 4px 8px; }

/* review overlay presunutý do panelu — nech vyplní panel, nie obrazovku */
html.is-mobile #pane-review #review-overlay {
  position: absolute; inset: 0;
  display: block; padding: 0; z-index: 1;
  pointer-events: auto; place-items: stretch;
}
html.is-mobile #pane-review #review-overlay.hidden { display: none; }
html.is-mobile .review-sheet {
  width: 100%; height: 100%; max-width: none;
  border: none; border-radius: 0;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 18px) 22px 22px;
  overflow-y: auto;
}
html.is-mobile #review-question { font-size: clamp(21px, 6vw, 28px); line-height: 1.3; }
html.is-mobile #review-answer { font-size: 17px; min-height: 90px; }
html.is-mobile #review-self-grades,
html.is-mobile #review-grades { display: flex; gap: 10px; }
html.is-mobile .grade { flex: 1 1 0; flex-direction: column; padding: 16px 6px; font-size: 16px; border-radius: 14px; }

/* ============ pane: Poznámky ============ */

#pane-notes { display: flex; flex-direction: column; }
.m-notes-head {
  flex: 0 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 10px;
  border-bottom: 1px solid var(--line, rgba(128,128,128,.14));
}
.m-notes-head h2 { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-soft, #9fb0c0); }
.m-quick { display: flex; gap: 8px; }
#m-quick-input {
  flex: 1 1 auto;
  background: var(--surface-2, rgba(128,128,128,.1));
  border: 1px solid var(--line, rgba(128,128,128,.2));
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 15px;
  color: var(--text, #e8eef4);
  font-family: inherit;
}
#m-quick-input:focus { outline: none; border-color: var(--accent, #5fd4b4); }
#m-quick-add {
  flex: 0 0 auto;
  width: 44px;
  border: none;
  border-radius: 50%;
  background: var(--accent, #5fd4b4);
  color: #06120e;
  font-size: 24px;
  line-height: 1;
}

#m-notes-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 6px 0 16px;
}
.note-item {
  position: relative;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line, rgba(128,128,128,.1));
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.note-item:active { background: var(--surface-2, rgba(128,128,128,.08)); }
.note-item.confirm-del { padding-right: 66px; background: color-mix(in srgb, #e5484d 12%, transparent); }
.note-del {
  position: absolute;
  top: 50%; right: 14px;
  width: 42px; height: 42px;
  display: none;
  align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: #e5484d; color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.note-del svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.note-item.confirm-del .note-del { display: flex; animation: del-pop .16s ease; }
@keyframes del-pop { from { transform: translateY(-50%) scale(.6); opacity: .2; } to { transform: translateY(-50%) scale(1); opacity: 1; } }
.note-del { transform: translateY(-50%); }
.note-crumbs { font-size: 11.5px; color: var(--text-faint, #65788a); margin-bottom: 3px; }
.note-crumbs .sep { margin: 0 3px; }
.note-title { font-family: var(--font-read, serif); font-size: 18px; font-weight: 600; color: var(--heading, #f3f7fb); line-height: 1.25; }
.note-snip { font-size: 14px; color: var(--text-soft, #9fb0c0); line-height: 1.45; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-due { color: var(--accent, #5fd4b4); }
.m-empty { padding: 40px 24px; text-align: center; color: var(--text-faint, #65788a); }

/* ============ pane: Graf ============ */

#pane-graph { position: relative; }
html.is-mobile #graph-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#m-fab {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 30px; line-height: 1;
  color: #06120e;
  background: var(--accent, #5fd4b4);
  box-shadow: 0 8px 22px rgba(0,0,0,.4);
  z-index: 3;
}
#m-fab:active { transform: scale(.94); }

/* FAB v Poznámkach — pridanie novej poznámky, vpravo dole */
#m-notes-fab {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 30px; line-height: 1;
  box-shadow: 0 8px 22px rgba(0,0,0,.4);
  z-index: 3;
}
#m-notes-fab:active { transform: scale(.94); }

/* spodný node-sheet v grafe */
.m-sheet {
  position: absolute;
  left: 10px; right: 10px; bottom: 10px;
  background: var(--sheet-grad, var(--surface, #131a22));
  border: 1px solid var(--line, rgba(128,128,128,.25));
  border-radius: 18px;
  box-shadow: var(--shadow, 0 8px 30px rgba(0,0,0,.4));
  padding: 16px 18px;
  z-index: 4;
  animation: m-sheet-in .2s cubic-bezier(.2,.9,.3,1);
}
.m-sheet.hidden { display: none; }
@keyframes m-sheet-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ns-crumbs { font-size: 12px; color: var(--text-soft, #9fb0c0); margin-bottom: 4px; }
.ns-title { font-family: var(--font-read, serif); font-size: 20px; font-weight: 600; color: var(--heading, #f3f7fb); margin-bottom: 4px; }
.ns-ex { font-size: 14px; color: var(--text-soft, #9fb0c0); line-height: 1.5; max-height: 4.5em; overflow: hidden; margin-bottom: 14px; }
.ns-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ns-actions button { flex: 1 1 auto; background: transparent; border: 1px solid var(--line, rgba(128,128,128,.3)); color: var(--text, #e8eef4); border-radius: 999px; padding: 9px 12px; font-size: 14px; font-weight: 500; }
#ns-add { border-color: var(--accent, #5fd4b4); color: var(--accent, #5fd4b4); font-weight: 600; }

/* ============ čítačka + editor (celoobrazovkové) ============ */

.m-full {
  position: fixed; inset: 0;
  z-index: 20;
  display: flex; flex-direction: column;
  background: var(--bg, #0b1016);
}
.m-full.hidden { display: none; }
.m-full header {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  border-bottom: 1px solid var(--line, rgba(128,128,128,.2));
}
.m-full header span { font-size: 14px; font-weight: 600; color: var(--text-soft, #9fb0c0); }
.m-full header button { background: transparent; border: none; font-size: 15px; font-weight: 600; padding: 6px 4px; color: var(--text, #e8eef4); }
.m-full header .accent { color: var(--accent, #5fd4b4); }

#m-read-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 20px calc(env(safe-area-inset-bottom) + 24px);
}
#m-read-crumbs { font-size: 12.5px; color: var(--text-soft, #9fb0c0); margin-bottom: 8px; }
#m-read-title { font-family: var(--font-read, serif); font-size: clamp(24px, 7vw, 32px); font-weight: 600; color: var(--heading, #f3f7fb); margin: 0 0 14px; line-height: 1.2; }
#m-read-prose { font-size: 18px; line-height: 1.62; }

#me-title {
  font-family: var(--font-read, serif); font-size: 23px; font-weight: 600;
  color: var(--heading, #f3f7fb); background: transparent; border: none;
  border-bottom: 1px solid var(--line, rgba(128,128,128,.2));
  padding: 16px 18px;
}
#me-title:focus { outline: none; border-bottom-color: var(--accent, #5fd4b4); }
#me-body {
  flex: 1 1 auto; resize: none; background: transparent; border: none;
  color: var(--prose, #d7e0e8); font-family: var(--font-read, serif);
  font-size: 18px; line-height: 1.6;
  padding: 14px 18px calc(env(safe-area-inset-bottom) + 18px);
}
#me-body:focus { outline: none; }

.muted { color: var(--text-faint, #65788a); font-style: italic; }
