/* EscrowNad product shell — full-bleed fintech app, ~10px gutters. */

/* ── shell ─────────────────────────────────────────────────────────── */
body.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}
body.app-shell > .brand {
  /* hide forge default if any leaks */
  display: none !important;
}

/* ── top bar ───────────────────────────────────────────────────────── */
.app-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-wrap: wrap;
}
.app-top__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  flex: none;
}
.app-top__mark {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  display: none;
}
/* theme classes on <html> — forge theme-mod */
html.light .app-top__mark.when-light { display: block; }
html:not(.light) .app-top__mark.when-dark { display: block; }
/* generic theme visibility (footer labels + icons) */
.when-dark { display: none; }
.when-light { display: none; }
html:not(.light) .when-dark { display: inline; }
html.light .when-light { display: inline; }
html:not(.light) .ico.when-dark { display: inline-block; }
html.light .ico.when-light { display: inline-block; }
.app-top__nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}
.app-top__link {
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 4px;
}
.app-top__link:hover {
  color: var(--fg);
  background: var(--line);
}
.app-top__right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: none;
}
/* ── monochrome icon pack (static/icons/*.svg via mask) ───────────── */
.ico {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
  vertical-align: -0.12em;
}
.ico--sm { width: 0.95em; height: 0.95em; }
.ico--plus     { --ico: url("/static/icons/plus.svg"); }
.ico--wallet   { --ico: url("/static/icons/wallet.svg"); }
.ico--logout   { --ico: url("/static/icons/logout.svg"); }
.ico--sun      { --ico: url("/static/icons/sun.svg"); }
.ico--moon     { --ico: url("/static/icons/moon.svg"); }
.ico--offer    { --ico: url("/static/icons/offer.svg"); }
.ico--request  { --ico: url("/static/icons/request.svg"); }
.ico--check    { --ico: url("/static/icons/check.svg"); }
.ico--external { --ico: url("/static/icons/external.svg"); }
.ico--search   { --ico: url("/static/icons/search.svg"); }
.ico--filter   { --ico: url("/static/icons/filter.svg"); }
.ico--copy     { --ico: url("/static/icons/copy.svg"); }
.ico--info     { --ico: url("/static/icons/info.svg"); }
.ico--dispute  { --ico: url("/static/icons/dispute.svg"); }

.app-top__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}
.app-top__cta:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.app-top__cta--solid {
  background: var(--accent);
  color: var(--accent-fg);
}
.app-top__cta--solid:hover {
  opacity: 0.92;
  background: var(--accent);
}
.app-top__cta--icon {
  padding: 7px 10px;
}
.app-top__cta--icon .cta-label {
  /* keep label; icon alone on very narrow via media if needed */
}
.app-top__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  cursor: pointer;
  line-height: 1.2;
}
.app-top__btn:hover {
  color: var(--fg);
  border-color: var(--muted);
}
.app-top__chip {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── footer ────────────────────────────────────────────────────────── */
.app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  margin-top: auto;
}
.app-foot__left,
.app-foot__right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-foot .dim {
  opacity: 0.75;
}
.app-foot__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  cursor: pointer;
  line-height: 1.2;
}
.app-foot__btn:hover {
  color: var(--fg);
  border-color: var(--muted);
}

/* hide forge partner foot if it ever leaks */
body.app-shell .foot:not(.app-foot) {
  display: none !important;
}

/* ── main ──────────────────────────────────────────────────────────── */
.app-main {
  flex: 1;
  padding: 10px 10px 16px;
  width: 100%;
  box-sizing: border-box;
  max-width: none;
}
.app-main__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.app-main__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.app-main__sub {
  margin: 2px 0 0;
  font-size: 13px;
}
.app-main--prose {
  max-width: 720px;
}
.app-main--prose h2 {
  font-size: 1rem;
  margin: 1.25rem 0 0.4rem;
}
.app-hint {
  margin: 0 0 10px;
  font-size: 13px;
}

/* ── data table (RIPE-style market) ────────────────────────────────── */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--line) 35%, var(--bg));
  white-space: nowrap;
}
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table__row {
  cursor: pointer;
}
.data-table__row:hover td {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
}
.data-table .num {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.data-table .desc {
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  padding: 2px 7px;
  border-radius: 999px;
}
.side--offer {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.side--request {
  background: color-mix(in srgb, #85e6ff 18%, transparent);
  color: #1a8fb0;
}
html.light .side--request {
  color: #0a5f7a;
}
.data-table__empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 10px !important;
}
.badge-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #1a7a45;
  background: color-mix(in srgb, #3dff9a 18%, transparent);
  border-radius: 999px;
  padding: 2px 6px;
  min-width: 1.4rem;
}
html.light .badge-ok {
  color: #0d5c32;
}

/* ── status pills ──────────────────────────────────────────────────── */
.status {
  display: inline-block;
  padding: 0.12em 0.5em;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 600;
  background: var(--line);
  color: var(--fg);
  text-transform: lowercase;
}
.status--listed { background: var(--violet-deep, #2a1848); color: var(--lavender, #ddd7fe); }
.status--funded,
.status--awaiting_proof,
.status--prepared,
.status--preparing { background: #12283a; color: var(--proof, #85e6ff); }
.status--released { background: #143d28; color: #5dff9a; }
.status--refunded,
.status--dispute,
.status--cancelled { background: #3d1a1a; color: #ff8a8a; }
.status--requested,
.status--accepted { background: #2a2140; color: #c8b8f0; }

html.light .status--listed { background: #eee8ff; color: #3d2a8a; }
html.light .status--funded,
html.light .status--awaiting_proof { background: #e0f4ff; color: #0a5f7a; }
html.light .status--released { background: #e0f8ea; color: #0d5c32; }

/* ── deal detail / forms ───────────────────────────────────────────── */
.app-form {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 10px;
  max-width: 720px;
}
.app-form--listing {
  max-width: 760px;
}
.app-form__title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.app-form__lead {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 40rem;
}
.app-form__section {
  margin: 18px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.app-form__section-hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.app-form__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

/* idiot-proof hint under every control */
.app-ctl {
  margin-bottom: 16px;
}
.app-ctl .ds-field {
  margin-bottom: 0;
}
.app-ctl__hint {
  margin: 6px 0 0;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 40rem;
}
.app-ctl__hint strong {
  color: var(--fg);
  font-weight: 600;
}
.app-ctl__hint em {
  font-style: normal;
  font-family: ui-monospace, monospace;
  font-size: 0.95em;
  color: var(--fg);
  opacity: 0.9;
}
.app-ctl__hint--solo {
  margin-top: 8px;
}
.app-ctl--actions {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* product chips: disabled (soon) types */
.app-form .ds-chip.is-disabled,
.app-form .ds-chip:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.35);
}
.app-form .ds-chips__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* hide rest of form until type picked */
.listing-rest[hidden],
.listing-ip[hidden] {
  display: none !important;
}
/* room for quill / fixed_n inside product chrome */
.app-form .ds-field {
  margin-bottom: 12px;
}
.app-form .ds-field--wysiwyg .ql-toolbar,
.app-form .ds-field--wysiwyg .ql-container {
  border-color: var(--line);
  background: var(--bg);
  color: var(--fg);
}
.app-form .ds-field--wysiwyg .ql-toolbar {
  border-radius: 4px 4px 0 0;
}
.app-form .ds-field--wysiwyg .ql-container {
  border-radius: 0 0 4px 4px;
  font-family: inherit;
}
.app-form .ds-file-upload__dropzone {
  border-color: var(--line);
  border-radius: 4px;
}
.lifecycle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.lifecycle li {
  padding: 0.25em 0.55em;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
}
.lifecycle li.done {
  border-color: var(--accent);
  color: var(--accent);
}
.lifecycle li.fail {
  border-color: #ff8a8a;
  color: #ff8a8a;
}
.card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 10px;
  margin-bottom: 10px;
}
.card h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 8px;
}
.deal-actions form {
  margin-bottom: 8px;
}

/* landing keeps its own chrome */
.landing-app .app-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px;
}
.landing-app .app-bar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2em;
}
.landing-app .app-bar__brand b {
  color: var(--accent);
}
.landing-app .app-bar__brand img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
}
