/* ============================================================
   Outlook-style Mail workspace (view-mail)
   Loaded only by index.html, after app.css.
   ============================================================ */

.ol-shell{
  display:grid;
  grid-template-columns:214px 336px minmax(0,1fr);
  height:calc(100vh - 236px);
  min-height:440px;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}

/* Mail view is full-bleed: it cancels .content's padding (28/30/40) and the
   1600px max-width cap, so the panes touch the topbar and the window edges. */
#contentArea:has(> #view-mail.on){max-width:none}
#view-mail.on{
  display:flex;flex-direction:column;
  height:calc(100% + 68px);
  margin:-28px -30px -40px;
}
#view-mail .ol-shell{flex:1 1 auto;border:none;border-radius:0}

/* ---------------- Folder rail ---------------- */
.ol-rail{
  background:#f5f5f5;
  border-right:1px solid var(--line);
  display:flex;flex-direction:column;
  padding:12px 10px;
  min-width:0;
}
.ol-new{
  display:flex;align-items:center;justify-content:center;gap:7px;
  width:100%;padding:9px 10px;border:none;border-radius:8px;
  background:#0f6cbd;color:#fff;font:inherit;font-size:13px;font-weight:600;
  cursor:pointer;transition:background .15s;
}
.ol-new:hover{background:#115ea3}
.ol-new:active{background:#0d4f8b}
.ol-rail-label{
  margin:16px 6px 6px;font-size:11px;font-weight:700;letter-spacing:.6px;
  text-transform:uppercase;color:var(--muted2);
}
.ol-folders{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:1px}
.ol-folders li{
  display:flex;align-items:center;gap:9px;
  padding:8px 10px;border-radius:7px;cursor:pointer;
  font-size:13.5px;color:var(--ink);
  position:relative;transition:background .12s;
}
.ol-folders li:hover{background:rgba(0,0,0,.05)}
.ol-folders li.active{background:#eaf3fb;font-weight:600}
.ol-folders li.active::before{
  content:"";position:absolute;left:0;top:50%;transform:translateY(-50%);
  width:3px;height:18px;border-radius:0 3px 3px 0;background:#0f6cbd;
}
.ol-folders li .ol-fi{width:16px;height:16px;flex:none;color:#5a5a5a}
.ol-folders li.active .ol-fi{color:#0f6cbd}
.ol-folders li span.ol-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ol-pill{
  font-size:10.5px;font-weight:700;line-height:1;padding:3px 6px;border-radius:999px;
  background:#0f6cbd;color:#fff;min-width:18px;text-align:center;
}
.ol-pill.quiet{background:#e0e0e0;color:#444}
.ol-rail-foot{
  margin-top:auto;padding-top:12px;border-top:1px solid var(--line);
  display:flex;align-items:center;gap:9px;min-width:0;
}
.ol-av{
  width:30px;height:30px;border-radius:50%;flex:none;
  background:linear-gradient(135deg,#0f6cbd,#5b9bd5);
  color:#fff;display:flex;align-items:center;justify-content:center;
  font-size:11.5px;font-weight:700;letter-spacing:.3px;
}
.ol-ident{min-width:0;line-height:1.25}
.ol-ident b{display:block;font-size:11.5px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ol-ident small{display:block;font-size:10px;color:var(--muted2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---------------- Message list ---------------- */
.ol-list{
  border-right:1px solid var(--line);
  display:flex;flex-direction:column;min-width:0;background:#fff;
}
.ol-list-head{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  padding:11px 12px;border-bottom:1px solid var(--line);
}
.ol-list-head b{font-size:14.5px;font-weight:700}
.ol-count{font-size:11.5px;color:var(--muted2)}
.ol-list-head .spacer{flex:1}
.ol-search{
  padding:6px 10px;font-size:12.5px;min-width:0;flex:1 1 130px;max-width:190px;
}
.ol-mini{padding:5px 9px !important;font-size:12px !important}
.ol-rows{flex:1;overflow-y:auto;overscroll-behavior:contain}

.ol-row{
  display:block;width:100%;text-align:left;
  padding:11px 14px 12px;border:none;border-bottom:1px solid #f0f0f0;
  background:#fff;cursor:pointer;position:relative;font:inherit;color:inherit;
  transition:background .12s;
}
.ol-row:hover{background:#f7f9fc}
.ol-row.sel{background:#eaf3fb}
.ol-row.sel::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#0f6cbd}
.ol-row.unread .ol-subj{font-weight:700}
.ol-row.unread::after{
  content:"";position:absolute;left:6px;top:16px;width:7px;height:7px;
  border-radius:50%;background:#0f6cbd;
}
.ol-row-top{display:flex;align-items:baseline;gap:8px;margin-bottom:2px}
.ol-from{
  font-size:13px;font-weight:600;flex:1;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ol-row.unread .ol-from{font-weight:700;color:#0f6cbd}
.ol-time{font-size:11px;color:var(--muted2);white-space:nowrap;flex:none}
.ol-subj{
  font-size:13px;color:var(--ink);margin-bottom:2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ol-snip{
  font-size:12px;color:var(--muted2);line-height:1.45;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.ol-row-tags{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}
.ol-empty{
  padding:40px 24px;text-align:center;color:var(--muted2);font-size:13px;line-height:1.6;
}
.ol-empty b{display:block;color:var(--ink);font-size:14px;margin-bottom:4px}
.ol-skel{padding:14px}
.ol-skel div{
  height:54px;border-radius:8px;margin-bottom:8px;
  background:linear-gradient(90deg,#f2f2f2 25%,#fafafa 50%,#f2f2f2 75%);
  background-size:200% 100%;animation:olShimmer 1.2s infinite;
}
@keyframes olShimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* ---------------- Reading pane ---------------- */
.ol-read{
  display:flex;flex-direction:column;min-width:0;background:#fff;overflow:hidden;
}
.ol-read-head{
  padding:16px 22px 14px;border-bottom:1px solid var(--line);
  display:flex;align-items:flex-start;gap:12px;
}
.ol-read-head h3{
  margin:0 0 6px;font-size:18px;font-weight:700;line-height:1.3;letter-spacing:-.3px;
  word-break:break-word;
}
.ol-read-meta{font-size:12.5px;color:var(--muted);line-height:1.7}
.ol-read-meta b{color:var(--ink);font-weight:600}
.ol-read-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:11px}
.ol-read-body{
  flex:1;overflow-y:auto;padding:20px 22px 28px;
  font-size:14px;line-height:1.7;color:var(--ink);
}
.ol-read-body p{margin:0 0 12px}
.ol-read-body a{color:#0f6cbd}
.ol-read-body img{max-width:100%;border-radius:8px}
.ol-read-placeholder{
  flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;padding:36px;color:var(--muted2);gap:6px;
}
.ol-read-placeholder svg{width:52px;height:52px;color:#cfcfcf;stroke-width:1.4}
.ol-read-placeholder b{font-size:15px;color:var(--ink)}
.ol-read-placeholder span{font-size:12.5px;max-width:300px;line-height:1.6}

/* ---------------- Template preview ---------------- */
.ol-tpl-preview{
  flex:1;overflow-y:auto;padding:22px 24px 30px;
}
.ol-tpl-preview h3{margin:0 0 4px;font-size:19px;font-weight:700;letter-spacing:-.3px}
.ol-tpl-preview .t-sub{font-size:13px;color:#0f6cbd;font-weight:600;margin-bottom:16px}
.ol-tpl-preview .t-box{
  border:1px solid var(--line);border-radius:12px;background:#fafbfc;
  padding:18px 20px;font-size:14px;line-height:1.75;white-space:pre-wrap;
  max-height:46vh;overflow:auto;
}
.ol-tok{
  display:inline-block;padding:1px 6px;border-radius:5px;background:#eaf3fb;
  color:#0f6cbd;font-size:11.5px;font-weight:700;font-family:ui-monospace,Menlo,Consolas,monospace;
}

/* ---------------- Outlook compose ---------------- */
#overlay.ol-mode .modal{width:min(900px,96vw);max-height:92vh;padding:0;overflow:hidden;display:flex;flex-direction:column}
#overlay.ol-mode .modal h3{
  margin:0;padding:13px 18px;font-size:14.5px;font-weight:600;
  border-bottom:1px solid var(--line);background:#fafafa;
}
#overlay.ol-mode .modal-actions{display:none}
#overlay.ol-mode #modalBody{padding:0;overflow-y:auto}
#overlay.ms-mode .modal{width:min(760px,96vw);max-height:92vh;overflow-y:auto}
#overlay.ms-mode #modalBody{padding-top:6px}
#overlay.ms-add-mode .modal-actions{display:none}

.ol-compose{display:flex;flex-direction:column;min-height:0}
.ol-c-fields{padding:6px 18px 4px;border-bottom:1px solid var(--line)}
.ol-c-row{display:flex;align-items:center;gap:10px;border-bottom:1px solid #f0f0f0;padding:7px 0}
.ol-c-row:last-child{border-bottom:none}
.ol-c-row>label{
  width:62px;flex:none;font-size:12.5px;color:var(--muted);
}
.ol-c-row>input{
  flex:1;min-width:0;border:none;background:transparent;padding:6px 0;
  font:inherit;font-size:14px;color:var(--ink);outline:none;
}
.ol-c-row>input::placeholder{color:#b5b5b5}
.ol-c-row .ol-ccbtn{
  border:none;background:none;color:#0f6cbd;font:inherit;font-size:12.5px;
  cursor:pointer;padding:4px 6px;border-radius:5px;
}
.ol-c-row .ol-ccbtn:hover{background:#eaf3fb}
.ol-c-row .ol-from-txt{font-size:13.5px;color:var(--ink)}
.ol-c-hint{
  padding:9px 18px 2px;font-size:11.5px;color:var(--muted2);
  display:flex;align-items:center;gap:6px;
}

.ol-c-tools{
  display:flex;align-items:center;gap:3px;flex-wrap:wrap;
  padding:7px 12px;border-bottom:1px solid var(--line);background:#fafafa;
}
.ol-c-tools .ol-tsep{width:1px;height:20px;background:var(--line);margin:0 5px}
.ol-cbtn{
  border:none;background:none;border-radius:5px;cursor:pointer;
  font:inherit;font-size:13px;color:var(--ink);
  min-width:28px;height:26px;padding:0 6px;
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
}
.ol-cbtn:hover{background:#eaf3fb}
.ol-cbtn select{border:none;background:none;font:inherit;font-size:12.5px;outline:none;cursor:pointer;color:inherit}
.ol-cbtn input[type=color]{width:24px;height:22px;border:none;background:none;cursor:pointer;padding:0}
.ol-cbody{
  min-height:240px;max-height:46vh;overflow:auto;padding:16px 20px;
  font-size:14.5px;line-height:1.7;outline:none;
}
.ol-cbody:empty::before{content:attr(data-placeholder);color:#b5b5b5}
.ol-c-foot{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  padding:12px 18px;border-top:1px solid var(--line);background:#fafafa;
}
.ol-c-foot .spacer{flex:1}
.ol-send{
  background:#0f6cbd !important;color:#fff !important;border:none !important;
  padding:8px 26px !important;font-weight:600 !important;border-radius:6px !important;
}
.ol-send:hover{background:#115ea3 !important}
.ol-attach-chip{
  display:inline-flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted);
  background:#f0f0f0;border-radius:6px;padding:3px 8px;margin:0 6px 6px 0;
}

/* ---------------- Responsive ---------------- */
@media (max-width:1180px){
  .ol-shell{grid-template-columns:190px 300px minmax(0,1fr)}
}
@media (max-width:980px){
  .ol-shell{
    grid-template-columns:1fr;
    grid-template-rows:auto minmax(160px,32vh) minmax(0,1fr);
    height:calc(100vh - 210px);
  }
  .ol-rail{
    flex-direction:row;align-items:center;gap:8px;
    border-right:none;border-bottom:1px solid var(--line);padding:8px 10px;overflow-x:auto;
  }
  .ol-new{width:auto;flex:none;padding:8px 14px}
  .ol-rail-label,.ol-rail-foot{display:none}
  .ol-folders{flex-direction:row;gap:4px}
  .ol-folders li{white-space:nowrap;padding:7px 11px}
  .ol-folders li.active::before{left:11px;right:11px;top:auto;bottom:0;width:auto;height:2.5px;transform:none;border-radius:3px 3px 0 0}
  .ol-list{border-right:none;border-bottom:1px solid var(--line)}
}
@media (max-width:768px){
  /* .content padding is 14/12/24 here */
  #view-mail.on{height:calc(100% + 38px);margin:-14px -12px -24px}
}
@media (max-width:620px){
  .ol-search{max-width:none}
  .ol-c-row>label{width:46px}
  #overlay.ol-mode .modal{width:100vw;max-height:100vh;border-radius:0}
}

@media (max-width:480px){
  /* .content padding is 10/8/20 here */
  #view-mail.on{height:calc(100% + 30px);margin:-10px -8px -20px}
}
/* ---------------- Email account settings (gear) ---------------- */
.ms-wrap{font-size:13px}
.ms-sec{border-top:1px solid var(--line);padding:14px 0 4px}
.ms-sec:first-child{border-top:none;padding-top:2px}
.ms-label{font-size:11.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--muted);margin-bottom:10px}
.ms-acct{display:flex;align-items:center;gap:10px;background:var(--surface2);border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.ms-ico{width:30px;height:30px;flex:none;border-radius:8px;background:#e8f2fd;color:#0f6cbd;display:flex;align-items:center;justify-content:center;font-size:15px}
.ms-acct-txt{min-width:0}
.ms-acct-txt b{display:block;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ms-acct-txt small{display:block;color:var(--muted2);font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ms-primary{margin-left:auto;flex:none;font-size:11.5px;padding:6px 10px;white-space:nowrap}
.ms-primary:disabled{opacity:.75;cursor:default}
.ms-pw{position:relative}
.ms-pw .form-input{padding-right:34px}
.ms-eye{position:absolute;top:0;right:0;bottom:0;width:32px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--muted2);cursor:pointer;padding:0;border-radius:0 var(--radius-sm) var(--radius-sm) 0}
.ms-eye:hover{color:var(--ink);background:rgba(15,23,42,.05)}
.ms-eye[aria-pressed="true"]{color:#0f6cbd}
.ms-help{display:block;font-size:11px;line-height:1.45;color:var(--muted2);margin-top:5px}
.ms-field{margin-bottom:10px}
.ms-field label{display:block;font-size:11.5px;font-weight:700;color:var(--muted);margin-bottom:5px}
.ms-row{display:grid;grid-template-columns:1fr 110px;gap:10px}
.ms-row .ms-field{margin-bottom:0}
.ms-row+.ms-field{margin-top:10px}
.ms-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--line);margin-top:6px;padding-top:14px}
.ms-test{font-size:12px;color:var(--muted)}
.ms-note{font-size:11.5px;line-height:1.55;color:var(--muted2);margin-top:10px}
.ms-label-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.ms-label-row span{flex:1}
.ms-add{font-size:11.5px;padding:5px 10px;white-space:nowrap;text-transform:none;letter-spacing:0}
.ms-acct.is-target{border-color:var(--blue);box-shadow:0 0 0 1px rgba(59,130,246,.28)}
.ms-acct-acts{margin-left:auto;display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.ms-mini{font-size:11px;padding:5px 9px;line-height:1.2;white-space:nowrap}
.ms-cur{font-size:11px;color:var(--muted2);font-weight:700;border:1px dashed var(--line);border-radius:var(--radius-sm);padding:5px 9px}
.ms-danger{color:#c0392b}
.ms-danger:hover{border-color:#c0392b;color:#c0392b}
.ms-badge{font-size:11px;font-weight:700;color:#0d7a4f;background:rgba(16,185,129,.12);border:1px solid rgba(16,185,129,.35);padding:5px 9px;border-radius:999px;white-space:nowrap}
.ms-pbtn{font-size:11.5px;padding:6px 10px;white-space:nowrap}
.ms-pbtn:disabled{opacity:.75;cursor:default}
.ms-actions.ms-top{border-top:none;margin-top:0;padding-top:0;align-items:center}
.ms-actions.ms-top .ms-prov-title{margin-right:auto}
#overlay.ms-add-mode #modalTitle{display:none}
.ms-ico-sm{width:24px;height:24px;border-radius:7px;font-size:13px}
.ms-x{margin-left:auto;flex:none;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:var(--radius-sm);font-size:16px;line-height:1;cursor:pointer;padding:0;font-family:inherit}
.ms-x:hover{border-color:var(--blue);color:var(--blue)}
.ms-back{font-size:12px;padding:5px 10px}
.ms-prov-title{font-size:13px;font-weight:700}
.ms-pgrid{display:flex;flex-direction:column;gap:8px}
.ms-provider{display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:11px 13px;cursor:pointer;font-family:inherit;transition:border-color .12s,box-shadow .12s,transform .12s}
.ms-provider:hover{border-color:var(--blue);box-shadow:0 3px 12px rgba(16,24,40,.07);transform:translateY(-1px)}
.ms-prov-ico{flex:none;width:36px;height:36px;display:flex;align-items:center;justify-content:center;border-radius:9px;background:#e8f2fd;color:#0f6cbd;font-size:17px}
.ms-prov-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.ms-prov-txt b{font-size:13.5px}
.ms-prov-txt small{color:var(--muted2);font-size:11.5px}
.ms-prov-go{color:var(--muted2);font-size:18px;line-height:1}
.ms-pnote{border-left:3px solid #f59e0b;background:rgba(245,158,11,.1);color:#8a5300;padding:8px 12px;border-radius:0 8px 8px 0;margin-top:12px}
.ms-check{display:flex;gap:8px;align-items:center;font-size:12.5px;color:var(--muted);cursor:pointer;margin-bottom:10px}
.ms-check input{accent-color:var(--blue);width:14px;height:14px}
@media (max-width:620px){
  .ms-row{grid-template-columns:1fr}
  .ms-acct{flex-wrap:wrap}
  .ms-primary{margin-left:0}
  .ms-acct-acts{margin-left:0;justify-content:flex-start;width:100%}
  .ms-label-row{flex-wrap:wrap}
}
@media print{
  .ol-rail,.ol-list,.ol-c-tools,.ol-c-foot,.ol-read-actions{display:none !important}
  .ol-shell{display:block;height:auto;border:none}
  .ol-read{overflow:visible}
}
