@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root{
  --paper:#F7F7F6;
  --panel:#FFFFFF;
  --ink:#161616;
  --ink-soft:#6E6E6E;
  --line:#DADAD8;
  --brass:#161616;
  --brass-dark:#000000;
  --teal:#4A4A4A;
  --rust:#2A2A2A;
  --success:#1A1A1A;
  --danger:#1A1A1A;
  --wheel-dark:#141414;
  --wheel-red:#4A4A4A;
}
*{box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent;}
html{ -webkit-text-size-adjust:100%; }
body{
  background:var(--paper);
  color:var(--ink);
  font-family:'IBM Plex Sans', sans-serif;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
#app{
  max-width:720px; margin:0 auto;
  padding:20px 16px calc(48px + env(safe-area-inset-bottom));
  padding-top:calc(20px + env(safe-area-inset-top));
}
@media(min-width:600px){
  #app{ padding:28px 20px 60px; }
}

/* ---------- shared bits ---------- */
.eyebrow{
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--brass-dark);
  font-weight:600;
}
h1{ font-size:26px; font-weight:700; margin-top:6px; line-height:1.2; }
h2{ font-size:18px; font-weight:700; margin-bottom:4px; }
p.sub{ color:var(--ink-soft); font-size:14px; margin-top:6px; }

.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:20px;
}

.btn{
  font-family:'IBM Plex Sans', sans-serif;
  font-weight:600;
  font-size:14px;
  border:none;
  border-radius:7px;
  padding:12px 18px;
  min-height:44px;
  cursor:pointer;
  transition:transform .08s ease, opacity .15s ease;
}
.btn:active{ transform:scale(.98); }
.btn-primary{ background:var(--brass); color:#fff; }
.btn-primary:hover{ background:var(--brass-dark); }
.btn-ghost{ background:transparent; color:var(--ink-soft); border:1px solid var(--line); }
.btn-ghost:hover{ border-color:var(--brass); color:var(--brass-dark); }
.btn-danger{ background:transparent; color:var(--danger); border:1px solid #B8B8B8; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }
.btn-block{ width:100%; }

input[type=text], input[type=password], input[type=date], input[type=number], select, textarea{
  font-family:'IBM Plex Sans', sans-serif;
  font-size:16px;
  padding:12px 12px;
  border:1px solid var(--line);
  border-radius:7px;
  background:#fff;
  color:var(--ink);
  width:100%;
  min-height:46px;
  -webkit-appearance:none;
  appearance:none;
}
textarea{ min-height:0; }
input:focus, select:focus, textarea:focus{
  outline:2px solid var(--brass);
  outline-offset:1px;
  border-color:var(--brass);
}
label{ font-size:13px; font-weight:600; color:var(--ink-soft); display:block; margin-bottom:6px; }
.field{ margin-bottom:16px; }

.error-box{
  background:#EFEFEF; border:1px solid #B8B8B8; color:var(--danger);
  padding:10px 12px; border-radius:7px; font-size:13.5px; margin-bottom:14px;
}
.hint{ font-size:12.5px; color:var(--ink-soft); margin-top:6px; }

/* ---------- landing ---------- */
.hero-photo{
  width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:12px;
  border:1px solid var(--line); box-shadow:0 4px 0 rgba(38,36,33,.06);
  margin-bottom:20px; display:block;
}
@media(min-width:600px){
  .hero-photo{ aspect-ratio:16/10; margin-bottom:24px; }
}
.landing-header{ text-align:center; margin-bottom:28px; }
.landing-header .mark{
  width:52px; height:52px; margin:0 auto 14px; border-radius:50%;
  background:radial-gradient(circle at 32% 28%, #3A3A3A, var(--brass) 60%, var(--brass-dark));
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 3px 0 var(--brass-dark);
}
.choice-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media(max-width:520px){ .choice-grid{ grid-template-columns:1fr; } }
.choice-card{
  background:var(--panel); border:1px solid var(--line); border-radius:10px;
  padding:22px 18px; cursor:pointer; text-align:left; transition:border-color .15s, transform .1s;
}
.choice-card:hover{ border-color:var(--brass); transform:translateY(-2px); }
.choice-card svg{ margin-bottom:10px; }
.choice-card h2{ font-size:16px; }
.choice-card p{ font-size:13px; color:var(--ink-soft); margin-top:4px; }

/* ---------- top bar ---------- */
.topbar{ display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; }
.back-link{
  font-family:'IBM Plex Mono', monospace; font-size:12px; letter-spacing:.06em;
  color:var(--ink-soft); background:none; border:none; cursor:pointer; text-transform:uppercase;
  display:flex; align-items:center; gap:6px;
}
.back-link:hover{ color:var(--brass-dark); }

/* ---------- digit wheels ---------- */
.wheel-row{ display:flex; align-items:center; gap:2px; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.wheelset{ display:inline-flex; gap:2px; background:var(--wheel-dark); padding:6px 8px; border-radius:6px; box-shadow:inset 0 0 0 1px #000, 0 2px 0 rgba(0,0,0,.15); flex-shrink:0; }
.wheel{
  font-family:'IBM Plex Mono', monospace; font-weight:700; font-size:20px;
  width:20px; text-align:center; color:#F2F2F0;
  background:linear-gradient(180deg, #2A2A2A, #0D0D0D);
  border-radius:2px; padding:3px 0;
}
.wheel.red{ color:#fff; background:linear-gradient(180deg, #5A5A5A, #313131); box-shadow:inset 0 0 0 1px #000; }
.wheel-unit{ font-family:'IBM Plex Mono', monospace; font-size:11px; color:var(--ink-soft); align-self:center; margin-left:8px; flex-shrink:0; }

/* ---------- meter type chips ---------- */
.type-tabs{ display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap; }
.type-tab{
  font-family:'IBM Plex Sans', sans-serif; font-size:13.5px; font-weight:600;
  padding:9px 14px; border-radius:20px; border:1.5px solid var(--line); background:#fff; cursor:pointer; color:var(--ink-soft);
  display:flex; align-items:center; gap:7px;
}
.type-tab .dot{ width:8px; height:8px; border-radius:50%; }
.type-tab.active{ border-color:currentColor; }

/* ---------- reading list rows ---------- */
.reading-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 4px; border-bottom:1px solid var(--line);
}
.reading-row:last-child{ border-bottom:none; }
.reading-meta{ display:flex; align-items:center; gap:10px; }
.type-badge{ width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.reading-date{ font-size:12px; color:var(--ink-soft); font-family:'IBM Plex Mono', monospace; }
.reading-unit-label{ font-size:12.5px; color:var(--ink-soft); }

.empty-state{ text-align:center; padding:34px 16px; color:var(--ink-soft); }
.empty-state svg{ margin-bottom:10px; opacity:.6; }

/* ---------- admin tabs ---------- */
.admin-tabs{ display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:20px; }
.admin-tab{
  font-family:'IBM Plex Sans', sans-serif; font-weight:600; font-size:13.5px;
  padding:10px 6px; background:none; border:none; cursor:pointer; color:var(--ink-soft);
  border-bottom:2px solid transparent; margin-bottom:-1px;
}
.admin-tab.active{ color:var(--brass-dark); border-bottom-color:var(--brass); }

.unit-row{ display:flex; align-items:center; justify-content:space-between; padding:14px 0; border-bottom:1px solid var(--line); gap:10px; }
.unit-row:last-child{ border-bottom:none; }
.code-pill{
  font-family:'IBM Plex Mono', monospace; font-weight:600; font-size:13px;
  background:#EFEFEF; border:1px solid var(--line); padding:4px 9px; border-radius:5px; letter-spacing:.05em;
}
.row-actions{ display:flex; gap:8px; }
.icon-btn{ background:none; border:none; cursor:pointer; color:var(--ink-soft); padding:4px; }
.icon-btn:hover{ color:var(--danger); }

.property-tag{
  font-family:'IBM Plex Mono', monospace; font-size:11px; letter-spacing:.08em; text-transform:uppercase;
  background:#EAEAE8; color:var(--ink); padding:3px 8px; border-radius:4px; display:inline-block;
  border:1px solid var(--line);
}
.property-tag.efh{ background:#EAEAE8; color:var(--ink); border:1px solid var(--line); }

.toolbar{ display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.toolbar select{ width:auto; flex:1 1 140px; }
@media(max-width:420px){
  .toolbar{ flex-direction:column; }
  .toolbar select, .toolbar .btn{ width:100%; }
}

.section-gap{ margin-top:30px; }
.footnote{ text-align:center; font-size:12px; color:var(--ink-soft); margin-top:36px; }

/* ---------- unit selection list (landing) ---------- */
.unit-select-list{ display:flex; flex-direction:column; }
.unit-select-row{
  display:flex; align-items:center; justify-content:space-between; width:100%;
  background:none; border:none; border-top:1px solid var(--line); padding:13px 2px;
  font-family:'IBM Plex Sans', sans-serif; font-size:14.5px; font-weight:600; color:var(--ink);
  cursor:pointer; text-align:left;
}
.unit-select-list .unit-select-row:first-child{ border-top:none; }
.unit-select-row:hover{ color:var(--ink-soft); }
.unit-row-label{ display:block; }
.unit-row-tenant{ display:block; font-family:'IBM Plex Sans', sans-serif; font-size:12.5px; font-weight:400; color:var(--ink-soft); margin-top:2px; }
