:root {
  --wine: #641d2d;
  --wine-dark: #43121e;
  --wine-soft: #f7eef0;
  --gold: #b28a4b;
  --gold-soft: #f8f3e9;
  --teal: #257d78;
  --blue: #4b5e8a;
  --ink: #15171b;
  --text: #25282e;
  --muted: #727984;
  --line: #e5e7eb;
  --canvas: #f3f4f6;
  --white: #fff;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { background: #dfe2e6; }
body {
  margin: 0;
  color: var(--text);
  background: #dfe2e6;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; letter-spacing: 0; }
button { padding: 0; color: inherit; border: 0; background: transparent; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
svg { display: block; width: 20px; height: 20px; stroke-width: 1.8; }

.app-shell {
  position: relative;
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--canvas);
  box-shadow: 0 0 32px rgba(20, 23, 30, .12);
}
.page {
  display: none;
  min-height: 100dvh;
  padding-bottom: calc(76px + var(--safe-bottom));
  background: var(--canvas);
}
.page.active { display: block; animation: page-in .18s ease; }
@keyframes page-in { from { opacity: .7; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 50%;
}
.icon-button:active { background: rgba(100, 29, 45, .08); }
.icon-button.alert { position: relative; }
.icon-button.alert::after {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  content: "";
  border: 2px solid white;
  border-radius: 50%;
  background: #d9474f;
}

.brand-header {
  min-height: calc(58px + var(--safe-top));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-lockup img { width: 32px; height: 32px; object-fit: contain; }
.brand-lockup strong { display: block; color: var(--wine); font-size: 17px; line-height: 1.1; }
.brand-lockup small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.header-actions { display: flex; align-items: center; gap: 2px; }

.page-header {
  min-height: calc(58px + var(--safe-top));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 16px 11px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.page-header h1 { font-size: 21px; font-weight: 650; }
.page-header p { margin-top: 2px; color: var(--muted); font-size: 11px; }
.page-header-actions { display: flex; gap: 2px; }

.day-brief {
  padding: 18px 18px 16px;
  color: white;
  background: var(--wine);
}
.brief-top { display: flex; justify-content: space-between; gap: 18px; }
.brief-top small { display: block; color: rgba(255,255,255,.72); font-size: 12px; }
.brief-top h1 { margin-top: 5px; font-size: 25px; font-weight: 600; }
.brief-top p { margin-top: 7px; color: rgba(255,255,255,.74); font-size: 12px; line-height: 1.5; }
.brief-weather { flex: 0 0 auto; padding-top: 2px; text-align: right; }
.brief-weather strong { display: block; font-size: 15px; font-weight: 600; }
.brief-weather span { display: block; margin-top: 4px; color: rgba(255,255,255,.7); font-size: 11px; }
.brief-focus {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.88);
  font-size: 12px;
}
.brief-focus svg { width: 17px; height: 17px; color: #e7c98e; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: white;
  border-bottom: 1px solid var(--line);
}
.metric-strip button {
  min-height: 62px;
  padding: 9px 8px;
  text-align: center;
  border-right: 1px solid var(--line);
}
.metric-strip button:last-child { border-right: 0; }
.metric-strip strong { display: block; color: var(--ink); font-size: 20px; font-weight: 650; }
.metric-strip span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.market-tape {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(118px, 1fr);
  gap: 1px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.market-tape::-webkit-scrollbar { display: none; }
.market-chip {
  min-height: 58px;
  padding: 9px 12px;
  text-align: left;
  background: white;
}
.market-chip small { display: block; color: var(--muted); font-size: 10px; }
.market-chip strong { display: block; margin-top: 3px; font-size: 14px; font-weight: 630; }
.market-chip span { display: block; margin-top: 2px; font-size: 10px; }
.up { color: #b4232d; }
.down { color: #17805c; }

.section { margin-top: 10px; padding: 0 16px; background: white; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section.flush { padding: 0; }
.section-heading {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-heading h2 { color: var(--ink); font-size: 16px; font-weight: 650; }
.section-heading button { display: flex; align-items: center; gap: 3px; color: var(--wine); font-size: 12px; }
.section-heading button svg { width: 15px; height: 15px; }

.agenda-list { padding-bottom: 4px; }
.agenda-row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 44px 3px minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  border-top: 1px solid #edf0f2;
}
.agenda-row:first-child { border-top: 0; }
.agenda-row time { color: var(--ink); font-size: 12px; font-weight: 650; }
.agenda-line { width: 3px; height: 36px; border-radius: 2px; background: var(--agenda); }
.agenda-row strong { display: block; overflow: hidden; font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.agenda-row small { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.agenda-row > svg { width: 16px; color: #a1a6ae; }

.project-snapshot { padding-bottom: 10px; }
.snapshot-row {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 8px 0;
  text-align: left;
  border-top: 1px solid #edf0f2;
}
.snapshot-row:first-child { border-top: 0; }
.project-code {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: white;
  background: var(--wine);
  font-size: 9px;
  font-weight: 700;
}
.snapshot-row strong { display: block; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 620; white-space: nowrap; text-overflow: ellipsis; }
.snapshot-row small { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.snapshot-side { text-align: right; }
.snapshot-side b { display: block; color: var(--wine); font-size: 12px; font-weight: 650; }
.snapshot-side span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 2px 0 13px;
}
.quick-grid button { position: relative; min-height: 72px; display: grid; place-items: center; align-content: center; gap: 7px; font-size: 11px; }
.quick-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--app-color);
  background: color-mix(in srgb, var(--app-color) 10%, white);
}
.quick-icon svg { width: 20px; height: 20px; }
.quick-grid em {
  position: absolute;
  top: 6px;
  left: calc(50% + 9px);
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid white;
  border-radius: 9px;
  color: white;
  background: #d7444c;
  font-size: 8px;
  font-style: normal;
}

.report-list { padding-bottom: 3px; }
.report-row {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto;
  gap: 11px;
  align-items: center;
  text-align: left;
  border-top: 1px solid #edf0f2;
}
.report-row:first-child { border-top: 0; }
.report-category {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #ead9dd;
  border-radius: 50%;
  color: var(--wine);
  background: var(--wine-soft);
  font-size: 11px;
  font-weight: 650;
}
.report-row strong { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.report-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.report-row > svg { width: 16px; color: #a1a6ae; }

.search-bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 14px;
  padding: 0 12px;
  color: #89909a;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}
.search-bar svg { width: 17px; }

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin: 0 14px 10px;
  padding: 3px;
  background: #e9ebee;
  border-radius: 6px;
}
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segmented button { min-height: 34px; border-radius: 4px; color: #626974; font-size: 12px; }
.segmented button.active { color: var(--wine); background: white; box-shadow: 0 1px 4px rgba(23,27,34,.08); font-weight: 600; }

.project-list { padding: 0 12px 12px; }
.project-card {
  width: 100%;
  margin-bottom: 9px;
  padding: 14px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-card h3 { color: var(--ink); font-size: 15px; font-weight: 650; }
.project-card p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.status-pill { flex: 0 0 auto; padding: 4px 7px; border-radius: 4px; font-size: 9px; font-weight: 650; }
.status-pill.active { color: #7b2438; background: #f7e9ec; }
.status-pill.approval { color: #8a641e; background: #f8f1df; }
.status-pill.preparing { color: #315080; background: #eaf0f8; }
.status-pill.archived { color: #667085; background: #eef0f2; }
.progress-track { height: 4px; margin-top: 13px; overflow: hidden; background: #eceef0; border-radius: 2px; }
.progress-track i { display: block; height: 100%; background: var(--wine); }
.project-meta { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 11px; }
.project-meta span { display: block; color: var(--muted); font-size: 9px; }
.project-meta strong { display: block; margin-top: 3px; color: var(--text); font-size: 11px; font-weight: 600; }
.project-meta > div:last-child { text-align: right; }

.market-hero { padding: 16px; color: white; background: #202a3c; }
.market-hero-head { display: flex; align-items: center; justify-content: space-between; }
.market-hero h2 { font-size: 16px; font-weight: 600; }
.market-hero small { color: rgba(255,255,255,.62); font-size: 10px; }
.index-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 13px; background: rgba(255,255,255,.15); }
.index-item { min-height: 72px; padding: 10px 11px; background: #202a3c; }
.index-item span { color: rgba(255,255,255,.62); font-size: 10px; }
.index-item strong { display: block; margin-top: 6px; font-size: 16px; font-weight: 600; }
.index-item b { display: block; margin-top: 3px; font-size: 10px; font-weight: 500; }
.market-note { padding: 11px 16px; color: #655a46; background: var(--gold-soft); border-bottom: 1px solid #eadfc9; font-size: 11px; line-height: 1.55; }

.collab-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 14px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.collab-summary div { min-height: 56px; display: grid; place-items: center; align-content: center; border-right: 1px solid var(--line); }
.collab-summary div:last-child { border-right: 0; }
.collab-summary strong { font-size: 17px; }
.collab-summary span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.collab-list { background: white; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.message-row, .mail-row, .schedule-row {
  width: 100%;
  min-height: 74px;
  display: grid;
  align-items: center;
  gap: 11px;
  padding: 8px 15px;
  text-align: left;
  border-top: 1px solid #edf0f2;
}
.message-row:first-child, .mail-row:first-child, .schedule-row:first-child { border-top: 0; }
.message-row { grid-template-columns: 42px minmax(0,1fr) auto; }
.message-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: white;
  background: var(--avatar);
  font-size: 12px;
  font-weight: 650;
}
.row-copy { min-width: 0; }
.row-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-title strong { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 620; white-space: nowrap; text-overflow: ellipsis; }
.row-title small { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.row-copy p { overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.row-side { align-self: stretch; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 8px; }
.row-side time { color: #9ba1a9; font-size: 9px; }
.row-side b { min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; border-radius: 9px; color: white; background: #d7444c; font-size: 8px; }
.mail-row { grid-template-columns: 8px minmax(0,1fr) auto; }
.mail-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.mail-row.unread .mail-dot { background: var(--wine); }
.mail-row.unread .row-title strong { font-weight: 700; }
.mail-star { width: 32px; height: 32px; display: grid; place-items: center; color: #a1a6ae; }
.mail-star.active { color: var(--gold); }
.mail-star svg { width: 18px; }
.schedule-row { grid-template-columns: 44px 3px minmax(0,1fr) auto; }
.schedule-row time { font-size: 12px; font-weight: 650; }

.profile-hero { padding: calc(22px + var(--safe-top)) 18px 20px; color: white; background: var(--wine); }
.profile-top { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; gap: 13px; align-items: center; }
.profile-avatar { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; color: var(--wine); background: white; font-size: 18px; font-weight: 700; }
.profile-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 7px; }
.profile-copy h1 { font-size: 20px; font-weight: 620; }
.profile-copy p { margin-top: 5px; color: rgba(255,255,255,.78); font-size: 11px; }
.profile-qr { color: rgba(255,255,255,.85); }
.profile-signature { margin-top: 15px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.78); font-size: 11px; line-height: 1.5; }
.company-band {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 10px 16px;
  text-align: left;
  background: white;
  border-bottom: 1px solid var(--line);
}
.company-band img { width: 38px; height: 38px; object-fit: contain; }
.company-band strong { display: block; color: var(--ink); font-size: 14px; font-weight: 630; }
.company-band small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.verified { display: inline-flex; align-items: center; gap: 3px; color: var(--teal); }
.verified svg { width: 13px; height: 13px; fill: currentColor; }
.profile-section { margin-top: 10px; background: white; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-section h2 { padding: 10px 16px 6px; color: var(--muted); font-size: 11px; font-weight: 500; }
.info-row {
  width: calc(100% - 16px);
  min-height: 54px;
  display: grid;
  grid-template-columns: 26px minmax(84px,1fr) minmax(0,1.7fr) auto;
  gap: 9px;
  align-items: center;
  margin-left: 16px;
  padding-right: 14px;
  text-align: left;
  border-top: 1px solid #edf0f2;
}
.profile-section h2 + .info-row { border-top: 0; }
.info-row > svg:first-child { width: 18px; color: var(--wine); }
.info-row span { font-size: 13px; }
.info-row strong { overflow-wrap: anywhere; text-align: right; color: #555c66; font-size: 12px; font-weight: 500; }
.info-row > svg:last-child { width: 15px; color: #afb4bb; }

.detail-page {
  display: none;
  min-height: 100dvh;
  padding-bottom: calc(18px + var(--safe-bottom));
  background: var(--canvas);
}
.detail-page.active { display: block; animation: detail-in .26s cubic-bezier(.22,1,.36,1); }
@keyframes detail-in { from { opacity: .75; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
.detail-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: calc(58px + var(--safe-top));
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) 42px;
  align-items: end;
  padding: calc(8px + var(--safe-top)) 8px 8px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.detail-header > div { align-self: center; min-width: 0; text-align: center; }
.detail-header h1 { overflow: hidden; color: var(--ink); font-size: 17px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.detail-header small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.detail-body { min-height: calc(100dvh - 58px); }
.detail-hero { padding: 18px 16px; color: white; background: var(--wine); }
.detail-hero .eyebrow { color: #e5c58c; font-size: 10px; font-weight: 650; }
.detail-hero h2 { margin-top: 6px; font-size: 21px; font-weight: 620; line-height: 1.3; }
.detail-hero p { margin-top: 8px; color: rgba(255,255,255,.75); font-size: 11px; line-height: 1.55; }
.detail-stat-grid { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 15px; border-top: 1px solid rgba(255,255,255,.18); }
.detail-stat-grid div { padding-top: 12px; }
.detail-stat-grid span { display: block; color: rgba(255,255,255,.6); font-size: 9px; }
.detail-stat-grid strong { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; }
.detail-section { margin-top: 10px; padding: 0 16px; background: white; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-section > h3 { padding: 13px 0 10px; color: var(--ink); font-size: 14px; font-weight: 650; }
.detail-row {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(90px,1fr) minmax(0,1.7fr);
  gap: 12px;
  align-items: center;
  border-top: 1px solid #edf0f2;
}
.detail-section > h3 + .detail-row { border-top: 0; }
.detail-row span { color: var(--muted); font-size: 11px; }
.detail-row strong { overflow-wrap: anywhere; text-align: right; font-size: 12px; font-weight: 550; }
.task-row, .milestone-row, .file-row, .approval-row {
  min-height: 56px;
  display: grid;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #edf0f2;
}
.detail-section > h3 + .task-row,
.detail-section > h3 + .milestone-row,
.detail-section > h3 + .file-row,
.detail-section > h3 + .approval-row { border-top: 0; }
.task-row { grid-template-columns: 22px minmax(0,1fr); }
.task-row i { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #c8cdd3; border-radius: 50%; color: white; font-style: normal; }
.task-row.done i { border-color: var(--teal); background: var(--teal); }
.task-row span { font-size: 12px; }
.milestone-row { grid-template-columns: 18px minmax(0,1fr) auto; }
.milestone-row i { width: 9px; height: 9px; margin-left: 3px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.milestone-row span { font-size: 12px; }
.milestone-row small { color: var(--muted); font-size: 9px; }
.file-row { grid-template-columns: 34px minmax(0,1fr) auto; }
.file-row > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: var(--wine); background: var(--wine-soft); }
.file-row strong { display: block; font-size: 12px; font-weight: 550; }
.file-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.file-row > svg { width: 16px; color: #9ba1a9; }

.article { padding: 18px 17px 30px; background: white; }
.article .article-meta { color: var(--wine); font-size: 10px; font-weight: 650; }
.article h2 { margin-top: 8px; color: var(--ink); font-size: 23px; font-weight: 650; line-height: 1.35; }
.article .byline { margin-top: 10px; color: var(--muted); font-size: 10px; }
.article .abstract { margin-top: 16px; padding: 12px; color: #5f5545; background: var(--gold-soft); border-left: 3px solid var(--gold); font-size: 12px; line-height: 1.7; }
.article h3 { margin-top: 22px; color: var(--ink); font-size: 16px; }
.article p { margin-top: 10px; color: #474d55; font-size: 13px; line-height: 1.85; }

.mail-detail-head { padding: 16px; background: white; border-bottom: 1px solid var(--line); }
.mail-detail-head h2 { color: var(--ink); font-size: 20px; font-weight: 650; line-height: 1.4; }
.sender-line { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; align-items: center; margin-top: 14px; }
.sender-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 7px; color: white; background: var(--wine); font-size: 12px; font-weight: 650; }
.sender-line strong { display: block; font-size: 13px; }
.sender-line small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.sender-line time { color: var(--muted); font-size: 9px; }
.mail-content { min-height: 260px; padding: 18px 16px; white-space: pre-line; background: white; font-size: 13px; line-height: 1.85; }
.attachment-list { padding: 0 16px 14px; background: white; }
.mail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px 18px; }
.mail-actions button, .primary-button, .secondary-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.mail-actions button:first-child, .primary-button { color: white; background: var(--wine); }
.mail-actions button:last-child, .secondary-button { color: var(--wine); background: white; border: 1px solid #d9c7cb; }

.chat-thread { min-height: calc(100dvh - 118px); padding: 14px 13px 84px; background: #eef0f3; }
.chat-message { display: flex; gap: 8px; margin-bottom: 14px; }
.chat-message.me { justify-content: flex-end; }
.chat-message .bubble { max-width: 78%; padding: 10px 12px; border-radius: 7px; background: white; font-size: 12px; line-height: 1.6; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.chat-message.me .bubble { color: white; background: var(--wine); }
.chat-composer { position: fixed; left: 50%; bottom: 0; z-index: 40; width: min(100%,520px); min-height: calc(58px + var(--safe-bottom)); display: grid; grid-template-columns: 32px minmax(0,1fr) 38px; gap: 8px; align-items: start; padding: 9px 12px calc(9px + var(--safe-bottom)); transform: translateX(-50%); background: white; border-top: 1px solid var(--line); }
.chat-composer input { height: 38px; padding: 0 10px; border: 1px solid #dfe2e6; border-radius: 6px; background: #f7f8f9; }
.chat-composer button { height: 38px; display: grid; place-items: center; color: white; background: var(--wine); border-radius: 6px; }

.approval-list { padding-bottom: 2px; }
.approval-row { grid-template-columns: 38px minmax(0,1fr) auto; }
.approval-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; color: var(--wine); background: var(--wine-soft); }
.approval-icon svg { width: 19px; }
.approval-row strong { display: block; font-size: 12px; font-weight: 600; }
.approval-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.approval-row > span:last-child { color: var(--wine); font-size: 9px; }
.action-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px calc(14px + var(--safe-bottom)); }

.module-banner { padding: 20px 16px; color: white; background: #202a3c; }
.module-banner span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--module-color); }
.module-banner h2 { margin-top: 14px; font-size: 21px; font-weight: 620; }
.module-banner p { margin-top: 7px; color: rgba(255,255,255,.7); font-size: 11px; line-height: 1.6; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  width: min(100%, 520px);
  height: calc(64px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 5px 5px var(--safe-bottom);
  transform: translateX(-50%);
  background: rgba(255,255,255,.97);
  border-top: 1px solid #dfe2e6;
  backdrop-filter: blur(16px);
}
.bottom-nav[hidden] { display: none; }
.bottom-nav button { min-width: 0; display: grid; place-items: center; align-content: center; gap: 2px; color: #7b818a; }
.bottom-nav button > span { position: relative; height: 27px; display: grid; place-items: center; }
.bottom-nav svg { width: 22px; height: 22px; }
.bottom-nav b { font-size: 10px; font-weight: 500; }
.bottom-nav em { position: absolute; top: -4px; left: 14px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; border: 2px solid white; border-radius: 8px; color: white; background: #d7444c; font-size: 7px; font-style: normal; }
.bottom-nav button.active { color: var(--wine); }
.bottom-nav button.active b { font-weight: 650; }

.sheet-layer { position: fixed; inset: 0; z-index: 100; }
.sheet-layer[hidden] { display: none; }
.sheet-mask { position: absolute; inset: 0; width: 100%; background: rgba(20,23,29,.48); }
.bottom-sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(100%,520px);
  max-height: 86dvh;
  overflow-y: auto;
  padding: 8px 16px calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  background: white;
  border-radius: 8px 8px 0 0;
  animation: sheet-in .24s cubic-bezier(.22,1,.36,1);
}
@keyframes sheet-in { from { transform: translate(-50%,100%); } to { transform: translate(-50%,0); } }
.sheet-handle { width: 34px; height: 4px; margin: 0 auto 12px; border-radius: 2px; background: #d1d4d8; }
.sheet-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-title h2 { font-size: 18px; }
.sheet-title button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #f0f1f2; }
.compose-form label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 10px; }
.compose-form input, .compose-form textarea {
  width: 100%;
  margin-top: 5px;
  padding: 10px 11px;
  color: var(--text);
  border: 1px solid #dfe2e6;
  border-radius: 6px;
  background: #f8f9fa;
  font-size: 13px;
}
.compose-form input { height: 42px; }
.compose-form textarea { min-height: 130px; resize: vertical; }
.search-input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #dfe2e6; border-radius: 6px; background: #f8f9fa; }
.sheet-results { margin-top: 12px; }
.sheet-result { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 10px; text-align: left; border-top: 1px solid #edf0f2; }
.sheet-result:first-child { border-top: 0; }
.sheet-result svg { color: var(--wine); }
.sheet-result span { font-size: 12px; }
.sheet-result small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(82px + var(--safe-bottom));
  z-index: 140;
  max-width: min(84vw, 420px);
  padding: 9px 14px;
  transform: translate(-50%, 10px);
  border-radius: 6px;
  color: white;
  background: rgba(23,26,31,.9);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { transform: translate(-50%,0); opacity: 1; }

.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state svg { width: 34px; height: 34px; margin: 0 auto 10px; color: #b6bbc2; }
.empty-state strong { display: block; color: var(--text); font-size: 14px; }
.empty-state p { margin-top: 6px; font-size: 11px; }

@media (max-width: 360px) {
  .brand-header, .page-header { padding-left: 12px; padding-right: 12px; }
  .section { padding-left: 12px; padding-right: 12px; }
  .quick-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .quick-grid button { font-size: 10px; }
  .brief-top h1 { font-size: 22px; }
  .project-list { padding-left: 9px; padding-right: 9px; }
}

@media (min-width: 700px) {
  .app-shell { min-height: calc(100dvh - 32px); margin: 16px auto; border-radius: 8px; overflow: hidden; }
  .bottom-nav { bottom: 16px; border-radius: 0 0 8px 8px; }
  .chat-composer { bottom: 16px; }
}
