/* the phone (the owner, 2026-11-17, from a wallet's browser): one column, the menus scroll sideways, tables scroll inside
   their panel, nothing is cut. desktop rules stay in cockpit.css; this file only narrows them. */
@media (max-width: 760px) {
  html, body { font-size: 13px; }
  header { position: static; flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px; }
  .brand { order: 1; font-size: 14px; }
  a.me { order: 2; margin-left: auto; }
  a.me .muted { display: inline; }
  nav.app, nav.chroma { order: 3; flex: 1 1 100%; width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  nav.app::-webkit-scrollbar, nav.chroma::-webkit-scrollbar { display: none; }
  nav.chroma { order: 4; margin-left: 0; padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 2px; }
  nav button { padding: 6px 8px; font-size: 12px; }
  nav.app button b { display: none; }

  main { padding: 10px; }
  body.gold { height: auto; display: block; overflow: visible; }
  body.gold main { padding: 10px; overflow: visible; }
  footer { flex-direction: column; gap: 8px; padding: 12px 10px 24px; }

  /* the cockpit: the one-screen grid becomes a column */
  .cockpit { display: flex; flex-direction: column; height: auto; gap: 10px; }
  .cockpit .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cockpit .panel { max-height: none; overflow: visible; }
  .cockpit .panel > .body { overflow: visible; }
  .cockpit ul.plain li { white-space: normal; }

  .grid, .grid.wide { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; } .kpi .v { font-size: 20px; } .kpi .l { white-space: normal; }
  .kpis.tight .kpi .v { font-size: 16px; }

  /* a table keeps its columns and scrolls inside its panel */
  .panel { padding: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 12px; }
  td, th { padding: 4px 6px; }
  table:not(.cmds) td { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
  .ell { max-width: 220px; }

  .line { flex-wrap: wrap; white-space: normal; row-gap: 0; }
  .line .k { min-width: 84px; }
  .line .v { flex: 1 1 0; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .line .r { margin-left: 0; flex-basis: 100%; padding-left: 92px; }

  /* commands */
  .cockpit .cmd-line { padding: 8px 10px !important; }
  .cmd-line-zone { flex-wrap: wrap; }
  .cmd-line-zone input { flex: 1 1 100%; padding: 6px 0; font-size: 14px; }
  .cmd-bar { flex-wrap: wrap; }
  .cmd-zone textarea { font-size: 14px; }
  table.cmds, table.cmds tbody, table.cmds tr, table.cmds td { display: block; width: 100%; }
  table.cmds tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.cmds td { padding: 2px 0; border: 0; }
  table.cmds td:first-child, table.cmds td:nth-child(2), table.cmds td:nth-child(3) { display: inline-block; width: auto; margin-right: 8px; }
  tr.reply-row td:nth-child(4) { padding-left: 14px; }
  .pts figure, .pts img, .pts video { max-width: 100%; } .pts audio { width: 100%; }

  .lverdict { flex-wrap: wrap; } .lverdict > span:nth-child(2) { flex: 1 1 0; min-width: 0; } .lverdict .r { margin-left: 0; flex-basis: 100%; white-space: normal; }
  .launch h2 .more, .cockpit h2 .more { float: none; display: block; margin-top: 4px; }
  .kpis.lk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signin { margin: 4vh auto; }
  .wallets button.act { flex: 1 1 100%; justify-content: center; padding: 10px; }
  .tokens { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* the messenger on the phone: the list, or the open conversation with a back arrow */
@media (max-width: 760px) {
  body.msg main { padding: 0; }
  #messenger { grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; }
  #messenger .m-pane { display: none; } #messenger.open .m-pane { display: flex; } #messenger.open .m-list { display: none; }
  .m-list { border-right: 0; }
  .m-back { display: inline; font-size: 18px; margin-right: 4px; }
  .m-head { padding: 8px 12px; flex-wrap: nowrap; align-items: center; } .m-head .m-title { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .m-head .sub { display: none; } .m-links { margin-left: 0; flex: 0 0 auto; }
  .m-body { padding: 12px; } .bub { max-width: 88%; }
  .m-compose { padding: 8px 10px 10px; }
}
@media (max-width: 760px) {
  a.sig { grid-template-columns: 40px 16px minmax(0, 1fr); } a.sig .sig-who, a.sig .sig-kind { display: none; } a.sig .sig-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* the project's page: the three columns stack — the information, the definition, the dialogue */
@media (max-width: 1100px) {
  .pj3 { grid-template-columns: minmax(0, 1fr); }
  .pj-talk { position: static; }
}

/* tasks: on a narrow screen the board is a strip of columns swiped sideways, one column wide */
@media (max-width: 1100px) {
  .tk-board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; height: 72vh; gap: 8px; padding-bottom: 6px; }
  .tk-col { flex: 0 0 82vw; scroll-snap-align: center; }
  .tk-bar select, .tk-bar input { max-width: 100%; flex: 1 1 140px; }
}

/* ---------------------------------------------------------------------------------------------------------------------
   mobile first (the owner, 2026-11-20: "a serious iteration of the mobile version"). the rules above narrowed the desk;
   these make the phone its own instrument:
     the shell    the header is one line — the name, the chroma as signs, who is signed in; the app's menu is a bar
                  under the thumb, six tabs with a sign each
     the numbers  the six tiles of a screen are one strip swiped sideways, so the list starts on the first screenful
     the lists    take the whole width, rows are a finger high, and only the columns a phone can read stay
     the body     of a chosen row is its own screen over the list (mobile.js), with a bar that leads back
     the cockpit  is one column: the treasury, your word, the realm, the factories
   every size a finger meets is 40px or more; a field is 16px so the phone does not zoom into it. */
@media (max-width: 1100px) { .ps-main, #fl .ps-main, .sg-post, .sg-main { grid-template-columns: minmax(0, 1fr); } .th-main { grid-template-columns: minmax(0, 1fr); } .sg-tk { grid-template-columns: 10px 56px minmax(0, 1fr) 80px; } .sg-col, .sg-box { min-width: 0; } }
@media (max-width: 760px) {
  :root { --bar: 56px; --top: 48px; --safe: 0px;   /* no inset of our own: a wallet's browser (OneKey, 2026-11-21) already keeps the page inside the safe area and still reports the notch, which left an empty band above and below */ }
  html { -webkit-text-size-adjust: 100%; } body { -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
  input, select, textarea { font-size: 16px !important; }

  /* the shell */
  header { position: sticky; top: 0; z-index: 70; height: var(--top); box-sizing: border-box; flex-wrap: nowrap; gap: 4px; padding: 0 8px 0 6px; padding-top: 0px; height: calc(var(--top) + 0px); background: rgba(3, 4, 3, .97); backdrop-filter: none; -webkit-backdrop-filter: none; }
  a.brand { order: 1; flex: none; font-size: 15px; padding: 6px; }
  nav.chroma { order: 2; flex: 1 1 auto; width: auto; min-width: 0; justify-content: flex-end; gap: 0; margin: 0; padding: 0; border: 0; overflow: visible; }
  nav.chroma button { font-size: 0; padding: 0 2px; min-width: 34px; height: 40px; border-bottom: 0; display: inline-flex; align-items: center; justify-content: center; }
  nav.chroma button i { font-size: 18px; margin: 0; } nav.chroma button .n { font-size: 9px; margin: -14px 0 0 1px; padding: 0 4px; }
  nav.chroma button.on i { text-shadow: 0 0 12px rgba(0, 184, 255, .8); } nav.chroma button[data-tab="avatar"] { display: none; }   /* who is signed in is the door to the avatar */
  a.me { order: 3; flex: none; margin: 0; padding: 6px 8px; max-width: 96px; overflow: hidden; text-overflow: ellipsis; } a.me .muted { display: none; }
  nav.app { order: 9; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; width: auto; flex: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; height: calc(var(--bar) + var(--safe)); padding-bottom: var(--safe); box-sizing: border-box; overflow: visible; background: #030403; border-top: 1px solid var(--saber); }
  nav.app button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--bar); min-width: 0; padding: 0; font-size: 10px; letter-spacing: 0; border-bottom: 0; border-top: 2px solid transparent; overflow: hidden; }
  nav.app button::before { content: attr(data-g); font-size: 18px; line-height: 1; color: var(--dim); transition: color .2s, transform .2s; }
  nav.app button.on { border-top-color: var(--green); } nav.app button.on::before { color: var(--green); transform: translateY(-1px) scale(1.12); text-shadow: 0 0 12px rgba(0, 255, 65, .7); }
  nav.app button:active::before { transform: scale(.9); } nav.app button .n { position: absolute; top: 5px; left: calc(50% + 7px); margin: 0; font-size: 9px; padding: 0 4px; }
  /* the page itself never scrolls: only the view between the header and the menu does. a phone browser hides its own bars when the page scrolls, and the menu under the thumb went away with them (the owner, 2026-11-21, OneKey) */
  html, body, body.gold, body.fit, body.msg { height: 100%; min-height: 0; overflow: hidden; display: block; } header { position: fixed; left: 0; right: 0; }
  main, body.gold main, body.fit main, body.msg main { position: fixed; left: 0; right: 0; top: var(--top); bottom: calc(var(--bar) + var(--safe)); margin: 0; max-width: none; width: auto; box-sizing: border-box; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 10px 10px 18px; }
  .pend-bar { bottom: calc(var(--bar) + var(--safe) + 10px); }
  #messenger { height: 100%; } body.msg main { padding: 0; overflow: hidden; }

  /* the numbers: one strip */
  .hud, .ps-top, .skel-hud { display: flex; grid-template-columns: none; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -10px 10px; padding: 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .hud::-webkit-scrollbar, .ps-top::-webkit-scrollbar, .tk-bar::-webkit-scrollbar { display: none; } #ps .hud, #gm .hud, #fl .hud, #hm .hud { margin-bottom: 0; }
  .hud-t, .ps-kpi, .skel-hud i { flex: 0 0 41%; scroll-snap-align: start; height: 68px; } .hud-t > b { font-size: 22px; }

  /* the lists */
  .ps-main { display: block; } .gm-list { padding: 6px 4px; } .gm-rows { max-height: none; overflow: visible; }
  .gm-head, .gm-row { grid-template-columns: minmax(0, 1fr) 42px 62px 50px; gap: 8px; } .gm-head { position: sticky; top: -10px; z-index: 3; background: #060706; padding: 8px 8px 6px; }
  .gm-head > span, .gm-row > * { display: none; } .gm-head > span:nth-child(1), .gm-row > :nth-child(1), .gm-head > span:nth-child(3), .gm-row > :nth-child(3), .gm-head > span:nth-child(4), .gm-row > :nth-child(4), .gm-head > span:nth-child(5), .gm-row > :nth-child(5) { display: block; }
  .gm-row { height: 42px; } .gm-row:active, .ps-row:active, table.gm-pt tr.drag:active td { background: #0e160f; } .gm-name { font-size: 14px; } .gm-n { font-size: 12px; }
  .gm-head.fl-row, .gm-row.fl-row { grid-template-columns: minmax(0, 1fr) 56px 50px 64px; } .gm-row.fl-row { height: 42px; }
  .gm-head.fl-row > *, .gm-row.fl-row > * { display: none; } .gm-head.fl-row > span:nth-child(1), .gm-row.fl-row > :nth-child(1), .gm-head.fl-row > span:nth-child(n+6), .gm-row.fl-row > :nth-child(n+6) { display: block; } .gm-head.fl-row > :nth-child(3), .gm-row.fl-row > :nth-child(3) { display: flex; }
  .gm-head.mm-row, .gm-row.mm-row { grid-template-columns: minmax(0, 1fr) 46px 76px; } .gm-row.mm-row { height: 42px; } .gm-head.mm-row > *, .gm-row.mm-row > * { display: none; } .gm-head.mm-row > span:nth-child(1), .gm-row.mm-row > :nth-child(1), .gm-head.mm-row > span:nth-child(3), .gm-row.mm-row > :nth-child(3), .gm-head.mm-row > span:nth-child(5), .gm-row.mm-row > :nth-child(5) { display: block; }
  .pj-doc table, .md table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .fl-group { padding: 12px 8px 4px; } .fl-group span { display: none; }
  table.gm-pt td { height: 42px; font-size: 14px; } table.gm-pt th { top: -10px; padding-top: 8px; }
  table.gm-pt th:nth-child(4), table.gm-pt td:nth-child(4) { display: none; } table.gm-pt th:nth-child(5), table.gm-pt td:nth-child(5) { display: table-cell; }
  table.gm-pt th:nth-child(1) { width: 22px; } table.gm-pt th:nth-child(2) { width: 30px; } table.gm-pt th:nth-child(3) { width: auto; } table.gm-pt th:nth-child(5) { width: 84px; } table.gm-pt th:nth-child(6) { width: 46px; }
  .ps-list { gap: 8px; } .ps-row { min-height: 64px; grid-template-columns: 82px minmax(0, 1fr) 52px; padding: 6px 12px; } .ps-row > .ps-num:nth-last-child(-n+2) { display: none; } .ps-row > .ps-num:nth-child(3) { display: block; } .ps-axis { display: none; }

  /* the body of a chosen row: its own screen over the list */
  .ps-main .ps-body { display: none; }
  html.sheet, html.sheet body { overflow: hidden; }
  html.sheet .ps-main .ps-body { display: flex; position: fixed; z-index: 60; left: 0; right: 0; top: calc(var(--top) + 0px); bottom: calc(var(--bar) + var(--safe)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border: 0; border-radius: 0; background: #040504; padding: 12px 12px 28px; }
  html.sheet-in .ps-main .ps-body { animation: sheetin .28s cubic-bezier(.2, .8, .2, 1); } @keyframes sheetin { from { transform: translateX(28%); opacity: 0; } to { transform: none; opacity: 1; } }
  html.sheet .ps-body > * { flex: none; } html.sheet .ps-body .ps-feed, html.sheet .ps-body .gm-box, html.sheet .ps-body .gm-two { overflow: visible; max-height: none; min-height: 0; }
  html.sheet #sheet-bar { display: flex; position: fixed; z-index: 80; left: 0; right: 0; top: 0; height: calc(var(--top) + 0px); padding-top: 0px; box-sizing: border-box; align-items: center; gap: 2px; background: #030403; border-bottom: 1px solid var(--saber); cursor: pointer; }
  #sheet-bar button { width: 48px; height: 44px; background: transparent; border: 0; color: var(--green); font-size: 30px; line-height: 1; padding: 0 0 4px; } #sheet-bar b { font-family: var(--mono); font-weight: 400; font-size: 13px; color: var(--dim); letter-spacing: .04em; }
  .ps-bh { flex-wrap: wrap; gap: 4px 10px; } .ps-bh .muted { flex: 1 1 100%; order: 3; white-space: normal; } .ps-bh a.more, .ps-bh > a:last-child { margin-left: auto; }
  .gm-bigs { gap: 8px; } .gm-big b { font-size: 24px; } .ps-bh h1 { font-size: 22px; } .gm-li { padding: 8px 0; font-size: 13px; min-height: 24px; } .ps-ev { padding: 5px 0; }
  .gm-strip { grid-template-columns: minmax(0, 1fr); height: 54px; } .gm-strip span { padding: 0; }
  .ps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ps-tabs { overflow-x: auto; } .ps-tabs button { padding: 8px 12px; flex: none; }
  .ps-legend { flex-wrap: wrap; white-space: normal; gap: 4px 12px; }
  .sg-tabs { overflow-x: auto; scrollbar-width: none; } .sg-tabs button { flex: none; padding: 8px 12px; } .sg-tabs > span { display: none; } .sg-balance { font-size: 48px; }

  /* the cockpit: one column — the treasury, your word, the realm, the factories */
  #hm { height: auto; gap: 14px; } .th-main { display: flex; flex-direction: column; gap: 16px; }
  .th-centre { order: -1; gap: 12px; } .th-core { width: min(74vw, 320px); height: min(74vw, 320px); flex: none; max-height: none; } .th-mid > b { font-size: 44px; }
  .th-wing { overflow: visible; gap: 8px; } .th-wing:last-child { order: 0; } .th-wing:first-child { order: 1; }
  .th-wing .th-h, .th-wing:last-child .th-h { display: block; text-align: left; padding: 0 2px; } .th-wing .th-h i, .th-wing:last-child .th-h i { margin: 0 0 0 10px; }
  .th-wing .th-i { flex: none; min-height: 76px; padding: 12px 14px; } .th-i:active, .th-f:active { background: #0c120c; }
  .th-funds { height: auto; grid-template-rows: none; gap: 4px; } .th-f { grid-template-columns: 78px minmax(0, 1fr) auto 14px; padding: 10px 8px; min-height: 44px; } .th-f > b { font-size: 18px; }
  .th-rib { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px; } .th-fac { max-width: none; flex-wrap: wrap; gap: 6px; } .th-fac a { padding: 7px 10px; font-size: 12px; }
  .th-last { white-space: normal; flex-wrap: wrap; } .th-last .ell { white-space: normal; flex: 1 1 100%; } .th-q { flex-wrap: wrap; } .th-q > div { flex: 1 1 45%; padding: 9px 10px; }
  .th-legend { max-width: none; }

  /* tasks: the filters are one strip, the board is swiped a column at a time */
  .tk-bar { flex-wrap: nowrap; overflow-x: auto; margin: 0 -10px 10px; padding: 0 10px; scrollbar-width: none; } .tk-bar > *, .tk-bar .right > * { flex: none; white-space: nowrap; } .tk-bar .right { margin-left: 0; display: flex; gap: 6px; order: -1; }
  .tk-bar select, .tk-bar input { flex: 0 0 auto; max-width: 180px; height: 40px; padding: 0 10px; } .tk-bar button, .tk-bar a.act, .tk-bar .tag { min-height: 40px; display: inline-flex; align-items: center; padding: 0 12px; }
  .tk-board { height: calc(100dvh - var(--top) - var(--bar) - var(--safe) - 152px); height: calc(100% - 132px); min-height: 360px; margin: 0 -10px; padding: 0 10px 6px; scroll-padding: 0 10px; } .tk-col { flex: 0 0 84vw; scroll-snap-align: start; }
  .tk-card { padding: 10px 12px; } .tk-title { font-size: 14px; } .tk-row { padding: 11px 4px; font-size: 13px; }
  .dc-opts button, .dc-opts .act { min-height: 44px; white-space: normal; text-align: left; }

  /* everything a finger presses */
  button.act { min-height: 40px; padding: 8px 14px; font-size: 13px; } button.act.small { min-height: 34px; padding: 4px 12px; font-size: 12px; }
  .pj-chip { padding: 7px 10px; font-size: 13px; } .pj-chip i { padding: 0 2px 0 6px; font-size: 16px; } .pj-add, .pj-parent { min-height: 40px; }
  .fl-edit .row > * { flex: 1 1 100%; box-sizing: border-box; min-height: 42px; } .fl-rline { flex-wrap: wrap; } .fl-rline em { flex: 1 1 100%; white-space: normal; } .fl-book { flex-wrap: wrap; } .fl-book > span { flex: 1 1 100%; white-space: normal; }
}
#sheet-bar { display: none; }   /* the bar that leads back from a row's body exists only on the phone */
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { html.sheet-in .ps-main .ps-body { animation: none; } }
@media (max-width: 380px) { a.me { max-width: 64px; } }
