.meyasubako-list-panel,
.meyasubako-detail {
  min-width: 0;
  border: 1px solid #ffa000;
  border-radius: 12px;
}

.meyasubako-list-panel {
  padding: 10px 14px 14px;
  background: #faf8c2;
}

.meyasubako-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(76px, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 8px;
}

.meyasubako-header h1 {
  margin: 0;
  line-height: 0;
}

.meyasubako-header h1 img {
  display: block;
  width: 142px;
  max-width: 100%;
  height: 46px;
  mix-blend-mode: multiply;
  object-fit: contain;
  object-position: left center;
}

.meyasubako-header button {
  padding: 0;
  border: 0;
  background: transparent;
}

.meyasubako-header button:disabled {
  opacity: 1;
  cursor: default;
}

.meyasubako-new {
  width: 100px;
  height: 32px;
}

.meyasubako-header button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.meyasubako-header h1 img.menu-sprite-meyasubako {
  height: calc(142px * 75 / 251);
  object-fit: cover;
  object-position: left calc(-142px * 666 / 251);
}

.meyasubako-pager {
  display: flex;
  justify-self: end;
  gap: 9px;
}

.meyasubako-pager button {
  width: 33px;
  height: 33px;
}

.meyasubako-pager button img {
  filter: hue-rotate(180deg) saturate(1.7);
}

.meyasubako-list {
  display: grid;
  gap: 5px;
}

.meyasubako-row {
  min-width: 0;
  height: 36px;
  border: 1px solid #aaa;
  border-radius: 9px;
  background: #fff;
}

.meyasubako-detail {
  min-height: 0;
  background: #fff;
}

@media (max-width: 1100px) {
  .meyasubako-header { gap: 8px; }
  .meyasubako-new { width: 88px; }
  .meyasubako-list-panel { padding: 10px; }
}

@media (max-width: 760px) {
  .meyasubako-header { grid-template-columns: minmax(0, 1fr) auto auto; }
  .meyasubako-pager { gap: 5px; }
  .meyasubako-detail { min-height: 0; }
}

.meyasubako-header .meyasubako-new {
  border: 1px solid #cc9800;
  border-radius: 9px;
  background: #f5a000;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

@media (min-width: 761px) and (max-width: 1100px) {
  .meyasubako-header { grid-template-columns: 142px auto auto; gap: 6px; }
  .meyasubako-new { width: 88px; }
  .meyasubako-pager { gap: 5px; }
  .app[data-menu-state] .workspace:has(.meyasubako-list-panel:not([hidden])) {
    grid-template-columns: var(--expanded-menu-width) 350px minmax(0, 1fr);
  }
  .app[data-menu-state="collapsed"] .workspace:has(.meyasubako-list-panel:not([hidden])) {
    grid-template-columns: var(--collapsed-menu-width) 350px minmax(0, 1fr);
  }
}

.meyasubako-header button:not(:disabled) { cursor: pointer; }
.meyasubako-list-status { margin: 0 0 8px; color: #555; font-size: 13px; }
.meyasubako-list-status:empty { display: none; }
.meyasubako-retry { margin-bottom: 8px; }
.meyasubako-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 4px 8px; text-align: left; color: #555; font-size: 14px; cursor: pointer; }
.meyasubako-card time { flex-shrink: 0; white-space: nowrap; }
.meyasubako-card span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meyasubako-card.is-selected { border-color: #e99a00; background: #fff4d7; }
.meyasubako-card:disabled { cursor: default; }
.meyasubako-card:focus-visible, .meyasubako-detail :focus-visible { outline: 2px solid #0786b9; outline-offset: 2px; }
.meyasubako-detail { padding: 16px 18px; color: #30444d; overflow-wrap: anywhere; scroll-margin-top: calc(var(--header-height) + 12px); }
.meyasubako-detail:empty { padding: 0; }
.meyasubako-heading { margin: 0 0 8px; color: #1781b5; font-size: 24px; }
.meyasubako-recipient { margin: 0 0 12px; font-size: 14px; color: #566e77; }
.meyasubako-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; min-width: 0; border: 0; padding: 0; margin: 0; }
.meyasubako-fields > * { grid-column: 1 / -1; }
.meyasubako-fields > .meyasubako-choice { grid-column: auto; }
.meyasubako-field { display: grid; gap: 6px; min-width: 0; font-weight: 700; }
.meyasubako-field select, .meyasubako-field textarea { width: 100%; min-width: 0; border: 1px solid #a6c9d5; border-radius: 9px; padding: 8px 10px; background: #fff; color: #222; font: inherit; font-weight: 400; }
.meyasubako-field select { min-height: 44px; }
.meyasubako-field textarea { height: clamp(180px, 26vh, 220px); min-height: 100px; resize: vertical; }
.meyasubako-drop { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; padding: 8px 10px; border: 2px dashed #a6c9d5; border-radius: 9px; background: #f3fbfd; text-align: center; }
.meyasubako-drop small { flex-basis: 100%; font-size: 12px; font-weight: 400; }
.meyasubako-drop.is-dragging { border-color: #00a9d9; background: #e0f7ff; }
.meyasubako-primary, .meyasubako-secondary { min-height: 46px; border: 1px solid #a6c9d5; border-radius: 9px; padding: 10px 24px; font: inherit; font-weight: 700; cursor: pointer; }
.meyasubako-primary { background: #00a9d9; border-color: #00a9d9; color: #fff; }
.meyasubako-secondary { background: #fff; color: #214d72; }
.meyasubako-detail button:disabled, .meyasubako-fields:disabled button { opacity: .55; cursor: wait; }
.meyasubako-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 0; }
.meyasubako-files { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-weight: 400; font-size: 14px; }
.meyasubako-files li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meyasubako-files a { color: #126fa5; }
.meyasubako-remove { flex-shrink: 0; border: 1px solid #adc3cd; border-radius: 5px; background: white; padding: 5px 10px; cursor: pointer; }
.meyasubako-form-status:empty, .meyasubako-files:empty { display: none; }
.meyasubako-form-status { margin: 8px 0 0; color: #994117; white-space: pre-wrap; }
.meyasubako-success { color: #267941; }
.meyasubako-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 20px; }
.meyasubako-meta dt { font-weight: 700; }
.meyasubako-meta dd { margin: 0; }
.meyasubako-detail h3 { font-size: 16px; margin-top: 24px; }
.meyasubako-memo { white-space: pre-wrap; line-height: 1.7; padding: 16px; border: 1px solid #a6c9d5; border-radius: 9px; min-height: 160px; }
@media (max-width: 980px) {
  .meyasubako-detail { padding: 18px 14px; }
  .meyasubako-actions { gap: 8px; }
  .meyasubako-primary, .meyasubako-secondary { padding: 10px 12px; }
}
@media (max-width: 760px) {
  .meyasubako-card { height: auto; min-height: 44px; flex-wrap: wrap; gap: 3px; }
  .meyasubako-card span { flex-basis: 100%; }
  .meyasubako-meta { gap: 10px; font-size: 14px; }
}

.meyasubako-replies { margin: 24px 0; }
.meyasubako-reply { padding: 16px; margin: 12px 0; border: 1px solid #a6c9d5; border-radius: 9px; background: #f5fbfd; }
.meyasubako-reply-meta { font-size: 13px; color: #566e77; }
.meyasubako-reply-body { white-space: pre-wrap; line-height: 1.7; margin: 12px 0; }
.meyasubako-reply-form { border-top: 1px solid #a6c9d5; margin-top: 24px; padding-top: 24px; scroll-margin-top: calc(var(--header-height) + 12px); }
.meyasubako-recipient-choices { min-width: 0; margin: 0; padding: 12px; border: 1px solid #a6c9d5; border-radius: 9px; }
.meyasubako-recipient-choices label { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.meyasubako-recipient-choices input { width: 18px; height: 18px; flex-shrink: 0; }

.meyasubako-card { position: relative; }
.meyasubako-card.has-new { padding-right: 42px; }
.meyasubako-new-badge { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; object-fit: contain; }

.meyasubako-form .meyasubako-primary,
.meyasubako-form .meyasubako-secondary { min-height: 38px; padding: 6px 20px; }

.meyasubako-list-panel:has(.meyasubako-list:empty) { min-height: 468px; }
.meyasubako-list-status.is-empty { margin: 16px 0; font-size: inherit; color: inherit; }
@media (max-width: 980px) {
  .meyasubako-list-panel:has(.meyasubako-list:empty) { min-height: 430px; }
}
@media (max-width: 760px) {
  .meyasubako-list-panel:has(.meyasubako-list:empty) { min-height: 390px; }
}
