:root {
  font-family:
    Inter,
    "Noto Sans JP",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #203a40;
  background: #f4f6f8;
  font-size: 14px;
  font-synthesis: none;
}
#file-dialog {
  width: min(580px, calc(100vw - 24px));
  max-height: 90vh;
  overflow-y: auto;
}
#file-dialog p {
  margin: 12px 0;
  overflow-wrap: anywhere;
}
#file-dialog details {
  margin-bottom: 18px;
}
#file-dialog summary {
  cursor: pointer;
  margin-bottom: 12px;
}
#file-dialog select {
  width: 100%;
}
#file-dialog .check {
  flex-direction: row;
  align-items: center;
}
#file-error {
  color: #95612c;
}
.mail-file-button {
  margin-top: 8px;
  font-size: 12px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 7px;
  padding: 9px 12px;
  background: #f0f4f5;
  color: #38555d;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: #23796a;
  text-decoration: none;
}
input,
select,
textarea {
  border: 1px solid #dce4e6;
  border-radius: 7px;
  background: white;
  color: inherit;
  padding: 10px;
  max-width: 100%;
  min-width: 0;
}
textarea {
  resize: vertical;
  line-height: 1.65;
  width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #73b7a8;
  outline-offset: 1px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 600;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 24px;
  letter-spacing: 0.01em;
}
h2 {
  font-size: 16px;
}
h3 {
  font-size: 13px;
}
.primary {
  background: #207768;
  color: white;
  font-weight: 650;
}
.attachment-info {
  font-size: 12px;
  margin-top: 7px;
  padding: 8px;
  border: 1px solid #dce4e6;
  border-radius: 6px;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.secondary {
  border: 1px solid #dae3e6;
  background: white;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: #829496;
}
.muted {
  font-size: 12px;
  color: #74868a;
  line-height: 1.8;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.login-card {
  max-width: 420px;
  margin: 12vh auto;
  background: white;
  border: 1px solid #dce5e7;
  border-radius: 16px;
  padding: 35px;
}
.login-card h1 {
  margin: 18px 0;
}
.login-card p {
  line-height: 1.8;
  color: #71858b;
  margin-bottom: 22px;
}
.login-card button {
  width: 100%;
}
#login-error {
  color: #b54f42;
  margin-top: 16px;
}
#app {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #183b40;
  color: #c0d4d4;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.logo {
  display: block;
  color: white;
  letter-spacing: 2px;
  font-size: 18px;
  font-weight: 700;
  padding: 0 8px;
}
.logo span {
  font-size: 10px;
  letter-spacing: 3px;
  display: block;
  margin-top: 6px;
  color: #86b8b2;
}
.workspace-label {
  font-size: 9px;
  letter-spacing: 1.6px;
  margin: 18px 9px -10px;
  color: #7ca4a7;
}
.sidebar select {
  background: #25474d;
  border: 1px solid #375b60;
  color: white;
  font-size: 12px;
  width: 100%;
}
.nav-label {
  display: block;
  font-size: 10px;
  color: #83a5a9;
  margin: 20px 10px 10px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  color: #bed0d1;
  background: none;
  text-align: left;
  font-size: 12px;
  padding: 13px 11px;
  margin: 4px 0;
  border-radius: 7px;
}
.nav.active {
  background: #2f5559;
  color: white;
}
.nav span {
  font-size: 17px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 30px 8px 0;
}
.environment {
  font-size: 10px;
  border: 1px solid #4b7175;
  border-radius: 4px;
  padding: 4px 7px;
}
.sidebar-bottom p {
  font-size: 10px;
  margin-top: 12px;
  color: #87a7a9;
}
.sidebar-bottom button {
  padding-left: 0;
}
main {
  padding: 25px 28px;
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.topbar h1 {
  margin-top: 8px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}
#notification-panel {
  position: relative;
  font-size: 12px;
}
#notification-panel summary {
  cursor: pointer;
  padding: 8px 10px;
  border: 1px solid #bccdd7;
  border-radius: 7px;
  background: #edf4fa;
  white-space: nowrap;
}
.notification-options {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 20;
  width: min(380px, calc(100vw - 32px));
  max-height: 70dvh;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid #dce4e6;
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 24px #203a4022;
  line-height: 1.65;
}
.notification-options p {
  margin-bottom: 12px;
}
.notification-options button {
  margin: 4px 4px 0 0;
}
.notification-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
@media (max-width: 720px) {
  .top-actions {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  #notification-panel {
    position: static;
  }
  .notification-options {
    position: fixed;
    right: 16px;
    top: 95px;
  }
}
.top-actions span {
  font-size: 11px;
  color: #839196;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.metrics button {
  position: relative;
  text-align: left;
  padding: 17px 20px;
  border: 1px solid #e0e6e8;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 3px #183b4003;
}
.metrics span {
  display: block;
  color: #74858a;
  font-size: 11px;
  margin-bottom: 10px;
}
.metrics strong {
  font-size: 27px;
  font-weight: 650;
  line-height: 1;
}
.dot {
  position: absolute;
  right: 20px;
  top: 22px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.attention-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.attention-summary button {
  background: white;
  border: 1px solid #dce5e8;
  font-size: 12px;
}
.attention-summary strong {
  margin-left: 8px;
}
.metrics button[aria-pressed="true"],
.attention-summary button[aria-pressed="true"] {
  border-color: #23796a;
  background: #eef7f4;
}
.summary-help {
  font-size: 11px;
  color: #647a80;
  line-height: 1.7;
  margin: 9px 0 16px;
}
.more-filters {
  padding: 0 16px 6px;
  flex-shrink: 0;
}
#open-filters {
  width: 100%;
  background: white;
  border: 1px solid #dce5e8;
  font-size: 12px;
  text-align: left;
}
#filter-panel {
  flex-shrink: 0;
  padding: 12px 16px;
  border-bottom: 1px solid #dce5e8;
  background: #f6faf9;
  max-height: 45dvh;
  overflow-y: auto;
}
.conversation {
  display: flex;
  flex-direction: column;
}
.conversation #thread,
.conversation #empty {
  flex: 1;
  min-height: 0;
  height: auto;
}
.filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 8px;
}
.filter-fields label {
  margin: 0;
}
.filter-fields > p {
  grid-column: 1 / -1;
}
.filter-fields select,
.filter-fields input {
  width: 100%;
}
.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 6px 16px 12px;
}
.filter-actions button {
  font-size: 11px;
  padding: 5px;
}
.episode .candidate-reason {
  white-space: normal;
  color: #7c642e;
  font-size: 11px;
  line-height: 1.7;
  margin-top: 8px;
}
.orange {
  background: #dd9a48;
}
.blue {
  background: #6699c2;
}
.purple {
  background: #aa94c7;
}
.green {
  background: #7ba69b;
}
#notice:not(:empty) {
  padding: 12px 16px;
  border: 1px solid #e3d5b0;
  background: #fff9eb;
  margin-bottom: 16px;
  border-radius: 8px;
  line-height: 1.7;
}
.desk {
  display: grid;
  grid-template-columns: 280px minmax(300px, 1fr) 250px;
  background: white;
  border: 1px solid #dce5e8;
  border-radius: 12px;
  overflow: hidden;
  min-height: 670px;
  height: calc(100vh - 232px);
}
.inbox-list {
  border-right: 1px solid #e4eaed;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.list-head {
  padding: 20px 17px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.list-head h2 {
  font-size: 13px;
}
#list-count {
  font-size: 11px;
  color: #849597;
}
#search {
  display: flex;
  margin: 0 15px 12px;
  border: 1px solid #e1e7e9;
  border-radius: 7px;
  overflow: hidden;
}
#search input {
  border: 0;
  width: 100%;
  font-size: 12px;
}
#search button {
  background: white;
}
.filters {
  display: flex;
  gap: 7px;
  padding: 0 15px 15px;
}
.filters select {
  width: 50%;
  font-size: 10px;
  padding: 7px;
}
.episode-list {
  overflow-y: auto;
  flex: 1;
}
.episode {
  background: white;
  border-radius: 0;
  width: 100%;
  padding: 17px;
  text-align: left;
  border-top: 1px solid #edf0f2;
  display: block;
  border-left: 3px solid transparent;
}
.episode.active {
  background: #eff7f4;
  border-left-color: #2b8975;
}
.episode:hover {
  background: #f4f8f8;
}
.episode-top {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.channel {
  color: #429075;
  font-weight: 650;
}
.channel.mail {
  color: #668fad;
}
.episode strong {
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.episode p {
  font-size: 11px;
  color: #819196;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.episode-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 10px;
}
.badge {
  display: inline-block;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f9efdd;
  color: #a57d37;
}
.badge.in_progress {
  background: #eaf1f9;
  color: #5279a4;
}
.badge.waiting_customer {
  background: #f0ebf8;
  color: #8c6da5;
}
.badge.closed {
  background: #eaf1ed;
  color: #658375;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-top: 1px solid #e7edef;
  font-size: 11px;
}
.pagination button {
  font-size: 11px;
  background: none;
}
.empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 30px;
  text-align: center;
}
.empty p {
  color: #8a999d;
  font-size: 12px;
  line-height: 1.8;
}
.empty-icon {
  font-size: 38px;
  background: #f0f7f4;
  color: #6b9e91;
  padding: 25px;
  border-radius: 50%;
}
.conversation {
  min-width: 0;
  min-height: 0;
}
.conversation #thread {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 22px;
  border-bottom: 1px solid #e7edef;
}
.thread-head h2 {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.thread-head p {
  font-size: 10px;
  color: #89989c;
  margin-top: 7px;
}
.thread-head #back {
  display: none;
}
.history-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  color: #8b989c;
  font-size: 10px;
  background: #fafcfc;
}
.history-bar span {
  margin-right: auto;
}
.history-bar button {
  font-size: 10px;
  padding: 4px 8px;
}
.messages {
  flex: 1;
  overflow-y: auto;
  background: #fbfcfc;
  padding: 20px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.bubble-wrap {
  max-width: 90%;
  align-self: flex-start;
}
.bubble-wrap.out {
  align-self: flex-end;
}
.bubble-meta {
  font-size: 10px;
  color: #8a989b;
  margin: 0 5px 6px;
}
.bubble {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
  background: white;
  border: 1px solid #e0e7e9;
  border-radius: 0 11px 11px 11px;
  padding: 12px 15px;
  font-size: 12px;
}
.out .bubble {
  background: #eaf4ef;
  border-color: #d8e9df;
  border-radius: 11px 0 11px 11px;
}
.bubble.cancelled {
  font-style: italic;
  color: #8d9699;
  background: #f2f4f5;
}
.bubble-state {
  font-size: 10px;
  color: #7a8d89;
  text-align: right;
  margin-top: 6px;
}
.composer {
  border-top: 1px solid #e1e8eb;
  padding: 18px 20px;
  background: white;
}
.composer-title {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 12px;
}
.composer-title span {
  color: #899899;
  font-size: 10px;
}
.composer textarea {
  font-size: 12px;
  border-color: #dce5e7;
  background: #fff;
  min-height: 96px;
}
.composer-bottom {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.composer-bottom > span {
  font-size: 9px;
  color: #8a969c;
  margin-right: auto;
}
.check {
  flex-direction: row;
  align-items: center;
  margin: 0;
  font-size: 10px;
  white-space: nowrap;
}
.composer button {
  font-size: 11px;
}
.details {
  border-left: 1px solid #e4eaed;
  padding: 22px 18px;
  overflow: auto;
}
.details h2 {
  font-size: 13px;
  margin-bottom: 22px;
}
.details select {
  width: 100%;
  font-size: 12px;
}
.details button {
  font-size: 11px;
}
.details label {
  font-size: 10px;
  color: #849397;
}
.metadata {
  display: grid;
  gap: 8px;
  border-top: 1px solid #e8edee;
  margin-top: 20px;
  padding-top: 20px;
}
.metadata span {
  font-size: 10px;
  color: #8c999d;
}
.metadata strong {
  font-size: 11px;
  font-weight: 500;
  overflow-wrap: anywhere;
  margin-bottom: 10px;
}
.notes {
  border-top: 1px solid #e8edee;
  margin-top: 16px;
  padding-top: 20px;
}
.notes p {
  font-size: 10px;
  color: #8a979d;
  margin: 8px 0 12px;
}
.notes textarea {
  font-size: 11px;
  margin-bottom: 8px;
}
.note {
  font-size: 11px;
  background: #fff9ec;
  border: 1px solid #f0e7d4;
  padding: 10px;
  margin-top: 12px;
  border-radius: 5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.note small {
  display: block;
  font-size: 9px;
  color: #998d70;
  margin-top: 6px;
}
#sending-control {
  border-top: 1px solid #e8edee;
  padding-top: 20px;
  margin-top: 22px;
}
#sending-control p {
  font-size: 11px;
  margin: 10px 0;
  color: #859496;
}
.warning {
  padding: 12px;
  background: #fff7e4;
  font-size: 11px;
  line-height: 1.8;
}
.warning button {
  font-size: 10px;
  margin: 3px;
}
dialog {
  border: 1px solid #dce6e8;
  border-radius: 14px;
  padding: 28px;
  max-width: 580px;
  width: calc(100% - 32px);
  color: inherit;
}
dialog::backdrop {
  background: #183b4066;
}
dialog h2 {
  margin: 10px 0 20px;
}
dialog p {
  font-size: 12px;
  margin: 10px 0;
  overflow-wrap: anywhere;
}
dialog pre {
  font: inherit;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 40vh;
  overflow: auto;
  background: #f4f8f6;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  padding: 20px;
  line-height: 1.8;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}
.dialog-close {
  float: right;
  background: none;
  font-size: 22px;
}
:focus-visible {
  outline: 2px solid #5bab97;
  outline-offset: 2px;
}
@media (max-width: 1250px) {
  #app {
    grid-template-columns: 170px minmax(0, 1fr);
  }
  main {
    padding: 20px 16px;
  }
  .desk {
    grid-template-columns: 240px minmax(280px, 1fr) 210px;
  }
  .sidebar {
    padding: 24px 12px;
  }
  .details {
    padding: 20px 13px;
  }
  .composer-bottom > span {
    display: none;
  }
}
@media (max-width: 1000px) {
  .desk {
    grid-template-columns: 240px minmax(0, 1fr);
    height: auto;
    min-height: 680px;
  }
  .details {
    grid-column: 2;
    border-top: 1px solid #e4eaed;
    max-height: none;
  }
  .conversation {
    min-height: 650px;
  }
  .inbox-list {
    grid-row: 1/3;
    max-height: 1000px;
  }
  .metrics {
    gap: 9px;
  }
  .metrics button {
    padding: 15px 12px;
  }
  .dot {
    right: 12px;
  }
  .top-actions span {
    display: none;
  }
}
@media (max-width: 720px) {
  #app {
    display: block;
  }
  .sidebar {
    padding: 14px 16px;
    gap: 10px;
  }
  .logo {
    font-size: 15px;
  }
  .logo span {
    display: inline;
    font-size: 10px;
    margin-left: 8px;
  }
  .workspace-label,
  .nav-label,
  .sidebar-bottom p,
  .environment {
    display: none;
  }
  .sidebar select {
    max-width: 260px;
  }
  .sidebar nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
  }
  .nav {
    width: auto;
    display: inline-flex;
    font-size: 10px;
    padding: 8px;
    margin: 0;
  }
  .nav span {
    font-size: 12px;
  }
  .sidebar-bottom {
    padding: 0;
    margin: 0;
    position: absolute;
    right: 14px;
    top: 13px;
  }
  .sidebar-bottom .nav {
    font-size: 10px;
  }
  .topbar h1 {
    font-size: 20px;
  }
  .topbar {
    margin-bottom: 18px;
  }
  main {
    padding: 18px 12px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }
  .metrics button {
    padding: 12px 14px;
  }
  .metrics strong {
    font-size: 22px;
  }
  .metrics span {
    font-size: 10px;
    margin-bottom: 7px;
  }
  .desk {
    display: block;
    min-height: 550px;
    height: auto;
  }
  .inbox-list {
    min-height: 540px;
    max-height: 75vh;
    border: 0;
  }
  .conversation {
    display: none;
  }
  .details {
    display: none;
  }
  .desk.selected .inbox-list {
    display: none;
  }
  .desk.selected .conversation {
    display: block;
    min-height: 600px;
  }
  .desk.selected .details:not([hidden]) {
    display: block;
    border-left: 0;
  }
  .desk.selected .thread-head #back {
    display: block;
    font-size: 10px;
    padding: 6px;
  }
  .thread-head {
    padding: 16px 12px;
  }
  .thread-head h2 {
    font-size: 12px;
  }
  .thread-head .badge {
    white-space: nowrap;
    font-size: 9px;
  }
  .messages {
    max-height: 60vh;
    min-height: 220px;
    padding: 15px;
  }
  .composer {
    padding: 14px;
  }
  .composer-bottom {
    justify-content: space-between;
  }
  .composer-bottom .check {
    font-size: 11px;
  }
  .composer button {
    padding: 10px;
  }
  .history-bar {
    padding: 10px;
  }
  .login-card {
    margin: 8vh 16px;
    padding: 25px;
  }
}
.received-image {
  margin-top: 8px;
  max-width: 100%;
}
.image-open {
  padding: 0;
  background: #fff;
  border: 1px solid #d4e3e4;
  overflow: hidden;
  border-radius: 10px;
  cursor: zoom-in;
  display: block;
  max-width: 100%;
}
.image-open img {
  display: block;
  max-width: min(360px, 100%);
  max-height: 320px;
  width: auto;
  height: auto;
  object-fit: contain;
  min-width: 40px;
  min-height: 40px;
}
#image-dialog {
  padding: 16px;
  width: min(1100px, 96vw);
  max-width: 96vw;
  max-height: 94vh;
}
.image-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.mail-folder-filter {
  display: block;
  padding: 0 16px 12px;
  font-size: 12px;
}
.mail-folder-filter select {
  width: 100%;
  margin-top: 6px;
}
.image-toolbar strong {
  margin-right: auto;
}
.image-canvas {
  overflow: auto;
  max-height: 78vh;
  margin-top: 12px;
  text-align: center;
}
#image-full {
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
}
#image-dialog.actual-size #image-full {
  max-width: none;
  max-height: none;
}
#image-composer {
  margin: 10px 0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
#draft-image {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
  padding: 10px;
  background: #eff6f3;
  border-radius: 8px;
}
#draft-image img {
  max-width: 160px;
  max-height: 120px;
  object-fit: contain;
}
#draft-image-name {
  overflow-wrap: anywhere;
}
#preview-reply-image {
  max-width: 100%;
  max-height: 45vh;
  object-fit: contain;
  display: block;
  margin: 12px auto;
}
.unread-badge {
  color: #fff;
  background: #237e75;
  border-radius: 12px;
  padding: 2px 7px;
  white-space: nowrap;
  font-size: 11px;
}
.episode.unread strong {
  color: #104c49;
}
.episode-top {
  flex-wrap: wrap;
  gap: 5px;
}

@media (min-width: 1001px) {
  main {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  main > :not(.desk) {
    flex-shrink: 0;
  }
  .desk {
    min-height: 0;
    height: auto;
    flex: 1;
  }
  .inbox-list > :not(.episode-list) {
    flex-shrink: 0;
  }
  .episode-list {
    min-height: 0;
  }
}
@media (min-width: 1001px) and (max-height: 850px) {
  main {
    padding: 16px 20px;
  }
  .topbar {
    margin-bottom: 12px;
  }
  .metrics {
    margin-bottom: 12px;
  }
  .metrics button {
    padding: 10px 16px;
  }
  .metrics span {
    margin-bottom: 6px;
  }
  .metrics strong {
    font-size: 23px;
  }
  .summary-help {
    margin-bottom: 10px;
  }
  .list-head {
    padding: 12px 16px;
  }
  #search {
    margin-bottom: 8px;
  }
  .filters {
    padding-bottom: 8px;
  }
  .mail-folder-filter {
    margin-bottom: 8px;
  }
}
@media (max-width: 480px) {
  .filter-fields {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1001px) {
  .filter-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .conversation:has(#filter-panel:not([hidden])) {
    display: flex;
    min-height: 0;
  }
  .conversation:has(#filter-panel:not([hidden])) #empty {
    display: none;
  }
}

@media (min-width: 1001px) and (max-height: 850px) {
  .mail-folder-filter {
    padding-top: 0;
    padding-bottom: 0;
    gap: 4px;
  }
  .mail-folder-filter select {
    padding: 7px;
  }
  .pagination {
    padding: 6px 10px;
  }
  .filter-actions {
    padding-bottom: 6px;
  }
  #open-filters {
    padding: 7px 10px;
  }
  .composer {
    padding: 10px 16px;
  }
  .composer textarea {
    min-height: 60px;
    height: 60px;
  }
  .composer-title {
    margin-bottom: 6px;
  }
  .thread-head {
    padding: 12px 16px;
  }
}
.filter-fields > p {
  grid-row: 2;
}

/* Operation buttons use a filled surface; editable fields keep a white surface. */
:is(
  .secondary,
  #open-filters,
  #close-filters,
  #clear-filters,
  .mail-file-button,
  .pagination button,
  .history-bar button
) {
  background: #e2eff3;
  color: #174f63;
  border: 1px solid #87aebd;
  border-bottom: 2px solid #6c98a8;
  font-weight: 600;
  box-shadow: 0 1px 2px #183b4012;
}
.primary {
  border: 1px solid #176252;
  border-bottom: 2px solid #104b40;
  box-shadow: 0 1px 2px #183b4020;
}
:is(
    .secondary,
    #open-filters,
    #close-filters,
    #clear-filters,
    .mail-file-button,
    .pagination button,
    .history-bar button
  ):hover:not(:disabled) {
  background: #cce3eb;
  border-color: #4d869b;
}
.primary:hover:not(:disabled) {
  background: #145e50;
}
:is(
    .secondary,
    .primary,
    #open-filters,
    #close-filters,
    #clear-filters,
    .mail-file-button,
    .pagination button,
    .history-bar button
  ):active:not(:disabled) {
  box-shadow: inset 0 1px 3px #183b4033;
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
#open-filters::before {
  content: "⚙  ";
}
#case-form button::before,
#quick-save::before {
  content: "✓  ";
}
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
#quick-create::before {
  content: "＋  ";
}
#quick-reload::before {
  content: "↻  ";
}
#quick-details::after,
.mail-file-button::after {
  content: "  ›";
}
#choose-image::before {
  content: "＋  ";
}
#close-filters::before {
  content: "×  ";
}
.metrics button,
.attention-summary button {
  border-color: #9bb5bd;
  box-shadow: 0 1px 2px #183b4015;
}
.metrics button:hover:not(:disabled),
.attention-summary button:hover:not(:disabled) {
  background: #eaf4f6;
  border-color: #4d869b;
}
.metrics span::after {
  content: "  ›";
  font-weight: 700;
  color: #356d7a;
}

@media (min-width: 1001px) and (max-height: 850px) {
  .attention-summary button {
    padding: 7px 12px;
  }
  .pagination {
    padding: 4px 10px;
  }
  .filter-actions button {
    padding: 4px;
  }
}

:is(
  .secondary,
  .primary,
  #open-filters,
  #close-filters,
  #clear-filters,
  .mail-file-button,
  .pagination button,
  .history-bar button
):disabled {
  opacity: 1;
  background: #edf0f2;
  color: #77868b;
  border-color: #d7dfe2;
  box-shadow: none;
}

/* Keep navigation optional and reserve vertical space for customer messages. */
.page-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
#menu-toggle {
  flex-shrink: 0;
  font-size: 12px;
}
#app.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}
#app.sidebar-collapsed .sidebar {
  display: none;
}
.metrics {
  gap: 10px;
  margin-bottom: 12px;
}
.metrics button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  min-width: 0;
}
.metrics span {
  margin: 0;
  font-size: 12px;
}
.metrics strong {
  font-size: 20px;
  margin-left: auto;
}
.metrics .dot {
  position: static;
  flex-shrink: 0;
  order: -1;
}
.metrics span::after {
  content: none;
}
.topbar {
  margin-bottom: 16px;
}
@media (max-width: 720px) {
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  #menu-toggle {
    padding: 6px 10px;
  }
  .metrics {
    gap: 6px;
  }
  .metrics button {
    gap: 6px;
    padding: 8px;
  }
  .metrics span {
    font-size: 10px;
  }
  .metrics strong {
    font-size: 18px;
  }
}

#app.sidebar-collapsed main {
  grid-column: 2;
}
.account-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 0 8px;
  font-size: 12px;
}
#account-buttons {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  min-width: 0;
  flex: 1;
}
.rule-condition {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.rule-condition > * {
  min-width: 0;
  margin: 0;
}
.rule-condition > input {
  grid-column: 1 / -1;
}
.rule-subdomains {
  grid-column: 1;
}
.rule-subdomains[hidden] {
  display: none;
}
.rule-condition > button {
  grid-column: 2;
}
#file-condition {
  overflow-wrap: anywhere;
}
.spam-actions {
  border-top: 1px solid #dce4e6;
  margin-top: 12px;
  padding-top: 10px;
}
#quick-spam {
  color: #873522;
  border-color: #b86e59;
  background: #fff3ed;
}
#quick-spam:disabled {
  color: #899893;
  border-color: #dce4e6;
  background: #f2f6f4;
}
#quick-spam-help {
  font-size: 11px;
  line-height: 1.65;
  margin-top: 6px;
}
#account-buttons[hidden] {
  display: none;
}
#account-buttons button {
  white-space: nowrap;
  padding: 5px 9px;
  font-size: 12px;
}
#account-buttons button[aria-pressed="true"] {
  background: #126579;
  color: white;
}
.account-bar label {
  display: flex;
  flex-direction: row;
  margin: 0;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}
.account-bar #endpoint {
  flex: 1;
  min-width: 0;
  width: 0;
}
.list-head #status-filter {
  width: 125px;
  padding: 4px;
  font-size: 11px;
}
.account-bar select {
  padding: 5px;
  width: auto;
}
.account-bar a {
  white-space: nowrap;
}
.account-source {
  display: block;
  font-size: 11px;
  color: #53727c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .account-bar {
    flex-wrap: wrap;
  }
  #account-buttons {
    flex-basis: 100%;
  }
}

/* Keep blocked replies and unsaved case changes visible beside their controls. */
.reply-guidance {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f0f6f4;
  color: #345c50;
  font-size: 13px;
  line-height: 1.7;
}
.reply-guidance p {
  margin: 0;
}
.reply-guidance button {
  margin-top: 8px;
}
.case-save-state {
  font-size: 12px;
  line-height: 1.6;
  color: #345c50;
}
#filter-state {
  min-width: 0;
  overflow-wrap: anywhere;
}
