:root {
  color-scheme: light;
  --teal: #0B6E6E; --orange: #F57C00; --ink: #1C2423;
  --muted: rgba(28,36,35,.55); --line: rgba(28,36,35,.08); --bg: #E8EEED;
  --app-tf-accent: #0B6E6E;
}
body.has-compose-actions {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}
body.has-compose-actions .bottom-nav { display: none; }
.bar .icon-btn, .bar .text-btn {
  height: 40px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); cursor: pointer;
  display: grid; place-items: center; flex: none; padding: 0 10px;
}
.bar .icon-btn { width: 40px; padding: 0; }
.bar .text-btn {
  font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #2A9B9B, #0B6E6E);
  border-radius: 999px; min-width: 72px;
}
.bar .text-btn:disabled { opacity: .55; cursor: default; }
.compose-shell { max-width: 560px; margin: 0 auto; }
.page { padding: 12px 12px 24px; }
.author {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.author .av {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  background: #DCE9E7; color: var(--teal); display: grid; place-items: center;
  font-weight: 800; flex: none;
}
.author .av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.author .meta { flex: 1; min-width: 0; }
.author .meta strong { display: block; font-size: 15px; }
.author .chip {
  display: inline-flex; margin-top: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 800; color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, #fff);
}
.content-box textarea {
  width: 100%; min-height: 140px; border: 0; resize: vertical;
  padding: 0; background: transparent; color: var(--ink); outline: none;
  font-size: 16px; line-height: 1.45;
}
.content-box textarea::placeholder { color: rgba(28,36,35,.4); }
.status-line {
  display: none; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px;
  background: #EEF6F5; color: var(--teal); font-size: 13px; font-weight: 700;
}
.status-line.show { display: block; }
.preview-block { margin-top: 12px; }
.preview-label {
  display: block; font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 8px;
}
.media-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.media-tile {
  width: 88px; height: 88px; border-radius: 12px; overflow: hidden;
  position: relative; background: #E7EEEC; flex: none;
}
.media-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile .vid {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: #1C2423; color: #fff; font-size: 11px; font-weight: 700; text-align: center; padding: 6px;
}
.media-tile button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.media-tile button svg { width: 12px; height: 12px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 6px 8px 6px 10px; border-radius: 999px;
  background: #F3F7F6; border: 1px solid var(--line); font-size: 13px; font-weight: 700;
}
.tag-chip .rm {
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.tag-chip .rm svg { width: 14px; height: 14px; }
.attach-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px;
}
.attach-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 8px; border: 0; border-radius: 8px;
  background: transparent; text-align: left; cursor: pointer; color: var(--ink);
}
.attach-item:disabled { opacity: .4; cursor: default; }
.attach-item .ico {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: var(--ico, var(--teal));
  background: color-mix(in srgb, var(--ico, var(--teal)) 12%, #fff);
}
.attach-item .ico svg { width: 22px; height: 22px; }
.attach-item span { font-size: 14px; font-weight: 700; }
.actions-bar {
  display: none; gap: 10px; box-sizing: border-box; width: 100%;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid color-mix(in srgb, var(--teal) 18%, transparent);
  box-shadow: 0 -6px 18px rgba(0,0,0,.06);
}
.btn-primary { background: linear-gradient(135deg, #2A9B9B, #0B6E6E); color: #fff; }
.sheet-panel {
  position: relative; width: 100%; max-width: 560px; max-height: 78vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 20px 20px 0 0; padding: 8px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,.12);
}
.sheet-handle {
  width: 36px; height: 4px; border-radius: 999px; background: rgba(28,36,35,.18);
  margin: 6px auto 10px;
}
.sheet-panel h2 { margin: 0 16px 10px; font-size: 17px; }
.sheet-search { padding: 0 16px 10px; }
.sheet-search input {
  width: 100%; min-height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid rgba(28,36,35,.16); background: #F7FAF9;
}
.sheet-list { flex: 1; overflow: auto; padding: 0 8px 16px; min-height: 180px; }
.sheet-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 8px; border: 0; border-radius: 12px;
  background: transparent; text-align: left; cursor: pointer; color: inherit;
}
.sheet-row:hover { background: #F3F7F6; }
.sheet-row .av {
  width: 40px; height: 40px; border-radius: 10px; overflow: hidden; flex: none;
  background: #E6F0ED; display: grid; place-items: center; color: var(--teal);
}
.sheet-row .av.round { border-radius: 50%; }
.sheet-row .av img { width: 100%; height: 100%; object-fit: cover; }
.sheet-row .meta { flex: 1; min-width: 0; }
.sheet-row .meta strong {
  display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-row .meta span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.sheet-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.sheet-done {
  margin: 0 16px 16px; min-height: 44px; border-radius: 12px; border: 0;
  background: var(--teal); color: #fff; font-weight: 800; cursor: pointer;
}
.state .cta {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 0;
  background: var(--teal); color: #fff; font-weight: 700; cursor: pointer;
}
.state[hidden], #compose-root[hidden] { display: none; }
@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
  body.has-php-inbox.has-compose-actions { padding-bottom: 0; }
  body.has-php-inbox .compose-shell {
    display: flex; flex-direction: column; min-height: calc(100vh - 24px);
  }
  body.has-php-inbox .compose-shell > .page { flex: 1 1 auto; }
  }
