:root{
  --bg:#06030b;
  --panel:#0b0613;
  --panel2:#080411;
  --stroke: rgba(255,255,255,.14);
  --text:#f7f4ff;
  --muted:rgba(215,205,246,.78);
  --accent:#a855f7;
  --accentRGB:168,85,247;
  --good:#53ffb0;
  --bad:#ff6b9e;
  --shadow: 0 16px 42px rgba(0,0,0,.55);
  --bgGrad1:#05030b;
  --bgGrad2:#070412;
  --bgGrad3:#090518;
  --topbarBg: rgba(8,4,14,.90);
  --surfaceBg: rgba(8,4,14,.92);
  --surfaceBg2: rgba(8,4,14,.95);
  --surfaceBg3: rgba(8,4,14,.98);
  --cardBg: rgba(0,0,0,.22);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color:var(--text);
  background: linear-gradient(180deg, var(--bgGrad1) 0%, var(--bgGrad2) 55%, var(--bgGrad3) 100%);
  overflow-x:hidden;
}

/* Top bar */
.topbar{
  position:sticky; top:0; z-index:20;
  backdrop-filter: blur(10px);
  background: var(--topbarBg);
  border-bottom: 1px solid var(--stroke);
  padding:12px 14px;
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
}
.brand{ display:flex; gap:10px; align-items:center; min-width: 0;}
.logo{
  width:38px; height:38px; display:grid; place-items:center; border-radius:12px;
  background: rgba(var(--accentRGB),.18);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  flex:0 0 auto;
}
.title{ font-weight:900; letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.subtitle{ color:var(--muted); font-size:12px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.top-actions{ display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }

/* Layout */
.layout{
  max-width: 860px;
  margin: 12px auto 120px;
  padding: 0 12px;
}
.panel{ display:none; padding-top:10px; }
.panel.active{ display:block; }
.panel-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:12px; margin: 6px 2px 10px;
}
.panel-head h2{ margin:0; font-size: 18px; }
.hint{ color:var(--muted); font-size:12px; }

/* Cards */
.card{
  border:1px solid var(--stroke);
  background: var(--surfaceBg);
  border-radius:18px;
  padding:14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }

.grid{ display:grid; gap:12px; }
.grid.two{ grid-template-columns: 1fr 1fr; }
.grid.three{ grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 520px){
  .grid.two{ grid-template-columns:1fr; }
  .grid.three{ grid-template-columns:1fr; }
  .top-actions{ gap:6px; }
}

.row{ margin-top:10px; }
.row-inline{ display:flex; gap:10px; align-items:center; margin-top:10px; flex-wrap:wrap; }

.label{ display:block; color:var(--muted); font-size:12px; margin-bottom: 0px; }
.micro{ color:var(--muted); font-size:12px; }
.big{ font-size:24px; font-weight:950; letter-spacing:.2px; }

/* Inputs */
.input,.textarea,select{
  width:100%;
  border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.38);
  color:var(--text);
  padding:10px 12px;
  outline:none;
}
.textarea{ resize: vertical; min-height: 110px; }

/* Buttons */
.btn{
  border:1px solid rgba(var(--accentRGB),.35);
  background: rgba(var(--accentRGB),.16);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:900;
}
.btn:hover{ filter: brightness(1.05); }
.btn.ghost{
  border:1px solid var(--stroke);
  background: var(--cardBg);
  color:var(--text);
}
.btn.small{ padding:8px 10px; border-radius:12px; font-weight:900; }

.chip{
  border:1px solid var(--stroke);
  background: var(--cardBg);
  color:var(--text);
  padding:7px 10px;
  border-radius:999px;
  cursor:pointer;
}
.chip.active{
  border-color: rgba(var(--accentRGB),.45);
  background: rgba(var(--accentRGB),.14);
}

.stack{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.item{
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:12px;
  background: rgba(0,0,0,.26);
}
.item-title{ font-weight:950; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.item-sub{ color:var(--muted); font-size:12px; margin-top:4px; }
.item-body{ margin-top:10px; white-space:pre-wrap; line-height:1.4; }

.pill{
  border:1px solid var(--stroke);
  background: var(--cardBg);
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  color:var(--muted);
}

.divider{ height:1px; background: var(--stroke); margin:14px 0; }

.mood{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }

.summary{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; margin-top:10px; }
.stat{ border:1px solid var(--stroke); border-radius:16px; padding:10px; background: var(--cardBg); }

.cal-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.cal-title{ font-weight:950; letter-spacing:.2px; }
.cal-grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:8px;
}
.day{
  border:1px solid var(--stroke);
  background: var(--cardBg);
  border-radius:14px;
  padding:10px 8px;
  min-height:52px;
  cursor:pointer;
  position:relative;
  -webkit-tap-highlight-color: transparent;
}
.day.dim{ opacity:.45; }
.day.selected{ border-color: rgba(var(--accentRGB),.45); background: rgba(var(--accentRGB),.10); }
.day .num{ font-weight:950; }
.dot{
  width:8px; height:8px; border-radius:999px;
  background: rgba(var(--accentRGB),.9);
  position:absolute; right:10px; bottom:10px;
  box-shadow: 0 0 0 4px rgba(var(--accentRGB),.12);
}

/* Bottom navigation */
.bottom-nav{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: var(--surfaceBg2);
  border-top: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  z-index: 50;
}
.navbtn{
  border: 1px solid var(--stroke);
  background: var(--cardBg);
  color: var(--muted);
  border-radius: 16px;
  padding: 10px 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 4px;
  font-weight: 950;
  -webkit-tap-highlight-color: transparent;
}
.navbtn .ico{ font-size: 18px; line-height: 1; }
.navbtn .lbl{ font-size: 11px; letter-spacing: .2px; }
.navbtn.active{
  color: var(--text);
  border-color: rgba(var(--accentRGB),.35);
  background: rgba(var(--accentRGB),.14);
}

.footer{ max-width:860px; margin:0 auto; padding:12px 12px 140px; opacity:.9; }


/* Journal accent aesthetics (v6) */
.j-title-mini{
  color: var(--accent);
  text-shadow: 0 0 8px rgba(var(--accentRGB),.35);
}
.j-mood-mini{
  filter: drop-shadow(0 0 6px rgba(var(--accentRGB),.45));
}


/* Options panel helpers */
#panel-options .row-inline{ justify-content:flex-start; }

/* Display toggles */
.compact .stack{ gap:8px; }
.compact .item{ padding:10px; }
.large-text body{ font-size: 17px; }
.large-text .big{ font-size: 26px; }



/* --- v9: prevent content being hidden behind bottom nav --- */
body{
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
.layout{
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}
.panel{
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}


/* --- v9: bottom nav shouldn't show "see-through" gaps --- */
.bottom-nav{
  bottom: 0;
  background: var(--surfaceBg3) !important;
  border-top: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 -16px 40px rgba(0,0,0,.55);
  padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
}


/* Mobile: avoid resize handle fighting the nav */
@media (max-width: 700px){
  .textarea{ resize: none; }
}



/* --- v10: reduce fixed-nav jitter on mobile (esp. Firefox/URL bar) --- */
.bottom-nav{
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: translateZ(0);
  will-change: transform;
  contain: paint;
}
.navbtn{
  transform: translateZ(0);
}

/* Also reduce blur on topbar which can trigger repaints */
.topbar{
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}


html, body{
  overscroll-behavior: none;
  scroll-behavior: auto;
}



/* --- v11: fix button overlap (Meals + Tasks) --- */
/* When a button is a direct child of a card (i.e., not inside .row-inline), give it breathing room */
#panel-meals .card > .btn,
#panel-meals .card > button.btn,
#panel-tasks .card > .btn,
#panel-tasks .card > button.btn{
  margin-top: 8px;
  display: inline-block;
}

/* Also ensure text inputs/areas have a little bottom margin inside these panels */
#panel-meals .input,
#panel-meals .textarea,
#panel-tasks .input,
#panel-tasks .textarea{
  margin-bottom: 0px;
}



/* --- v12: prevent huge blank space in Meals/Tasks lists --- */
#panel-meals .item-body,
#panel-tasks .item-body{
  white-space: normal;
}



/* --- v15: prevent huge blank space in Calendar meals list --- */
#panel-calendar #dayMeals .item-body{
  white-space: normal;
}



/* --- v29 readability + spacing polish --- */
.label{
  margin-bottom: 8px;
  color: rgba(255,255,255,.70);
  font-weight: 600;
  letter-spacing: .2px;
}
.input{
  margin-top: 0;
}
.field{ 
  margin-top: 12px;
}
.field + .field{ 
  margin-top: 14px;
}
/* Section titles like Appearance */
.section-title{
  color: rgba(255,255,255,.78);
  font-weight: 700;
  margin-bottom: 10px;
}
/* Reduce cramped label stacks like "Appearance" then "Accent" */
.stack-tight .label{
  margin-bottom: 10px;
}
.stack-tight .input{
  margin-top: 0;
}


.micro{ margin-top: 6px; }

/* --- Themes (set on <html data-theme="...">) --- */
:root[data-theme="amethyst"]{
  --bg:#06030b; --panel:#0b0613; --panel2:#080411;
  --stroke: rgba(255,255,255,.14);
  --text:#f7f4ff; --muted:rgba(215,205,246,.78);
  --accent:#a855f7; --accentRGB:168,85,247;
  --bgGrad1:#05030b; --bgGrad2:#070412; --bgGrad3:#090518;
  --topbarBg: rgba(8,4,14,.90);
  --surfaceBg: rgba(8,4,14,.92);
  --surfaceBg2: rgba(8,4,14,.95);
  --surfaceBg3: rgba(8,4,14,.98);
  --cardBg: rgba(0,0,0,.22);
}

:root[data-theme="standard-dark"]{
  --bg:#0b0d10; --panel:#101318; --panel2:#0f1217;
  --stroke: rgba(255,255,255,.12);
  --text:#f5f7fb; --muted:rgba(215,225,240,.78);
  --accent:#94a3b8; --accentRGB:148,163,184;
  --bgGrad1:#0b0d10; --bgGrad2:#0b0d10; --bgGrad3:#0b0d10;
  --topbarBg: rgba(12,15,20,.90);
  --surfaceBg: rgba(16,19,24,.92);
  --surfaceBg2: rgba(16,19,24,.95);
  --surfaceBg3: rgba(16,19,24,.98);
  --cardBg: rgba(0,0,0,.18);
}

:root[data-theme="standard-light"]{
  --bg:#f6f7fb; --panel:#ffffff; --panel2:#f0f2f6;
  --stroke: rgba(0,0,0,.10);
  --text:#111827; --muted:rgba(55,65,81,.74);
  --accent:#64748b; --accentRGB:100,116,139;
  --bgGrad1:#f6f7fb; --bgGrad2:#f6f7fb; --bgGrad3:#f6f7fb;
  --topbarBg: rgba(255,255,255,.88);
  --surfaceBg: rgba(255,255,255,.92);
  --surfaceBg2: rgba(255,255,255,.95);
  --surfaceBg3: rgba(255,255,255,.98);
  --cardBg: rgba(17,24,39,.04);
  --shadow: 0 14px 30px rgba(0,0,0,.12);
}

:root[data-theme="sapphire"]{
  --bg:#040812; --panel:#071027; --panel2:#050b1a;
  --stroke: rgba(255,255,255,.14);
  --text:#f2f7ff; --muted:rgba(200,220,255,.78);
  --accent:#3b82f6; --accentRGB:59,130,246;
  --bgGrad1:#03060d; --bgGrad2:#040812; --bgGrad3:#060a1a;
  --topbarBg: rgba(6,10,22,.90);
  --surfaceBg: rgba(7,16,39,.92);
  --surfaceBg2: rgba(7,16,39,.95);
  --surfaceBg3: rgba(7,16,39,.98);
  --cardBg: rgba(0,0,0,.20);
}

:root[data-theme="amber"]{
  /* Topaz: golden yellow-orange, still dark */
  --bg:#0a0702; --panel:#141004; --panel2:#100c03;
  --stroke: rgba(255,255,255,.16);
  --text:#fff8e1; --muted:rgba(255,230,170,.78);

  /* accent is golden topaz */
  --accent:#fbbf24; --accentRGB:251,191,36;

  /* warmer golden gradient */
  --bgGrad1:#070500; --bgGrad2:#0a0702; --bgGrad3:#120c02;

  --topbarBg: rgba(20,16,4,.90);
  --surfaceBg: rgba(20,16,4,.92);
  --surfaceBg2: rgba(20,16,4,.95);
  --surfaceBg3: rgba(20,16,4,.98);

  /* cards slightly less black so gold reads */
  --cardBg: rgba(0,0,0,.18);
}
:root[data-theme="emerald"]{
  --bg:#020b08; --panel:#061612; --panel2:#04110d;
  --stroke: rgba(255,255,255,.14);
  --text:#ecfdf5; --muted:rgba(190,255,228,.74);
  --accent:#10b981; --accentRGB:16,185,129;
  --bgGrad1:#010806; --bgGrad2:#020b08; --bgGrad3:#04130f;
  --topbarBg: rgba(6,18,14,.90);
  --surfaceBg: rgba(6,22,18,.92);
  --surfaceBg2: rgba(6,22,18,.95);
  --surfaceBg3: rgba(6,22,18,.98);
  --cardBg: rgba(0,0,0,.22);
}

:root[data-theme="ruby"]{
  --bg:#0b0205; --panel:#18060b; --panel2:#120409;
  --stroke: rgba(255,255,255,.14);
  --text:#fff1f2; --muted:rgba(255,200,210,.76);
  --accent:#ef4444; --accentRGB:239,68,68;
  --bgGrad1:#090104; --bgGrad2:#0b0205; --bgGrad3:#13030a;
  --topbarBg: rgba(18,4,10,.90);
  --surfaceBg: rgba(24,6,11,.92);
  --surfaceBg2: rgba(24,6,11,.95);
  --surfaceBg3: rgba(24,6,11,.98);
  --cardBg: rgba(0,0,0,.22);
}



/* --- Standard Light readability fixes --- */
:root[data-theme="standard-light"] .input,
:root[data-theme="standard-light"] .textarea,
:root[data-theme="standard-light"] select{
  background: #ffffff;
  color: #111827;
  border-color: rgba(0,0,0,.12);
}

:root[data-theme="standard-light"] .card{
  background: rgba(255,255,255,.85);
}

:root[data-theme="standard-light"] .label,
:root[data-theme="standard-light"] .micro{
  color: rgba(17,24,39,.75);
}


/* --- v35 Phase 1 QoL: Undo toast + draft --- */
.toast{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 99998;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 16px;
  background: var(--surfaceBg2);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.toast-msg{
  color: var(--text);
  font-weight: 650;
  font-size: 14px;
  line-height: 1.25;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:root[data-theme="standard-light"] .toast{
  background: rgba(255,255,255,.92);
}


/* --- v37 Phase 2: Meals summary bar --- */
.summary-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.summary-pill{
  flex: 1 1 120px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--cardBg);
  color: var(--text);
  font-weight: 650;
  font-size: 13px;
  line-height: 1.25;
}
.summary-pill .sub{
  display:block;
  margin-top:4px;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
}
#mealsSummaryCard.summary-ok .summary-pill{
  box-shadow: 0 0 0 1px rgba(var(--accentRGB), .08) inset;
}
#mealsSummaryCard.summary-near .summary-pill{
  box-shadow: 0 0 0 1px rgba(var(--accentRGB), .18) inset, 0 0 0 6px rgba(var(--accentRGB), .06);
}
#mealsSummaryCard.summary-over .summary-pill{
  box-shadow: 0 0 0 1px rgba(var(--accentRGB), .26) inset, 0 0 0 6px rgba(var(--accentRGB), .10);
}
:root[data-theme="standard-light"] .summary-pill{
  background: rgba(17,24,39,.04);
}


/* --- v38 Phase 3: editable items tap affordance --- */
.clickable{ cursor: pointer; }
.clickable:active{ transform: translateY(1px); }


/* --- v42 Phase 4: Weekly mood strip + collapses --- */
.mood-week{
  display:flex;
  gap:10px;
  align-items:flex-end;
  justify-content:space-between;
  padding: 6px 2px;
}
.mood-day{
  flex: 1 1 0;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--cardBg);
  padding: 10px 8px;
  text-align:center;
}
.mood-day .d{
  display:block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 650;
}
.mood-day .e{
  display:block;
  margin-top: 6px;
  font-size: 20px;
  line-height: 1;
}
.mood-day.empty .e{ opacity: .25; }
:root[data-theme="standard-light"] .mood-day{
  background: rgba(17,24,39,.04);
}

/* Journal entry collapse */
.entry-body.collapsed{
  display:-webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow:hidden;
}
.entry-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}


/* --- v43 Weight tracker --- */
.chart{
  width: 100%;
  height: 180px;
  display:block;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--cardBg);
}
.weight-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255,255,255,.10);
}
:root[data-theme="standard-light"] .weight-row{
  border-bottom-color: rgba(0,0,0,.08);
}
.weight-row:last-child{ border-bottom: none; }
.weight-row .meta{ color: var(--muted); font-size: 12px; font-weight: 650; }
.weight-row .val{ font-weight: 750; }


/* --- v44: bottom nav scaling for 5 tabs --- */
.nav{
  --nav-icon-size: 22px;
}
.nav .tab{
  font-size: 12px;
}
.nav .tab > *:first-child{
  font-size: var(--nav-icon-size);
  line-height: 1;
}

/* When weight tab is visible, shrink icons a bit */
.nav.has-weight{
  --nav-icon-size: 19px;
}


/* --- v45: keep bottom nav in one row when Weight tab enabled --- */
.bottom-nav{ gap: 10px; }
.bottom-nav.has-weight{
  gap: 8px;
}
.bottom-nav.has-weight .navbtn{
  padding: 10px 10px;
  min-width: 0;
}
.bottom-nav.has-weight .ico{
  font-size: 18px;
}
.bottom-nav.has-weight .lbl{
  font-size: 11px;
}


/* --- v46: force bottom nav single row --- */
.bottom-nav{
  flex-wrap: nowrap !important;
  overflow: hidden;
}
.bottom-nav .navbtn{
  flex: 1 1 0;
  min-width: 0;
}
.bottom-nav .lbl{
  white-space: nowrap;
}
.bottom-nav.has-weight .lbl{
  font-size: 10px;
}


/* --- v49: keep bottom nav in ONE row when Weight is enabled --- */
.bottom-nav{
  display:flex;
  flex-wrap: nowrap;
  gap: 10px;
}
.bottom-nav .navbtn{
  flex: 1 1 0;
  min-width: 0;
}
.bottom-nav.has-weight{
  gap: 6px;
}
.bottom-nav.has-weight .navbtn{
  padding: 10px 8px;
}
.bottom-nav.has-weight .ico{
  font-size: 18px;
}
.bottom-nav.has-weight .lbl{
  font-size: 10px;
  letter-spacing: 0;
}


/* --- v51: spacing for Weight add button --- */
#panel-weight .card .btn{
  margin-top: 14px;
}


/* --- v53 Phase 5A: quick add + smart defaults --- */
#panel-meals .row-inline .btn.ghost.small,
#panel-weight .row-inline .btn.ghost.small{
  padding: 10px 12px;
}


/* --- v62: Meals insights pill layout --- */
.summary-row{
  align-items: stretch;
}
.summary-pill.summary-insights{
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
}
.summary-pill .pill-title{
  font-weight: 700;
  font-size: 14px;
  opacity: .9;
}
.summary-pill.summary-insights .micro{
  margin: 0;
  line-height: 1.2;
  opacity: .8;
  font-size: 12px;
}


/* --- v63: tidy Meals 'Today' layout --- */
.summary-row.meals-today-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.summary-row.meals-today-grid .summary-pill{
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.summary-row.meals-today-grid .summary-pill.span-2{
  grid-column: 1 / -1;
}
.summary-row.meals-today-grid .summary-pill.summary-insights{
  align-items: flex-start;
  padding: 14px 16px;
  gap: 6px;
}
.summary-row.meals-today-grid .summary-pill.summary-insights .pill-title{
  font-weight: 700;
  font-size: 14px;
  opacity: .9;
}
.summary-row.meals-today-grid .summary-pill.summary-insights .micro{
  margin: 0;
  opacity: .8;
  font-size: 12px;
  line-height: 1.2;
}


/* --- v76: quick calorie calculator (food) --- */
.calc-details{
  margin-top: 10px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  padding: 10px 12px;
}
.calc-details > summary{
  cursor: pointer;
  user-select: none;
  font-weight: 650;
  font-size: 13px;
  opacity: .9;
  list-style: none;
}
.calc-details > summary::-webkit-details-marker{ display:none; }
.calc-details[open] > summary{ margin-bottom: 10px; }

.calc-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.calc-field input{ width: 100%; }
.calc-actions{
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#calcPreview{ opacity: .85; }


/* --- v79: inline item menu (kebab) --- */
.item-more{ position: relative; display: inline-flex; }
.kebab{ width: 38px; padding: 0 0; font-size: 18px; line-height: 1; }

.more-menu{
  position: absolute;
  right: 0;
  top: 38px;
  min-width: 140px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(20,16,28,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 35px rgba(0,0,0,.35);
  display: none;
  z-index: 50;
}
.more-menu.open{ display: block; }

.more-menu .menu-item{
  width: 100%;
  justify-content: flex-start;
  padding: 10px 10px;
  border-radius: 10px;
}
.more-menu .menu-item + .menu-item{ margin-top: 6px; }


/* --- v83: journal preview + full text (keeps line breaks when expanded) --- */
.entry-preview{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: .9;
}
.entry-body:not(.collapsed) .entry-preview{ display:none; }
.entry-body.collapsed .entry-text{ display:none; }
.entry-body .entry-text{ white-space: pre-wrap; }
.entry-chev{ z-index: 2; }


/* v84: journal entry spacing polish */
.entry-body{
  margin-top: 14px;
}
.entry-preview{
  margin-top: 6px;
}
