/* Jenny HQ — pixel LCD graphing-calculator look */
:root {
  --lcd: #c7d1a8;
  --ink: #1f2a1a;
  --body: #2a2e37;
  --desk: #17191e;
  --key: #e6e4dd; --key-sh: #8c8a83;
  --op: #c9ccd3;  --op-sh: #7a7e88;
  --hot: #ec7d3c; --hot-sh: #9a4a1d;
  --exe: #8fbde8; --exe-sh: #3f6f9e;
  --focus: #f2c94c;
  --px: 'Silkscreen', ui-monospace, monospace;
  --lcdfont: 'VT323', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--desk); }
body {
  min-height: 100vh; min-height: 100dvh;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 24px 16px;
  font-family: var(--lcdfont); color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
body.mode-login { align-items: center; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.noscript { color: #eceef2; font-size: 28px; text-align: center; }

/* ---------- calculator body ---------- */
.device {
  width: 100%;
  background: var(--body);
  border-radius: 28px;
  padding: 18px 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: inset 0 2px 0 #3a3f4a, 0 30px 60px rgba(0, 0, 0, .45);
}
.mode-login .device { max-width: 390px; }
.mode-dash .device { max-width: 1280px; }
.brand { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 6px; font-family: var(--px); letter-spacing: 2px; }
.brand-name { font-size: 16px; color: #eceef2; }
.brand-model { font-size: 10px; color: #a3a9b6; }
.bezel { background: #101215; border-radius: 14px; padding: 9px; }
.lcd {
  background-color: var(--lcd);
  background-image:
    repeating-linear-gradient(0deg, rgba(20, 28, 16, .06) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(20, 28, 16, .06) 0 1px, transparent 1px 3px);
  border-radius: 4px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .3);
  display: flex; flex-direction: column;
  overflow: hidden;
  color: var(--ink);
}
.mode-login .lcd { height: 370px; }
.mode-dash .lcd { min-height: 640px; }

.status {
  height: 32px; flex-shrink: 0;
  background: var(--ink); color: var(--lcd);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 14px;
  font-family: var(--px); font-size: 13px; letter-spacing: 1px;
}
.status .right { display: flex; align-items: center; gap: 14px; }
.status > span { white-space: nowrap; }
.mode-login .status { font-size: 12px; padding: 0 12px; }
.mode-login .status .time { display: none; }

/* ---------- keys ---------- */
.key {
  height: 58px; padding: 0; border: 0;
  border-radius: 10px 10px 16px 16px;
  background: var(--key); color: #17191d;
  font-family: var(--px); font-size: 15px;
  box-shadow: 0 4px 0 var(--key-sh), 0 8px 12px rgba(0, 0, 0, .35);
  touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
}
.key.num { font-size: 26px; }
.key.small { font-size: 11px; }
.key.op { background: var(--op); box-shadow: 0 4px 0 var(--op-sh), 0 8px 12px rgba(0, 0, 0, .35); }
.key.hot { background: var(--hot); box-shadow: 0 4px 0 var(--hot-sh), 0 8px 12px rgba(0, 0, 0, .35); }
.key.exe { background: var(--exe); box-shadow: 0 4px 0 var(--exe-sh), 0 8px 12px rgba(0, 0, 0, .35); }
.key:active, .key.pressed { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.keypad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 10px; }
.fkeys { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 0 19px; }
.fkeys .key { height: 42px; font-size: 13px; border-radius: 8px 8px 12px 12px; flex-direction: column; gap: 2px; }
.flabel { display: none; font-family: var(--px); font-size: 8px; letter-spacing: 0; }
.foot { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
.foot:empty { display: none; }
.foot-label { font-family: var(--px); font-size: 10px; letter-spacing: 2px; color: #8e95a3; }
.solar { display: flex; gap: 3px; padding: 3px; background: #15171b; border-radius: 3px; }
.solar i { width: 30px; height: 18px; background: #3b2f33; }

/* ---------- login screen ---------- */
.login-body {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 16px; text-align: center;
}
.big { font-family: var(--px); font-size: 46px; font-weight: 700; letter-spacing: 4px; line-height: 1; }
.hello { font-family: var(--px); font-size: 24px; font-weight: 700; letter-spacing: 2px; line-height: 1; }
.granted { font-family: var(--px); font-size: 28px; font-weight: 700; letter-spacing: 3px; line-height: 1.1; }
.t28 { font-size: 28px; line-height: 1; }
.t24 { font-size: 24px; line-height: 1; }
.wave { position: relative; width: 288px; height: 96px; margin: 6px 0; border-left: 2px solid var(--ink); }
.wave::before { content: ''; position: absolute; left: 0; right: 0; top: 47px; border-top: 2px dashed var(--ink); }
.wave i { position: absolute; width: 6px; height: 6px; background: var(--ink); }
.pinboxes { display: flex; gap: 10px; }
.pinboxes span { width: 40px; height: 52px; border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.pinboxes span.cur { border-style: dashed; }
.pinboxes span.on::after { content: ''; width: 16px; height: 16px; background: var(--ink); }
.hint { display: flex; gap: 22px; font-size: 23px; line-height: 1; }
.errbox {
  position: absolute; inset: 70px 30px;
  background: var(--lcd); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.errbox b { font-family: var(--px); font-size: 20px; letter-spacing: 1px; }
.loadbar { display: flex; gap: 3px; width: 240px; height: 14px; }
.loadbar i { flex: 1; background: var(--ink); }
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- dashboard ---------- */
.dash { flex: 1; display: flex; gap: 20px; padding: 14px 18px; align-items: flex-start; }
.col-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.col-side { width: 360px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.h1 { font-family: var(--px); font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.t26 { font-size: 26px; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.box { border: 3px solid var(--ink); display: flex; flex-direction: column; min-width: 0; }
.box-head {
  min-height: 30px; background: var(--ink); color: var(--lcd);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 0 10px; font-family: var(--px); font-size: 15px; letter-spacing: 1px;
}
.box-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 12px; }
.proj { display: flex; flex-direction: column; gap: 6px; }
.proj-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 25px; line-height: 1; }
.proj-name, .rem-text, .todo-text { overflow-wrap: anywhere; }
.seg { position: relative; display: flex; gap: 3px; height: 16px; }
.seg i { flex: 1 1 0; border: 2px solid var(--ink); }
.seg i.on { background: var(--ink); }
.seg input { position: absolute; left: 0; top: -8px; width: 100%; height: 32px; margin: 0; opacity: 0; cursor: ew-resize; }
.seg:focus-within { outline: 3px dashed var(--ink); outline-offset: 3px; }
.empty { font-size: 22px; opacity: .75; }
.add {
  min-height: 40px; border: 2px dashed var(--ink); background: transparent; color: var(--ink);
  font-family: var(--px); font-size: 12px; letter-spacing: 1px;
}
.add:hover, .mini:hover { background: rgba(31, 42, 26, .12); }
.cats > .add { min-height: 120px; }
.acts { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.mini {
  min-height: 26px; border: 2px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--px); font-size: 10px; letter-spacing: 1px; padding: 2px 6px;
}
.box-head .mini { border-color: var(--lcd); color: var(--lcd); }
.box-head .mini:hover { background: rgba(199, 209, 168, .2); }
.rem { display: flex; gap: 12px; align-items: center; }
.rem-date { width: 62px; flex-shrink: 0; border: 2px solid var(--ink); text-align: center; line-height: 1; padding: 3px 0; }
.rem-date b { display: block; font-family: var(--px); font-size: 12px; font-weight: 400; }
.rem-date span { font-size: 20px; }
.rem-date.late, .rem-date.today { background: var(--ink); color: var(--lcd); }
.rem-text { flex: 1; font-size: 24px; line-height: 1.05; }
.todo { display: flex; gap: 10px; align-items: center; min-height: 34px; }
.todo label { display: flex; gap: 12px; align-items: center; flex: 1; font-size: 25px; line-height: 1; cursor: pointer; min-width: 0; }
.todo.done .todo-text { text-decoration: line-through; opacity: .65; }
.chk { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border: 3px solid var(--ink); background: transparent; flex-shrink: 0; cursor: pointer; }
.chk:checked { background: var(--ink); box-shadow: inset 0 0 0 3px var(--lcd); }
.tabs { flex-shrink: 0; margin-top: auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 0 10px 8px; }
.tabs div {
  height: 28px; background: var(--ink); color: var(--lcd);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--px); font-size: 13px; letter-spacing: 1px;
}
.tabs div.lit { background: transparent; color: var(--ink); border: 3px solid var(--ink); }

/* ---------- dialogs ---------- */
.dlg {
  border: 3px solid var(--ink); border-radius: 0; padding: 0;
  background: var(--lcd); color: var(--ink);
  width: min(440px, calc(100vw - 32px));
  box-shadow: 8px 8px 0 var(--ink);
  font-family: var(--lcdfont);
}
.dlg::backdrop { background: rgba(10, 12, 14, .65); }
.dlg form { display: flex; flex-direction: column; margin: 0; }
.dlg h2 { margin: 0; padding: 8px 12px; background: var(--ink); color: var(--lcd); font-family: var(--px); font-size: 15px; font-weight: 400; letter-spacing: 1px; }
.dlg .fields { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.dlg label { display: flex; flex-direction: column; gap: 4px; font-size: 22px; }
.dlg input, .dlg select {
  font-family: var(--lcdfont); font-size: 24px;
  background: transparent; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 0; padding: 4px 8px; width: 100%;
}
.dlg select option { background: var(--lcd); }
.dlg p { margin: 0; font-size: 24px; line-height: 1.1; }
.dlg .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg .btns { display: flex; gap: 10px; justify-content: flex-end; padding: 0 14px 14px; }
.dlg .btns button, .dlg .choices button {
  min-height: 44px; padding: 0 14px;
  border: 3px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--px); font-size: 13px; letter-spacing: 1px;
}
.dlg .btns button.ok { background: var(--ink); color: var(--lcd); }
.dlg .choices button:hover, .dlg .btns button:hover { filter: brightness(.92); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .dash { flex-direction: column; align-items: stretch; }
  .col-side { width: 100%; }
}
@media (max-width: 560px) {
  body { padding: 0; }
  .device { border-radius: 0; padding: 12px 10px 16px; min-height: 100vh; min-height: 100dvh; }
  .mode-login .device { justify-content: space-between; }
  .mode-login .lcd { height: 340px; }
  .brand-model { font-size: 8px; }
  .keypad { gap: 12px 8px; }
  .key { height: 54px; }
  .dash { padding: 10px; }
  .cats { grid-template-columns: minmax(0, 1fr); }
  .status { font-size: 11px; padding: 0 10px; }
  .status .time { display: none; }
  .mode-dash .lcd { min-height: 0; }
  .tabs { display: none; }
  .mode-dash #keys {
    position: sticky; bottom: 0; z-index: 5;
    margin: 0 -10px -16px; padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
    background: var(--body); box-shadow: 0 -6px 12px rgba(0, 0, 0, .35);
  }
  .fkeys { gap: 5px; padding: 0; }
  .fkeys .key { font-size: 12px; height: 46px; }
  .flabel { display: block; }
}
