:root {
  --ink: #11110f;
  --muted: #777771;
  --faint: #a5a59f;
  --line: #deded8;
  --line-strong: #c7c7c0;
  --paper: #fafaf8;
  --canvas: #efefec;
  --white: #fff;
  --soft: #ecece7;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.stage { min-height: 100vh; padding: 22px 22px 64px; }
.artboard {
  width: min(1540px, 100%);
  min-height: calc(100vh - 88px);
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid #d4d4ce;
  border-radius: 28px;
  box-shadow: 0 18px 60px rgba(18,18,15,.08), 0 3px 14px rgba(18,18,15,.05);
}
.prototype-nav {
  position: fixed; z-index: 100; left: 50%; bottom: 12px;
  display: flex; align-items: center; gap: 3px; padding: 5px;
  transform: translateX(-50%);
  background: rgba(17,17,15,.94); border-radius: 999px;
  box-shadow: 0 10px 32px rgba(0,0,0,.18);
}
.prototype-nav a {
  padding: 7px 11px; color: #c7c7c2; border-radius: 999px;
  font-size: 11px; white-space: nowrap;
}
.prototype-nav a:hover, .prototype-nav a.active { color: #111; background: #fff; }

.line-logo { width: 35px; height: 39px; display: block; flex: 0 0 35px; position: relative; }
.line-logo::before {
  content: ""; position: absolute; left: 9px; top: 1px; width: 17px; height: 30px;
  border: 2px solid var(--ink); border-bottom: 0; border-radius: 17px 17px 0 0;
}
.line-logo::after {
  content: ""; position: absolute; left: 2px; bottom: 3px; width: 18px; height: 12px;
  border-bottom: 2px solid var(--ink); border-radius: 0 0 18px 18px; transform: rotate(-10deg);
}
.line-logo i::before {
  content: ""; position: absolute; right: 1px; bottom: 4px; width: 18px; height: 13px;
  border-bottom: 2px solid var(--ink); border-radius: 0 0 18px 18px; transform: rotate(10deg);
}
.line-logo i::after {
  content: ""; position: absolute; left: 10px; bottom: 4px; width: 16px; height: 13px;
  border-top: 2px solid var(--ink); border-radius: 16px 16px 0 0;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { font-size: 22px; letter-spacing: -.04em; }

.icon-btn, .round-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: transparent; border-radius: 50%; transition: background .16s, transform .16s;
}
.icon-btn:hover, .round-btn:hover { background: #e9e9e5; transform: translateY(-1px); }
.icon-btn.dark { color: #fff; background: var(--ink); }
.icon-btn.dark:hover { background: var(--ink); }
.avatar {
  width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 48px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 50%;
  font-size: 17px; letter-spacing: -.03em;
}
.avatar.large {
  width: 108px;
  height: 108px;
  flex: 0 0 108px;
  aspect-ratio: 1;
  font-size: 32px;
}
.avatar.medium {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  aspect-ratio: 1;
  font-size: 24px;
}
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.badge {
  min-width: 19px; height: 19px; padding: 0 5px; display: inline-grid; place-items: center;
  color: #fff; background: var(--ink); border-radius: 20px; font-size: 10px; font-weight: 650;
}

/* Main messenger */
.messenger-grid { height: calc(100vh - 88px); min-height: 670px; display: grid; grid-template-columns: 76px 350px minmax(450px,1fr) 315px; }
.rail {
  padding: 22px 12px 17px; display: flex; flex-direction: column; align-items: center;
  background: #f7f7f4; border-right: 1px solid var(--line);
}
.rail .brand { justify-content: center; }
.rail nav, .rail-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail nav { margin-top: 48px; }
.rail-foot { margin-top: auto; }
.rail .nav-button {
  width: 44px; height: 44px; display: grid; place-items: center; color: #666660;
  background: transparent; border-radius: 14px;
}
.rail .nav-button:hover { color: var(--ink); background: #e8e8e4; }
.rail .nav-button.active { color: #fff; background: var(--ink); }
.mini-profile { position: relative; font-size: 11px; }
.mini-profile::after {
  content: ""; width: 9px; height: 9px; position: absolute; right: 0; bottom: 2px;
  background: var(--ink); border: 2px solid #f7f7f4; border-radius: 50%;
}
.chat-list-panel, .conversation, .details { min-width: 0; min-height: 0; }
.chat-list-panel { display: flex; flex-direction: column; background: #f9f9f7; border-right: 1px solid var(--line); }
.topbar { height: 76px; flex: 0 0 76px; padding: 0 18px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.list-head { justify-content: space-between; }
.head-actions { display: flex; align-items: center; gap: 5px; }
.searchbox {
  height: 50px; margin: 11px 12px 0; padding: 0 13px; display: none; align-items: center; gap: 9px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 15px;
}
.searchbox.open { display: flex; }
.searchbox input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 13px; }
.searchbox kbd { padding: 3px 5px; color: var(--muted); background: #eee; border-radius: 5px; font-size: 9px; }
.tabs { min-height: 52px; padding: 0 13px; display: flex; align-items: flex-end; gap: 16px; border-bottom: 1px solid var(--line); }
.tab { height: 42px; position: relative; color: var(--muted); background: transparent; font-size: 12px; }
.tab.active { color: var(--ink); font-weight: 650; }
.tab.active::after { content: ""; height: 2px; position: absolute; right: 0; bottom: 0; left: 0; background: var(--ink); }
.tab.filter { width: 32px; margin-left: auto; display: grid; place-items: center; }
.chat-list { min-height: 0; flex: 1; overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.chat-row {
  width: 100%; min-height: 74px; padding: 10px 9px; display: grid;
  grid-template-columns: 48px 1fr auto; align-items: center; gap: 11px; position: relative;
  background: transparent; border-radius: 15px; text-align: left;
}
.chat-row:hover { background: #efefeb; }
.chat-row.active { background: #e7e7e2; }
.chat-row.active::before { content: ""; width: 3px; height: 26px; position: absolute; left: 0; top: calc(50% - 13px); background: var(--ink); border-radius: 5px; }
.chat-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.chat-name, .chat-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-name { font-size: 14px; font-weight: 650; }
.chat-preview, .chat-time { color: var(--muted); font-size: 12px; }
.chat-meta { height: 44px; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.chat-signals { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.conversation { display: flex; flex-direction: column; background: #f4f4f1; }
.chat-head { gap: 11px; background: #fafaf8; }
.contact { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.contact strong { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.contact small { color: var(--muted); font-size: 11px; }
.chat-actions { margin-left: auto; display: flex; gap: 3px; }
.messages { min-height: 0; flex: 1; overflow-y: auto; padding: 18px clamp(22px,5vw,70px) 28px; scrollbar-width: thin; }
.secure, .date {
  width: max-content; margin-right: auto; margin-left: auto; padding: 6px 10px;
  color: var(--muted); background: #eaeae6; border: 1px solid var(--line); border-radius: 999px; font-size: 10px;
}
.secure { display: flex; align-items: center; gap: 5px; }
.date { margin-top: 12px; margin-bottom: 22px; padding: 7px 13px; }
.message-line { margin: 8px 0; display: flex; }
.message-line.own { justify-content: flex-end; }
.bubble {
  max-width: min(76%,520px); padding: 11px 13px 9px; position: relative;
  background: #fff; border: 1px solid #d8d8d2; border-radius: 17px 17px 17px 5px;
}
.own .bubble { background: #e3e3de; border-radius: 17px 17px 5px 17px; }
.bubble p { margin: 0; padding-right: 46px; font-size: 14px; line-height: 1.42; }
.message-time { position: absolute; right: 9px; bottom: 7px; display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 9px; }
.file-bubble { width: min(300px,82%); min-height: 86px; padding: 12px 48px 12px 62px; display: flex; flex-direction: column; gap: 3px; }
.file-icon { width: 42px; height: 52px; position: absolute; left: 11px; top: 12px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 9px; }
.file-bubble strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-bubble small { color: var(--muted); font-size: 10px; }
.file-bubble button { width: max-content; padding: 4px 0 0; display: flex; align-items: center; gap: 5px; background: transparent; font-size: 10px; }
.composer {
  min-height: 66px; margin: 0 17px 17px; padding: 8px 8px 8px 12px; display: flex; align-items: flex-end; gap: 6px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: 0 8px 30px rgba(18,18,15,.04);
}
.composer textarea { min-width: 0; min-height: 38px; max-height: 86px; flex: 1; padding: 9px 3px 5px; resize: none; border: 0; outline: 0; background: transparent; font-size: 13px; }
.send { width: 38px; height: 38px; display: grid; place-items: center; color: #888; background: #e7e7e3; border-radius: 50%; }
.send.ready { color: #fff; background: var(--ink); }
.details { display: flex; flex-direction: column; overflow-y: auto; background: #fbfbf9; }
.details-head { justify-content: space-between; }
.details-profile { padding: 23px 18px 19px; display: flex; flex-direction: column; align-items: center; border-bottom: 1px solid var(--line); text-align: center; }
.details-profile h2 { margin: 13px 0 3px; font-size: 20px; }
.details-profile p { margin: 0; color: var(--muted); font-size: 12px; }
.online { margin-top: 8px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.online::before { content: ""; width: 6px; height: 6px; background: var(--ink); border-radius: 50%; }
.profile-actions { width: 100%; margin-top: 20px; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.profile-actions > button,
.profile-actions > a {
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}
.profile-actions > button span,
.profile-actions > a span {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.profile-actions > button:hover span,
.profile-actions > a:hover span { background: var(--soft); }
.detail-list { border-bottom: 1px solid var(--line); }
.detail-row { width: 100%; min-height: 56px; padding: 12px 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: transparent; border-bottom: 1px solid #e7e7e3; text-align: left; }
.detail-row:hover { background: #f0f0ec; }
.detail-row > span { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600; }
.detail-row small { color: var(--muted); font-size: 10px; }
.media-box { padding: 17px; }
.section-head { display: flex; align-items: center; justify-content: space-between; }
.section-head strong { font-size: 12px; }
.section-head a { color: var(--muted); font-size: 10px; }
.media-grid { margin-top: 10px; display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.media-grid span { aspect-ratio: 1; display: grid; place-items: center; color: var(--muted); background: #ecece8; border: 1px solid var(--line); border-radius: 10px; }

/* Shared page layouts */
.web-page { min-height: calc(100vh - 88px); display: grid; grid-template-columns: 76px minmax(0,1fr); }
.page-rail { min-height: 100%; }
.page-main { min-width: 0; display: flex; flex-direction: column; }
.page-header { height: 78px; padding: 0 30px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.page-header h1 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.page-header .spacer { flex: 1; }
.content-wrap { width: min(1120px,100%); margin: 0 auto; padding: 34px clamp(24px,5vw,64px) 48px; }
.two-column { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 26px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.card-title { margin: 0 0 15px; font-size: 13px; font-weight: 650; }
.primary-btn, .secondary-btn {
  min-height: 48px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 14px; font-weight: 600;
}
.primary-btn { color: #fff; background: var(--ink); }
.secondary-btn { background: transparent; border: 1px solid var(--ink); }

/* Call */
.call-page { height: calc(100vh - 88px); min-height: 670px; display: grid; grid-template-columns: 76px 1fr; }
.call-space { display: flex; flex-direction: column; position: relative; background: #f8f8f6; }
.call-top { height: 76px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.call-title { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.call-title strong { font-size: 16px; }
.call-title span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.call-title span::before { content: ""; width: 5px; height: 5px; background: var(--ink); border-radius: 50%; }
.call-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.call-avatar { width: 180px; height: 180px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line-strong); border-radius: 50%; box-shadow: 0 28px 70px rgba(0,0,0,.08); font-size: 58px; }
.call-center h2 { margin: 24px 0 5px; font-size: 28px; }
.call-center p { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.call-controls { margin: 0 auto 42px; display: flex; align-items: flex-start; justify-content: center; gap: 22px; }
.call-control { width: 78px; display: flex; flex-direction: column; align-items: center; gap: 8px; background: transparent; font-size: 10px; }
.call-control span { width: 58px; height: 58px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line-strong); border-radius: 50%; }
.call-control.end span { color: #fff; background: var(--ink); border-color: var(--ink); }

/* Settings */
.settings-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 26px; }
.settings-list { overflow: hidden; }
.setting-row { width: 100%; min-height: 82px; padding: 16px 20px; display: grid; grid-template-columns: 46px 1fr 20px; align-items: center; gap: 15px; background: #fff; border-bottom: 1px solid var(--line); text-align: left; }
.setting-row:last-child { border-bottom: 0; }
.setting-row:hover { background: #f3f3f0; }
.setting-icon { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.setting-copy { display: flex; flex-direction: column; gap: 4px; }
.setting-copy strong { font-size: 15px; }
.setting-copy span { color: var(--muted); font-size: 12px; }
.account-summary { padding: 25px; text-align: center; }
.account-summary .avatar { margin: 0 auto; }
.account-summary h2 { margin: 15px 0 3px; font-size: 19px; }
.account-summary p { margin: 0; color: var(--muted); font-size: 12px; }
.storage { margin-top: 20px; text-align: left; }
.storage-line { height: 6px; margin: 8px 0 7px; overflow: hidden; background: #e7e7e2; border-radius: 999px; }
.storage-line span { width: 41%; height: 100%; display: block; background: var(--ink); border-radius: 999px; }

/* Profile */
.profile-layout { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 26px; }
.profile-hero { padding: 32px; display: flex; gap: 25px; align-items: center; }
.profile-hero h2 { margin: 0 0 3px; font-size: 28px; }
.profile-hero .handle { margin: 0 0 15px; color: var(--muted); }
.profile-hero .bio { margin: 0; color: #555550; line-height: 1.5; }
.profile-menu { margin-top: 20px; overflow: hidden; }
.profile-menu .setting-row { min-height: 66px; grid-template-columns: 30px 1fr 20px; }
.status-card { padding: 25px; }
.status-card h3 { margin: 0 0 16px; font-size: 14px; }
.status-option { width: 100%; padding: 12px 0; display: flex; align-items: center; gap: 12px; background: transparent; border-bottom: 1px solid var(--line); text-align: left; }
.status-option:last-child { border-bottom: 0; }
.status-dot { width: 12px; height: 12px; border: 1px solid var(--ink); border-radius: 50%; }
.status-option.active .status-dot { background: var(--ink); box-shadow: inset 0 0 0 3px #fff; }

/* Forms */
.form-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 28px; }
.form-card { padding: 28px; }
.cover-upload { width: 120px; height: 120px; margin-bottom: 24px; display: grid; place-items: center; position: relative; background: #f8f8f5; border: 1px dashed #aaa; border-radius: 50%; }
.cover-upload b { width: 34px; height: 34px; position: absolute; right: 0; bottom: 5px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 21px; font-weight: 400; }
.field { margin-bottom: 17px; }
.field label, .form-section-title { margin-bottom: 8px; display: block; font-size: 12px; font-weight: 650; }
.input, .textarea {
  width: 100%; padding: 0 15px; background: transparent; border: 1px solid var(--line-strong); border-radius: 14px; outline: 0;
}
.input { height: 52px; }
.textarea { min-height: 110px; padding-top: 14px; resize: vertical; }
.radio-card { min-height: 78px; margin-bottom: 10px; padding: 15px; display: grid; grid-template-columns: 20px 36px 1fr; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 15px; cursor: pointer; }
.radio-card input { width: 18px; height: 18px; accent-color: var(--ink); }
.radio-card strong { display: block; font-size: 14px; }
.radio-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.form-submit { width: 100%; margin-top: 18px; }
.preview-card { padding: 24px; position: sticky; top: 24px; }
.preview-card h3 { margin: 0 0 18px; font-size: 13px; }
.preview-window { padding: 24px; background: #f4f4f1; border: 1px solid var(--line); border-radius: 18px; text-align: center; }
.preview-window .avatar { margin: 0 auto 14px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 6px 9px 6px 6px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; }
.chip span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.person-list { margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; }
.person { min-height: 64px; padding: 10px 13px; display: grid; grid-template-columns: 42px 1fr 32px; align-items: center; gap: 11px; background: #fff; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .avatar { width: 42px; height: 42px; flex-basis: 42px; font-size: 14px; }
.person strong { display: block; font-size: 13px; }
.person small { color: var(--muted); font-size: 10px; }
.select-person { width: 30px; height: 30px; display: grid; place-items: center; background: transparent; border: 1px solid var(--ink); border-radius: 50%; }
.select-person.selected { color: #fff; background: var(--ink); }

/* Auth */
.auth-board { min-height: calc(100vh - 88px); display: grid; grid-template-columns: minmax(400px,1fr) minmax(460px,600px); }
.auth-story { padding: clamp(40px,7vw,100px); display: flex; flex-direction: column; justify-content: space-between; background: #11110f; color: #fff; }
.auth-story .line-logo::before, .auth-story .line-logo::after, .auth-story .line-logo i::before, .auth-story .line-logo i::after { border-color: #fff; }
.auth-story h1 { max-width: 620px; margin: 0; font-size: clamp(46px,6vw,86px); line-height: .98; letter-spacing: -.06em; }
.auth-story p { max-width: 480px; color: #aaa; font-size: 16px; line-height: 1.55; }
.auth-form-wrap { padding: 48px clamp(36px,6vw,76px); display: flex; flex-direction: column; justify-content: center; background: #fafaf8; }
.auth-form { width: min(420px,100%); margin: 0 auto; }
.auth-form h2 { margin: 0 0 8px; font-size: 32px; }
.auth-form > p { margin: 0 0 30px; color: var(--muted); }
.auth-form .input { height: 58px; background: #fff; }
.auth-form .primary-btn, .auth-form .secondary-btn { width: 100%; min-height: 54px; margin-top: 10px; }
.text-link { width: 100%; margin: 3px 0 14px; padding: 8px; background: transparent; text-decoration: underline dotted; text-underline-offset: 5px; }
.auth-note { margin-top: 42px; text-align: center; color: var(--muted); font-size: 11px; }

/* Components */
.components-board { padding: 42px; }
.components-head { padding-bottom: 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.components-title { display: flex; align-items: center; gap: 20px; }
.logo-tile { width: 92px; height: 92px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 8px 25px rgba(0,0,0,.07); }
.logo-tile .line-logo { transform: scale(1.6); }
.components-title h1 { margin: 0 0 5px; font-size: 42px; }
.components-title p { margin: 0; color: var(--muted); }
.logo-note { max-width: 330px; display: flex; align-items: center; gap: 18px; }
.logo-note .line-logo { transform: scale(1.5); margin: 10px 20px; }
.logo-note p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.icon-library { padding: 35px 0; display: grid; grid-template-columns: repeat(6,1fr); gap: 28px 20px; border-bottom: 1px solid var(--line); }
.icon-sample { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; font-size: 12px; }
.icon-sample span { width: 62px; height: 62px; display: grid; place-items: center; }
.tokens { padding-top: 30px; display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.token-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.token-card strong { display: block; margin-bottom: 8px; }
.token-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* Gallery */
.gallery-board { padding: 42px; }
.gallery-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.gallery-head h1 { max-width: 760px; margin: 18px 0 8px; font-size: clamp(42px,6vw,76px); line-height: 1; letter-spacing: -.06em; }
.gallery-head p { max-width: 620px; margin: 0; color: var(--muted); line-height: 1.55; }
.gallery-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.gallery-grid { margin-top: 42px; display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.gallery-card { min-height: 230px; padding: 22px; display: flex; flex-direction: column; position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 20px; transition: transform .18s, box-shadow .18s; }
.gallery-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0,0,0,.08); }
.gallery-card .num { color: var(--muted); font-size: 10px; }
.gallery-card h2 { margin: auto 0 5px; font-size: 22px; }
.gallery-card p { margin: 0; color: var(--muted); font-size: 12px; }
.gallery-card .arrow { width: 42px; height: 42px; position: absolute; right: 18px; top: 18px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.gallery-card.dark { color: #fff; background: var(--ink); border-color: var(--ink); }
.gallery-card.dark p, .gallery-card.dark .num { color: #aaa; }
.gallery-card.dark .arrow { border-color: #555; }

.toast { max-width: min(360px,calc(100vw - 32px)); padding: 12px 15px; position: fixed; z-index: 200; right: 24px; bottom: 24px; display: none; align-items: center; gap: 8px; color: #fff; background: var(--ink); border-radius: 13px; box-shadow: 0 14px 38px rgba(0,0,0,.2); font-size: 12px; }
.toast.show { display: flex; animation: toast .2s ease both; }
@keyframes toast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1280px) {
  .messenger-grid { grid-template-columns: 76px 340px minmax(430px,1fr); }
  .details { display: none; }
  .icon-library { grid-template-columns: repeat(5,1fr); }
}
@media (max-width: 920px) {
  .stage { padding: 12px 12px 62px; }
  .artboard { min-height: calc(100vh - 74px); border-radius: 22px; }
  .messenger-grid { height: calc(100vh - 74px); grid-template-columns: 330px minmax(380px,1fr); }
  .messenger-grid > .rail { display: none; }
  .messages { padding-right: 25px; padding-left: 25px; }
  .web-page, .call-page { min-height: calc(100vh - 74px); grid-template-columns: 1fr; }
  .page-rail, .call-page > .rail { display: none; }
  .two-column, .settings-grid, .profile-layout, .form-layout { grid-template-columns: 1fr; }
  .preview-card { position: static; }
  .auth-board { grid-template-columns: 1fr; }
  .auth-story { min-height: 370px; }
  .gallery-grid { grid-template-columns: repeat(2,1fr); }
  .icon-library { grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 680px) {
  .stage { padding: 0 0 58px; }
  .artboard { min-height: calc(100dvh - 58px); border: 0; border-radius: 0; box-shadow: none; }
  .prototype-nav { max-width: calc(100vw - 16px); overflow-x: auto; justify-content: flex-start; }
  .messenger-grid { height: calc(100dvh - 58px); min-height: 520px; display: block; }
  .messenger-grid .chat-list-panel { height: 100%; }
  .messenger-grid .conversation { display: none; height: 100%; }
  .messenger-grid.chat-open .chat-list-panel { display: none; }
  .messenger-grid.chat-open .conversation { display: flex; }
  .chat-head .mobile-back { display: grid !important; }
  .chat-actions .hide-mobile { display: none; }
  .messages { padding: 14px 13px 20px; }
  .bubble { max-width: 89%; }
  .page-header { padding: 0 18px; }
  .page-header h1 { font-size: 20px; }
  .content-wrap { padding: 22px 15px 35px; }
  .profile-hero { padding: 24px; flex-direction: column; text-align: center; }
  .form-card { padding: 20px; }
  .call-page { height: calc(100dvh - 58px); }
  .call-avatar { width: 138px; height: 138px; font-size: 44px; }
  .call-controls { gap: 5px; }
  .call-control { width: 72px; }
  .auth-board { min-height: calc(100dvh - 58px); }
  .auth-story { min-height: 300px; padding: 32px 25px; }
  .auth-story h1 { font-size: 48px; }
  .auth-form-wrap { padding: 36px 24px; }
  .components-board, .gallery-board { padding: 26px 18px; }
  .components-head, .gallery-head { align-items: flex-start; flex-direction: column; }
  .logo-note { display: none; }
  .icon-library { grid-template-columns: repeat(3,1fr); gap: 22px 8px; }
  .tokens, .gallery-grid { grid-template-columns: 1fr; }
  .gallery-card { min-height: 180px; }
}
@media (min-width: 681px) { .mobile-back { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; scroll-behavior:auto!important; } }
/* CSP-safe icon sizing; templates do not use inline style attributes. */
.icon-12 { width: 12px; height: 12px; }
.icon-13 { width: 13px; height: 13px; }
.icon-14 { width: 14px; height: 14px; }
.icon-16 { width: 16px; height: 16px; }
.icon-17 { width: 17px; height: 17px; }
.icon-18 { width: 18px; height: 18px; }
.icon-19 { width: 19px; height: 19px; }
.icon-20 { width: 20px; height: 20px; }
