:root {
  color-scheme: light;
  --page: #f5f6f7;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --ink: #141414;
  --ink-soft: #3d3d3d;
  --muted: #8a8f98;
  --line: #e8eaed;
  --line-strong: #dfe3e8;
  --accent: #18a058;
  --accent-soft: #eaf8f0;
  --blue: #4d7cff;
  --warning: #f7b955;
  --shadow: 0 18px 40px rgba(20, 20, 20, 0.08);
  --tabs-height: 77px;
  --composer-height: 78px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--page);
  color: var(--ink);
  letter-spacing: 0;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus,
a:focus,
textarea:focus {
  outline: none;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.08);
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.topbar {
  height: 62px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(232, 234, 237, 0.75);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(18px);
}

.topbar > .new-session {
  display: none;
}

.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #111111;
  position: relative;
  box-shadow: 0 8px 18px rgba(20, 20, 20, 0.12);
}

.brand-mark::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--accent);
  position: absolute;
  right: 5px;
  bottom: 5px;
}

.brand strong,
.section-title strong,
.account-card strong {
  display: block;
  font-size: 15px;
  line-height: 19px;
  font-weight: 760;
}

.brand strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small,
.section-title span,
.account-card small,
.metrics small,
.package span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
}

.icon-button,
.points-pill,
.send-button,
.text-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
}

.icon-button:hover,
.tab:hover,
.text-button:hover,
.scenario:hover {
  background: var(--surface-soft);
}

.icon-button svg,
.send-button svg,
.points-pill svg,
.tab svg,
.primary-wide svg,
.primary-action svg,
.secondary-action svg,
.image-lightbox-close svg,
[data-editor-cancel] svg,
[data-clear-reference] svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.points-pill {
  height: 34px;
  min-width: 66px;
  gap: 5px;
  border-radius: 999px;
  color: #3a2a00;
  background: #fff5d8;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 760;
}

.text-icon-button {
  height: 32px;
  gap: 6px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--ink);
  background: #f2f4f6;
  font-size: 12px;
  font-weight: 760;
}

.text-icon-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.text-icon-button:hover {
  background: #e8ecef;
}

.chat-actions {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px 0;
}

.surface {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 7;
  width: min(100%, 430px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(232, 234, 237, 0.82);
  box-shadow: 0 -14px 32px rgba(20, 20, 20, 0.08);
  backdrop-filter: blur(18px);
}

.tab {
  min-height: 52px;
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  line-height: 14px;
  transition: background 160ms ease, color 160ms ease;
}

.tab.active {
  color: #087443;
  background: var(--accent-soft);
  font-weight: 720;
}

.tab.active svg {
  stroke-width: 2.5;
}

.panel {
  display: none;
  min-height: 0;
  flex: 1;
}

.panel.active {
  display: flex;
  flex-direction: column;
}

#worksPanel,
#accountPanel {
  overflow-y: auto;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.scenario-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 14px 10px;
  scrollbar-width: none;
}

.scenario-row::-webkit-scrollbar {
  display: none;
}

.scenario,
.hint-grid button,
.text-button {
  white-space: nowrap;
  border-radius: 999px;
  color: var(--ink-soft);
}

.scenario {
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 13px;
  transition: border 160ms ease, background 160ms ease, color 160ms ease;
}

.scenario.active {
  color: #087443;
  border-color: rgba(24, 160, 88, 0.28);
  background: var(--accent-soft);
}

.workspace-panel {
  margin: 0 14px 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(20, 20, 20, 0.04);
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.workspace-head strong {
  font-size: 14px;
  line-height: 18px;
}

.workspace-group {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding: 3px 0;
  scrollbar-width: none;
}

.workspace-group::-webkit-scrollbar {
  display: none;
}

.workspace-group + .workspace-group {
  margin-top: 6px;
}

.workspace-group > span {
  width: 34px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.workspace-chip {
  height: 30px;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0 10px;
  color: #59616b;
  background: #f4f5f7;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 650;
}

.workspace-chip.active {
  color: #087443;
  background: var(--accent-soft);
  border-color: rgba(24, 160, 88, 0.28);
}

.brief-status {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 14px 10px;
  scrollbar-width: none;
}

.brief-status::-webkit-scrollbar {
  display: none;
}

.brief-status span {
  height: 28px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px dashed #d6dbe1;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
}

.brief-status span.filled {
  border-style: solid;
  border-color: rgba(24, 160, 88, 0.32);
  color: #087443;
  background: var(--accent-soft);
}

.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 4px 14px calc(var(--tabs-height) + var(--composer-height) + 42px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 68%),
    var(--surface);
}

.message {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
}

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

.message.user .bubble {
  background: #151515;
  color: #ffffff;
  max-width: 86%;
  border-color: #151515;
  box-shadow: 0 10px 24px rgba(20, 20, 20, 0.12);
}

.message.user .avatar {
  display: none;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.bubble {
  max-width: calc(100% - 42px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  padding: 12px 13px;
  line-height: 1.58;
  font-size: 14px;
  box-shadow: 0 8px 22px rgba(20, 20, 20, 0.045);
}

.bubble p {
  margin: 0;
}

.bubble p + p,
.bubble p + .ai-list,
.bubble .ai-list + p,
.bubble h4 + p,
.bubble h4 + .ai-list {
  margin-top: 9px;
}

.bubble h4 {
  margin: 0 0 7px;
  font-size: 14px;
  line-height: 1.45;
}

.bubble strong {
  font-weight: 800;
}

.ai-list {
  margin: 8px 0 0;
  padding-left: 20px;
}

.ai-list li {
  margin: 0 0 8px;
  padding-left: 2px;
}

.ai-list li:last-child {
  margin-bottom: 0;
}

.message.assistant .bubble {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.hint-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hint-grid button {
  height: 31px;
  padding: 0 11px;
  color: #087443;
  background: var(--accent-soft);
  font-size: 12px;
}

.inspiration-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 20px 38px;
}

.inspiration-card {
  min-height: 94px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 12px;
  text-align: left;
  box-shadow: 0 8px 22px rgba(20, 20, 20, 0.035);
  transition: transform 160ms ease, border 160ms ease, background 160ms ease;
}

.inspiration-card:hover {
  border-color: rgba(24, 160, 88, 0.28);
  background: #fbfcfc;
  transform: translateY(-1px);
}

.inspiration-card span {
  display: inline-flex;
  height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: #087443;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 720;
}

.inspiration-card strong {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  line-height: 19px;
}

.inspiration-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ratio-option {
  min-height: 76px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8f9fa;
  padding: 10px;
  text-align: left;
}

.ratio-option strong {
  display: block;
  font-size: 13px;
  line-height: 18px;
}

.ratio-option span,
.ratio-option small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 15px;
  margin-top: 2px;
}

.ratio-option:hover {
  border-color: rgba(24, 160, 88, 0.34);
  background: var(--accent-soft);
}

.analysis-card,
.image-result {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
}

.analysis-card {
  padding: 12px;
}

.result-detail {
  margin-top: 10px;
}

.result-detail summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: #59616b;
  background: #f2f4f6;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
  user-select: none;
}

.result-detail summary::marker,
.result-detail summary::-webkit-details-marker {
  display: none;
  content: "";
}

.result-detail summary::after {
  content: "展开";
  margin-left: 6px;
  color: var(--muted);
  font-weight: 600;
}

.result-detail[open] summary::after {
  content: "收起";
}

.analysis-card h3,
.image-result h3 {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 18px;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag-row span {
  border-radius: 999px;
  background: #f2f4f6;
  color: #59616b;
  padding: 3px 8px;
  font-size: 11px;
}

.image-preview-button {
  width: 100%;
  height: 330px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  padding: 0 10px;
  background: #f7f8fa;
  cursor: zoom-in;
  overflow: hidden;
}

.image-preview-button.square-preview,
.image-preview-button.landscape-preview {
  justify-content: center;
}

.image-preview-button:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(24, 160, 88, 0.28);
}

.image-preview-frame {
  height: calc(100% - 20px);
  max-width: 100%;
  max-height: calc(100% - 20px);
  display: block;
  background: #ffffff;
  border: 1px solid rgba(223, 227, 232, 0.92);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(20, 20, 20, 0.12);
}

.mock-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #ffffff;
}

.image-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 0;
  background: #ffffff;
}

.image-meta-row span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: #59616b;
  background: #f2f4f6;
  font-size: 11px;
  line-height: 16px;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  background: #ffffff;
}

.secondary-action,
.primary-action {
  height: 38px;
  border-radius: 10px;
  font-weight: 720;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-size: 13px;
}

.secondary-action {
  color: var(--ink);
  background: #f2f4f6;
}

.primary-action {
  color: #ffffff;
  background: #111111;
}

.preview-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(12, 12, 12, 0.84);
}

.image-lightbox.active {
  display: flex;
}

.image-lightbox-frame {
  width: min(100%, 430px);
  height: min(86svh, 760px);
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
}

.image-lightbox-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.image-lightbox-frame figcaption {
  min-height: 22px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.image-lightbox-close {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: max(14px, calc((100vw - 430px) / 2 + 14px));
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  z-index: 21;
  display: grid;
  place-items: center;
}

.image-lightbox-close svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.compression-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 17, 17, 0.42);
  z-index: 30;
}

.compression-modal.active {
  display: flex;
}

.compression-dialog {
  width: min(100%, 340px);
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(17, 17, 17, 0.22);
}

.compression-dialog strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 17px;
}

.compression-dialog p {
  margin: 0;
  color: #59616b;
  font-size: 13px;
  line-height: 1.65;
}

.compression-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.compression-actions button {
  min-width: 92px;
}

.text-editor-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 17, 17, 0.28);
  z-index: 32;
}

.text-editor-modal.active {
  display: flex;
}

.text-editor-dialog {
  width: min(100%, 430px);
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(17, 17, 17, 0.22);
}

.text-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.text-editor-head strong {
  color: var(--ink);
  font-size: 15px;
}

.text-editor-head button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #8b939e;
  background: #f4f5f7;
  display: grid;
  place-items: center;
}

.text-editor-dialog textarea {
  width: 100%;
  min-height: 180px;
  max-height: 42svh;
  resize: none;
  overflow-y: auto;
  border: 0;
  border-radius: 16px;
  padding: 12px;
  outline: none;
  color: #111111;
  background: #f7f8fa;
  font-size: 18px;
  line-height: 1.65;
}

.text-editor-dialog textarea::placeholder {
  color: #a0a6ae;
}

.text-editor-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
}

.text-editor-actions button {
  min-width: 76px;
}

.clear-editor-action {
  justify-self: start;
  min-width: 68px;
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  color: #ef4444;
  background: #fff1f2;
}

.composer {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabs-height) + 14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(100%, 430px);
  display: grid;
  grid-template-columns: 38px 1fr 40px;
  grid-template-rows: auto auto auto;
  gap: 8px;
  align-items: end;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 26%);
  z-index: 6;
}

.reference-preview {
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 58px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 4px 2px;
  padding: 6px;
  border-radius: 14px;
  background: #f7f8fa;
  border: 1px solid var(--line);
}

.reference-preview[hidden] {
  display: none;
}

.reference-chip {
  min-width: 0;
  flex: 1 1 120px;
  max-width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 26px;
  gap: 7px;
  align-items: center;
  padding: 5px 6px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(223, 227, 232, 0.9);
}

.reference-chip img {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: cover;
  border-radius: 10px;
}

.attachment-file-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: #353b44;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.reference-chip span {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: #59616b;
}

.reference-chip strong {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: #353b44;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-chip small {
  font-size: 10px;
  color: #8b939e;
}

.reference-chip button {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--muted);
  background: #f4f5f7;
  display: grid;
  place-items: center;
}

.reference-chip button svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.composer::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 227, 232, 0.9);
  box-shadow: 0 16px 34px rgba(20, 20, 20, 0.1);
  z-index: -1;
}

.composer .attach {
  grid-column: 1;
  grid-row: 2;
  margin-bottom: 3px;
}

.prompt-box {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  width: 100%;
  min-width: 0;
}

.expand-editor {
  position: absolute;
  top: 2px;
  right: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #8b939e;
  background: rgba(255, 255, 255, 0.86);
  z-index: 2;
}

.expand-editor [data-lucide] {
  width: 15px;
  height: 15px;
}

.expand-editor:active,
.expand-editor:hover {
  color: #111111;
  background: #f4f5f7;
}

.composer textarea {
  min-height: 44px;
  max-height: 92px;
  width: 100%;
  min-width: 0;
  resize: none;
  overflow-y: hidden;
  border: 0;
  border-radius: 16px;
  padding: 12px 32px 10px 4px;
  outline: none;
  line-height: 20px;
  background: transparent;
  color: var(--ink);
}

.composer textarea::placeholder {
  color: #a0a6ae;
}

.composer textarea::-webkit-scrollbar {
  width: 4px;
}

.composer textarea::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d0d5dc;
}

[data-lucide] {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

[data-lucide] svg,
.svg-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.svg-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.send-button {
  grid-column: 3;
  grid-row: 2;
  width: 40px;
  height: 40px;
  margin-bottom: 2px;
  border-radius: 14px;
  color: #ffffff;
  background: #111111;
  box-shadow: 0 10px 20px rgba(20, 20, 20, 0.18);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
}

.section-title.compact {
  padding: 0 0 12px;
}

.text-button {
  height: 32px;
  padding: 0 12px;
  color: var(--muted);
  background: #f2f4f6;
  font-size: 13px;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 14px calc(104px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.work-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(20, 20, 20, 0.045);
}

.work-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
}

.work-item div {
  padding: 9px 10px 10px;
}

.work-item strong {
  display: block;
  font-size: 12px;
  line-height: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-item span {
  color: var(--muted);
  font-size: 11px;
}

.account-card,
.recharge {
  margin: 10px 14px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(20, 20, 20, 0.04);
}

.account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.account-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #111111, #4b5563);
  font-weight: 800;
  flex: 0 0 auto;
}

.primary-small,
.primary-wide {
  border-radius: 12px;
  color: #ffffff;
  background: #111111;
  font-weight: 760;
}

.primary-small {
  height: 36px;
  padding: 0 12px;
  flex: 0 0 auto;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 14px 12px;
}

.metrics div {
  min-height: 76px;
  border-radius: 16px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  align-content: center;
}

.metrics span {
  font-size: 21px;
  line-height: 28px;
  font-weight: 820;
}

.package-list {
  display: grid;
  gap: 9px;
}

.package {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 12px;
  text-align: left;
}

.package.selected {
  border-color: rgba(24, 160, 88, 0.35);
  background: var(--accent-soft);
}

.primary-wide {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(154px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  width: min(calc(100% - 32px), 360px);
  border-radius: 12px;
  padding: 10px 12px;
  color: #ffffff;
  background: rgba(20, 20, 20, 0.92);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  text-align: center;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing-label {
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 13px;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #a0a6ae;
  animation: blink 900ms infinite;
}

.typing span:nth-child(2) {
  animation-delay: 120ms;
}

.typing span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes blink {
  50% {
    opacity: 0.35;
    transform: translateY(-2px);
  }
}

@media (min-width: 720px) {
  body {
    padding: 24px 0;
  }

  .phone-shell {
    min-height: calc(100svh - 48px);
    border-radius: 28px;
    box-shadow: var(--shadow);
  }

  .composer {
    bottom: calc(24px + var(--tabs-height) + 14px + env(safe-area-inset-bottom));
    border-radius: 0 0 28px 28px;
  }

  .tabs {
    bottom: 24px;
    border-radius: 0 0 28px 28px;
    overflow: hidden;
  }
}
