/* Shared ISTT design and JS-coordinate fixes for both English and Persian. */
:root{--istt-link:#436e79;--istt-link-hover:#274d58;--istt-muted:#687c8c;--istt-selection-bg:#dceef7;--istt-selection-text:#163f55;--istt-line:#e2e9ed}
html.dark-mode{--istt-link:#a2c8d6;--istt-link-hover:#d2e9ee;--istt-muted:#a1b4cd;--istt-selection-bg:#223d57;--istt-selection-text:#b9dfff;--istt-line:#293b50;color-scheme:dark}
body{color:#293943}
a{color:var(--istt-link)}
a:hover{color:var(--istt-link-hover)}
html.dark-mode a{color:var(--istt-link)}
html.dark-mode a:hover{color:var(--istt-link-hover)}
#message-header a,#message-content>.leftcol a,.formbuttons>a,.attachmentslist a{color:var(--istt-link)!important}
#message-header a:hover,.attachmentslist a:hover{color:var(--istt-link-hover)!important}
/* A clicked control uses its fill, never a blue outline or glowing shadow. */
a:focus,a:focus-visible,button:focus,button:focus-visible,input:focus,input:focus-visible,
select:focus,select:focus-visible,textarea:focus,textarea:focus-visible,
.form-control:focus,.custom-select:focus,.listing tr.focused>td,.listing li>a:focus,
#messagelist.focus>tbody>tr.focused>td.subject,.tox-tinymce:focus-within,.html-editor:focus-within{
  outline:none!important;box-shadow:none!important;
}
.form-control:focus,.custom-select:focus,textarea:focus{border-color:#aebdc8!important}
html.dark-mode .form-control:focus,html.dark-mode .custom-select:focus,html.dark-mode textarea:focus{border-color:#50667b!important}
.listing li>a{border-inline:0!important}
.html-editor,.tox-tinymce{outline:none!important;box-shadow:none!important}
/* Popper always computes physical left coordinates, even in RTL. */
.popover{right:auto!important;max-width:calc(100vw - 16px)}
.popover.select-menu{width:auto}
.popover .popover-body{max-width:100%;overflow-x:hidden}
.popover .listing a{white-space:normal;overflow-wrap:anywhere}
#layout-content,#layout-sidebar,#layout-list{min-width:0}
#layout>div>.header{align-items:center}
#layout>div>.header .toolbar.menu a:not(.disabled):hover,
#layout>div>.header .toolbar.menu a:not(.disabled):focus,
#layout>div>.header .toolbar.menu a.selected,
#layout>div>.header .toolbar.menu a.pressed,
#layout>div>.header .toolbar.menu a[aria-expanded="true"]{
  background:var(--istt-selection-bg)!important;color:var(--istt-selection-text)!important;
}
#layout>div>.header .header-title{min-width:0}
#layout>div>.header>.toolbar.menu.popupmenu{display:none}
/* Elastic moves toolbar controls into ul > li after loading. Fit the entire
   icon/caption group inside the 58px header, including split dropdown buttons. */
@media(min-width:769px){
  #layout>div>.header>.toolbar.menu{display:flex;align-items:stretch;flex-wrap:nowrap;gap:4px;height:100%;max-height:100%;padding:4px;margin:0;box-sizing:border-box;min-width:0;border:0}
  #layout>div>.header>.toolbar.menu>li{display:flex;align-items:stretch;height:100%;min-width:0;flex-shrink:0;padding:0;margin:0;border:0!important;overflow:visible}
  #layout>div>.header>.toolbar.menu a{display:flex;flex-direction:column;align-items:center;justify-content:center;float:none;height:100%;min-height:0;box-sizing:border-box;margin:0;padding:3px 6px;gap:3px;line-height:1.2;border:0!important;border-radius:8px;box-shadow:none!important;text-decoration:none}
  #layout>div>.header>.toolbar.menu a:before{display:block;float:none!important;height:22px!important;line-height:22px!important;margin:0!important;font-size:1.2rem}
  #layout>div>.header>.toolbar.menu a>.inner{display:block;font-size:.82rem;line-height:16px;max-width:100%;overflow:hidden;text-overflow:ellipsis}
  #layout>div>.header>.toolbar.menu .dropbutton{display:flex;align-items:stretch;height:100%;border:0;border-radius:8px}
  #layout>div>.header>.toolbar.menu .dropbutton:not(.disabled):hover{background:var(--istt-selection-bg)!important}
  #layout>div>.header>.toolbar.menu .dropbutton>a.dropdown{min-width:18px;max-width:18px;padding:0 2px}
  #layout>div>.header>.toolbar.menu .dropbutton>a.dropdown:before{font-size:.8rem}
  #layout>div>.header>.toolbar.menu .dropbutton>a.dropdown>.inner{display:none}
  #layout>div>.header>a.button.icon:is(.sidebar-menu,.toolbar-button){display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;height:48px;min-width:30px;box-sizing:border-box;padding:0 5px;margin:0 2px;border:0!important;border-radius:8px;box-shadow:none!important;line-height:1}
  #layout>div>.header>a.button.icon:is(.sidebar-menu,.toolbar-button):before{float:none!important;width:24px;height:24px!important;line-height:24px!important;margin:0!important}
  #layout>div>.header>a.button.icon:is(.sidebar-menu,.toolbar-button):not(.disabled):hover,#layout>div>.header>a.button.icon:is(.sidebar-menu,.toolbar-button):not(.disabled):focus{background:var(--istt-selection-bg)!important;color:var(--istt-selection-text)!important}
}
@media(min-width:1201px){
  #layout>div>.header>a.button.icon.toolbar-button{flex-direction:column;gap:3px;min-width:54px}
  #layout>div>.header>a.button.icon.toolbar-button:before{height:22px!important;line-height:22px!important;font-size:1.2rem}
  #layout>div>.header>a.button.icon.toolbar-button>.inner{display:block!important;font-size:.82rem;line-height:16px}
}
/* All navigation lists share the folder tile's six-pixel inset and colors.
   Exclude toolbar li elements: they are controls, not navigation rows. */
.listing:not(.toolbar):not(.messagelist) li>a,
.listing:not(.toolbar):not(.messagelist) li>div>a,
.popover .listing li>a{position:relative;box-sizing:border-box;width:calc(100% - 12px);margin:6px;border-radius:10px!important}
.listing:not(.toolbar):not(.messagelist) li.selected,.popover .listing li.selected{background:transparent!important}
.listing:not(.toolbar):not(.messagelist) li.selected>a,
.listing:not(.toolbar):not(.messagelist) li.selected>div>a,
.listing:not(.toolbar):not(.messagelist) li>a.selected,
.popover .listing li.selected>a,.popover .listing li>a.selected{background:var(--istt-selection-bg)!important;color:var(--istt-selection-text)!important;font-weight:700}
.listing:not(.toolbar):not(.messagelist) li>a:not(.disabled):hover,
.listing:not(.toolbar):not(.messagelist) li>div>a:not(.disabled):hover,
.popover .listing li>a:not(.disabled):hover{background:var(--istt-selection-bg)!important;color:var(--istt-selection-text)!important}
table.listing:not(.messagelist){width:calc(100% - 12px);margin-inline:6px;border-collapse:separate;border-spacing:0 6px}
table.listing:not(.messagelist) tr.selected>td{background:var(--istt-selection-bg)!important;color:var(--istt-selection-text)!important}
table.listing:not(.messagelist) tr.selected>td:first-child{border-start-start-radius:10px;border-end-start-radius:10px}
table.listing:not(.messagelist) tr.selected>td:last-child{border-start-end-radius:10px;border-end-end-radius:10px}
/* Focus may add a physical right border in the RTL core stylesheet. Keep the
   row separator while removing that edge on both selected and focused rows. */
table.listing:not(.messagelist)>tbody>tr>td{border-inline:0!important;border-bottom:1px solid var(--istt-line)!important}
.listing:not(.toolbar):not(.messagelist) li.selected{border-inline:0!important;border-bottom:1px solid var(--istt-line)!important}
/* The outer surface clips the header, iframe/body and footer to one curve.
   Child widget corner classes must not leave square patches or inner gaps. */
.ui-dialog,.modal-content,.tox .tox-dialog{border-radius:14px!important;overflow:hidden}
.ui-dialog>.ui-dialog-titlebar,.ui-dialog>.ui-dialog-content,.ui-dialog>.ui-dialog-buttonpane,
.modal-content>.modal-header,.modal-content>.modal-body,.modal-content>.modal-footer,
.tox .tox-dialog>.tox-dialog__header,.tox .tox-dialog>.tox-dialog__footer{border-radius:0!important}
/* Constrain the compose form, including labels, tokens and the editor. */
body.action-compose #layout-content{min-width:0;overflow:hidden}
#compose-content,#compose-content>form,#compose-headers,.compose-headers{min-width:0;max-width:100%;box-sizing:border-box}
#compose-content>form{width:100%;padding:20px}
#compose-headers .form-group.row{display:grid;grid-template-columns:6rem minmax(0,1fr);gap:10px;margin:0 0 12px;align-items:start}
#compose-headers .form-group.row>label{width:auto;max-width:none;min-width:0;padding:7px 0;overflow:visible;line-height:1.5}
#compose-headers .form-group.row>.col-10{width:auto;max-width:none;min-width:0;padding:0}
#compose-headers .input-group{min-width:0;flex-wrap:nowrap}
#compose-headers .input-group-text{background:var(--istt-selection-bg)!important;color:var(--istt-selection-text)!important;border-color:#cdd8e0;box-shadow:none}
#compose-headers a.input-group-text:hover,#compose-headers a.input-group-text:focus{background:#cbe3ef!important}
html.dark-mode #compose-headers .input-group-text{border-color:#334b64}
html.dark-mode #compose-headers a.input-group-text:hover,html.dark-mode #compose-headers a.input-group-text:focus{background:#2a4c69!important}
#compose-headers .input-group>.form-control,#compose-headers .recipient-input{min-width:0;flex:1 1 0;width:0}
#compose-headers .recipient-input{direction:ltr;text-align:left}
#compose-headers .recipient-input li{max-width:100%}
#composebody,#compose-content .html-editor,#compose-content .tox-tinymce{width:100%!important;max-width:100%;min-width:0;box-sizing:border-box}
#composebody{min-height:280px;resize:vertical}
#compose-content .formbuttons{padding:12px 20px}
@media(max-width:768px){#compose-content>form{padding:12px}#compose-headers .form-group.row{grid-template-columns:4.5rem minmax(0,1fr);gap:8px}}
/* Keep one navigation design in either writing direction. */
@media(min-width:481px){
  #layout-menu{display:flex;flex-direction:column;width:88px;flex-shrink:0;overflow:hidden}
  #layout-menu>.popover-header{flex-shrink:0}
  #taskmenu{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}
  #taskmenu>.action-buttons,#taskmenu>a{flex-shrink:0}
  #taskmenu .special-buttons{position:static;width:100%;margin-top:auto;flex-shrink:0}
  #taskmenu a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;width:calc(100% - 12px);height:auto;min-height:66px;margin:4px 6px;padding:9px 2px;border:0!important;border-radius:11px;text-align:center;box-shadow:none!important}
  #taskmenu a:before{float:none!important;display:block;width:auto;height:auto;margin:0!important;line-height:1.1;font-size:1.3rem}
  #taskmenu a .inner{display:block!important;padding:0;white-space:normal;overflow-wrap:anywhere;font-size:.78rem;line-height:1.5}
  #taskmenu a.selected{background:var(--istt-selection-bg)!important;color:var(--istt-selection-text)!important}
  #taskmenu>.action-buttons{margin-block:5px 9px}
  #taskmenu .action-buttons a.compose{min-height:82px;background:transparent!important;color:#d9e9ed!important;box-shadow:none!important}
  #taskmenu .action-buttons a.compose:before{content:"\f303";display:flex;align-items:center;justify-content:center;width:40px!important;height:40px!important;border-radius:12px;font-size:1.2rem;background:#203a52;color:#a5d4f6}
}
.folderlist li>a{display:block;position:relative;box-sizing:border-box;width:calc(100% - 12px);margin:6px;border-radius:10px}
.folderlist li.selected{background:transparent!important}
.folderlist li.selected>a{background:var(--istt-selection-bg)!important;color:var(--istt-selection-text)!important}
.folderlist li.mailbox .unreadcount{top:50%;transform:translateY(-50%);margin:0!important;inset-inline-end:8px;inset-inline-start:auto}
#taskmenu a.about{display:none!important}
html.dark-mode body{background:#111c2a;color:#d8e4ef}
html.dark-mode #layout-menu,html.dark-mode #layout-menu>.popover-header,html.dark-mode #taskmenu .special-buttons{background:#0e1825!important}
html.dark-mode #layout-sidebar{background:#152334}
html.dark-mode #layout-list{background:#172638}
html.dark-mode #layout-content{background:#111c2a}
html.dark-mode #layout>div>.header,html.dark-mode #layout>div>.footer{background:#162436;border-color:var(--istt-line);color:#b9cbe0}
html.dark-mode .popover,html.dark-mode .ui-dialog{background:#1a2b3f;color:#d8e4ef;border-color:#334a63}
html.dark-mode .popover .popover-header,html.dark-mode .ui-dialog .ui-dialog-titlebar{background:#20344b;color:#d8e4ef;border-color:#334a63}
html.dark-mode .ui-dialog.ui-widget-content,
html.dark-mode .ui-dialog .ui-dialog-content,
html.dark-mode .ui-dialog .ui-dialog-buttonpane{background:#1a2b3f!important;color:#d8e4ef;border-color:#334a63}
html.dark-mode .ui-dialog .ui-dialog-titlebar{background:#20344b!important}
html.dark-mode .ui-dialog .ui-dialog-title,html.dark-mode .ui-dialog .ui-dialog-titlebar-close{color:#d8e4ef}
html.dark-mode .form-control,html.dark-mode .custom-select{background-color:#112033;border-color:#334b64;color:#d8e4ef}
@media(prefers-reduced-motion:reduce){#taskmenu a,.folderlist li>a{transition:none}}

/* Persian compose: a quiet recipient card, detached actions and a clear editor. */
html[lang^="fa"] body.action-compose{
  --compose-page:#f3f6fa;--compose-card:#fff;--compose-field:#f7f9fc;
  --compose-line:#dce5ee;--compose-label:#627487;--compose-ink:#293d50;
  --compose-action:#e7eff5;--compose-action-ink:#355e76;
  --compose-send:#326b78;--compose-send-ink:#fff;--compose-send-hover:#275866;
}
html[lang^="fa"].dark-mode body.action-compose{
  --compose-page:#111c2a;--compose-card:#172638;--compose-field:#122033;
  --compose-line:#30465d;--compose-label:#a8bdd1;--compose-ink:#d8e4ef;
  --compose-action:#233d54;--compose-action-ink:#b9d9ed;
  --compose-send:#9bcbd9;--compose-send-ink:#122e3d;--compose-send-hover:#b4dde7;
}
html[lang^="fa"] body.action-compose #layout-content{background:var(--compose-page)}
html[lang^="fa"] body.action-compose #compose-content>form{padding:24px 28px 18px;width:100%;max-width:1160px;align-self:center;scrollbar-gutter:stable}
html[lang^="fa"] body.action-compose #compose-headers{padding:6px 20px;margin-bottom:20px;background:var(--compose-card);border:1px solid var(--compose-line);border-radius:16px;box-shadow:0 4px 16px rgba(23,45,68,.025)}
html[lang^="fa"] body.action-compose #compose-headers .form-group.row{grid-template-columns:4.5rem minmax(0,1fr);align-items:center;gap:14px;margin:0;padding:12px 0;border-bottom:1px solid var(--compose-line)}
html[lang^="fa"] body.action-compose #compose-headers .form-group.row:last-child{border-bottom:0}
html[lang^="fa"] body.action-compose #compose-headers .form-group.row>label{padding:0;font-size:.88rem;font-weight:700;line-height:1.8;color:var(--compose-label)}
html[lang^="fa"] body.action-compose #compose-headers .input-group{gap:5px;align-items:center;padding:4px;background:var(--compose-field);border:1px solid var(--compose-line);border-radius:11px}
html[lang^="fa"] body.action-compose #compose-headers .input-group:focus-within{border-color:#7b9aaf}
html[lang^="fa"] body.action-compose #compose-headers .input-group>.form-control{background:transparent;border:0!important;border-radius:7px!important;box-shadow:none!important;min-height:36px;color:var(--compose-ink)}
html[lang^="fa"] body.action-compose #compose-headers select.form-control{direction:ltr;text-align:left;font-family:Tahoma,sans-serif!important;font-size:.9rem}
html[lang^="fa"] body.action-compose #compose-headers .input-group-append{margin:0;align-self:stretch;align-items:center;flex-shrink:0}
html[lang^="fa"] body.action-compose #compose-headers .input-group-text{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:34px;height:34px;padding:0;border:0;border-radius:8px!important;background:var(--compose-action)!important;color:var(--compose-action-ink)!important}
html[lang^="fa"] body.action-compose #compose-headers .input-group-text:before{float:none!important;width:20px;height:20px;line-height:20px;margin:0!important;font-size:1rem}
html[lang^="fa"] body.action-compose #compose-headers .input-group-text:hover{background:var(--istt-selection-bg)!important}
html[lang^="fa"] body.action-compose #compose-headers .recipient-input{min-height:36px;padding:3px 10px;margin-bottom:0;align-items:center;gap:4px}
html[lang^="fa"] body.action-compose #compose-headers .recipient-input.focus{background:transparent!important;outline:0!important;border:0!important;box-shadow:none!important}
html[lang^="fa"] body.action-compose #compose-headers .recipient-input input{margin:0;min-height:28px;line-height:1.6;outline:0!important;box-shadow:none!important;color:var(--compose-ink)}
html[lang^="fa"] body.action-compose #compose-headers .recipient-input li.recipient{margin:0;padding:3px 5px;border:1px solid var(--compose-line);border-radius:7px;background:var(--compose-action);color:var(--compose-ink)}
html[lang^="fa"] body.action-compose #compose-headers .recipient-input li.recipient a.button.icon{color:var(--compose-action-ink)}
html[lang^="fa"] body.action-compose #compose-headers .col-10>.form-control{height:46px;padding:9px 14px;border:1px solid var(--compose-line);border-radius:11px;background:var(--compose-field);color:var(--compose-ink);font-size:.95rem}
html[lang^="fa"] body.action-compose #composebodycontainer,
html[lang^="fa"] body.action-compose #compose-content .html-editor{margin:0;min-width:0;border-radius:16px;background:var(--compose-card)}
html[lang^="fa"] body.action-compose #composebody{height:clamp(300px,calc(100dvh - 445px),640px);min-height:280px;padding:66px 22px 24px;border:1px solid var(--compose-line);border-radius:16px;background:var(--compose-card);color:var(--compose-ink);font-family:"Arad FD",Tahoma,sans-serif;line-height:1.9;font-size:1rem;resize:vertical}
html[lang^="fa"] body.action-compose #composebody:not([data-html-editor]){padding-top:22px}
html[lang^="fa"] body.action-compose .html-editor #composebody{padding-top:66px}
html[lang^="fa"] body.action-compose .html-editor .editor-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;top:1px;left:1px;right:1px;min-height:46px;padding:6px 12px;border-radius:15px 15px 0 0;border-bottom:1px solid var(--compose-line);background:var(--compose-card);color:var(--compose-label)}
html[lang^="fa"] body.action-compose .html-editor .editor-toolbar:before{content:"متن پیام";font-size:.86rem;font-weight:700}
html[lang^="fa"] body.action-compose .html-editor .editor-toolbar .mce-i-html{display:flex;align-items:center;justify-content:center;margin:0;width:32px;height:32px;border-radius:8px;background:var(--compose-action);color:var(--compose-action-ink)}
html[lang^="fa"] body.action-compose .html-editor .editor-toolbar .mce-i-html:before{float:none;margin:0!important;line-height:22px}
html[lang^="fa"] body.action-compose .html-editor .tox-tinymce+.editor-toolbar,
html[lang^="fa"] body.action-compose .html-editor.mailvelope .editor-toolbar{display:none}
html[lang^="fa"] body.action-compose .html-editor .tox-tinymce{border:1px solid var(--compose-line);border-radius:16px;overflow:hidden}
html[lang^="fa"] body.action-compose #compose-content .formbuttons{padding:16px 28px;border-top:1px solid var(--compose-line);background:var(--compose-page)}
html[lang^="fa"] body.action-compose #compose-content .formbuttons .float-right{float:none!important;margin-inline-start:auto}
html[lang^="fa"] body.action-compose #compose-content .formbuttons .btn-primary{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:116px;min-height:44px;margin:0;padding:10px 22px;border:0;border-radius:11px;background:var(--compose-send);color:var(--compose-send-ink);font-size:.95rem;font-weight:700;box-shadow:0 3px 9px rgba(22,55,75,.1)}
html[lang^="fa"] body.action-compose #compose-content .formbuttons .btn-primary:before{float:none!important;margin:0!important;height:auto;line-height:1.3}
html[lang^="fa"] body.action-compose #compose-content .formbuttons .btn-primary:not(:disabled):hover{background:var(--compose-send-hover)}
html[lang^="fa"] body.action-compose #compose-content .formbuttons .btn-link{padding:6px 0;font-size:.83rem;color:var(--istt-link)}
html[lang^="fa"] body.action-compose #compose-attachments{margin:18px 16px;min-height:190px;border:1px dashed var(--compose-line);border-radius:14px;background:var(--compose-card);color:var(--compose-label)}
html[lang^="fa"] body.action-compose #compose-attachments .btn-secondary{padding:9px 14px;border:0;border-radius:9px;background:var(--compose-action);color:var(--compose-action-ink);font-size:.86rem}
@media(min-width:769px){html[lang^="fa"] body.action-compose #compose-content .formbuttons{display:flex;align-items:center;gap:16px}}
@media(max-width:768px){
  html[lang^="fa"] body.action-compose #compose-content>form{padding:14px 12px}
  html[lang^="fa"] body.action-compose #compose-headers{padding:4px 12px;margin-bottom:14px;border-radius:13px}
  html[lang^="fa"] body.action-compose #compose-headers .form-group.row{grid-template-columns:minmax(0,1fr);gap:6px;padding:10px 0}
  html[lang^="fa"] body.action-compose #compose-headers .form-group.row>label{font-size:.82rem}
  html[lang^="fa"] body.action-compose #compose-content .formbuttons{display:none}
  html[lang^="fa"] body.action-compose #composebody{padding-inline:16px}
}

/* BEGIN ISTT login tweaks 20261123 */
html[lang^="fa"] body.task-login #login-form #rcmloginuser,
html[lang^="fa"] body.task-login #login-form #rcmloginpwd {
  direction: rtl !important;
  text-align: right !important;
}
html[lang^="fa"] body.task-login #login-form #rcmloginuser::placeholder,
html[lang^="fa"] body.task-login #login-form #rcmloginpwd::placeholder {
  direction: rtl !important;
  text-align: right !important;
}
/* Temporary presentation change; hide the OAuth row including its separator. */
body.task-login #login-form .oauthlogin,
body.task-login #login-form #rcmloginoauth {
  display: none !important;
}
/* END ISTT login tweaks 20261123 */
