:root {
  color-scheme: dark;
  --app: #080e19;
  --panel: #121a26;
  --panel-strong: #17202e;
  --glass-a: #163149;
  --glass-b: #09111a;
  --border: #424854;
  --border-blue: #426084;
  --text: #dfe5f5;
  --muted: #a5abb9;
  --accent: #00f5f5;
  --purple: #929bfa;
  --green: #8eff71;
  --danger: #ff716c;
  font: 14px "Segoe UI", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { display: grid; place-items: center; color: var(--text); background: #edf7f1; }
button, input, textarea { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.ambient-a { width: 480px; height: 480px; left: -170px; top: 170px; background: #ddf5e7; }
.ambient-b { width: 560px; height: 560px; right: -170px; bottom: -180px; background: #dcebe1; }

.app-window {
  position: relative;
  width: min(calc(100vw - 58px), calc((100vh - 32px) * 1.617));
  height: min(calc(100vh - 32px), calc((100vw - 58px) / 1.617));
  min-width: 900px;
  min-height: 556px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--app);
  box-shadow: 0 16px 42px #06121d55;
  animation: app-enter .22s ease-out both;
}
@keyframes app-enter { from { opacity: 0; transform: scale(.992); } }
.titlebar {
  position: relative;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #426084;
  background: linear-gradient(115deg, #17273b, #0b1421 42%, #1f4c73);
}
.traffic { position: absolute; left: 17px; display: flex; gap: 8px; }
.traffic i { width: 15px; height: 15px; border-radius: 50%; background: #ff5a5f; box-shadow: inset 0 -2px 2px #0005; }
.traffic i:nth-child(2) { background: #ffbf27; }
.traffic i:nth-child(3) { background: #32c954; }
.title-logo { width: 50px; height: 32px; object-fit: contain; }
.fullscreen-btn { position: absolute; right: 12px; height: 36px; padding: 0 16px; border: 1px solid #00e4fa; border-radius: 19px; background: #1a3956; box-shadow: 0 0 10px #00ecff88; font-size: 12px; font-weight: 700; cursor: pointer; }

.app-body {
  position: relative;
  height: calc(100% - 54px);
  padding: 16px 49px 86px;
  overflow: hidden;
  background:
    radial-gradient(circle at 5% 12%, #15344e 0 10%, transparent 25%),
    radial-gradient(circle at 94% 32%, #082f3a 0 20%, transparent 34%),
    repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 4px),
    #080e19;
}
.commandbar {
  position: relative;
  z-index: 2;
  height: 111px;
  padding: 13px 13px 13px 48px;
  display: grid;
  grid-template-columns: 210px 1fr auto 44px;
  gap: 12px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border-blue);
  border-radius: 30px;
  background: linear-gradient(135deg, #163149ee, #102132ee 48%, #09111af5);
}
.commandbar::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 8% 0%, #2b5b8155, transparent 24%), radial-gradient(circle at 19% 0%, #4b438044, transparent 20%); }
.brand-logo { position: relative; z-index: 1; width: 125px; height: 82px; object-fit: contain; }
.global-search { position: relative; z-index: 1; height: 56px; padding: 0 18px; display: flex; align-items: center; gap: 15px; border: 1px solid #355173; border-radius: 28px; background: #0c1523; }
.global-search::after { content: ""; position: absolute; left: 48px; right: 20px; bottom: -1px; height: 1px; background: linear-gradient(90deg, #a8c9ff, #56d5ff 56%, #78f777); opacity: .7; }
.global-search span { color: #9dd6f8; font-size: 22px; }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.account-pill { position: relative; z-index: 1; height: 49px; padding: 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid #3a5268; border-radius: 18px; background: #0b1725; cursor: pointer; }
.account-pill > span:last-child { display: grid; text-align: left; }
.account-pill strong { font-size: 12px; }
.account-pill small { color: #c4d8e6; font-size: 10px; }
.avatar { width: 29px; height: 29px; flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: 10px; background: #586a83; color: white; font-size: 10px; font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-cyan { background: #05bfe8; }
.round-btn, .icon-btn { display: grid; place-items: center; border: 1px solid #40516d; border-radius: 50%; background: #142337; cursor: pointer; }
.round-btn { position: relative; z-index: 1; width: 40px; height: 40px; }
.icon-btn { width: 32px; height: 32px; }

.workspace { height: calc(100% - 123px); min-height: 0; margin-top: 12px; }
.screen { height: 100%; min-height: 0; display: grid; animation: workspace-in .18s ease-out both; }
@keyframes workspace-in { from { opacity: .45; transform: translateY(3px); } }
.panel { min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #38577d; border-radius: 28px; background: linear-gradient(135deg, #163149de, #102132e8 48%, #09111af2); }
.panel-header { height: 40px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(90deg, #343a94, #2d3d8a 42%, #0c6b8c); font-size: 12px; }
.section-title { margin: 0; font-size: 15px; }
.muted { color: var(--muted); }
.eyebrow { color: #35e5ff; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.chip { min-height: 31px; padding: 0 12px; display: inline-grid; place-items: center; border: 1px solid #305675; border-radius: 17px; background: #0b1828; font-size: 11px; }
.primary-action, .secondary-action { min-height: 38px; padding: 0 16px; border: 1px solid #2f8e4d; border-radius: 20px; background: linear-gradient(#8ecf56, #6db450 46%, #2f8e4d); color: white; font-weight: 800; cursor: pointer; }
.secondary-action { border-color: #345772; background: #0d1c2d; }
button:disabled { opacity: .48; cursor: default; }
.scroll-area { overflow: auto; scrollbar-width: thin; scrollbar-color: #29718e transparent; }
.scroll-area::-webkit-scrollbar, .pin-grid::-webkit-scrollbar { width: 7px; }
.scroll-area::-webkit-scrollbar-thumb, .pin-grid::-webkit-scrollbar-thumb { border-radius: 5px; background: linear-gradient(#c8ff7c, #4fa88b); }

/* Pins */
.pins-screen { grid-template-columns: 165px minmax(0, 1fr); gap: 8px; }
.pins-sidebar { padding: 14px 12px 12px; display: flex; flex-direction: column; }
.side-title { height: 37px; margin-bottom: 9px; display: grid; place-items: center; border: 1px solid #2f8e4d; border-radius: 13px; background: linear-gradient(#8ecf56, #6db450 46%, #2f8e4d); font-size: 11px; font-weight: 800; }
.pins-sidebar > p { margin: 0 2px 10px; color: #9db7c9; font-size: 11px; line-height: 1.45; }
.category-list { min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; scrollbar-width: none; }
.category-list::-webkit-scrollbar { display: none; }
.category { min-height: 36px; padding: 0 12px; border: 1px solid #27526f; border-radius: 18px; background: #0d1b2b; text-align: left; font-size: 11px; font-weight: 700; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.category:hover { transform: translateX(2px); border-color: #57d6ff; }
.category.active { border-color: #008da8; background: #0b2739; color: #8bbad0; }
.pins-actions { margin-top: auto; padding-top: 10px; display: grid; gap: 7px; }
.pins-actions button { height: 33px; border: 1px solid #34536d; border-radius: 17px; background: #0e1c2c; font-size: 11px; font-weight: 700; cursor: pointer; }
.pins-actions .generate { border-color: #2f8e4d; background: linear-gradient(#8ecf56, #2f8e4d); }
.pins-stats { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 7px; font-size: 10px; }
.pins-stats span { padding: 5px 8px; border: 1px solid #315878; border-radius: 10px; }
.pins-main { min-width: 0; overflow: hidden; display: grid; grid-template-rows: 40px 58px minmax(0, 1fr) 28px; }
.mobile-category-strip { display: none; }
.feed-toolbar { padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #34536c; background: #101928; }
.feed-toolbar p { margin: 3px 0 0; color: #b7cfe0; font-size: 10px; }
.zoom-controls { display: flex; align-items: center; gap: 8px; }
.zoom-controls button, .zoom-controls span { min-width: 32px; height: 32px; padding: 0 9px; display: grid; place-items: center; border: 1px solid #2d516e; border-radius: 16px; background: #0a1727; font-size: 10px; }
.pin-grid { width: 100%; min-width: 0; min-height: 0; padding: 10px 22px 12px; overflow-x: clip; overflow-y: scroll; overscroll-behavior: contain; scrollbar-gutter: stable; }
.pin-grid::-webkit-scrollbar { width: 7px; height: 0; }.pin-grid::-webkit-scrollbar:horizontal { display: none; }
.pin-columns { width: 100%; min-width: 0; max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(var(--pin-columns), minmax(0, 1fr)); gap: calc(9px * var(--pin-zoom)); }
.pin-column { min-width: 0; max-width: 100%; display: flex; flex-direction: column; gap: calc(10px * var(--pin-zoom)); }
.pin-card { appearance: none; position: relative; width: 100%; min-width: 0; max-width: 100%; min-height: 72px; padding: 0; overflow: hidden; border: 1px solid #365477; border-radius: 22px; background: #0d1421; cursor: pointer; transform-origin: center; transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; }
.pin-card img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #0d1421; }
.pin-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #72869a; font-size: 10px; font-weight: 700; }.pin-card:not(.media-error) .pin-placeholder { visibility: hidden; }.pin-card.media-error img { display: none; }
.pin-card:hover { z-index: 2; border-color: #8ecf56; box-shadow: 0 10px 24px #0008; transform: translateY(-3px) scale(1.01); }
.media-badge { position: absolute; right: 12px; bottom: 12px; padding: 5px 10px; border: 1px solid #445b76; border-radius: 12px; background: #111724df; font-size: 10px; font-weight: 700; }
.pin-audio-title { position: absolute; left: 12px; right: 12px; top: 12px; padding: 10px 12px; border: 1px solid #5d7698; border-radius: 16px; background: #111824ec; text-align: left; opacity: 0; transition: opacity .25s; }
.pin-card:hover .pin-audio-title { opacity: 1; }
.pin-audio-title strong, .pin-audio-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-audio-title small { margin-top: 4px; color: #afc0d7; font-size: 10px; }
.feed-footer { padding: 0 13px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #314868; background: #101827; color: #9fbdd1; font-size: 10px; }

/* Messenger */
.chat-screen { grid-template-columns: 300px minmax(390px, 1fr) 250px; gap: 18px; }
.chat-list { padding: 18px; display: flex; flex-direction: column; overflow: hidden; }.online-panel { padding: 18px; }
.chat-user-card { padding: 16px; display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; border: 1px solid #426084; border-radius: 24px; background: #162131; }
.chat-user-avatar { width: 46px; height: 46px; border-radius: 16px; }
.chat-user-card strong, .chat-user-card small, .chat-user-card em { display: block; }
.chat-user-card strong { font-size: 17px; }
.chat-user-card small { margin-top: 3px; color: var(--muted); }
.chat-user-card em { margin-top: 7px; color: var(--green); font-size: 10px; font-style: normal; }
.new-dm { width: 100%; margin: 18px 0; }
.chat-list h4, .online-panel h4 { margin: 16px 0 8px; color: #7e9db9; font-size: 10px; letter-spacing: .08em; }
.conversation-list { min-height: 0; display: grid; align-content: start; gap: 6px; }.channel-list { flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; }.direct-list { flex: 0 1 35%; max-height: 220px; overflow-x: hidden; overflow-y: auto; }
.conversation { padding: 8px; display: grid; grid-template-columns: 34px 1fr; gap: 9px; align-items: center; border: 1px solid transparent; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; transition: .18s; }
.conversation:hover, .conversation.active { border-color: #28607e; background: #10263b; transform: translateX(2px); }
.conversation strong, .conversation small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation small { color: #8ea9bd; font-size: 10px; }
.chat-main { display: grid; grid-template-rows: 72px minmax(0, 1fr) 35px auto; }
.mobile-chat-nav { display: none; }
.chat-room-header { padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #38577d; background: #101a29; }
.chat-room-header h3 { margin: 4px 0 0; }
.messages { padding: 16px 18px; display: flex; flex-direction: column; gap: 13px; }
.message { display: grid; grid-template-columns: 40px 1fr; gap: 10px; }
.message .avatar { width: 36px; height: 36px; border-radius: 12px; }
.message-head { display: flex; align-items: center; gap: 8px; }
.message-head time { color: #7894a9; font-size: 10px; }
.message-bubble { display: inline-block; max-width: 90%; margin-top: 5px; padding: 13px 18px; border: 1px solid var(--border); border-radius: 18px; background: #182435; }
.message-bubble p { margin: 0; font-size: 15px; line-height: 1.42; }
.reply-preview { display: block; margin-bottom: 8px; padding: 7px 10px; border-left: 2px solid var(--accent); background: #101c2b; color: var(--muted); }
.emoji-strip { padding: 4px 14px; display: flex; align-items: center; gap: 6px; border-top: 1px solid #29445c; }
.emoji-strip button { border: 0; background: transparent; cursor: pointer; }
.emoji-strip span { margin-left: auto; color: #7894a9; font-size: 10px; }
.chat-composer { padding: 11px; display: grid; grid-template-columns: 1fr 40px; gap: 8px; border-top: 1px solid #29445c; }
.chat-composer textarea { height: 42px; padding: 11px 15px; resize: none; outline: 0; border: 1px solid #31536d; border-radius: 20px; background: #071421; color: white; }
.chat-composer button { border: 1px solid #13d7ee; border-radius: 50%; background: #10465d; }
.presence-heading { display: flex; align-items: center; justify-content: space-between; }
.presence-heading h3 { margin: 4px 0; }
.presence-heading > span { padding: 5px 9px; border-radius: 11px; background: #10345d; color: #81ecff; }
.online-list { display: grid; }
.online-user { padding: 9px 0; display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; border-bottom: 1px solid #1e354a; }
.online-user small { display: block; color: #7fa0b7; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #4aee63; }

/* Posts */
.posts-screen { grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; font-family: Bahnschrift, "Segoe UI", sans-serif; }
.posts-main { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
.posts-compose { padding: 13px 16px; background: linear-gradient(135deg, #132c42, #0d1f30 55%, #09131f); }
.quick-post-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: start; }
.quick-post-row .avatar { width: 40px; height: 40px; border-radius: 15px; }
.quick-post-row textarea { min-height: 40px; max-height: 72px; padding: 9px 0; resize: none; border: 0; outline: 0; background: transparent; color: #f4faff; font-size: 16px; }
.quick-post-row .primary-action { min-width: 82px; }
.compose-tools { margin: 8px 0 10px 52px; display: flex; align-items: center; gap: 8px; }
.compose-tools button { padding: 6px 10px; border: 1px solid #294a66; border-radius: 14px; background: #0c1b2a; color: #a9c4dd; cursor: pointer; }
.compose-tools small { margin-left: auto; color: #72e98c; }
.post-sort { padding-top: 9px; display: flex; justify-content: center; gap: 8px; border-top: 1px solid #24415c; }
.post-sort button { width: 112px; height: 30px; border: 0; background: url('assets/posts-sort-button-idle-v7-160x42.png') center/100% 100% no-repeat; color: #a6bed4; cursor: pointer; }
.post-sort button.active { background-image: url('assets/posts-sort-button-active-v10-160x42.png'); color: #ecfff2; }
.post-feed { padding: 12px; }
.post-card { margin-bottom: 10px; padding: 13px; border: 1px solid #294d69; border-radius: 18px; background: #0d1d2f; content-visibility: auto; contain-intrinsic-size: 620px 180px; }
.post-author { display: flex; align-items: center; gap: 9px; }
.post-author div { flex: 1; }
.post-author small { display: block; color: #87a5bb; }
.post-body { margin: 11px 0; line-height: 1.45; }
.post-media { max-width: 100%; max-height: 360px; display: block; border-radius: 13px; }
.post-actions { display: flex; gap: 8px; }
.post-actions button { padding: 5px 10px; border: 1px solid #2d516c; border-radius: 14px; background: #081625; color: #cce2f2; cursor: pointer; }
.trends { padding: 15px; }
.trend { width: 100%; padding: 11px 0; display: flex; justify-content: space-between; border: 0; border-bottom: 1px solid #1e354a; background: transparent; text-align: left; cursor: pointer; }
.trend strong { color: #49dcff; }
.posts-side-nav { margin-top: 24px; padding-top: 16px; display: grid; gap: 7px; border-top: 1px solid #1e354a; }
.posts-side-nav button { height: 38px; padding: 0 12px; border: 1px solid #24415c; border-radius: 13px; background: #0c1b2a; text-align: left; cursor: pointer; }
.relay-private { margin-top: 22px; padding: 14px; border: 1px solid #254059; border-radius: 18px; background: #0b1928; }
.relay-private strong, .relay-private small { display: block; }
.relay-private small { margin-top: 6px; color: #72e98c; }

/* Canvas */
.canvas-screen { grid-template-columns: 276px minmax(390px, 1fr) 300px; gap: 12px; }
.canvas-tools, .canvas-activity { padding: 16px; }
.canvas-tools h2 { margin: 5px 0; font-size: 26px; }
.canvas-tools h4 { margin: 16px 0 8px; font-size: 11px; }
.selected-color { margin-top: 14px; padding: 14px; display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: center; border: 1px solid #35516f; border-radius: 20px; background: #101927; }
.selected-color i { width: 58px; height: 58px; border: 1px solid #e8f9ff; border-radius: 18px; }
.selected-color strong, .selected-color small { display: block; }
.selected-color small { margin-top: 5px; color: #7be7ff; }
.selected-color em { display: block; margin-top: 5px; color: #8ecf56; font-size: 10px; font-style: normal; }
.palette { margin: 14px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.swatch { aspect-ratio: 1; padding: 3px; border: 2px solid #ffffff44; border-radius: 12px; box-shadow: inset 0 0 0 3px #0e1724; cursor: pointer; }
.swatch.active { outline: 2px solid #8ecf56; outline-offset: 2px; }
.canvas-tools .secondary-action { width: 100%; margin-top: 12px; }
.canvas-view-buttons { margin-top: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }.canvas-view-buttons button,.canvas-view-buttons span { min-height: 30px; display: grid; place-items: center; border: 1px solid #35506f; border-radius: 12px; background: #101a28; font-size: 10px; }.canvas-view-buttons button { cursor: pointer; }.canvas-view-buttons button.active { border-color: #8ecf56; color: #8ecf56; }
.canvas-stage { padding: 18px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.canvas-heading { display: flex; align-items: start; justify-content: space-between; }
.canvas-heading h2 { margin: 0; font-size: 28px; }
.canvas-heading p { margin: 6px 0 0; color: var(--muted); }
.canvas-heading > div:last-child { display: flex; gap: 7px; }
.canvas-board-shell { min-width: 0; min-height: 0; margin-top: 16px; padding: 16px; display: grid; place-items: center; overflow: auto; border: 1px solid #5c7898; border-radius: 24px; background: #d6dee8; }
.canvas-render-frame { position: relative; min-width: 50%; max-width: 300%; aspect-ratio: 1; flex: none; }.pixel-canvas { display: block; width: 100%; height: 100%; aspect-ratio: 1; background: #eff4fa; image-rendering: pixelated; cursor: crosshair; }.canvas-grid-overlay { display: none; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(#52667a66 1px,transparent 1px),linear-gradient(90deg,#52667a66 1px,transparent 1px); background-size: calc(100% / var(--board-size)) calc(100% / var(--board-size)); }.grid-on .canvas-grid-overlay { display: block; }
.canvas-render-frame.is-loading::after { content: "Loading board…"; position: absolute; inset: 0; display: grid; place-items: center; background: #eff4fa; color: #536579; font-weight: 700; }
.canvas-stage footer { padding-top: 12px; display: flex; justify-content: space-between; color: #8ea9bb; font-size: 11px; }
.canvas-activity h3 { margin: 6px 0 15px; }
.canvas-activity>p { margin: -8px 0 12px; font-size: 11px; }.canvas-navigator { position: relative; width: 100%; aspect-ratio: 1; padding: 8px; border: 1px solid #35516f; border-radius: 20px; background: #d6dee8; }.canvas-navigator canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }.canvas-navigator>i { position: absolute; inset: 25%; border: 2px solid #00f5f5; border-radius: 4px; box-shadow: 0 0 8px #00f5f5; }.placement-title { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; }.placement-title h3 { margin: 0; }.placement-title small { color: #8ea9bb; }
.placements { display: grid; gap: 8px; }
.placement { padding: 8px; display: grid; grid-template-columns: 28px 1fr auto; gap: 9px; align-items: center; border: 1px solid #294a66; border-radius: 10px; background: #102238; font-size: 10px; }.placement time { color: #7894a9; }
.placement i { width: 24px; height: 24px; border: 1px solid #eef8ff; border-radius: 8px; }
.placement strong, .placement small { display: block; }
.placement small { margin-top: 3px; color: var(--muted); }

/* Profile */
.profile-screen { grid-template-columns: 310px 1fr; gap: 18px; }
.profile-card { padding: 28px; text-align: center; background: radial-gradient(circle at 50% 4%, #254f70, transparent 35%), linear-gradient(135deg, #163149, #09111a); }
.profile-avatar { width: 112px; height: 112px; margin: 0 auto 15px; display: grid; place-items: center; overflow: hidden; border: 3px solid #46e6ff; border-radius: 50%; background: #04b7e3; font-size: 34px; font-weight: 900; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-card h2 { margin: 0; }
.profile-card p { color: #91adc1; }
.taros { display: inline-block; padding: 8px 15px; border: 1px solid #56cc44; border-radius: 17px; color: #8ef072; }
.profile-editor { padding: 26px; }
.profile-editor form { max-width: 650px; display: grid; gap: 14px; }
.profile-editor label, .auth-modal label, .composer-modal label { display: grid; gap: 6px; color: #a9c1d2; font-size: 11px; }
.profile-editor input, .profile-editor textarea, .auth-modal input, .composer-modal input, .composer-modal textarea { padding: 11px 13px; outline: 0; border: 1px solid #31536f; border-radius: 12px; background: #071421; color: white; }
.profile-editor textarea { min-height: 110px; resize: vertical; }

/* Dock and dialogs */
.lower-deck { position: absolute; left: 49px; right: 49px; bottom: 20px; height: 59px; display: grid; grid-template-columns: 124px 1fr 120px; gap: 12px; align-items: center; }
.relay-card, .presence-card { height: 58px; padding: 10px; display: flex; align-items: center; border: 1px solid #31526c; border-radius: 16px; background: #0d1d30; color: #9fc0d5; font-size: 9px; }
.dock { justify-self: center; height: 64px; padding: 8px; display: flex; gap: 8px; border: 1px solid #315b7b; border-radius: 20px; background: #10253a; }
.dock button { position: relative; width: 108px; min-width: 108px; height: 48px; padding: 0 14px; overflow: hidden; border: 1px solid #294561; border-radius: 15px; background: #10233c; color: #d7eafd; font: 600 13px Bahnschrift,"Segoe UI",sans-serif; cursor: pointer; box-shadow: inset 0 0 0 3px #0a1523; transition: color .14s,border-color .16s,transform .14s,box-shadow .16s,background .16s; }
.dock button::after { content:""; position:absolute; inset:2px; pointer-events:none; border:1px solid #1ad7ff; border-radius:13px; opacity:0; transition:opacity .16s; }
.dock button:hover { color:#f5fdff; transform:translateY(-1px); }.dock button:hover::after { opacity:.38; }
.dock button:active { transform:translateY(0); }.dock button:active::after { opacity:.18; }
.dock button .dock-icon { position:relative; z-index:1; margin-right:8px; color:inherit; font-family:"Segoe MDL2 Assets"; font-size:13px; font-weight:400; }
.dock button.active { border-color:#43de73; background:linear-gradient(135deg,#1a3b63 0%,#0a58b6 18%,#2ce45f 100%); color:#f7fff6; box-shadow:inset 0 0 0 3px #0a1523,0 0 10px #3aea8e94; }
.presence-card { justify-content: center; gap: 8px; }
.presence-card i { width: 8px; height: 8px; border-radius: 50%; background: #50ed58; }
.presence-card time { color: white; font-weight: 800; }
.modal { padding: 0; border: 1px solid #3a607c; border-radius: 22px; background: #0b192a; color: white; box-shadow: 0 24px 70px #000b; }
.modal::backdrop { background: #020912c9; backdrop-filter: blur(5px); }
.modal-close { position: absolute; right: 14px; top: 11px; z-index: 2; width: 34px; height: 34px; border: 1px solid #3a607c; border-radius: 50%; background: #0a1727; font-size: 20px; cursor: pointer; }
.install-app-btn { position: absolute; right: 150px; height: 34px; padding: 0 16px; border: 1px solid #4ce778; border-radius: 18px; background: linear-gradient(135deg,#0b5dbb,#2bdd62); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 0 13px #37ee8370; }
.install-app-btn[hidden] { display: none; }
.install-modal form { width: min(480px,90vw); padding: 42px 38px 34px; display: grid; gap: 14px; text-align: center; }
.install-modal img { width: 150px; max-height: 85px; object-fit: contain; justify-self: center; }
.install-modal h2,.install-modal p { margin: 0; }.install-modal p { color: #a7c1d3; line-height: 1.55; }
.auth-modal form, .composer-modal form { width: min(420px, 90vw); padding: 34px; display: grid; gap: 14px; }
.auth-modal img { width: 110px; justify-self: center; }
.auth-modal h2, .auth-modal p { margin: 0; text-align: center; }
.auth-modal p { color: #91adbf; }
.form-error { min-height: 16px; color: #ff7182; font-size: 11px; }
.pin-modal { width: min(1120px, 94vw); height: min(760px, 90vh); grid-template-columns: minmax(0, 1fr) 320px; }
.pin-modal[open] { display: grid; }
.pin-dialog-media { min-width: 0; overflow: hidden; display: grid; place-items: center; background: #030b13; }
.pin-dialog-media img, .pin-dialog-media video { max-width: 100%; max-height: 100%; object-fit: contain; }
.pin-dialog-media audio { width: 80%; }
.pin-modal aside { padding: 50px 25px 25px; overflow: auto; }
.pin-modal aside h2 { margin: 8px 0; }
.pin-modal aside p { color: #9db7c9; line-height: 1.5; }
.toast-region { position: fixed; right: 22px; top: 22px; z-index: 20; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border: 1px solid #31b9d3; border-radius: 12px; background: #0a1929ef; box-shadow: 0 8px 24px #0008; }
.empty-state { height: 100%; padding: 30px; display: grid; place-items: center; color: #91aabd; text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: white; font-size: 18px; }

@media (max-width: 1180px), (max-height: 700px) {
  .app-window { width: 100vw; height: 100vh; min-width: 0; min-height: 0; border-radius: 0; }
  .app-body { padding: 12px 18px 78px; }
  .commandbar { grid-template-columns: 130px 1fr auto 40px; padding-left: 18px; }
  .lower-deck { left: 18px; right: 18px; bottom: 10px; grid-template-columns: 1fr auto; }
  .relay-card, .presence-card { display: none; }
  .dock button { width: 92px; min-width: 92px; }
  .chat-screen { grid-template-columns: 210px 1fr; gap: 10px; }
  .online-panel { display: none; }
  .canvas-screen { grid-template-columns: 220px 1fr; }
  .canvas-activity { display: none; }
  .pins-screen { grid-template-columns: 150px 1fr; }
  .posts-screen { grid-template-columns: 1fr 210px; }
}
@media (max-width: 760px) {
  :root { font-size: 13px; }
  html, body { height: 100%; height: 100dvh; overflow: hidden; background: var(--app); }
  body { display: block; overscroll-behavior: none; }
  .ambient { display: none; }
  .app-window { width: 100%; height: 100vh; height: 100dvh; min-width: 0; min-height: 0; overflow: hidden; border-radius: 0; box-shadow: none; }
  .titlebar { display: none; }
  .app-body { height: 100%; min-height: 0; padding: max(7px, env(safe-area-inset-top)) 7px calc(66px + env(safe-area-inset-bottom)); display: grid; grid-template-rows: 59px minmax(0, 1fr); gap: 7px; }
  .commandbar { position: relative; z-index: 5; height: 59px; grid-template-columns: 44px minmax(0, 1fr) 40px; gap: 6px; padding: 6px; border-radius: 18px; }
  .brand-logo { width: 40px; height: 43px; }
  .global-search { height: 44px; min-width: 0; padding: 0 11px; gap: 8px; border-radius: 23px; }
  .global-search::after { left: 36px; right: 14px; }
  .global-search span { font-size: 19px; }
  .global-search input { min-width: 0; font-size: 16px; text-overflow: ellipsis; }
  .account-pill { width: 40px; height: 40px; padding: 5px; justify-content: center; border-radius: 15px; }
  .account-pill .avatar { width: 30px; height: 30px; }
  .account-pill > span:last-child, .round-btn { display: none; }
  .workspace { height: auto; min-height: 0; margin: 0; overflow: hidden; }
  .screen { height: 100%; min-height: 0; }
  .pins-screen, .chat-screen, .posts-screen, .canvas-screen, .profile-screen { grid-template-columns: 1fr; }
  .panel { border-radius: 20px; }
  .pins-sidebar, .chat-list, .online-panel, .trends, .canvas-activity, .profile-card { display: none; }

  .lower-deck { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; height: calc(62px + env(safe-area-inset-bottom)); display: block; padding-bottom: env(safe-area-inset-bottom); background: #07131ff2; border-top: 1px solid #315b7b; backdrop-filter: blur(14px); }
  .dock { width: 100%; height: 62px; padding: 6px 4px; justify-content: space-around; gap: 3px; border: 0; border-radius: 0; background: transparent; }
  .dock button { width: calc(20% - 3px); min-width: 0; height: 50px; padding: 5px 2px 4px; display: grid; place-items: center; align-content: center; gap: 2px; border-radius: 14px; font-size: 9px; line-height: 1; }
  .dock button .dock-icon { display: none; }
  .dock button::before { content: "•"; position: relative; z-index: 1; display: block; color: #9ebcd2; font-size: 16px; line-height: 14px; }
  .dock button[data-view="posts"]::before { content: "▤"; }
  .dock button[data-view="pins"]::before { content: "◆"; }
  .dock button[data-view="canvas"]::before { content: "▦"; }
  .dock button[data-view="profile"]::before { content: "●"; }
  .dock button.active::before { color: #f4fff7; }
  .dock button:last-child { display: none; }
  body:has(input:focus, textarea:focus) .lower-deck { transform: translateY(110%); }

  /* Mobile pins: category access plus readable two-column masonry. */
  .pins-main { grid-template-rows: 38px 43px 63px minmax(0, 1fr); border-radius: 20px; }
  .panel-header { height: 38px; padding: 0 12px; font-size: 11px; }
  .mobile-category-strip { padding: 6px 8px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; background: #0b1725; border-bottom: 1px solid #29465e; }
  .mobile-category-strip::-webkit-scrollbar { display: none; }
  .mobile-category { flex: 0 0 auto; height: 30px; padding: 0 12px; border: 1px solid #2c5572; border-radius: 15px; background: #0d1d2e; color: #abc5d7; font-size: 10px; font-weight: 700; }
  .mobile-category.active { border-color: #25dff4; background: #0b3c50; color: white; }
  .feed-toolbar { min-width: 0; padding: 7px 9px; gap: 6px; }
  .feed-toolbar > div:first-child { min-width: 0; }
  .feed-toolbar p { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .section-title { font-size: 14px; }
  .zoom-controls { gap: 4px; }
  .zoom-controls button, .zoom-controls span { min-width: 30px; height: 30px; padding: 0 7px; }
  #filterAll { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pin-grid { padding: 7px; overflow-x: hidden; scrollbar-gutter: auto; }
  .pin-columns { gap: 7px; }
  .pin-column { gap: 7px; }
  .pin-card { min-height: 76px; border-radius: 17px; }
  .pin-card:hover { transform: none; box-shadow: none; }
  .media-badge { right: 7px; bottom: 7px; padding: 4px 7px; font-size: 9px; }
  .feed-footer { display: none; }

  /* Mobile chat keeps every channel reachable without the desktop sidebar. */
  .chat-main { grid-template-rows: 63px 43px minmax(0, 1fr) 35px 58px; border-radius: 20px; }
  .chat-room-header { padding: 0 12px; }
  .chat-room-header h3 { font-size: 17px; }
  .chat-room-header .chip { min-height: 29px; padding: 0 10px; }
  .mobile-chat-nav { min-width: 0; padding: 6px 8px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid #29445c; background: #0b1725; }
  .mobile-chat-nav > div { min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .mobile-chat-nav > div::-webkit-scrollbar { display: none; }
  .mobile-conversation, .mobile-new-dm { flex: 0 0 auto; height: 30px; padding: 0 12px; border: 1px solid #2c5572; border-radius: 15px; background: #0d1d2e; color: #abc5d7; font-size: 10px; font-weight: 700; }
  .mobile-conversation.active { border-color: #25dff4; background: #0b3c50; color: white; }
  .mobile-new-dm { width: 32px; padding: 0; font-size: 17px; }
  .messages { padding: 10px; gap: 11px; }
  .message { grid-template-columns: 32px minmax(0, 1fr); gap: 8px; }
  .message .avatar { width: 31px; height: 31px; border-radius: 10px; }
  .message-head { min-width: 0; gap: 6px; }
  .message-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .message-head time { flex: none; }
  .message-bubble { max-width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 15px; }
  .message-bubble p { overflow-wrap: anywhere; font-size: 14px; line-height: 1.38; }
  .emoji-strip { padding: 3px 10px; }
  .chat-composer { padding: 7px 8px 8px; grid-template-columns: minmax(0, 1fr) 40px; }
  .chat-composer textarea { height: 42px; padding: 10px 13px; font-size: 16px; }

  /* Mobile posts uses the current feed and compact native controls. */
  .posts-main { grid-template-rows: auto minmax(0, 1fr); gap: 7px; }
  .posts-compose { padding: 10px; }
  .quick-post-row { grid-template-columns: 34px minmax(0, 1fr) 62px; gap: 8px; }
  .quick-post-row .avatar { width: 34px; height: 34px; border-radius: 11px; }
  .quick-post-row textarea { min-height: 38px; padding: 8px 0; font-size: 16px; }
  .quick-post-row .primary-action { min-width: 0; min-height: 36px; padding: 0 10px; }
  .compose-tools { margin: 6px 0 8px 42px; gap: 5px; }
  .compose-tools button { padding: 6px 8px; font-size: 10px; }
  .compose-tools small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
  .post-sort { padding-top: 8px; gap: 6px; }
  .post-sort button, .post-sort button.active { width: auto; height: 32px; flex: 1; border: 1px solid #2d5874; border-radius: 16px; background: #0a1929; color: #a8c2d4; font-size: 11px; font-weight: 700; }
  .post-sort button.active { border-color: #42df70; background: linear-gradient(135deg, #0e5e94, #26aa67); color: white; }
  .post-feed { padding: 7px; }
  .post-card { margin-bottom: 7px; padding: 11px; border-radius: 16px; contain-intrinsic-size: 430px 160px; }
  .post-body { margin: 9px 0; overflow-wrap: anywhere; }
  .post-actions { flex-wrap: wrap; gap: 5px; }
  .post-actions button { padding: 5px 9px; }

  /* Mobile canvas exposes palette and board controls instead of hiding them. */
  .canvas-screen { grid-template-rows: 80px minmax(0, 1fr); gap: 7px; }
  .canvas-tools { padding: 7px; display: grid; grid-template-rows: 34px 32px; gap: 5px; border-radius: 18px; }
  .canvas-tools > .eyebrow, .canvas-tools > h2, .canvas-tools > p, .canvas-tools > .selected-color, .canvas-tools > h4, .canvas-tools > .secondary-action { display: none; }
  .palette { margin: 0; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
  .palette::-webkit-scrollbar { display: none; }
  .swatch { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; }
  .canvas-view-buttons { margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
  .canvas-view-buttons button, .canvas-view-buttons span { min-height: 30px; padding: 0; border-radius: 9px; font-size: 9px; }
  .canvas-stage { padding: 11px; border-radius: 20px; }
  .canvas-heading { gap: 8px; }
  .canvas-heading h2 { font-size: 21px; }
  .canvas-heading p { margin-top: 3px; max-width: 52vw; font-size: 11px; }
  .canvas-heading > div:last-child { gap: 4px; flex-direction: column; }
  .canvas-heading .chip { min-height: 25px; padding: 0 8px; font-size: 9px; }
  .canvas-board-shell { margin-top: 9px; padding: 9px; border-radius: 18px; }
  .canvas-render-frame { min-width: 100%; }
  .canvas-stage footer { padding-top: 7px; gap: 8px; font-size: 9px; }

  /* Mobile profile scrolls inside its panel and keeps controls thumb-sized. */
  .profile-editor { padding: 18px 15px; overflow-y: auto; border-radius: 20px; }
  .profile-editor h2 { margin: 5px 0 14px; font-size: 25px; }
  .profile-editor form { gap: 11px; }
  .profile-editor input, .profile-editor textarea { min-height: 44px; padding: 10px 12px; font-size: 16px; }
  .profile-editor textarea { min-height: 84px; max-height: 130px; }
  .profile-editor .primary-action, .profile-editor .secondary-action { min-height: 44px; }

  /* Phone-sized dialogs account for dynamic browser chrome and keyboards. */
  .modal { max-width: calc(100vw - 20px); max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 20px; overflow: auto; }
  .auth-modal form, .composer-modal form, .install-modal form { width: calc(100vw - 22px); padding: 25px 20px 20px; gap: 11px; }
  .auth-modal img { width: 92px; max-height: 64px; object-fit: contain; }
  .auth-modal h2 { font-size: 22px; }
  .auth-modal input, .composer-modal input, .composer-modal textarea { min-height: 46px; font-size: 16px; }
  .auth-modal .primary-action, .auth-modal .secondary-action, .install-modal .primary-action, .install-modal .secondary-action { min-height: 46px; }
  .modal-close { width: 38px; height: 38px; }
  .pin-modal { width: calc(100vw - 16px); height: calc(100dvh - 24px); }
  .pin-modal[open] { display: grid; grid-template-rows: minmax(0, 65%) minmax(0, 35%); grid-template-columns: 1fr; }
  .pin-dialog-media { min-height: 0; }
  .pin-modal aside { min-height: 0; padding: 35px 18px 16px; }
  .toast-region { left: 10px; right: 10px; top: max(10px, env(safe-area-inset-top)); }
  .toast { text-align: center; }
}

@media (max-width: 420px) {
  .app-body { padding-left: 5px; padding-right: 5px; }
  .commandbar { grid-template-columns: 38px minmax(0, 1fr) 38px; }
  .brand-logo { width: 35px; }
  .feed-toolbar p { max-width: 39vw; }
  .zoom-controls { gap: 3px; }
  .zoom-controls button, .zoom-controls span { min-width: 28px; padding: 0 5px; }
  #filterAll { max-width: 61px; }
  .compose-tools small { display: none; }
  .compose-tools { margin-left: 42px; }
  .canvas-heading p, .canvas-stage footer span:last-child { display: none; }
}

@media (max-width: 760px) and (max-height: 620px) {
  .app-body { grid-template-rows: 52px minmax(0, 1fr); }
  .commandbar { height: 52px; }
  .global-search { height: 39px; }
  .brand-logo { height: 38px; }
  .canvas-screen { grid-template-rows: 72px minmax(0, 1fr); }
  .auth-modal form, .composer-modal form, .install-modal form { padding-top: 18px; gap: 8px; }
  .auth-modal img { width: 68px; max-height: 45px; }
}

@media (hover: none) {
  .category:hover, .conversation:hover, .dock button:hover, .pin-card:hover { transform: none; }
}
