/* =============================================================
   DRAWING SET — instrument bay (tools & features)
   ============================================================= */

.bay {
  display: grid;
  grid-template-columns: minmax(0, 236px) minmax(0, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule-firm);
}
@media (max-width: 860px) { .bay { grid-template-columns: 1fr; } }

/* ---- index of instruments ---- */
.bay__index {
  background: var(--paper-2);
  display: grid;
  align-content: start;
}
@media (max-width: 860px) {
  .bay__index {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--rule);
  }
  .bay__index::-webkit-scrollbar { height: 3px; }
  .bay__index::-webkit-scrollbar-thumb { background: var(--rule-firm); }
}

.bay__tab {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 0.95rem;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 0.7188rem;
  letter-spacing: 0.04em;
  text-align: left;
  color: var(--ink-2);
  position: relative;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}
@media (max-width: 860px) { .bay__tab { border-bottom: none; border-right: 1px solid var(--rule-soft); } }
.bay__tab i {
  font-style: normal;
  font-size: 0.5938rem;
  letter-spacing: 0.1em;
  color: var(--graphite-2);
  min-width: 1.6rem;
}
.bay__tab:hover { background: var(--paper-3); color: var(--ink); }
.bay__tab[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}
.bay__tab[aria-selected="true"] i { color: var(--vis); }

/* ---- instrument panel ---- */
.bay__panel { background: var(--paper); padding: clamp(1.2rem, 3vw, 2rem); }
.bay__panel[hidden] { display: none; }

.instr__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--rule);
}
.instr__head h3 { font-size: 1.28rem; letter-spacing: -0.03em; }
.instr__head p {
  font-family: var(--mono);
  font-size: 0.6563rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.mt { margin-top: 1.2rem; }

/* readout — the answer panel */
.readout {
  margin-top: 1.3rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.75;
}
.readout__hd {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--plate-rule);
  font-size: 0.5938rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(242,240,234,0.5);
  display: flex; justify-content: space-between; gap: 1rem;
}
.readout__bd { padding: 0.9rem; }
.readout__bd dl { display: grid; gap: 0.42rem; }
.readout__bd div {
  display: flex; justify-content: space-between; gap: 1.2rem;
  border-bottom: 1px dotted rgba(242,240,234,0.18);
  padding-bottom: 0.3rem;
}
.readout__bd dt { color: rgba(242,240,234,0.62); }
.readout__bd dd { font-variant-numeric: tabular-nums; text-align: right; }
.readout__bd dd b { color: var(--vis); font-weight: 500; }
.readout__note {
  padding: 0.55rem 0.9rem;
  border-top: 1px solid var(--plate-rule);
  font-size: 0.6563rem;
  color: rgba(242,240,234,0.45);
  line-height: 1.6;
}
.readout--empty { background: var(--paper-2); color: var(--graphite); border-color: var(--rule); }
.readout--empty .readout__bd { text-align: center; padding: 1.6rem 0.9rem; font-size: 0.75rem; }

/* ---- converter ---- */
.conv__io {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.9rem;
  align-items: end;
  margin-top: 1rem;
}
@media (max-width: 620px) { .conv__io { grid-template-columns: 1fr; } }
.conv__swap {
  width: 42px; height: 42px;
  border: 1px solid var(--rule-firm);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.9rem;
  transition: background-color 0.2s, color 0.2s, transform 0.3s var(--ease);
}
.conv__swap:hover { background: var(--ink); color: var(--paper); transform: rotate(180deg); }
.conv__out {
  padding: 0.68rem 0.85rem;
  border: 1px solid var(--ink);
  background: var(--vis);
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  overflow-x: auto;
  white-space: nowrap;
}

/* ---- calendar ---- */
.cal__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem; margin-bottom: 0.9rem;
}
.cal__bar b { font-family: var(--display); font-weight: 700; font-size: 1.08rem; letter-spacing: -0.02em; }
.cal__nav {
  width: 32px; height: 32px;
  border: 1px solid var(--rule-firm);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.8rem;
  transition: background-color 0.2s, color 0.2s;
}
.cal__nav:hover { background: var(--ink); color: var(--paper); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.cal__dow, .cal__day {
  background: var(--paper);
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.75rem;
  position: relative;
}
.cal__dow {
  aspect-ratio: auto; padding: 0.4rem 0;
  font-size: 0.5625rem; letter-spacing: 0.1em;
  color: var(--graphite-2); background: var(--paper-2);
}
.cal__day { cursor: pointer; transition: background-color 0.16s; }
.cal__day:hover { background: var(--paper-3); }
.cal__day.is-void { background: var(--paper-2); cursor: default; }
.cal__day.is-today { box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.cal__day.is-pick { background: var(--ink); color: var(--paper); }
.cal__day.has-note::after {
  content: ''; position: absolute; bottom: 5px;
  width: 4px; height: 4px; background: var(--vis-deep);
}
.cal__day.is-pick.has-note::after { background: var(--vis); }

/* ---- map ---- */
.map__frame {
  border: 1px solid var(--rule-firm);
  overflow: hidden;
  background: var(--paper-2);
  position: relative;
}
.map__frame iframe { width: 100%; height: 330px; border: 0; filter: grayscale(0.28) contrast(1.05); }
.map__pins { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-top: 1rem; }
.map__pin {
  background: var(--paper);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  text-align: left;
  transition: background-color 0.2s;
  font-family: var(--mono);
  font-size: 0.75rem;
}
.map__pin:hover { background: var(--paper-2); }
.map__pin[aria-current="true"] { background: var(--vis); }
.map__pin i { font-style: normal; width: 9px; height: 9px; background: var(--ink); }
.map__pin em { font-style: normal; font-size: 0.625rem; color: var(--graphite); letter-spacing: 0.1em; }

/* ---- schedule / mini-gantt planner ---- */
.plan__chart {
  border: 1px solid var(--rule-firm);
  margin-top: 1rem;
  overflow: hidden;
}
.plan__task {
  display: grid;
  grid-template-columns: minmax(110px, 150px) 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.plan__task:last-child { border-bottom: none; }
.plan__task > span:first-child {
  font-family: var(--mono); font-size: 0.6875rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plan__lane { position: relative; height: 20px; background: var(--paper-2); }
.plan__bar {
  position: absolute; top: 0; bottom: 0;
  background: var(--ink);
  transition: left 0.35s var(--ease), width 0.35s var(--ease);
}
.plan__bar.is-crit { background: var(--signal); }
.plan__del {
  font-family: var(--mono); font-size: 0.75rem;
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 1px solid transparent; color: var(--graphite-2);
}
.plan__del:hover { border-color: var(--signal); color: var(--signal); }
.plan__empty { padding: 1.6rem 0.9rem; text-align: center; font-family: var(--mono); font-size: 0.75rem; color: var(--graphite); }

/* ---- weather ---- */
.wx {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  align-items: center;
  padding: 1.2rem;
  border: 1px solid var(--rule-firm);
  background: var(--paper-2);
  margin-top: 1rem;
}
.wx__t {
  font-family: var(--display); font-weight: 800; font-stretch: 115%;
  font-size: 3.2rem; line-height: 0.9; letter-spacing: -0.05em;
}
.wx__t sup { font-size: 1.1rem; vertical-align: super; }
.wx__rows { display: grid; gap: 0.3rem; font-family: var(--mono); font-size: 0.75rem; }
.wx__rows div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dotted var(--rule); padding-bottom: 0.25rem; }
.wx__rows span:last-child { font-variant-numeric: tabular-nums; }

/* ---- timer ---- */
.timer__face {
  font-family: var(--display); font-weight: 800; font-stretch: 118%;
  font-size: clamp(3.6rem, 13vw, 6.4rem);
  line-height: 0.86; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 1.4rem 0 0.6rem;
}
.timer__face.is-run { color: var(--ink); }
.timer__face.is-rest { color: var(--water); }
.timer__track { height: 5px; background: var(--paper-3); overflow: hidden; border: 1px solid var(--rule); }
.timer__fill { height: 100%; background: var(--vis-deep); width: 0; transition: width 0.35s linear; }
.timer__mode {
  text-align: center; font-family: var(--mono); font-size: 0.6563rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--graphite);
  margin-bottom: 0.7rem;
}
.timer__pips { display: flex; justify-content: center; gap: 0.35rem; margin-top: 1rem; }
.timer__pips i { width: 9px; height: 9px; border: 1px solid var(--rule-firm); display: block; }
.timer__pips i.on { background: var(--vis); border-color: var(--ink); }

/* ---- generic table used by rebar / estimator ---- */
.tbl { width: 100%; border-collapse: collapse; margin-top: 1rem; font-family: var(--mono); font-size: 0.75rem; }
.tbl th, .tbl td { padding: 0.5rem 0.6rem; border: 1px solid var(--rule); text-align: right; }
.tbl th {
  background: var(--paper-2); font-weight: 500;
  font-size: 0.5938rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--graphite);
}
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tbody tr:hover td { background: var(--paper-2); }
.tbl tfoot td { font-weight: 600; background: var(--paper-2); }
.tbl__scroll { overflow-x: auto; }
