/* Approved BINWORKS CI, 2026-10-14. UI chrome only; never restyle message HTML. */
:root {
  --bw-brand: #da1c78;
  --bw-brand-hover: #b91565;
  --bw-brand-ink: #a81158;
  --bw-brand-soft: #fceef5;
  --bw-brand-selected: #f9dce9;
  --bw-brand-line: #edb5d0;
  --bw-blue: var(--bw-brand);
  --bw-folder: var(--bw-brand-soft);
  --bw-selected: var(--bw-brand-selected);
  --bw-compose: var(--bw-brand);
  --bw-text: #111111;
}
.bw-brand .bw-ci-brand { display:flex; align-items:center; gap:11px; text-decoration:none; }
.bw-brand .bw-ci-brand img { display:block; width:148px; height:auto; max-height:34px; object-fit:contain; flex:none; }
.bw-shell #layout-menu>.action-buttons a.compose,
.bw-mail .btn-primary, .bw-mail.action-compose .formbuttons .send {
  background:var(--bw-brand); border-color:var(--bw-brand); color:#fff;
}
.bw-shell #layout-menu>.action-buttons a.compose:hover,
.bw-mail .btn-primary:hover, .bw-mail.action-compose .formbuttons .send:hover {
  background:var(--bw-brand-hover); border-color:var(--bw-brand-hover); color:#fff;
}
.bw-avatar { background:var(--bw-brand-soft); color:var(--bw-brand-ink); }
.bw-office-filter:hover,.bw-office-filter[aria-pressed=true],
.bw-shell #mailboxlist a:hover { background:var(--bw-brand-soft); color:var(--bw-brand-ink); }
.bw-office-filter[aria-pressed=true] .bw-symbol,
.bw-shell #mailboxlist li.selected>a::before,
.bw-shell #mailboxlist .unreadcount { color:var(--bw-brand); }
.bw-shell #mailboxlist li.selected>a,.bw-shell #taskmenu .selected,
.bw-mail .listing li.selected,.bw-mail .listing tr.selected td {
  background:var(--bw-brand-soft); color:var(--bw-brand-ink);
}
.bw-shell #messagelist tr.selected { background:var(--bw-brand-selected); }
.bw-shell #messagelist tr.focused { outline-color:var(--bw-brand-line); }
.bw-shell #messagelist tr:hover,.bw-row-actions { background:#fdf6fa; }
#bw-search-slot .searchbar:focus-within { border-color:var(--bw-brand); box-shadow:0 0 0 2px #da1c781a; }
.bw-mail .form-control:focus,.bw-mail .custom-select:focus { border-color:var(--bw-brand); box-shadow:0 0 0 2px #da1c781a; }
.bw-mail input[type=checkbox],.bw-mail input[type=radio] { accent-color:var(--bw-brand); }
.bw-mail .custom-control-input:checked~.custom-control-label::before { background-color:var(--bw-brand); border-color:var(--bw-brand); }
.bw-mail .nav-tabs .nav-link.active { color:var(--bw-brand-ink); border-bottom-color:var(--bw-brand); }
.bw-mail .menu.listing li>a:hover,.bw-mail .menu.listing li>a:focus { background:var(--bw-brand-soft); color:var(--bw-brand-ink); }
#bw-account { border-color:var(--bw-brand-line); }
.bw-mail.task-login { background:#faf7f9; }
.bw-mail.task-login #logo { width:236px!important; max-width:100%; height:auto; margin:0 auto 32px; }
.bw-mail.task-login a { color:var(--bw-brand-ink); }
.bw-mail.action-compose .bw-compose-tools a { color:#59515a; }
/* Roundcube wraps list controls in UL/LI at runtime. Reset those list metrics too. */
.bw-shell #messagelist-header { align-items:center; }
.bw-shell #messagelist-header #toolbar-list-menu,
.bw-shell #messagelist-header #bw-bulk-tools { display:flex;align-items:center;gap:6px;height:36px;margin:0;padding:0;border:0; }
.bw-shell #messagelist-header #toolbar-list-menu>li { display:flex;align-items:center;height:36px;margin:0;padding:0;border:0;background:none; }
.bw-shell #messagelist-header #toolbar-list-menu>li:has(>a.select),
.bw-shell #messagelist-header #toolbar-list-menu>li:has(>a.threads) { display:none; }
.bw-shell #messagelist-header :is(#bw-select-all,#listmenulink,#bw-bulk-tools>a,a.refresh) {
  display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
  height:36px;min-height:36px;line-height:1;min-width:36px;margin:0;padding:0 10px;
  border:1px solid var(--bw-border);border-radius:5px;box-shadow:none;
  background:var(--bw-surface);color:var(--bw-text);text-decoration:none;
}
.bw-shell #messagelist-header #bw-select-all { width:36px;flex-basis:36px;padding:0; }
.bw-shell #messagelist-header #listmenulink { width:36px;padding:0; }
.bw-shell #messagelist-header #listmenulink::after { display:none; }
.bw-shell #messagelist-header a.refresh { margin-left:auto; }
.bw-shell #messagelist-header :is(#bw-select-all,#listmenulink,a.refresh):hover { background:var(--bw-brand-soft); }
.bw-header-actions #bw-theme-toggle {
  position:relative;display:flex;align-items:center;justify-content:space-around;
  width:64px;min-width:64px;height:40px;flex:0 0 64px;padding:0 3px;
  border:1px solid var(--bw-border);border-radius:22px;background:var(--bw-search);
  color:var(--bw-muted);cursor:pointer;box-shadow:none;
}
#bw-theme-toggle::before { content:'';position:absolute;left:4px;top:5px;width:28px;height:28px;border-radius:50%;background:var(--bw-surface);box-shadow:0 1px 3px #0002;transition:transform .16s ease; }
#bw-theme-toggle[aria-checked=true]::before { transform:translateX(26px); }
#bw-theme-toggle .bw-symbol { position:relative;z-index:1;font-size:18px!important; }
#bw-theme-toggle[aria-checked=false] .bw-symbol:first-child,
#bw-theme-toggle[aria-checked=true] .bw-symbol:last-child { color:var(--bw-brand-ink); }
#bw-theme-toggle:focus-visible { outline:2px solid var(--bw-brand);outline-offset:3px; }
/* Split-button dropdown labels are accessibility text, not duplicate captions. */
.bw-mail:not(.action-compose) #toolbar-menu .dropbutton { display:inline-flex;align-items:center;vertical-align:middle; }
.bw-mail:not(.action-compose) #toolbar-menu .dropbutton a { margin:0!important; }
.bw-mail:not(.action-compose) #toolbar-menu a.dropdown { display:inline-flex;align-items:center;justify-content:center;width:28px;min-width:28px;padding:0!important; }
.bw-mail:not(.action-compose) #toolbar-menu a.dropdown .inner { display:none!important; }
.bw-mail:not(.action-compose) #toolbar-menu a.dropdown::after { display:none!important; }
.bw-mail:not(.action-compose) #toolbar-menu a.dropdown::before { margin:0!important; }
.bw-mail:not(.action-compose) #toolbar-menu [hidden],#bw-bulk-tools [hidden] { display:none!important; }
.bw-mail:not(.action-compose) #toolbar-menu .bw-not-spam,#bw-bulk-tools .bw-not-spam {
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  width:auto;min-width:0;flex:0 0 auto;height:36px;padding:0 10px;margin:0 4px;
  border:1px solid var(--bw-border);border-radius:5px;background:var(--bw-surface);
  color:var(--bw-text);font:inherit;font-size:13px;white-space:nowrap;cursor:pointer;
}
.bw-mail:not(.action-compose) #toolbar-menu .bw-not-spam:disabled,#bw-bulk-tools .bw-not-spam:disabled { opacity:.45;cursor:default; }
.bw-mail:not(.action-compose) #toolbar-menu .bw-not-spam:not(:disabled):hover,#bw-bulk-tools .bw-not-spam:not(:disabled):hover { background:var(--bw-brand-soft); }
.bw-not-spam:focus-visible { outline:2px solid var(--bw-brand);outline-offset:2px; }
@media(prefers-reduced-motion:reduce){#bw-theme-toggle::before{transition:none}}
@media(max-width:767px){
  .bw-shell #layout-list>#messagelist-header { height:auto;min-height:46px;flex-wrap:wrap;row-gap:8px; }
  .bw-shell #messagelist-header #bw-bulk-tools { flex:0 0 auto; }
  .bw-shell #messagelist-header #bw-bulk-tools>a { padding:0 7px; }
  .bw-shell #bw-bulk-tools .folder-selector-link { display:none; }
  #bw-bulk-tools .bw-not-spam { margin:0;padding:0 8px;flex-shrink:0; }
  .bw-brand{width:132px;flex-basis:132px;gap:4px}
  .bw-brand .bw-ci-brand{display:flex}
  .bw-brand .bw-ci-brand img{width:88px;max-height:28px}
  .bw-header-actions #bw-quick-toggle{display:inline-flex;width:32px;flex-basis:32px}
  #bw-search-slot .searchbar{padding:0 4px}
  #bw-search-slot .searchbar :is(.reset,.unread,.options){display:none}
  #bw-search-slot input{padding-left:2px}
  #bw-quick{right:8px;left:8px;width:auto}
  .bw-quick-open #layout{padding-right:0}
}
/* Show name (address) without changing native recipient serialization/editing. */
.bw-mail .recipient-input li.recipient { max-width:100%; }
.bw-mail .recipient-input li.recipient .name { white-space:normal; overflow-wrap:anywhere; }
.bw-mail .recipient-input li.recipient .name::after { content:attr(data-bw-address); }
@media(max-width:359px){
  .bw-brand{width:108px;flex-basis:108px}
  .bw-brand .bw-ci-brand img{width:64px}
  #bw-search-slot{min-width:54px}
  #bw-search-slot .searchbar .search{display:none}
  .bw-header-actions{gap:2px}
}

/* The final 2.24% of the digital wordmark is its baseline dot. */
.bw-brand .bw-ci-brand { position:relative; }
.bw-brand .bw-ci-brand img { clip-path:inset(0 2.3% 0 0); }
.bw-brand .bw-ci-brand::after {
  content:"";
  position:absolute;
  right:0;
  bottom:0;
  width:2.24%;
  aspect-ratio:1;
  border-radius:50%;
  background:var(--bw-compose);
}
[data-bw-theme="dark"] .bw-ci-brand::after { background:#be1768; }

.bw-shell:is(.task-settings,.task-addressbook) #layout {
  box-sizing:border-box;
}
.bw-shell:is(.task-settings,.task-addressbook) :is(#layout-sidebar,#layout-list) {
  border-inline-end:1px solid var(--bw-border);
}
.bw-shell:is(.task-settings,.task-addressbook) #layout-list > .header {
  border-bottom:1px solid var(--bw-border);
}
.bw-shell.task-addressbook #layout-list > .header .toolbar a.select::before {
  display:none;
}
.bw-shell.task-addressbook #layout-list > .header .toolbar a.select .inner {
  display:inline;
}
@media (min-width:1025px) {
  .bw-shell.task-addressbook #layout-list > .header .toolbar a.select {
    display:inline-flex;
    align-items:center;
    gap:6px;
    height:36px;
    line-height:1;
  }
  .bw-shell:is(.task-settings,.task-addressbook) #layout-sidebar {
    flex:0 1 clamp(156px,15vw,208px);
    min-width:0;
  }
  .bw-shell:is(.task-settings,.task-addressbook) #layout-list {
    flex:0 1 clamp(230px,23vw,360px);
    min-width:0;
  }
  .bw-shell:is(.task-settings,.task-addressbook) #layout-content {
    flex:1 1 0;
    width:auto;
  }
  .bw-shell:is(.task-settings,.task-addressbook) #layout-list > .header > .header-title {
    display:block;
    margin:0;
    text-align:start;
    color:var(--bw-text);
  }
}

.bw-shell.task-settings #sections-table td.section,
.bw-shell.task-addressbook #contacts-table td.name {
  position:relative;
  height:var(--bw-list-row);
  padding:5px 14px 7px 46px;
  line-height:24px;
  vertical-align:middle;
}
.bw-shell.task-settings #settings-menu li > a::before,
.bw-shell.task-addressbook #directorylist li > a::before,
.bw-shell.task-settings #sections-table td.section::before,
.bw-shell.task-addressbook #contacts-table td.name::before {
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  line-height:1;
}
.bw-shell.task-settings #sections-table td.section::before,
.bw-shell.task-addressbook #contacts-table td.name::before {
  position:absolute;
  inset-inline-start:14px;
  top:50%;
  transform:translateY(-50%);
  margin:0;
}
.bw-shell.task-addressbook #directorylist li.selected > a {
  background:var(--bw-brand-soft);
  color:var(--bw-brand-ink);
}

.bw-shell:is(.task-addressbook,.task-settings) {
  --bw-list-header:56px;
  --bw-list-row:46px;
}
.bw-shell:is(.task-addressbook,.task-settings) :is(#layout-sidebar,#layout-list) > .header {
  height:var(--bw-list-header);
  min-height:var(--bw-list-header);
  align-items:center;
  line-height:1.4;
}
.bw-shell.task-settings #settings-menu li > a,
.bw-shell.task-addressbook #directorylist li > a {
  /* The list item draws a one-pixel divider below the link. */
  min-height:calc(var(--bw-list-row) - 1px);
  padding-block:0 2px;
  line-height:24px;
}
.bw-shell.task-settings #settings-menu li > a::before,
.bw-shell.task-addressbook #directorylist li > a::before {
  transform:translateY(1px);
}
@media (max-width:767px) {
  .bw-shell:is(.task-addressbook,.task-settings) { --bw-list-header:48px; }
}
.bw-shell.task-mail #layout-content > .header > .toolbar { border-bottom:0; box-shadow:none; }
.bw-shell.task-mail #layout-content > .header > .toolbar > li { border-bottom:0; }

/* Reading metadata and attachment controls share the BINWORKS palette. */
.bw-mail #message-header .header-title { color:var(--bw-muted); }
.bw-mail #message-header .rcmContactAddress { color:var(--bw-brand-ink); }
.bw-mail #message-header .rcmContactAddress:hover { color:var(--bw-brand-hover);text-decoration:underline;text-underline-offset:3px; }
.bw-mail #message-header :is(.header-links a,.extwin,.rcmaddcontact) { color:var(--bw-muted); }
.bw-mail #message-header .header-links a { border-radius:4px;padding:3px 5px;text-decoration:none; }
.bw-mail #message-header :is(.header-links a,.extwin,.rcmaddcontact):hover { color:var(--bw-brand-ink);background:var(--bw-brand-soft); }
.bw-mail #message-header a:focus-visible { outline:2px solid var(--bw-brand);outline-offset:3px;border-radius:3px; }
.bw-mail #message-content .attachmentslist li .filename,
.bw-mail #message-content .attachmentslist li .attachment-name { color:var(--bw-text); }
.bw-mail #message-content .attachmentslist li .attachment-size,
.bw-mail #message-content .attachmentslist li::before,
.bw-mail #message-content .attachmentslist li a.dropdown { color:var(--bw-muted); }
.bw-mail #message-content .attachmentslist li:hover { border-color:var(--bw-brand-line); }
.bw-mail #message-content .attachmentslist li a.dropdown:hover { color:var(--bw-brand-ink);background:var(--bw-brand-soft);border-radius:4px; }
.bw-mail #message-content .attachmentslist li a:focus-visible { outline:2px solid var(--bw-brand);outline-offset:2px;border-radius:3px; }

/* Show long Korean filenames in full, including the extension. */
.bw-mail #message-content .attachmentslist li {
  display:flex;align-items:center;gap:10px;width:640px;max-width:100%;
  box-sizing:border-box;min-height:64px;height:auto;white-space:normal;
}
.bw-mail #message-content .attachmentslist li::before { position:static;float:none;flex:0 0 24px;margin:0; }
.bw-mail #message-content .attachmentslist li a.filename { display:flex;flex-direction:column;flex:1;min-width:0;width:auto;max-width:none;padding:0;overflow:visible; }
.bw-mail #message-content .attachmentslist li .attachment-name { display:block;width:auto;max-width:none;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.5; }
.bw-mail #message-content .attachmentslist li .attachment-size { display:block;margin:3px 0 0;white-space:nowrap;font-size:12px; }
.bw-mail #message-content .attachmentslist li a.dropdown { position:static;float:none;flex:0 0 24px;margin:0; }
.bw-mail .bw-attachment-preview { flex:0 0 auto;padding:7px 10px;border:1px solid var(--bw-border);border-radius:6px;background:transparent;color:var(--bw-text);font:inherit;font-size:12px;line-height:1.5;white-space:nowrap;cursor:pointer; }
.bw-mail .bw-attachment-preview:hover { background:var(--bw-brand-soft);color:var(--bw-brand-ink);border-color:var(--bw-brand-line); }
.bw-mail .bw-attachment-preview:focus-visible { outline:2px solid var(--bw-brand);outline-offset:2px; }
@media(max-width:480px){
  .bw-mail #message-content .attachmentslist li { flex-wrap:wrap;gap:8px; }
  .bw-mail #message-content .attachmentslist li a.filename { flex-basis:calc(100% - 40px); }
  .bw-mail #message-content .attachmentslist li .bw-attachment-preview { margin-left:32px; }
}

/* Native prompts must fit the current document/compose iframe, including short screens. */
.bw-mail .ui-dialog.bw-message-dialog {
  position:fixed!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%);
  width:min(528px,calc(100vw - 32px))!important;max-width:calc(100vw - 32px)!important;
  height:auto!important;max-height:calc(100dvh - 32px);min-height:0;box-sizing:border-box;
  flex-direction:column;padding:0;border-color:var(--bw-border);border-radius:12px;
  background:var(--bw-surface);color:var(--bw-text);
}
.bw-mail .ui-dialog.bw-message-dialog>.ui-dialog-titlebar {
  flex:0 0 auto;height:auto;min-height:52px;margin:0;padding:16px 48px 16px 20px;
  color:var(--bw-text);background:var(--bw-search);border-bottom:1px solid var(--bw-border);
}
.bw-mail .ui-dialog.bw-message-dialog .ui-dialog-title { float:none;display:block;width:auto;margin:0;color:inherit;white-space:normal;line-height:1.4;text-align:left; }
.bw-mail .ui-dialog.bw-message-dialog .ui-dialog-titlebar-close { display:block!important;color:var(--bw-muted);right:12px;top:50%;margin:-16px 0 0;width:32px;height:32px;padding:0;background:transparent;border:0; }
.bw-mail .ui-dialog.bw-message-dialog>.ui-dialog-content {
  flex:1 1 auto;height:auto!important;min-height:0!important;max-height:none!important;
  width:auto!important;box-sizing:border-box;padding:20px;margin:0;overflow:auto;
  background:var(--bw-surface);color:var(--bw-text);line-height:1.6;
}
.bw-mail .ui-dialog.bw-message-dialog>.ui-dialog-content::before,
.bw-mail .ui-dialog.bw-message-dialog>.ui-dialog-content::after { display:none; }
.bw-mail .ui-dialog.bw-message-dialog .prompt input { width:100%;max-width:100%;box-sizing:border-box; }
.bw-mail .ui-dialog.bw-message-dialog>.ui-dialog-buttonpane {
  flex:0 0 auto;height:auto!important;min-height:0;padding:12px 20px 16px!important;margin:0;border:0;
  background:var(--bw-surface);color:var(--bw-text);box-sizing:border-box;
}
.bw-mail .ui-dialog.bw-message-dialog .ui-dialog-buttonset { display:flex;float:none;justify-content:flex-end;flex-wrap:wrap;gap:8px;height:auto;padding:0;margin:0; }
.bw-mail .ui-dialog.bw-message-dialog .ui-dialog-buttonpane button { flex:0 1 auto;margin:0;min-height:40px;height:auto;padding:8px 16px;white-space:normal; }
.bw-mail .ui-dialog.bw-message-dialog .ui-dialog-buttonpane button::before { display:inline-block!important;float:none;width:1.18em;height:1em;line-height:1;margin:0 .25rem 0 0!important;vertical-align:-.1em; }
.bw-mail .ui-dialog.bw-message-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.btn-secondary { background:var(--bw-search);color:var(--bw-text);border:1px solid var(--bw-border)!important; }
.bw-mail .ui-dialog.bw-message-dialog .ui-dialog-buttonpane .mainaction { background:var(--bw-brand);border-color:var(--bw-brand);color:#fff; }
[data-bw-theme="dark"] .bw-mail .ui-dialog.bw-message-dialog .ui-dialog-buttonpane .mainaction { background:#be1768;border-color:#be1768; }
