:root {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar: #f7f7f8;
  --sidebar-hover: #eeeeef;
  --text: #111111;
  --muted: #6f6f6f;
  --subtle: #9b9b9b;
  --line: #e7e7e7;
  --line-strong: #d9d9d9;
  --field: #ffffff;
  --chip: #f4f4f4;
  --primary: #111111;
  --primary-text: #ffffff;
  --danger: #d04437;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.10);
  --soft-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
  --radius: 8px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

html {
  font-size: 16px;
}

body {
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  display: none;
}

.app-body {
  overflow: auto;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(14rem, 18.75rem) minmax(0, 1fr);
  min-height: 100dvh;
  height: auto;
  align-items: stretch;
  overflow: visible;
}

.app-shell,
.workspace {
  min-height: 0;
}

.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.brand-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 4px 10px;
}

.brand-block strong {
  font-size: 23px;
  line-height: 1;
  letter-spacing: 0;
}

.panel-button,
.icon-button,
.send-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
}

.panel-button {
  width: 36px;
  height: 36px;
  color: var(--muted);
  border-radius: 8px;
}

.panel-button:hover {
  background: var(--sidebar-hover);
}

.sidebar-actions {
  display: grid;
  gap: 8px;
}

.side-button,
.logout-button,
.upload-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 14px;
}

.side-button:hover,
.side-button.is-active,
.logout-button:hover,
.upload-strip:hover {
  background: var(--sidebar-hover);
}

.contact-line {
  margin: -10px 12px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.quick-zone {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.section-head {
  padding: 8px 2px 2px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.quick-cards {
  display: grid;
  gap: 8px;
}

.quick-card {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
}

.quick-card:hover {
  background: var(--sidebar-hover);
}

.quick-card.is-active {
  background: #ffffff;
  border-color: var(--line-strong);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.quick-card strong,
.history-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 650;
}

.quick-card span,
.history-item time {
  color: var(--muted);
  font-size: 12px;
}

.quick-upload {
  display: grid;
  gap: 9px;
  padding-top: 2px;
}

.quick-upload textarea,
.composer textarea,
.auth-form input {
  width: 100%;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line-strong);
  outline: none;
}

.quick-upload textarea {
  min-height: 76px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 14px;
}

.quick-upload textarea:focus,
.composer textarea:focus,
.auth-form input:focus {
  border-color: #bcbcbc;
}

.primary-button {
  min-height: 42px;
  color: var(--primary-text);
  font-weight: 650;
  background: var(--primary);
  border: 0;
  border-radius: 999px;
}

.primary-button:hover {
  background: #252525;
}

.primary-button:disabled,
.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.logout-button {
  margin-top: auto;
  color: var(--muted);
}

.workspace {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 100dvh;
  overflow: visible;
  background: var(--bg);
}

.workspace-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  min-height: 3.5rem;
  padding: 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.session-state,
.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
  flex-wrap: wrap;
  font-weight: 650;
}

.top-chip {
  flex: 0 0 auto;
  min-height: 2.15rem;
  padding: 0 0.85rem;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.top-chip:hover,
.top-chip.is-active {
  background: var(--chip);
}

#sessionLabel,
#usernameLabel,
#balanceLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-info-panel {
  display: none;
  padding: 0 2rem 1.75rem;
}

.top-info-panel.is-open {
  display: block;
}

.info-card {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 0.85rem 1rem;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  box-shadow: var(--soft-shadow);
}

.info-card p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.65;
}

.announcement-card {
  display: grid;
  gap: 0.75rem;
}

.announcement-list {
  display: grid;
  gap: 0.45rem;
}

.announcement-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.7rem;
  text-align: left;
  color: var(--text);
  background: var(--chip);
  border: 1px solid transparent;
  border-radius: 0.65rem;
}

.announcement-title.is-active {
  background: #ffffff;
  border-color: var(--line-strong);
}

.announcement-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-title time {
  flex: none;
  color: var(--muted);
  font-size: 0.82rem;
}

.announcement-body {
  padding: 0.8rem;
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--text);
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.messages {
  min-height: 0;
  overflow-y: auto;
  padding: 3.5rem 2rem 3.375rem;
  scroll-behavior: smooth;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 100%;
  gap: 14px;
  text-align: center;
}

.empty-brand {
  margin: 0;
  color: var(--text);
  font-size: 3rem;
  line-height: 1.12;
  font-weight: 650;
}

.empty-state h1 {
  margin: 0;
  font-size: 3rem;
  line-height: 1.12;
  font-weight: 650;
  letter-spacing: 0;
}

.empty-art {
  display: none;
}

.message {
  display: flex;
  margin: 0 auto 22px;
  max-width: 880px;
}

.message.user {
  justify-content: flex-end;
}

.message.ai {
  justify-content: flex-start;
}

.bubble {
  max-width: min(760px, 100%);
  padding: 13px 16px;
  background: #f4f4f4;
  border-radius: 20px;
}

.message.ai .bubble {
  background: transparent;
  border-radius: 0;
  padding-left: 0;
}

.bubble-text {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble-text:empty {
  display: none;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  width: min(760px, 100%);
  min-width: 0;
}

.image-card {
  position: relative;
  margin: 0;
}

.image-grid img {
  width: 100%;
  height: auto;
  max-height: 80dvh;
  object-fit: contain;
  background: #f2f2f2;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.download-button {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  min-height: 2rem;
  padding: 0 0.8rem;
  color: #ffffff;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.68);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.download-button:hover {
  background: rgba(0, 0, 0, 0.82);
}

.composer {
  padding: 8.5rem 2rem 1.875rem;
}

.composer-row {
  display: grid;
  grid-template-columns: 44px 1fr 50px;
  align-items: center;
  gap: 8px;
  width: min(900px, 100%);
  min-height: 70px;
  margin: 0 auto;
  padding: 9px 10px 9px 12px;
  background: #ffffff;
  border: 1px solid #d7d7d7;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.composer textarea {
  min-height: 40px;
  max-height: 160px;
  resize: none;
  padding: 9px 6px;
  line-height: 1.45;
  border: 0;
  color: var(--text);
}

.composer textarea::placeholder,
.quick-upload textarea::placeholder,
.auth-form input::placeholder {
  color: var(--subtle);
}

.icon-button,
.send-button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
}

.icon-button {
  color: var(--text);
}

.icon-button:hover {
  background: var(--chip);
}

.send-button {
  color: #ffffff;
  background: #111111;
}

.send-button:hover {
  background: #2a2a2a;
}

.send-button.is-processing {
  background: var(--danger);
}

.send-button.is-processing:hover {
  background: #b8392f;
}

.icon-button.small {
  width: 38px;
  height: 38px;
}

.upload-preview,
.mini-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-preview {
  width: min(900px, 100%);
  margin: 0 auto 10px;
}

.workspace .quick-zone {
  flex: none;
  display: grid;
  gap: 0.85rem;
  min-height: 0;
  padding: 0 2rem 1.5rem;
  overflow: visible;
}

.inspiration-text {
  width: min(72rem, 100%);
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

.workspace .quick-cards {
  width: min(58rem, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  align-items: start;
  gap: 0.85rem;
  margin: 0 auto;
}

.workspace .quick-card {
  position: relative;
  display: block;
  min-height: 0;
  height: auto;
  padding: 0;
  overflow: hidden;
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.42);
  background: #111111;
  border: 2px solid transparent;
  border-radius: 1.1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.workspace .quick-card-media {
  display: block;
  width: 100%;
  background: linear-gradient(145deg, #f4f4f4, #dcdcdc);
}

.workspace .quick-card:not(.has-image) .quick-card-media {
  aspect-ratio: 16 / 9;
}

.workspace .quick-card-image {
  display: block;
  width: 100%;
  height: auto;
}

.workspace .quick-card-shade {
  position: absolute;
  inset: auto 0 0;
  height: 55%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.62));
  pointer-events: none;
}

.workspace .quick-card:hover {
  transform: translateY(-1px);
  background-color: #f3f3f3;
  box-shadow: var(--soft-shadow);
}

.workspace .quick-card.is-active {
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08), var(--soft-shadow);
}

.workspace .quick-card strong {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 1;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 1.18rem;
  line-height: 1.08;
  font-weight: 760;
}

.workspace .quick-upload {
  width: min(72rem, 100%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 auto;
  padding: 0;
}

.workspace .upload-strip {
  width: auto;
  min-height: 2.75rem;
  padding: 0 1rem;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.workspace .quick-upload .primary-button {
  min-width: 7rem;
  padding: 0 1.25rem;
}

.workspace .mini-preview {
  flex: 1;
  min-width: 0;
}

.preview-chip {
  position: relative;
  width: 70px;
  height: 70px;
  overflow: hidden;
  background: #f3f3f3;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.mini-preview .preview-chip {
  width: 54px;
  height: 54px;
  border-radius: 12px;
}

.preview-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-chip button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.64);
  border: 0;
  border-radius: 999px;
}

.drawer {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.18);
  z-index: 20;
}

.drawer.is-open {
  display: flex;
}

.quick-dialog {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.18);
  z-index: 24;
}

.quick-dialog.is-open {
  display: grid;
}

.quick-dialog-panel {
  width: min(28rem, 100%);
  display: grid;
  gap: 0.9rem;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  box-shadow: var(--shadow);
}

.quick-dialog-tip {
  margin: 0;
  color: var(--muted);
}

.quick-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.3rem;
  background: var(--chip);
  border-radius: 999px;
}

.quick-mode-tabs button {
  min-height: 2.35rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
}

.quick-mode-tabs button.is-active {
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.quick-mode-panel {
  display: grid;
  gap: 0.75rem;
}

.quick-mode-panel[hidden] {
  display: none;
}

.quick-theme-input {
  width: 100%;
  min-height: 6.5rem;
  resize: vertical;
  padding: 0.8rem 0.9rem;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 0.9rem;
  outline: none;
  line-height: 1.55;
}

.quick-dialog .upload-strip {
  justify-content: center;
  background: var(--chip);
}

.quick-dialog .primary-button {
  width: 100%;
}

.recharge-panel {
  gap: 1rem;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.amount-grid button {
  min-height: 3rem;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 0.85rem;
}

.amount-grid button:hover,
.amount-grid button.is-active {
  background: var(--chip);
  border-color: var(--text);
}

.custom-amount {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.custom-amount input {
  min-height: 2.75rem;
  padding: 0 0.85rem;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 0.85rem;
  outline: none;
}

.drawer-panel {
  width: min(420px, 100vw);
  height: 100%;
  padding: 20px;
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  width: 100%;
  padding: 13px 12px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
}

.history-item:hover {
  background: var(--sidebar-hover);
}

.waiting-bubble {
  min-width: min(420px, 72vw);
}

.waiting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pause-button,
.retry-actions button {
  min-height: 2rem;
  padding: 0 0.8rem;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.pause-button:hover,
.retry-actions button:hover {
  background: var(--chip);
}

.retry-actions {
  margin-top: 0.65rem;
}

.loader-strip {
  display: flex;
  gap: 6px;
  height: 28px;
  align-items: center;
  margin-bottom: 8px;
}

.loader-tile {
  width: 8px;
  height: 8px;
  background: #111111;
  border-radius: 999px;
  animation: pulse 1.05s ease-in-out infinite;
}

.loader-tile:nth-child(2) {
  animation-delay: 0.16s;
}

.loader-tile:nth-child(3) {
  animation-delay: 0.32s;
}

.waiting-text {
  margin: 0;
  color: var(--muted);
}

@keyframes pulse {
  0%, 80%, 100% {
    opacity: 0.26;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.auth-body {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: auto;
  background: #ffffff;
}

.auth-shell {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 42px;
  align-items: center;
}

.single-auth-shell {
  width: min(440px, 100%);
  grid-template-columns: 1fr;
  gap: 0;
}

.auth-art {
  display: grid;
  gap: 16px;
}

.brand-kicker {
  width: fit-content;
  padding: 6px 10px;
  color: var(--muted);
  background: var(--chip);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
}

.auth-art h1 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: 0;
}

.auth-art p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.auth-panel {
  display: grid;
  gap: 20px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--soft-shadow);
}

.auth-panel-title {
  margin: 0 0 4px;
  text-align: center;
  white-space: nowrap;
  font-size: clamp(24px, 6vw, 40px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--chip);
  border-radius: 999px;
}

.auth-tab {
  min-height: 40px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
}

.auth-tab.is-active {
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.auth-form input {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
}

.auth-submit {
  margin-top: 6px;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
}

.auth-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.admin-body {
  min-height: 100%;
  color: var(--text);
  background: #ffffff;
}

.admin-top {
  height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}

.admin-top div {
  display: grid;
  gap: 0.2rem;
}

.admin-top strong {
  font-size: 1.1rem;
}

.admin-top span,
.admin-empty {
  color: var(--muted);
}

.admin-top nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-top a,
.admin-top button,
.admin-panel-head button,
.admin-card-actions button {
  min-height: 2.35rem;
  padding: 0 0.85rem;
  color: var(--text);
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.admin-top a,
.admin-top button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.35rem;
  line-height: 1;
}

.admin-top a:hover,
.admin-top button:hover,
.admin-panel-head button:hover,
.admin-card-actions button:hover {
  background: var(--chip);
}

.admin-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2vw, 1.35rem);
  padding: clamp(1rem, 4vw, 3rem);
}

.admin-section {
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.admin-section summary {
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  padding: 0 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-section-body {
  padding: 0 1.1rem 1.1rem;
}

.card-admin-grid,
.announcement-admin-grid {
  display: grid;
  grid-template-columns: minmax(20rem, 28rem) minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}

.admin-panel {
  min-width: 0;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: var(--soft-shadow);
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-form {
  display: grid;
  gap: 1rem;
}

.card-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-form input,
.card-form textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.75rem 0.85rem;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 0.85rem;
  outline: none;
}

.card-form textarea {
  resize: vertical;
  line-height: 1.55;
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
}

.admin-form-row.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-check {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 2.75rem;
}

.admin-check input {
  width: auto;
  min-height: 0;
}

.admin-bg-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.admin-card-list {
  display: grid;
  gap: 0.9rem;
}

.admin-card-item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.admin-card-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  color: var(--muted);
  background: var(--chip);
  border-radius: 0.85rem;
}

.admin-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-card-meta {
  min-width: 0;
}

.admin-card-meta strong,
.admin-card-meta span,
.admin-card-meta p {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-meta span,
.admin-card-meta p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-actions-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-actions-row .primary-button {
  min-width: 8rem;
  padding: 0 1rem;
}

.secondary-action {
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
}

.secondary-action:hover {
  background: var(--chip);
}

.announcement-admin-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 18;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    max-height: none;
    overflow: visible;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-block {
    min-height: 0;
    padding: 0;
  }

  .panel-button {
    display: none;
  }

  .sidebar-actions {
    display: flex;
    gap: 0.5rem;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-actions::-webkit-scrollbar {
    display: none;
  }

  .side-button,
  .logout-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 2.5rem;
    border-radius: 999px;
    white-space: nowrap;
  }

  .logout-button {
    margin-top: 0;
  }

  .contact-line {
    grid-column: 1 / -1;
    margin: -0.2rem 0 0;
  }

  .workspace {
    min-height: 60vh;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 760px) {
  .workspace {
    grid-template-rows: auto auto minmax(14rem, 1fr) auto auto;
  }

  .workspace-top {
    min-height: 2.8rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }

  .messages {
    padding-top: 1.8rem;
    padding-bottom: 1.6rem;
  }

  .empty-state {
    gap: 0.45rem;
  }

  .empty-state h1 {
    font-size: 2.35rem;
  }

  .workspace .quick-zone {
    gap: 0.55rem;
    padding-bottom: 0.45rem;
  }

  .workspace .quick-card {
    min-height: 0;
  }

  .composer {
    padding-top: 5rem;
    padding-bottom: 0.8rem;
  }

  .composer-row {
    min-height: 3.8rem;
  }
}

@media (max-width: 620px) {
  .app-shell {
    min-height: 100vh;
  }

  .sidebar {
    grid-template-columns: 1fr auto;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
  }

  .brand-block strong {
    font-size: 1.25rem;
  }

  .sidebar-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 3;
  }

  .side-button,
  .logout-button {
    min-height: 2.25rem;
    padding: 0 0.7rem;
    gap: 0.45rem;
    font-size: 0.92rem;
  }

  .logout-button {
    justify-self: end;
  }

  .contact-line {
    display: none;
  }

  .workspace-top,
  .top-info-panel,
  .messages,
  .composer,
  .workspace .quick-zone {
    padding-left: 16px;
    padding-right: 16px;
  }

  .workspace .quick-cards {
    grid-template-columns: 1fr;
  }

  .workspace-top {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .session-state {
    flex: 1 1 0;
  }

  .top-actions {
    justify-content: flex-start;
    gap: 0.45rem;
  }

  .top-chip {
    min-height: 2rem;
    padding: 0 0.7rem;
  }

  #balanceLabel {
    max-width: 100%;
  }

  #usernameLabel {
    display: none;
  }

  .top-info-panel {
    padding-bottom: 1rem;
  }

  .info-card {
    padding: 0.75rem;
    border-radius: 0.75rem;
  }

  .announcement-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .announcement-title strong {
    white-space: normal;
  }

  .messages {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .message {
    max-width: 100%;
  }

  .bubble {
    max-width: 100%;
  }

  .image-grid {
    grid-template-columns: 1fr;
    min-width: 0;
    width: 100%;
  }

  .image-grid img {
    height: auto;
    max-height: 70dvh;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .composer {
    padding-top: 2rem;
    padding-bottom: 1rem;
  }

  .composer-row {
    grid-template-columns: 40px 1fr 44px;
    align-items: end;
    min-height: 62px;
    border-radius: 1.35rem;
  }

  .icon-button,
  .send-button {
    width: 40px;
    height: 40px;
  }

  .empty-state h1 {
    font-size: 32px;
  }

  .auth-body {
    padding: 18px;
  }

  .auth-panel {
    padding: 18px;
  }

  .admin-top,
  .admin-shell {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .admin-top {
    height: auto;
    min-height: 4rem;
    align-items: flex-start;
    flex-direction: column;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .admin-card-item {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }

  .card-admin-grid,
  .announcement-admin-grid,
  .admin-form-row.two-columns,
  .announcement-admin-item {
    grid-template-columns: 1fr;
  }

  .admin-card-actions {
    grid-column: 1 / -1;
  }

  .amount-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-dialog {
    place-items: end center;
    padding: 0.75rem;
  }

  .quick-dialog-panel {
    width: 100%;
    max-height: calc(100dvh - 1.5rem);
    overflow: auto;
    padding: 1rem;
    border-radius: 1rem;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .workspace {
    display: block;
    min-height: auto;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3.5rem;
    padding: 0.45rem 0.75rem;
    background: rgba(255, 255, 255, 0.96);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .brand-block {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
  }

  .brand-block strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.25rem;
  }

  .panel-button,
  .contact-line {
    display: none;
  }

  .sidebar-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 0.25rem;
    min-width: 0;
    overflow: visible;
  }

  .side-button,
  .logout-button {
    justify-content: center;
    width: 2.35rem;
    min-width: 2.35rem;
    height: 2.35rem;
    min-height: 2.35rem;
    margin: 0;
    padding: 0;
    gap: 0;
    overflow: hidden;
    border-radius: 999px;
    font-size: 0;
    white-space: nowrap;
  }

  .side-button svg,
  .logout-button svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .workspace-top {
    display: block;
    min-height: auto;
    padding: 0.65rem 0.75rem 0;
  }

  .session-state {
    display: none;
  }

  .top-actions {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
  }

  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .top-chip {
    min-height: 1.95rem;
    padding: 0 0.65rem;
    font-size: 0.92rem;
  }

  #balanceLabel {
    flex: 0 0 auto;
    font-size: 0.92rem;
  }

  #usernameLabel {
    display: none;
  }

  .top-info-panel {
    padding: 0.55rem 0.75rem 0;
  }

  .messages {
    overflow: visible;
    padding: 1.1rem 0.75rem 0.25rem;
  }

  .empty-state {
    min-height: 8.5rem;
    align-content: center;
  }

  .empty-state h1,
  .empty-brand {
    font-size: 2rem;
    line-height: 1.12;
  }

  .composer {
    padding: 0.6rem 0.75rem 1rem;
  }

  .composer-row {
    grid-template-columns: 2.35rem minmax(0, 1fr) 2.55rem;
    min-height: 3.55rem;
    padding: 0.45rem 0.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.08);
  }

  .composer textarea {
    min-height: 2.25rem;
    padding: 0.45rem 0.25rem;
    font-size: 1rem;
  }

  .icon-button,
  .send-button {
    width: 2.35rem;
    height: 2.35rem;
  }

  .workspace .quick-zone {
    gap: 0.6rem;
    padding: 0.35rem 0.75rem 1.25rem;
  }

  .inspiration-text {
    font-size: 0.92rem;
  }

  .workspace .quick-cards {
    width: min(28rem, 100%);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .workspace .quick-card {
    border-radius: 0.95rem;
  }

  .workspace .quick-card-media {
    display: grid;
    place-items: center;
  }

  .workspace .quick-card-image {
    width: auto;
    max-width: 100%;
    max-height: 11rem;
    height: auto;
  }

  .workspace .quick-card strong {
    right: 0.65rem;
    bottom: 0.65rem;
    left: 0.65rem;
    font-size: 0.98rem;
  }

  .drawer-panel {
    width: min(24rem, 100vw);
  }

  .admin-top {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    min-height: 3.5rem;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
  }

  .admin-top strong {
    font-size: 1rem;
  }

  .admin-top nav {
    margin-left: auto;
    gap: 0.45rem;
  }

  .admin-top a,
  .admin-top button {
    height: 2rem;
    min-height: 2rem;
    padding: 0 0.7rem;
    font-size: 0.9rem;
  }

  .admin-shell {
    gap: 0.8rem;
    padding: 0.8rem 0.75rem 1.2rem;
  }

  .admin-section {
    border-radius: 0.85rem;
  }

  .admin-section summary {
    min-height: 2.9rem;
    padding: 0 0.9rem;
  }

  .admin-section-body {
    padding: 0 0.75rem 0.75rem;
  }

  .card-admin-grid,
  .announcement-admin-grid,
  .admin-form-row,
  .admin-form-row.two-columns,
  .announcement-admin-item {
    grid-template-columns: 1fr;
  }

  .admin-panel {
    padding: 0.9rem;
    border-radius: 0.9rem;
    box-shadow: none;
  }

  .admin-panel-head {
    align-items: center;
    margin-bottom: 0.75rem;
  }

  .card-form {
    gap: 0.75rem;
  }

  .card-form input,
  .card-form textarea {
    min-height: 2.45rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.7rem;
  }

  .admin-card-item {
    grid-template-columns: 4.75rem minmax(0, 1fr);
    align-items: start;
    gap: 0.75rem;
    padding: 0.65rem;
    border-radius: 0.85rem;
  }

  .admin-card-thumb {
    width: 4.75rem;
  }

  .admin-card-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .brand-block strong {
    font-size: 1.08rem;
  }

  .workspace .quick-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace .quick-card-image {
    max-height: 9rem;
  }

  .workspace .quick-card strong {
    font-size: 0.9rem;
  }

  .admin-top nav {
    width: 100%;
    margin-left: 0;
  }

  .admin-top a,
  .admin-top button {
    flex: 1 1 0;
  }
}

@media (max-width: 920px) {
  .app-body {
    overflow-x: hidden;
  }

  .app-shell {
    display: grid;
    grid-template-columns: clamp(4.25rem, 16vw, 5.5rem) minmax(0, 1fr);
    min-height: 100dvh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-self: start;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.7rem 0.45rem;
    overflow: hidden;
    background: var(--sidebar);
    border-right: 1px solid var(--line);
    border-bottom: 0;
    backdrop-filter: none;
  }

  .brand-block {
    justify-content: center;
    min-height: 2.25rem;
    padding: 0;
  }

  .brand-block strong {
    overflow: hidden;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: clamp(0.72rem, 2.8vw, 0.95rem);
    line-height: 1.05;
  }

  .panel-button,
  .contact-line {
    display: none;
  }

  .sidebar-actions {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    overflow: visible;
  }

  .side-button,
  .logout-button {
    justify-content: center;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    min-height: 3rem;
    height: auto;
    margin: 0;
    padding: 0;
    gap: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
    border-radius: 0.9rem;
  }

  .logout-button {
    margin-top: auto;
    justify-self: auto;
  }

  .side-button svg,
  .logout-button svg {
    width: 1.45rem;
    height: 1.45rem;
  }

  .workspace {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    min-height: 100dvh;
  }

  .workspace-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    min-height: auto;
    padding: 0.7rem clamp(0.75rem, 3vw, 1.25rem) 0;
  }

  .session-state {
    display: none;
  }

  .top-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.4rem;
    overflow: visible;
    padding-bottom: 0;
  }

  .top-chip {
    min-height: 1.95rem;
    padding: 0 0.65rem;
    font-size: 0.92rem;
  }

  #balanceLabel {
    flex: 0 0 auto;
    max-width: 100%;
    font-size: 0.92rem;
  }

  #usernameLabel {
    display: none;
  }

  .top-info-panel,
  .messages,
  .composer,
  .workspace .quick-zone {
    padding-left: clamp(0.75rem, 3vw, 1.25rem);
    padding-right: clamp(0.75rem, 3vw, 1.25rem);
  }

  .top-info-panel {
    padding-top: 0.55rem;
    padding-bottom: 0;
  }

  .messages {
    overflow-y: auto;
    padding-top: clamp(1rem, 8vh, 3rem);
    padding-bottom: 1rem;
  }

  .empty-state {
    min-height: clamp(9rem, 28vh, 15rem);
    align-content: center;
  }

  .empty-state h1,
  .empty-brand {
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.12;
  }

  .composer {
    padding-top: 0.5rem;
    padding-bottom: 1rem;
  }

  .composer-row {
    grid-template-columns: 2.35rem minmax(0, 1fr) 2.5rem;
    align-items: center;
    min-height: 3.4rem;
    padding: 0.45rem 0.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.08);
  }

  .composer textarea {
    min-height: 2.2rem;
    padding: 0.45rem 0.25rem;
    font-size: 1rem;
  }

  .icon-button,
  .send-button {
    width: 2.35rem;
    height: 2.35rem;
  }

  .workspace .quick-zone {
    gap: 0.5rem;
    padding-top: 0.35rem;
    padding-bottom: 1.2rem;
  }

  .inspiration-text {
    font-size: 0.92rem;
  }

  .workspace .quick-cards {
    width: min(28rem, 100%);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .workspace .quick-card {
    border-radius: 0.95rem;
  }

  .workspace .quick-card-media {
    display: grid;
    place-items: center;
  }

  .workspace .quick-card-image {
    width: auto;
    max-width: 100%;
    max-height: 9rem;
    height: auto;
  }

  .workspace .quick-card strong {
    right: 0.65rem;
    bottom: 0.65rem;
    left: 0.65rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    transition: grid-template-columns 180ms ease;
  }

  .app-shell.sidebar-expanded {
    grid-template-columns: minmax(13.5rem, 74vw) minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 0;
    min-width: 0;
    height: 100dvh;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
    transition: width 180ms ease, opacity 180ms ease, transform 180ms ease;
    cursor: pointer;
  }

  .app-shell.sidebar-expanded .sidebar {
    width: min(74vw, 18rem);
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    cursor: default;
    padding: 0.9rem 0.75rem;
    overflow-y: auto;
  }

  .app-shell::before {
    content: "";
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 24;
    width: 2.75rem;
    height: 2.75rem;
    background: #ffffff;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    box-shadow: var(--soft-shadow);
    pointer-events: none;
  }

  .app-shell::after {
    content: "";
    position: fixed;
    top: 1.43rem;
    left: 1.45rem;
    z-index: 25;
    width: 1.35rem;
    height: 0.9rem;
    border-top: 2px solid var(--text);
    border-bottom: 2px solid var(--text);
    pointer-events: none;
  }

  .app-shell.sidebar-expanded::before,
  .app-shell.sidebar-expanded::after {
    display: none;
  }

  .app-shell.sidebar-expanded .brand-block {
    justify-content: space-between;
    gap: 0.5rem;
  }

  .app-shell.sidebar-expanded .brand-block strong {
    text-align: left;
    white-space: nowrap;
    font-size: 1.35rem;
  }

  .app-shell.sidebar-expanded .panel-button {
    display: inline-grid;
    flex: 0 0 auto;
  }

  .app-shell.sidebar-expanded .side-button,
  .app-shell.sidebar-expanded .logout-button {
    justify-content: flex-start;
    min-height: 2.75rem;
    padding: 0 0.8rem;
    gap: 0.65rem;
    font-size: 0.96rem;
  }

  .app-shell.sidebar-expanded .contact-line {
    display: block;
    margin: 0 0.65rem;
    font-size: 0.78rem;
  }

  .app-shell.sidebar-expanded .workspace {
    opacity: 0.42;
    pointer-events: none;
  }

  .workspace .quick-card-media {
    aspect-ratio: 4 / 3;
    overflow: hidden;
  }

  .workspace .quick-card-image {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
  }
}

.sidebar-toggle {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 44;
  display: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--soft-shadow);
}

.sidebar-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

@media (max-width: 920px) {
  .sidebar-toggle {
    display: inline-grid;
  }

  .app-shell::before,
  .app-shell::after {
    display: none !important;
    content: none !important;
  }

  .workspace-top {
    padding-left: calc(0.75rem + 2.75rem + 0.65rem);
  }

  .top-actions {
    align-items: center;
    justify-content: flex-start;
  }

  .app-shell.sidebar-expanded {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell.sidebar-expanded .sidebar-toggle {
    display: none;
  }

  .sidebar {
    z-index: 45;
  }

  .composer-row {
    align-items: center;
    grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem;
  }

  .icon-button,
  .send-button {
    display: inline-grid;
    place-items: center;
    align-self: center;
    justify-self: center;
    line-height: 1;
  }

  .send-button svg {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* Responsive shell v2: drawer sidebar + ratio-safe quick card rail. */
.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.sidebar-toggle {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 60;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--soft-shadow);
}

.sidebar-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
}

.sidebar {
  position: fixed !important;
  inset: 0 auto 0 0;
  z-index: 70;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.75rem;
  width: min(82vw, 18.75rem) !important;
  max-width: 18.75rem;
  min-width: 0 !important;
  height: 100dvh;
  padding: 0.9rem 0.75rem !important;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-100%);
  transition: opacity 180ms ease, transform 180ms ease;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.app-shell.sidebar-expanded .sidebar {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.app-shell.sidebar-expanded .sidebar-toggle {
  display: none;
}

.app-shell.sidebar-expanded .workspace {
  opacity: 0.42;
  pointer-events: none;
}

.sidebar .brand-block {
  order: 1 !important;
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center;
  justify-content: space-between;
  min-height: 2.5rem;
  padding: 0 0.15rem 0.25rem;
  gap: 0.5rem;
}

.sidebar .brand-block strong {
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1.35rem;
  line-height: 1;
}

.sidebar .panel-button {
  display: inline-grid !important;
  flex: 0 0 auto;
}

.sidebar .sidebar-actions {
  order: 2 !important;
  display: grid !important;
  flex: 0 0 auto !important;
  gap: 0.5rem;
  min-width: 0;
  overflow: visible !important;
}

.sidebar .logout-button {
  order: 3 !important;
  flex: 0 0 auto !important;
  margin-top: 0 !important;
}

.sidebar .contact-line {
  order: 4 !important;
  display: block !important;
  margin: auto 0.6rem 0 !important;
}

.sidebar .side-button,
.sidebar .logout-button {
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 2.75rem !important;
  height: auto !important;
  padding: 0 0.8rem !important;
  gap: 0.65rem !important;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.96rem !important;
  border-radius: 8px !important;
}

.sidebar .side-button svg,
.sidebar .logout-button svg {
  flex: 0 0 auto;
  width: 1.25rem !important;
  height: 1.25rem !important;
}

.workspace-top {
  padding-left: max(28px, calc(0.75rem + 2.5rem + 0.75rem));
}

.workspace .quick-zone {
  overflow: hidden !important;
}

.workspace .quick-cards {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-end !important;
  max-width: none;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.workspace .quick-card {
  position: relative;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  overflow: hidden;
  scroll-snap-align: start;
  background: #111111;
}

.workspace .quick-card-media {
  display: grid !important;
  place-items: center;
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  aspect-ratio: auto !important;
  overflow: visible !important;
  background: #f4f4f4;
}

.workspace .quick-card:not(.has-image) .quick-card-media {
  width: 13rem;
  aspect-ratio: 4 / 3 !important;
}

.workspace .quick-card-image {
  display: block !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

@media (min-width: 921px) {
  .workspace .quick-cards {
    width: min(72rem, 100%);
    margin: 0 auto;
    padding: 0 0.25rem 0.55rem;
    gap: 0.85rem;
    scrollbar-width: thin;
  }

  .workspace .quick-card-image {
    max-width: min(22rem, 32vw);
    max-height: 10.5rem;
  }
}

@media (max-width: 920px) {
  .sidebar-toggle {
    top: 0.7rem;
    left: 0.75rem;
    width: 2.15rem;
    height: 2.15rem;
  }

  .sidebar-toggle svg {
    width: 1.05rem;
    height: 1.05rem;
  }

  .workspace-top {
    display: grid !important;
    min-height: 2.85rem;
    padding: 0.7rem 0.75rem 0 calc(0.75rem + 2.15rem + 0.55rem) !important;
  }

  .top-actions {
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0.4rem !important;
    min-height: 2.15rem;
    overflow-x: auto;
    padding-bottom: 0;
    scrollbar-width: none;
  }

  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .top-chip,
  #balanceLabel {
    display: inline-flex;
    align-items: center;
    min-height: 2.15rem;
    line-height: 1;
  }

  .composer-row {
    grid-template-columns: 2.25rem minmax(0, 1fr) 2.35rem !important;
    align-items: center !important;
    gap: 0.45rem !important;
    min-height: 3.4rem;
    padding: 0.45rem 0.5rem !important;
  }

  .composer textarea {
    align-self: center !important;
    min-height: 2.2rem;
    margin: 0;
    padding: 0.45rem 0.2rem !important;
    line-height: 1.35;
  }

  .composer-row .icon-button,
  .composer-row .send-button {
    display: inline-grid !important;
    place-items: center !important;
    align-self: center !important;
    justify-self: center !important;
    width: 2.25rem !important;
    height: 2.25rem !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
  }

  .composer-row .send-button {
    width: 2.35rem !important;
    height: 2.35rem !important;
  }

  .composer-row .send-button svg {
    display: block;
    width: 1.2rem;
    height: 1.2rem;
  }

  .sidebar {
    width: min(84vw, 18rem) !important;
    max-width: 18rem;
  }

  .workspace .quick-zone {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .workspace .quick-cards {
    width: calc(100% + 1.5rem) !important;
    margin: 0 -0.75rem !important;
    padding: 0 0.75rem 0.55rem !important;
    gap: 0.65rem;
    scrollbar-width: none;
  }

  .workspace .quick-cards::-webkit-scrollbar {
    display: none;
  }

  .workspace .quick-card-image {
    max-width: min(68vw, 14rem);
    max-height: 8.5rem;
  }

  .workspace .quick-card:not(.has-image) .quick-card-media {
    width: 11rem;
  }

  .workspace .quick-card strong {
    right: 0.65rem;
    bottom: 0.65rem;
    left: 0.65rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 420px) {
  .workspace .quick-card-image {
    max-width: min(72vw, 12.5rem);
    max-height: 7.75rem;
  }
}
