/* Lucy's desk: where DECK's parts go on the page. Colours and fonts live in theme.css,
   shapes and motion in core/deck.css. Nothing here names a colour or starts an animation. */
@import "/static/theme.css";
@import "/static/core/deck.css";

.denied { padding: 40px; font-size: 18px; }
#app { height: 100dvh; display: flex; }

/* rail: Chat, Home, App Store, Approvals */
#rail { width: 92px; flex: none; display: flex; flex-direction: column; gap: 6px; padding: 14px 0 14px 8px; }
#rail .dk-nav__item { width: 84px; }
.logo { width: 52px; height: 52px; margin: 0 16px 14px; border: 0; background: var(--signal); color: var(--on-signal); display: grid; place-items: center; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); --focus: var(--on-signal); }
.logo svg { width: 28px; height: 28px; }

/* column: header over body */
#col { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
#head { display: flex; align-items: center; gap: 14px; padding: 14px 24px 12px 12px; }
.me { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.me .av { width: 40px; height: 40px; flex: none; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); display: grid; place-items: center; font: 700 14px/1 var(--font-display); letter-spacing: .04em; }
.me .nm { font: 600 var(--fz-md)/1 var(--font-display); letter-spacing: .04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp { flex: 1; }
.only-narrow { display: none; }
#body { flex: 1; min-height: 0; display: flex; gap: 20px; padding: 0 24px 20px 12px; }
#main { flex: 1; min-width: 0; min-height: 0; display: flex; }
#main > section { display: none; flex: 1; min-width: 0; min-height: 0; }
.v-home #home, .v-store #store, .v-app #appview, .v-approvals #approvals { display: block; overflow: auto; padding: 6px 4px 28px; }
.v-chat #chat { display: flex; }
.page { max-width: 1180px; }
.phead { display: flex; align-items: flex-end; gap: 16px; margin: 2px 0 20px; }
.phead .hl { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.phead .dk-field { flex: 0 1 340px; }
.empty { color: var(--ink-dim); padding: 28px 0; margin: 0; }

/* the chat list beside a chat */
#right { width: 340px; flex: none; display: none; flex-direction: column; min-height: 0; }
.v-chat #right { display: flex; }
.chats { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 18px; gap: 12px; }
.chats > .list { flex: 1; min-height: 0; overflow: auto; }
.crow .gl { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: var(--well); color: var(--ink-dim); }
.crow .gl svg { width: 16px; height: 16px; }
.crow .gl.run { color: var(--ok); }
.crow .tx b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow.on .tx b { color: var(--signal); font-weight: 600; }

/* chat: the first thing anyone sees */
#chat { flex-direction: column; overflow: hidden; }
#thread { flex: 1; min-height: 0; overflow: auto; padding: 26px 48px 12px; }
#chat.fresh { justify-content: center; }
#chat.fresh #thread { flex: none; }
.hello { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 10px; }
.hello p { margin: 0; color: var(--ink-dim); font-size: 17px; }
.sugg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.msg { max-width: 760px; margin: 0 auto 20px; }
.msg.user { display: flex; justify-content: flex-end; }
.bub { background: var(--surface-2); box-shadow: inset -4px 0 0 var(--signal); padding: 12px 18px 12px 16px; max-width: 82%; white-space: pre-wrap; overflow-wrap: anywhere; }
.ans { font-size: 17px; line-height: 1.6; overflow-wrap: anywhere; }
.ans p { margin: 0 0 10px; } .ans ul { margin: 0 0 10px; padding-left: 22px; }
.ans code { background: var(--well); padding: 1px 6px; font: 500 15px/1.4 var(--font-mono); }
.ans b { color: var(--signal); font-weight: 600; }
.think { color: var(--ink-dim); font-family: var(--font-mono); }
.err { color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.wait { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 14px 18px; margin-bottom: 10px; border: 0; color: var(--ink); text-align: left; --cut: 12px; }
.wait b { color: var(--warn); font: 600 var(--fz-sm)/1.2 var(--font-display); letter-spacing: .06em; text-transform: uppercase; }
.wait span { font-size: var(--fz-sm); overflow-wrap: anywhere; }
#composer { display: flex; align-items: flex-end; gap: 8px; width: min(760px, calc(100% - 32px)); margin: 6px auto 20px; padding: 8px 8px 8px 18px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow var(--t-base) var(--ease); }
#composer:focus-within { box-shadow: inset 0 0 0 2px var(--signal); }
#input { flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: transparent; font-size: 17px; line-height: 1.5; padding: 11px 0; }
#input::placeholder { color: var(--ink-faint); }
#attach.has { background: var(--surface); color: var(--signal); box-shadow: inset 0 0 0 2px var(--signal); }
#send.stop svg { fill: currentColor; }

/* Home and the App Store */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, 124px); gap: 20px 12px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 2px; border: 0; background: transparent; color: var(--ink); }
.tile:hover .dk-glyph { transform: translateY(-3px); }
.tile .nm { font: 500 var(--fz-sm)/1.25 var(--font-body); text-align: center; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.appr { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 16px; --cut: 12px; }
.appm { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 0; border: 0; background: transparent; text-align: left; color: var(--ink); }
.appm .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.appm .tx b { font: 600 17px/1.25 var(--font-display); letter-spacing: .02em; }
.appm .tx span { font: 400 var(--fz-sm)/1.4 var(--font-body); color: var(--ink-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.appm:hover .tx b { color: var(--signal); }
.appr .acts { display: flex; gap: 8px; flex: none; }
.added { color: var(--ok); }

/* an open app */
.apph { display: flex; align-items: center; gap: 14px; margin: 2px 0 20px; }
.apph .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.apph .tx span { color: var(--ink-dim); font-size: var(--fz-sm); }
.stamp { color: var(--ink-faint); font: 500 var(--fz-xs)/1 var(--font-mono); white-space: nowrap; }
.blk-h { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; font: 600 17px/1.2 var(--font-display); letter-spacing: .05em; text-transform: uppercase; }
.blk-h small { font: 400 var(--fz-sm)/1.2 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--ink-dim); }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.imgs figure { margin: 0; padding: 1px; }
.imgs img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--well); }
.imgs figure.dead img { visibility: hidden; }
.imgs figcaption { padding: 10px 14px; display: flex; align-items: baseline; gap: 8px; }
.imgs figcaption small { color: var(--ink-dim); }
.pre { margin: 0; padding: 16px 18px; font: 400 15px/1.55 var(--font-body); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-dim); }

/* approvals */
.aps { display: grid; gap: 12px; }
.ap { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.ap .does { font: 500 17px/1.45 var(--font-body); overflow-wrap: anywhere; }
.ap p { margin: 0; color: var(--ink-dim); font-size: var(--fz-sm); }
.ap .st { font: 500 var(--fz-sm)/1.4 var(--font-mono); overflow-wrap: anywhere; }
.apb { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }

@media (max-width: 1280px) { #right { width: 290px; } .shelf { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); } }
@media (max-width: 899px) {
  .v-chat #right { display: none; }
  .v-chat .only-narrow { display: inline-flex; }
  .v-chat.show-list #right { display: flex; flex: 1; width: auto; }
  .v-chat.show-list #main { display: none; }
}
/* a phone: the rail becomes a bar under the thumb, and every row gets the full width */
@media (max-width: 760px) {
  #app { flex-direction: column-reverse; }
  #rail { width: auto; flex-direction: row; gap: 0; padding: 0 0 env(safe-area-inset-bottom); background: var(--surface); box-shadow: 0 -1px 0 var(--line); }
  #rail .dk-nav__item { flex: 1; width: auto; min-height: 60px; font-size: 11px; }
  #rail .dk-nav__item.on::before { left: 14px; right: 14px; top: 0; bottom: auto; width: auto; height: 4px; }
  .logo { display: none; }
  #head { padding: 10px 12px 8px; gap: 10px; }
  .me .nm, #new-chat .lb2, #list-btn .lb2 { display: none; }
  #new-chat, #list-btn { width: var(--tap); padding: 0; }
  #body { padding: 0 10px 10px; gap: 0; }
  .phead { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .phead .dk-field { flex: 1 1 100%; }
  .dk-head { margin-top: 26px; flex-wrap: wrap; }
  .shelf { grid-template-columns: 1fr; }
  .appr { flex-wrap: wrap; }
  .appr .acts { width: 100%; }
  .appr .acts .dk-btn { flex: 1; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 16px 6px; }
  .apph { flex-wrap: wrap; } .apph .tx span, .stamp { display: none; }
  .dk-stats { grid-template-columns: repeat(2, 1fr); }
  .imgs { grid-template-columns: 1fr; }
  #thread { padding: 18px 16px 8px; }
  .sugg { grid-template-columns: 1fr; }
  #composer { margin-bottom: 10px; width: calc(100% - 16px); padding-left: 14px; }
  .bub { max-width: 90%; }
}

/* the sign-in page of the public door */
.signin { display: grid; place-items: center; padding: 16px; }
.signin form, .signin-note { width: min(400px, 100%); padding: 32px 28px; display: flex; flex-direction: column; gap: 14px; }
.signin p { margin: 0; color: var(--ink-dim); }
.signin input { height: var(--tap); border: 0; padding: 0 14px; font-size: 17px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line-strong); }
.signin .err { min-height: 1.4em; }
.signin a { color: var(--signal); }
