* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: #f5f3ef;
  color: #2b2b26;
}
.hidden { display: none !important; }
.app-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #3f4a3c; color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.facility-name { font-weight: 600; font-size: 15px; }
.app-header select, .staff-name {
  font-size: 14px; padding: 6px; border-radius: 6px; border: none;
}
.view { padding: 16px; max-width: 720px; margin: 0 auto; }
.primary-btn {
  background: #3f4a3c; color: #fff; border: none; border-radius: 8px;
  padding: 12px 20px; font-size: 16px; cursor: pointer;
}
.secondary-btn {
  background: #fff; color: #3f4a3c; border: 1px solid #3f4a3c; border-radius: 8px;
  padding: 10px 16px; font-size: 14px; cursor: pointer;
}
.danger-btn {
  background: #fff; color: #a33; border: 1px solid #a33; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; cursor: pointer;
}
.resume-box { margin-top: 32px; }
.resume-row { display: flex; gap: 8px; margin-top: 8px; }
.resume-row input {
  flex: 1; font-size: 16px; padding: 10px; border: 1px solid #bbb; border-radius: 8px;
  text-transform: uppercase;
}
.tabs {
  display: flex; gap: 4px; padding: 8px 16px 0; max-width: 720px; margin: 0 auto;
  overflow-x: auto;
}
.tab-btn {
  flex: 1; padding: 10px 6px; border: 1px solid #ccc; border-bottom: none;
  background: #e9e6df; border-radius: 8px 8px 0 0; font-size: 14px; cursor: pointer;
  white-space: nowrap;
}
.tab-btn.active { background: #fff; font-weight: 600; }
.tab-panel {
  background: #fff; border: 1px solid #ccc; border-radius: 0 0 8px 8px;
  padding: 12px; min-height: 50vh;
}
.doc h2 { font-size: 16px; margin: 8px 0; }
.doc { line-height: 1.7; font-size: 14px; overflow-wrap: break-word; }
.doc img { max-width: 100%; height: auto; }
.hint { color: #777; font-size: 13px; }
.code-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: #f5f3ef; border-radius: 8px; padding: 8px 12px; margin-bottom: 4px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips-title { width: 100%; font-size: 12px; color: #777; }
.chip {
  background: #eef1ea; border: 1px solid #c8cfc0; border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.chip-seen { opacity: 0.5; }
.message-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 52vh; overflow-y: auto; padding: 8px 2px;
}
.msg { max-width: 85%; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg.theirs { align-self: flex-start; }
.msg-who { font-size: 11px; color: #888; margin-bottom: 2px; }
.msg-original { font-size: 12px; color: #999; margin-top: 2px; }
.bubble {
  display: inline-block; padding: 9px 12px; border-radius: 14px;
  background: #eef1ea; text-align: left; white-space: pre-wrap; overflow-wrap: break-word;
}
.msg.mine .bubble { background: #3f4a3c; color: #fff; }
.msg.auto .bubble { background: #dfe5d8; color: #2b2b26; }
.send-form { display: flex; gap: 8px; margin-top: 10px; }
.send-form input {
  flex: 1; font-size: 16px; padding: 11px; border: 1px solid #bbb; border-radius: 8px;
}
.conv-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: #fff; border: 1px solid #ddd; border-radius: 8px;
  padding: 12px; margin-bottom: 8px; font-size: 14px; cursor: pointer; text-align: left;
}
.conv-item.priority { border-color: #a33; background: #fdf3f3; }
.conv-code { font-weight: 700; letter-spacing: 1px; }
.conv-meta { color: #888; font-size: 12px; }
.conv-flags { color: #a33; font-size: 12px; }
.badge {
  background: #c0392b; color: #fff; border-radius: 999px;
  min-width: 20px; height: 20px; line-height: 20px; text-align: center; font-size: 12px;
}
.thread-head {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0;
}
