/* The working part: a wide console with a live entry preview, then the entries table. */

.console { padding: 0; overflow: hidden; }
.console-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; }
.tab { padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--grey); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background 0.18s, color 0.18s; }
.tab.on { background: var(--pink); color: #fff; }
.tab.on.burn { background: var(--ink); }

.console-body { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 0; }
.form-col { padding: 22px; display: flex; flex-direction: column; gap: 16px; border-right: 1px solid var(--line); }
.preview-col { padding: 22px; background: var(--panel-2); display: flex; flex-direction: column; gap: 14px; }

.token-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; min-height: 18px; }
.token-line .sym { font-family: var(--mono); color: var(--ink); }
.token-line .bal { font-family: var(--mono); color: var(--grey); }

.input-row { position: relative; }
.input-row .input { padding-right: 78px; }
.max-btn {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--grey); cursor: pointer; transition: all 0.18s;
}
.max-btn:hover:not(:disabled) { color: var(--pink); border-color: var(--pink); background: var(--pink-wash); }
.max-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.durations { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dur { padding: 10px 2px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--panel-2); font-family: var(--mono); font-size: 12px; color: var(--grey); cursor: pointer; text-align: center; transition: all 0.18s; }
.dur:hover { color: var(--ink); border-color: var(--grey-2); }
.dur.on { border-color: var(--pink); background: var(--pink-wash); color: var(--pink-deep); font-weight: 600; }

.note-count { font-family: var(--mono); font-size: 11px; color: var(--grey-2); text-align: right; }
.note-count.over { color: var(--pink-deep); }

/* the entry as it will be written */
.entry-card { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 16px; background: var(--panel); }
.entry-card .badge { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--grey); }
.entry-card .badge.seal { color: var(--pink-deep); border-color: rgba(254,80,170,0.4); background: var(--pink-wash); }
.entry-card .badge.burn { color: #fff; background: var(--ink); border-color: var(--ink); }
.entry-card dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 14px 0 0; }
.entry-card dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey-2); }
.entry-card dd { margin: 0; font-family: var(--mono); font-size: 13px; word-break: break-all; }
.entry-card .empty { color: var(--grey-2); font-size: 13.5px; }

.steps-line { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 11px; color: var(--grey-2); }
.steps-line .s.on { color: var(--ink); }
.steps-line .s.done { color: var(--pink); }

.status { font-family: var(--mono); font-size: 12.5px; min-height: 17px; color: var(--grey); }
.status.bad { color: #C8395C; }
.status.good { color: var(--pink-deep); }
.status a { color: var(--pink); border-bottom: 1px solid rgba(254,80,170,0.4); }

/* entries table */
.table-wrap { overflow-x: auto; }
table.entries { width: 100%; border-collapse: collapse; font-size: 14px; }
table.entries th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--grey-2); font-weight: 500; padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.entries td { padding: 15px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.entries tr:last-child td { border-bottom: 0; }
table.entries tbody tr { transition: background 0.18s; }
table.entries tbody tr:hover { background: var(--panel-2); }
table.entries .num { font-family: var(--mono); color: var(--grey-2); }
table.entries .who { font-family: var(--mono); font-size: 13px; }
table.entries .amt { font-family: var(--mono); white-space: nowrap; }
table.entries .note { color: var(--grey); font-size: 13px; font-style: italic; }
table.entries .cd { font-family: var(--mono); font-size: 12.5px; color: var(--pink-deep); white-space: nowrap; }
table.entries .cd.done { color: var(--grey-2); }
.tag { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; padding: 4px 9px; border-radius: 999px; }
.tag.seal { color: var(--pink-deep); background: var(--pink-wash); }
.tag.burn { color: #fff; background: var(--ink); }
.tag.open { color: var(--grey); background: var(--panel-2); border: 1px solid var(--line-2); }
.empty-row { padding: 40px 16px; text-align: center; color: var(--grey-2); font-size: 14px; }

.mine-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.mine-row:last-child { border-bottom: 0; }
.mine-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; border-radius: 999px; padding: 13px 20px; font-size: 13.5px; z-index: 80; opacity: 0; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); pointer-events: none; max-width: min(92vw, 460px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #C8395C; }

/* wallet chooser */
.wallet-sheet { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(26,15,26,0.4); backdrop-filter: blur(6px); padding: 20px; }
.wallet-sheet[hidden] { display: none; }
.wallet-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 20px; }
.wallet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wallet-close { background: none; border: 0; color: var(--grey); font-size: 22px; line-height: 1; cursor: pointer; }
.wallet-list { display: flex; flex-direction: column; gap: 8px; }
.wallet-option { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel-2); font-size: 14.5px; font-weight: 600; cursor: pointer; transition: all 0.18s; }
.wallet-option:hover { border-color: var(--pink); background: var(--pink-wash); transform: translateY(-1px); }
.wallet-option img { width: 26px; height: 26px; border-radius: 7px; }
.wallet-option .fallback { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--panel); color: var(--grey); font-family: var(--mono); font-size: 12px; }

@media (max-width: 900px) {
  .console-body { grid-template-columns: 1fr; }
  .form-col { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 540px) { .durations { grid-template-columns: repeat(4, 1fr); } }

/* ---- the entry sheet: the form reads as the sentence it will write */
.sheet-wrap { padding: 30px 34px 26px; }
.sheet {
  font-size: clamp(19px, 2.2vw, 27px); line-height: 2.05; letter-spacing: -0.01em;
  color: var(--ink); font-weight: 500;
}
.sheet .lead { color: var(--grey-2); }
.f-in {
  display: inline-block; border: 0; border-bottom: 2px solid var(--line-2); background: transparent;
  font-family: var(--mono); font-size: 0.72em; padding: 0 6px 3px; color: var(--ink);
  outline: none; transition: border-color 0.18s, background 0.18s; text-align: center; min-width: 4ch;
}
.f-in::placeholder { color: #D8C6CD; }
.f-in:focus { border-bottom-color: var(--pink); background: var(--pink-wash); }
.f-in.bad { border-bottom-color: #E0607F; }
.f-in.wide { min-width: 22ch; }
.f-sel {
  font-family: var(--mono); font-size: 0.72em; padding: 3px 30px 3px 10px; color: var(--pink-deep);
  border: 1px solid rgba(254,80,170,0.4); border-radius: 999px; background: var(--pink-wash);
  appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--pink) 50%), linear-gradient(135deg, var(--pink) 50%, transparent 50%);
  background-position: calc(100% - 16px) 0.9em, calc(100% - 11px) 0.9em; background-size: 5px 5px; background-repeat: no-repeat;
}
.f-chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.6em;
  padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--grey);
}
.f-max {
  font-family: var(--mono); font-size: 0.55em; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--grey); cursor: pointer; vertical-align: middle; margin-left: 4px; transition: all 0.18s;
}
.f-max:hover:not(:disabled) { color: var(--pink); border-color: var(--pink); background: var(--pink-wash); }
.f-max:disabled { opacity: 0.4; cursor: not-allowed; }

.sheet-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 18px 34px 24px; border-top: 1px solid var(--line); background: var(--panel-2);
}
.sheet-foot .what { font-family: var(--mono); font-size: 12.5px; color: var(--grey); max-width: 60ch; }
.sheet-foot .what b { color: var(--ink); font-weight: 500; }
.sheet-foot .go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.seg { display: inline-flex; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; }
.seg button { padding: 8px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--grey); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all 0.18s; }
.seg button.on { background: var(--pink); color: #fff; }
.seg button.on.burn { background: var(--ink); }

@media (max-width: 640px) {
  .sheet-wrap { padding: 22px 20px 18px; }
  .sheet { font-size: 17px; line-height: 2.2; }
  .sheet-foot { padding: 16px 20px 20px; }
}
