:root {
  --page-bg: #f3f5f8;
  --card-bg: #ffffff;
  --text-strong: #1e293b;
  --text-normal: #334155;
  --text-muted: #64748b;
  --line: #dbe3ee;
  --line-strong: #c7d3e2;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;
  --primary-soft: #ecf3ff;
  --action-blue: #5f86c8;
  --action-blue-hover: #5378b7;
  --action-blue-active: #496ca8;
  --action-blue-focus: rgba(95, 134, 200, 0.12);
  --focus-ring-soft: 0 0 0 2px rgba(37, 99, 235, 0.08);
  --focus-ring: 0 0 0 2px rgba(37, 99, 235, 0.1);
  --danger-bg: #fef2f2;
  --danger-line: #fecaca;
  --danger-text: #b42318;
  --success-bg: #ecfdf3;
  --success-line: #b7ebc6;
  --success-text: #067647;
  --radius-card: 16px;
  --radius-control: 10px;
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 16px 32px;
  background: var(--page-bg);
  color: var(--text-normal);
  font-family: 'PingFang SC', 'Noto Sans SC', 'Hiragino Sans GB', sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

.container {
  width: 100%;
  max-width: 470px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-strong);
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.section {
  margin: 0;
}

.section + .section {
  margin-top: 20px;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-normal);
}

.input-control {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--text-strong);
  padding: 11px 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-control::placeholder {
  color: #8b99ab;
}

.input-control:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.input-code {
  text-align: center;
  font-size: 28px;
  letter-spacing: 0.28em;
  font-weight: 600;
  padding-left: 22px;
}

.home-code {
  text-align: left;
  font-size: 15px;
  letter-spacing: 0;
  font-weight: 400;
  padding-left: 12px;
}

.home-code::placeholder {
  font-size: 14px;
  font-weight: 400;
}

.text-area {
  min-height: 190px;
  line-height: 1.65;
  resize: vertical;
}

.share-form {
  padding: 0;
  border: none;
  background: transparent;
}

.composer-shell {
  border: 1px solid #b8c8de;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer-shell:focus-within {
  border-color: var(--primary);
  box-shadow: var(--focus-ring-soft);
}

.composer-shell.dragging {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.share-form .compose-text {
  min-height: 148px;
  padding: 14px;
  border: none;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  font-size: 15px;
  font-weight: 400;
}

.share-form .compose-text:focus {
  border-color: transparent;
  box-shadow: none;
}

.share-form .compose-text::placeholder {
  color: #7f90a8;
  font-size: 14px;
  font-weight: 400;
}

.composer-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-top: 1px solid #e1e9f4;
  background: #f8fbff;
}

.actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  appearance: none;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 0 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--action-blue-focus);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--action-blue);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--action-blue-hover);
}

.btn-primary:active:not(:disabled) {
  background: var(--action-blue-active);
}

.btn-ghost {
  background: #f8fafc;
  border-color: var(--line);
  color: #1e3a8a;
}

.btn-ghost:hover:not(:disabled) {
  background: #eef4fc;
  border-color: #c6d7ef;
}

.tab-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f4f7fb;
}

.tab-btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn:hover {
  color: #3c4f67;
}

.tab-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-soft);
}

.tab-btn.active {
  border-color: #d6e0ee;
  background: #fff;
  color: var(--text-strong);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.drop-zone {
  min-height: 186px;
  border: 2px dashed #b2c0d3;
  border-radius: 12px;
  background: #f9fbfe;
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.drop-zone:hover {
  border-color: #8ea3be;
  background: #f4f8ff;
}

.share-form .drop-zone {
  min-height: auto;
  border-width: 1px;
  border-style: dashed;
  border-color: #bccce2;
  border-radius: 999px;
  background: #ffffff;
  padding: 6px 12px;
  flex-shrink: 0;
  text-align: left;
}

.share-form .drop-zone:hover {
  border-color: #a3b9d8;
  background: #f4f8ff;
}

.share-form .drop-zone > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drop-zone:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.drop-zone.dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.drop-zone.has-file {
  border-style: solid;
  border-color: #a1b9e8;
  background: #f4f8ff;
}

.share-form .drop-zone.dragging {
  border-width: 1px;
  border-style: solid;
}

.share-form .drop-zone.has-file {
  border-color: #afc3e2;
  background: #f1f6ff;
}

.drop-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
}

.drop-hint {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

.share-form .drop-title {
  font-size: 13px;
  font-weight: 600;
  color: #4a617f;
}

.share-form .drop-hint {
  margin: 0;
  font-size: 12px;
  color: #74879f;
}

.file-meta {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #f8fafd;
  color: var(--text-normal);
  font-size: 14px;
  word-break: break-word;
}

.file-meta.show {
  display: block;
}

.share-form .file-meta {
  margin: 0;
  border-color: #cfdae9;
  border-radius: 10px;
  background: #f3f8ff;
  color: #425873;
  font-size: 13px;
  padding: 8px 10px;
}

.share-form .file-meta.show {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1 1 200px;
  min-width: 0;
}

.file-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-remove-btn {
  border: none;
  background: transparent;
  color: #5f7290;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.file-remove-btn:hover {
  color: #425873;
}

.share-form .actions {
  margin-top: 14px;
}

.home-link {
  border: none;
  padding: 0;
  margin: 0;
  min-height: auto;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.home-link:hover {
  color: var(--primary-hover);
}

.status {
  display: none;
  margin-top: 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 10px 12px;
  font-size: 14px;
}

.status.show {
  display: block;
}

.status-error {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.status-success {
  border-color: var(--success-line);
  background: var(--success-bg);
  color: var(--success-text);
}

.result-card {
  display: none;
  margin-top: 14px;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  background: #f5f9ff;
  padding: 12px 14px;
}

.result-card.show {
  display: block;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-text {
  margin: 0;
  color: #123b8f;
  font-size: 15px;
}

.result-code-inline {
  color: #0f3fa6;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.btn-copy {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.copy-tip {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--success-text);
  min-height: 18px;
}

.content-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.chat-title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.chat-title-label {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
}

.room-code-inline {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.dialog-shell {
  padding: 0;
}

.page-view {
  padding-bottom: 0;
}

.page-view .view-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 720px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

.page-view .page-header,
.page-view .dialog-shell,
.page-view .status {
  flex-shrink: 0;
}

.page-view .dialog-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 340px;
  max-height: 56vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 8px 0 0;
  padding-right: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 177, 201, 0.42) transparent;
}

.page-view .message-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.message-list::-webkit-scrollbar,
.chat-input::-webkit-scrollbar {
  width: 10px;
}

.message-list::-webkit-scrollbar-track,
.chat-input::-webkit-scrollbar-track {
  background: transparent;
}

.message-list::-webkit-scrollbar-thumb,
.chat-input::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(160, 177, 201, 0.32);
  background-clip: padding-box;
}

.message-list::-webkit-scrollbar-thumb:hover,
.chat-input::-webkit-scrollbar-thumb:hover {
  background: rgba(160, 177, 201, 0.46);
  background-clip: padding-box;
}

.message-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.chat-row {
  display: flex;
  width: 100%;
  padding: 0 12px;
}

.chat-row.own {
  justify-content: flex-end;
}

.chat-row.other {
  justify-content: flex-start;
}

.chat-bubble {
  display: inline-flex;
  flex-direction: column;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--sender-line, var(--line));
  border-radius: 15px;
  background: var(--sender-soft, #fff);
  padding: 11px 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.chat-row.own .chat-bubble {
  border-bottom-right-radius: 5px;
}

.chat-row.other .chat-bubble {
  border-bottom-left-radius: 5px;
}

.chat-item {
  display: inline-flex;
  width: auto;
  max-width: 90%;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.chat-row.own .chat-item {
  align-items: flex-end;
}

.chat-row.other .chat-item {
  align-items: flex-start;
}

.message-side-time {
  font-size: 12px;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1.35;
}

.chat-bubble {
  order: 0;
}

.message-side-time {
  order: 1;
}

.message-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-text {
  margin: 0;
  color: var(--text-normal);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-file {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  padding: 10px 12px;
}

.message-file-name {
  color: var(--text-strong);
  font-size: 14px;
  word-break: break-word;
}

.dialog-shell .composer-footer {
  margin-top: 4px;
  min-height: 46px;
  padding: 10px 12px;
  border-top: 1px solid #e1e9f4;
  border-bottom: 1px solid #e1e9f4;
  background: #f8fbff;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
}

.dialog-shell .drop-zone {
  width: auto;
  min-height: auto;
  border-width: 1px;
  border-style: dashed;
  border-color: #bccce2;
  border-radius: 999px;
  background: #ffffff;
  padding: 6px 12px;
  flex: 0 0 auto;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.dialog-shell .drop-zone:hover {
  border-color: #a3b9d8;
  background: #f4f8ff;
}

.dialog-shell .drop-zone.dragging {
  border-width: 1px;
  border-style: solid;
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dialog-shell .drop-zone.has-file {
  border-color: #afc3e2;
  background: #f1f6ff;
}

.dialog-shell .drop-zone.is-hidden,
.dialog-shell .file-meta.is-hidden {
  display: none !important;
}

.dialog-shell .drop-zone.is-disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.dialog-shell .drop-title {
  font-size: 13px;
  font-weight: 600;
  color: #4a617f;
}

.dialog-shell .drop-hint {
  margin: 0;
  font-size: 12px;
  color: #74879f;
  white-space: nowrap;
}

.dialog-shell .file-meta {
  margin: 0;
  border-width: 1px;
  border-style: dashed;
  border-color: #bccce2;
  border-radius: 999px;
  background: #ffffff;
  color: #425873;
  font-size: 13px;
  padding: 6px 12px;
  width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
}

.dialog-shell .file-meta.show {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.dialog-shell .file-meta.show:hover {
  border-color: #a3b9d8;
  background: #f4f8ff;
}

.file-inline-left {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 50%;
  padding-right: 4px;
  gap: 8px;
}

.file-inline-main {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.55;
}

.file-inline-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.file-inline-name {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-inline-name-btn {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.file-inline-name-btn:hover {
  color: var(--primary);
}

.file-inline-name-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-soft);
}

.dialog-shell .file-remove-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: #edf2f8;
  color: #60748d;
  line-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 0;
  vertical-align: middle;
}

.dialog-shell .file-remove-btn:hover {
  color: #42556c;
  background: #e0e8f3;
}

.file-remove-icon {
  width: 14px;
  height: 14px;
  stroke: #d14343;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}

.file-actions {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  align-self: center;
  gap: 12px;
}

.file-inline-link {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}

.file-inline-link:hover {
  color: var(--primary-hover);
}

.file-inline-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-soft);
}

body.file-preview-open {
  overflow: hidden;
}

.file-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
}

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

.file-preview-dialog {
  width: min(92vw, 760px);
  max-height: min(86vh, 720px);
  max-height: min(86dvh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.24);
}

.file-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.file-preview-title {
  min-width: 0;
  margin: 0;
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: #edf2f8;
  color: #60748d;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.file-preview-close:hover {
  color: #42556c;
  background: #e0e8f3;
}

.file-preview-close:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-soft);
}

.file-preview-close-icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  fill: none;
}

.file-preview-body {
  min-height: 220px;
  overflow: auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-preview-body.is-text {
  align-items: flex-start;
  justify-content: flex-start;
}

.file-preview-image {
  display: block;
  max-width: 100%;
  max-height: calc(86vh - 92px);
  max-height: calc(86dvh - 92px);
  object-fit: contain;
}

.file-preview-text {
  width: 100%;
  min-height: 100%;
  margin: 0;
  color: var(--text-normal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.file-preview-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.chat-input-shell {
  position: relative;
  padding: 10px 12px 12px;
}

.chat-input {
  min-height: 96px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 2px 0 50px 0;
  font-size: 13px;
  resize: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 177, 201, 0.42) transparent;
}

.chat-input:focus {
  border-color: transparent;
  box-shadow: none;
}

.chat-send-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  min-width: 84px;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
}

.online-hint {
  margin: 0;
  padding: 0 12px 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.section-title {
  margin: 0 0 12px;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 600;
}

.text-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.75;
  min-height: 0;
  margin: 0;
  color: var(--text-normal);
  font-size: 14px;
}

.file-name-label {
  color: var(--text-muted);
  font-size: 13px;
}

.file-name-value {
  margin-top: 6px;
  color: var(--text-strong);
  font-size: 15px;
  word-break: break-word;
}

.file-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  text-decoration: none;
}

.file-download.btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

@media (max-width: 768px) {
  body {
    padding: 0 12px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  input[type='text'],
  input[type='number'],
  input[type='search'],
  input[type='email'],
  input[type='tel'],
  input[type='url'],
  textarea,
  select {
    font-size: 16px;
  }

  .container {
    padding: 20px 16px;
    border-radius: 14px;
  }

  .page-view {
    padding-bottom: 0;
  }

  .page-view .view-shell {
    min-height: 0;
  }

  .page-title {
    font-size: 24px;
  }

  .input-code {
    font-size: 24px;
    letter-spacing: 0.2em;
    padding-left: 14px;
  }

  .home-code {
    font-size: 16px;
    letter-spacing: 0;
    padding-left: 12px;
  }

  .drop-zone {
    min-height: 160px;
  }

  .share-form {
    padding: 0;
  }

  .share-form .compose-text {
    min-height: 120px;
  }

  .composer-footer {
    padding: 10px;
  }

  .share-form .drop-zone {
    width: 100%;
    border-radius: 10px;
    padding: 8px 10px;
  }

  .share-form .drop-zone > div {
    justify-content: space-between;
    width: 100%;
  }

  .share-form .file-meta.show {
    flex-basis: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .result-row {
    align-items: flex-start;
  }

  .result-code-inline {
    font-size: 18px;
  }

  .message-list {
    min-height: 280px;
    max-height: 48vh;
  }

  .chat-bubble {
    max-width: 100%;
  }

  .dialog-shell .drop-zone {
    min-height: 42px;
  }

  .dialog-shell .file-meta.show {
    gap: 10px;
  }

  .file-inline-left {
    max-width: 55%;
    flex-basis: 55%;
  }

  .file-actions {
    gap: 10px;
  }

  .file-preview-backdrop {
    padding: 12px;
  }

  .file-preview-dialog {
    width: 100%;
    max-height: 84vh;
    max-height: 84dvh;
  }

  .chat-input-shell {
    padding: 10px 10px 10px;
  }

  .share-form .compose-text,
  .chat-input {
    font-size: 16px;
  }

  .chat-send-btn {
    right: 10px;
    bottom: 10px;
  }
}

@media (pointer: coarse) {
  input[type='text'],
  textarea {
    font-size: 16px;
  }

  .share-form .compose-text,
  .chat-input {
    font-size: 16px;
  }

  .page-view .view-shell {
    min-height: 0;
  }

  .home-link {
    padding: 12px 10px;
    margin: -12px -10px;
  }

  .chat-send-btn {
    min-height: 44px;
  }

  .btn-copy {
    min-height: 40px;
  }

  .file-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0 6px;
  }

  .dialog-shell .file-remove-btn {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .file-inline-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 4px;
  }

  .file-preview-close {
    width: 36px;
    height: 36px;
  }

  .share-form .drop-zone,
  .dialog-shell .drop-zone {
    min-height: 44px;
  }
}

@media (max-width: 768px) and (orientation: portrait) and (pointer: coarse) {
  body {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }

  .page-view .view-shell {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .page-view .dialog-shell {
    flex: none;
  }

  .page-view .message-list {
    flex: none;
    height: max(180px, calc(100vh - 300px));
    height: max(180px, calc(100svh - 300px));
  }
}
