/* ============================================================
   KON — STYLES
   Paper background, ink borders. Blue = shared, red = management.
   ============================================================ */

:root {
  --ink: #24242A;
  --paper: #F5F4F0;
  --card: #FBFAF7;
  --line: #E4E1D8;
  --blue: #8CA0B3;
  --blue-deep: #4C6478;
  --blue-tint: #EEF2F5;
  --red: #B33F2E;
  --red-deep: #7A2E20;
  --red-tint: #F7ECE9;
  --muted: #6E6F66;
  --body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --display: 'Space Grotesk', var(--body);
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --barh: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
body { min-height: 100vh; min-height: 100dvh; }

input, textarea, select, button { font-family: inherit; font-size: 16px; }
::placeholder { color: #9B9C93; }

.boot { padding: 60px 20px; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 13px; }

.wrap {
  max-width: 760px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(var(--barh) + 28px + env(safe-area-inset-bottom));
}

/* ---------- Buttons ---------- */
.btn { cursor: pointer; transition: opacity .15s ease, transform .1s ease; border-radius: 0; }
.btn:active { transform: scale(.985); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .btn, .card { transition: none; } }

/* ---------- Auth ---------- */
.auth { max-width: 380px; margin: 0 auto; padding: 11vh 20px 40px; }
.auth-mark { display: flex; justify-content: center; margin-bottom: 20px; }
.auth h1 {
  font-family: var(--display); font-size: 24px; font-weight: 700;
  text-align: center; margin: 0 0 6px; letter-spacing: -.01em;
}
.auth h1.wordmark { font-size: 34px; letter-spacing: .18em; text-indent: .18em; }
.auth p.sub { text-align: center; color: var(--muted); font-size: 13.5px; margin: 0 0 26px; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 22px; line-height: 1.5; }

/* ---------- Title block ---------- */
.titleblock {
  border: 1.5px solid var(--ink); background: var(--card);
  margin-bottom: 20px; padding: 0; width: 100%; display: block; text-align: left;
}
.titleblock-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.project-title {
  font-family: var(--display); font-weight: 700; font-size: 20px;
  letter-spacing: -.01em; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-sub {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chev { color: var(--muted); font-size: 22px; line-height: 1; }

/* Drawing-sheet style info strip under the project name */
.titleblock .titleblock-row { border-bottom: 1px solid var(--line); }
.titleblock-meta { display: grid; grid-template-columns: repeat(4, 1fr); }
.meta { padding: 9px 12px; border-right: 1px solid var(--line); min-width: 0; }
.meta:last-child { border-right: none; }
.meta-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em;
  color: var(--muted); text-transform: uppercase;
}
.meta-value {
  font-family: var(--mono); font-size: 13px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Team Set / Management switch ---------- */
.tabs { display: flex; gap: 8px; margin: 18px 0 4px; }
.tab {
  flex: 1; padding: 11px 12px;
  background: transparent; border: 1.3px solid var(--line); color: var(--muted);
  font-family: var(--display); font-weight: 600; font-size: 14.5px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
}
.tab-count { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--muted); }
.tab.on-team { border-color: var(--blue); color: var(--ink); background: var(--blue-tint); }
.tab.on-private { border-color: var(--red); color: var(--ink); background: var(--red-tint); }

/* ---------- Totals ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.stat { border: 1px solid var(--line); background: var(--card); padding: 14px; }
.stat-value { font-family: var(--display); font-weight: 700; font-size: 22px; }
.stat-label {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  margin-top: 2px; text-transform: uppercase; letter-spacing: .05em;
}

/* ---------- Sections ---------- */
.section-head { margin: 22px 0 10px; }
.section-title {
  font-family: var(--display); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: .1em;
}
.section-note { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card {
  border: 1.3px solid var(--line); background: var(--card);
  padding: 14px; text-align: left; display: block; width: 100%;
}
.card:hover { border-color: var(--ink); }
.card-mgmt { background: #FCF7F5; border-color: #E8D5CF; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-code { font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--blue-deep); }
.card-mgmt .card-code { color: var(--red); }
.flagdot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: inline-block; }
.card-label { font-family: var(--display); font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.card-hint { font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-bottom: 8px; min-height: 31px; }
.card-count { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ---------- Folder view ---------- */
.folder-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.back { background: none; border: none; font-size: 13.5px; color: var(--muted); padding: 6px 0; flex-shrink: 0; }
.folder-titles { min-width: 0; }
.cat-code { font-family: var(--mono); font-size: 11.5px; color: var(--blue-deep); }
.cat-code.mgmt { color: var(--red); }
.cat-label { font-family: var(--display); font-weight: 700; font-size: 19px; }

.searchbar {
  display: flex; align-items: center; gap: 8px;
  border: 1.3px solid var(--line); background: #fff;
  padding: 0 10px; margin-bottom: 12px; color: var(--muted);
}
.search-input {
  flex: 1; border: none; outline: none; background: transparent;
  padding: 11px 0; font-size: 15px; color: var(--ink);
}
.search-input::-webkit-search-cancel-button { cursor: pointer; }

.add {
  display: block; width: 100%; padding: 12px 14px;
  background: transparent; border: 1.5px dashed var(--blue);
  color: var(--ink); font-weight: 500; font-size: 14px;
  margin-bottom: 16px; text-align: left;
}
.add.mgmt { border-color: var(--red); }

.empty {
  padding: 30px 10px; text-align: center; color: var(--muted);
  font-size: 13.5px; border: 1px dashed var(--line);
}

/* ---------- Entries ---------- */
.entries { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; gap: 12px; padding: 12px;
  border: 1px solid var(--line); background: var(--card);
  align-items: flex-start;
}
.row:hover { background: #F0EEE7; }
.thumb {
  width: 52px; height: 52px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line); background: #EEEEE8;
}
.row-main { flex: 1; min-width: 0; }
.row-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.row-title { font-weight: 600; font-size: 14.5px; word-break: break-word; }
.row-amount { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.row-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row-notes { font-size: 13px; color: #45463F; margin-top: 4px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.row-foot { display: flex; gap: 10px; margin-top: 6px; align-items: center; flex-wrap: wrap; }
.row-date { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.row-author { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); padding: 1px 5px; }
.row-edited { font-family: var(--mono); font-size: 10.5px; color: var(--muted); font-style: italic; }
.row-link { font-size: 12.5px; color: var(--blue-deep); text-decoration: none; font-weight: 500; }
.row-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.iconbtn { background: none; border: none; color: var(--muted); font-size: 14px; padding: 3px 6px; }
.iconbtn:hover { color: var(--ink); }

/* ---------- Panels ---------- */
.panel { border: 1.3px solid var(--line); background: var(--card); padding: 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; align-items: baseline; }
.kv span { color: var(--muted); }
.kv strong { font-family: var(--mono); font-size: 12.5px; font-weight: 500; text-align: right; word-break: break-all; }
.hintline { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; margin: 6px 0 0; }

.signout {
  width: 100%; padding: 13px; background: transparent;
  border: 1.5px solid var(--red); color: var(--red);
  font-weight: 600; font-size: 14px;
}

/* ---------- Coming soon ---------- */
.soon { border: 1.5px dashed var(--line); background: var(--card); padding: 22px 18px; }
.soon-badge {
  display: inline-block; font-family: var(--mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .08em;
  background: var(--blue-tint); color: var(--blue-deep);
  border: 1px solid var(--blue); padding: 4px 8px; margin-bottom: 14px;
}
.soon-list { margin: 0; padding-left: 18px; color: #45463F; font-size: 13.5px; line-height: 1.7; }

/* ---------- Banners ---------- */
.banner { padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner-error { background: var(--red-tint); border: 1px solid var(--red); color: var(--red-deep); }
.banner-info { background: var(--blue-tint); border: 1px solid var(--blue); color: var(--blue-deep); }
.banner button { margin-left: auto; background: none; border: none; color: inherit; font-size: 15px; cursor: pointer; padding: 0 2px; }

.notice {
  font-family: var(--mono); font-size: 11.5px; color: var(--red-deep);
  background: var(--red-tint); border: 1px solid #E3CFC8;
  padding: 9px 12px; margin: 16px 0; line-height: 1.5;
}

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(36,36,42,.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 60;
}
.modal {
  background: var(--card); width: 100%; max-width: 520px;
  max-height: 90vh; max-height: 90dvh; overflow-y: auto;
  border: 1.5px solid var(--ink); border-bottom: none;
  padding-bottom: env(safe-area-inset-bottom);
  animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }

.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 2px solid var(--blue);
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.modal-head.mgmt { border-bottom-color: var(--red); }
.modal-title { font-family: var(--display); font-weight: 700; font-size: 16px; }
.close { background: none; border: none; font-size: 16px; color: var(--muted); cursor: pointer; padding: 4px 6px; }

form.entryform { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
label.field {
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.field input, .field textarea {
  font-family: var(--body); font-size: 16px; color: var(--ink);
  border: 1.3px solid var(--line); background: #fff; padding: 10px;
  text-transform: none; letter-spacing: normal; width: 100%;
}
.field textarea { min-height: 74px; resize: vertical; }
.field input:disabled, .field textarea:disabled { background: #F2F1EC; color: var(--muted); }

/* ---------- Colour picker ---------- */
.colors { display: flex; gap: 6px; flex-wrap: wrap; text-transform: none; letter-spacing: normal; }
.swatch {
  display: flex; align-items: center; gap: 6px;
  border: 1.3px solid var(--line); background: #fff;
  padding: 7px 9px; font-size: 12.5px; color: var(--muted);
}
.swatch .dot-sw { width: 11px; height: 11px; border-radius: 50%; background: var(--sw); border: 1px solid rgba(0,0,0,.15); }
.swatch.on { border-color: var(--ink); color: var(--ink); background: #F3F1EA; font-weight: 600; }

/* ---------- Photo ---------- */
.photo-btn {
  border: 1.3px dashed var(--line); background: #fff; padding: 12px;
  text-align: center; color: var(--muted); font-size: 13.5px;
  text-transform: none; letter-spacing: normal; width: 100%;
}
.photo-preview {
  display: flex; align-items: center; gap: 10px;
  border: 1.3px solid var(--line); background: #fff; padding: 8px;
  text-transform: none; letter-spacing: normal;
}
.photo-preview img { width: 46px; height: 46px; object-fit: cover; border: 1px solid var(--line); background: #EEEEE8; }
.photo-preview span { flex: 1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

.actions { display: flex; gap: 10px; margin-top: 4px; }
.cancel {
  flex: 1; padding: 12px; background: transparent;
  border: 1.3px solid var(--line); color: var(--muted);
  font-weight: 500; font-size: 14px;
}
.save {
  flex: 2; padding: 12px; border: none; background: var(--blue);
  color: #fff; font-weight: 600; font-size: 14px;
}
.save.mgmt { background: var(--red); }
.save[disabled], .cancel[disabled] { opacity: .5; cursor: default; }

/* ---------- Bottom bar ---------- */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--barh) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1.3px solid var(--line);
  display: flex; z-index: 40;
}
.tabbtn {
  flex: 1; background: none; border: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); padding: 0;
}
.tabbtn.on { color: var(--ink); }
.tabbtn.on .tabicon::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: -7px; width: 16px; height: 2px; background: var(--red);
}
.tabicon { position: relative; display: flex; }
.tablabel { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; }
.soon-dot {
  position: absolute; top: -2px; right: -4px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue); border: 1px solid var(--card);
}

/* ---------- Attachments on a note ---------- */
.attstrip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.att-thumb {
  width: 46px; height: 46px; object-fit: cover;
  border: 1px solid var(--line); background: #EEEEE8;
}
.filechip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 11.5px; padding: 5px 8px; max-width: 190px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.filechip:hover { color: var(--ink); border-color: var(--ink); }

.replybtn {
  background: none; border: none; color: var(--blue-deep);
  font-size: 12px; padding: 2px 0; margin-left: auto; font-weight: 500;
}

/* ---------- File grid in the form ---------- */
.filegrid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filecell { position: relative; width: 66px; height: 66px; }
.filecell img {
  width: 100%; height: 100%; object-fit: cover;
  border: 1px solid var(--line); background: #EEEEE8;
}
.docbox {
  width: 100%; height: 100%;
  border: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; color: var(--red);
}
.cellx {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); color: #fff; border: none;
  font-size: 11px; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.fieldhelp {
  font-family: var(--body); font-size: 11.5px; color: var(--muted);
  text-transform: none; letter-spacing: normal; line-height: 1.45;
  margin-top: 2px;
}

/* ---------- Chat & threads ---------- */
.wrap-chat { display: flex; flex-direction: column; min-height: calc(100dvh - var(--barh)); }
.chatpane { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.threadnote {
  border: 1px solid var(--line); background: var(--card);
  padding: 12px; margin-bottom: 14px;
}

.msglist {
  flex: 1; min-height: 120px;
  display: flex; flex-direction: column; gap: 10px;
  padding-bottom: 8px; overflow-y: auto;
}

.msg { display: flex; }
.msg.mine { justify-content: flex-end; }
.bubble {
  max-width: 82%;
  border: 1px solid var(--line); background: var(--card);
  padding: 9px 11px;
}
.msg.mine .bubble { background: var(--blue-tint); border-color: var(--blue); }
.msg-who { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }
.msg-body { font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.msg-img {
  display: block; max-width: 100%; max-height: 260px;
  object-fit: cover; border: 1px solid var(--line); margin-bottom: 6px; background: #EEEEE8;
}
.msg-foot {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 5px; font-family: var(--mono); font-size: 10px; color: var(--muted);
}
.msg-act { background: none; border: none; color: var(--blue-deep); font-family: var(--mono); font-size: 10px; padding: 0; }
.editbox {
  width: 100%; min-height: 68px; resize: vertical;
  border: 1.3px solid var(--line); background: #fff; padding: 8px;
  font-family: var(--body); font-size: 15px; color: var(--ink);
}

/* ---------- Composer ---------- */
.composer {
  position: sticky; bottom: 0;
  background: var(--paper); padding-top: 8px;
  border-top: 1px solid var(--line); margin-top: 8px;
}
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer-input {
  flex: 1; resize: none; overflow-y: auto; max-height: 120px;
  border: 1.3px solid var(--line); background: #fff;
  padding: 10px; font-family: var(--body); font-size: 16px; color: var(--ink);
  line-height: 1.4;
}
.composer-btn, .composer-send {
  flex-shrink: 0; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1.3px solid var(--line); background: #fff; color: var(--muted);
}
.composer-send { background: var(--blue); border-color: var(--blue); color: #fff; }
.composer-send[disabled] { opacity: .5; }
.chat-preview {
  display: flex; align-items: center; gap: 10px;
  border: 1.3px solid var(--line); background: #fff; padding: 7px; margin-bottom: 8px;
}
.chat-preview img { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--line); }
.chat-preview span { flex: 1; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Feed ---------- */
.feed { display: flex; flex-direction: column; gap: 6px; }
.feeditem {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); background: var(--card);
  padding: 11px 12px; text-align: left; width: 100%;
}
.feeditem:hover { background: #F0EEE7; }
.feeditem.fresh { border-left: 3px solid var(--red); background: #FDFBF7; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.feed-main { min-width: 0; flex: 1; }
.feed-line { font-size: 12.5px; color: var(--muted); }
.feed-line strong { color: var(--ink); font-weight: 600; }
.feed-title {
  font-size: 14px; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.feed-time { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Badges ---------- */
.badge {
  position: absolute; top: -5px; right: -8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--red); color: #fff;
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--card);
}

/* ---------- Auth switch ---------- */
.authswitch {
  display: flex; gap: 6px; justify-content: center; align-items: baseline;
  margin-top: 22px; font-size: 13px; color: var(--muted); flex-wrap: wrap;
}
.linkbtn {
  background: none; border: none; padding: 0;
  color: var(--blue-deep); font-size: 13px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- Team screen ---------- */
.teamlist { display: flex; flex-direction: column; gap: 8px; }
.teamrow {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); background: var(--card); padding: 12px;
}
.teammain { flex: 1; min-width: 0; }
.teamname { font-weight: 600; font-size: 14.5px; }
.teammail {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.teamrole { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.rolechip {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .06em; border: 1px solid var(--line);
  padding: 2px 6px; color: var(--muted);
}
.rolechip.strong { border-color: var(--blue); background: var(--blue-tint); color: var(--blue-deep); }
.rolechip.warn { border-color: var(--red); background: var(--red-tint); color: var(--red-deep); }

.teamacts { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.btn.tiny {
  padding: 7px 10px; font-size: 12px; flex: none; width: auto;
  white-space: nowrap;
}
.btn.tiny.danger { border-color: var(--red); color: var(--red); }

.inlinebadge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 8px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-family: var(--mono); font-size: 10px;
}

/* ---------- Studio header (home) ---------- */
.studiohead { display: flex; align-items: center; gap: 12px; padding: 4px 0 6px; }
.studioname {
  font-family: var(--display); font-weight: 700; font-size: 26px;
  letter-spacing: .1em; line-height: 1.1;
}
.studiosub { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Project list ---------- */
.newproject {
  display: block; width: 100%; padding: 14px;
  background: var(--ink); color: #fff; border: none;
  font-family: var(--display); font-weight: 600; font-size: 15px;
  margin-bottom: 12px;
}
.newproject:hover { opacity: .88; }

.projlist { display: flex; flex-direction: column; gap: 8px; }
.projrow {
  display: flex; align-items: stretch;
  border: 1.3px solid var(--line); background: var(--card);
}
.projrow:hover { border-color: var(--ink); }
.projrow.archived { opacity: .6; }

.projmain {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px;
  background: none; border: none; padding: 15px 14px; text-align: left;
}
.projnum {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  flex-shrink: 0; letter-spacing: .04em;
}
.projtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.projname {
  font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.projmeta {
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.projedit {
  flex-shrink: 0; width: 44px; background: none;
  border: none; border-left: 1px solid var(--line);
  color: var(--muted); font-size: 18px; line-height: 1;
}
.projedit:hover { color: var(--ink); background: #F0EEE7; }

.switchproj {
  margin-left: auto; flex-shrink: 0;
  background: none; border: 1px solid var(--line);
  color: var(--muted); font-family: var(--mono); font-size: 11px;
  padding: 5px 10px;
}
.switchproj:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Small screens ---------- */
@media (max-width: 400px) {
  .titleblock-meta { grid-template-columns: repeat(2, 1fr); }
  .meta:nth-child(2n) { border-right: none; }
  .meta:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
  .card-hint { min-height: 0; }
  .bubble { max-width: 90%; }
}
