/* ==========================================================================
   Microsoft Outlook Fluent UI Theme & Styling
   ========================================================================== */

:root {
  --outlook-blue: #0078d4;
  --outlook-blue-hover: #106ebe;
  --outlook-blue-active: #005a9e;
  --outlook-blue-light: #eff6fc;
  --outlook-blue-subtle: #deecf9;
  
  --bg-app: #f3f2f1;
  --bg-surface: #ffffff;
  --bg-sidebar: #f5f5f5;
  --bg-rail: #edebe9;
  --bg-hover: #f3f2f1;
  --bg-selected: #edebe9;
  --bg-active: #e1dfdd;
  
  --text-primary: #201f1e;
  --text-secondary: #605e5c;
  --text-subtle: #a19f9d;
  --text-disabled: #c8c6c4;
  --text-on-accent: #ffffff;

  --border-light: #edebe9;
  --border-subtle: #e1dfdd;
  --border-strong: #8a8886;

  --status-unread: #0078d4;
  --status-flagged: #d83b01;
  --status-success: #107c10;
  --status-warning: #ffb900;
  --status-error: #a80000;

  --header-height: 48px;
  --ribbon-height: 44px;
  --rail-width: 48px;
  --sidebar-width: 240px;
  --message-list-width: 380px;

  --font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  --shadow-fluent: 0 1.6px 3.6px 0 rgba(0,0,0,0.132), 0 0.3px 0.9px 0 rgba(0,0,0,0.108);
  --shadow-flyout: 0 6.4px 14.4px 0 rgba(0,0,0,0.132), 0 1.2px 3.6px 0 rgba(0,0,0,0.108);
  --shadow-modal: 0 25.6px 57.6px 0 rgba(0,0,0,0.22), 0 4.8px 14.4px 0 rgba(0,0,0,0.18);
}

/* Dark Theme overrides */
body.theme-dark {
  --bg-app: #1b1a19;
  --bg-surface: #252423;
  --bg-sidebar: #201f1e;
  --bg-rail: #11100f;
  --bg-hover: #292827;
  --bg-selected: #323130;
  --bg-active: #3b3a39;

  --text-primary: #f3f2f1;
  --text-secondary: #c8c6c4;
  --text-subtle: #8a8886;
  --text-disabled: #605e5c;

  --border-light: #323130;
  --border-subtle: #3b3a39;
  --border-strong: #605e5c;

  --outlook-blue-light: #1f3d5c;
  --outlook-blue-subtle: #19324b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text-primary);
  background-color: var(--bg-app);
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.outlook-header {
  height: var(--header-height);
  background-color: var(--outlook-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.waffle-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.waffle-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.header-search {
  flex: 1;
  max-width: 580px;
  margin: 0 24px;
  position: relative;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 0 12px;
  height: 32px;
  transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
  background-color: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.search-input-wrapper svg {
  color: rgba(255, 255, 255, 0.85);
  margin-right: 8px;
}
.search-input-wrapper:focus-within svg {
  color: var(--text-secondary);
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}
.search-input-wrapper:focus-within .search-input {
  color: var(--text-primary);
}
.search-input-wrapper:focus-within .search-input::placeholder {
  color: var(--text-subtle);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-action-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.header-action-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.user-avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #ffffff;
  color: var(--outlook-blue);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ==========================================================================
   Command Ribbon Bar
   ========================================================================== */
.outlook-ribbon {
  height: var(--ribbon-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}

.ribbon-btn-primary {
  background-color: var(--outlook-blue);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 16px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ribbon-btn-primary:hover {
  background-color: var(--outlook-blue-hover);
}

.ribbon-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-primary);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ribbon-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-subtle);
}

.ribbon-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-light);
  margin: 0 4px;
}

/* ==========================================================================
   Main 3-Pane Layout
   ========================================================================== */
.outlook-body {
  display: flex;
  height: calc(100vh - var(--header-height) - var(--ribbon-height));
  width: 100vw;
  overflow: hidden;
}

/* Left Navigation Rail */
.outlook-rail {
  width: var(--rail-width);
  background-color: var(--bg-rail);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 8px;
  z-index: 10;
}

.rail-btn {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}
.rail-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}
.rail-btn.active {
  color: var(--outlook-blue);
  background-color: var(--bg-surface);
}
.rail-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background-color: var(--outlook-blue);
  border-radius: 0 2px 2px 0;
}

/* Left Folder Sidebar */
.outlook-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 6px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13px;
  border-radius: 0 16px 16px 0;
  margin-right: 8px;
  transition: background 0.1s ease;
}
.folder-item:hover {
  background-color: var(--bg-hover);
}
.folder-item.active {
  background-color: var(--outlook-blue-subtle);
  color: var(--outlook-blue);
  font-weight: 600;
}

.folder-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--outlook-blue);
  background: rgba(0, 120, 212, 0.12);
  padding: 1px 7px;
  border-radius: 10px;
}

/* Middle Message List Pane */
.outlook-message-list-pane {
  width: var(--message-list-width);
  min-width: 320px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.message-list-header {
  padding: 10px 16px 6px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list-tabs {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 6px 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
}
.tab-btn.active {
  color: var(--text-primary);
}
.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--outlook-blue);
  border-radius: 2px 2px 0 0;
}

.filter-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.filter-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.message-items-scroll {
  flex: 1;
  overflow-y: auto;
}

.message-item {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  position: relative;
  transition: background 0.1s ease;
}
.message-item:hover {
  background-color: var(--bg-hover);
}
.message-item.selected {
  background-color: var(--outlook-blue-subtle);
}

.message-item.unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--outlook-blue);
}

.msg-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.msg-sender {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-item.unread .msg-sender {
  font-weight: 600;
}

.msg-date {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-left: 8px;
}
.message-item.unread .msg-date {
  color: var(--outlook-blue);
  font-weight: 600;
}

.msg-subject {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-item.unread .msg-subject {
  font-weight: 600;
}

.msg-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.msg-badges-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.hover-actions {
  display: none;
  align-items: center;
  gap: 4px;
  position: absolute;
  right: 12px;
  top: 10px;
  background: var(--bg-hover);
  padding: 2px 4px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.message-item:hover .hover-actions {
  display: flex;
}

.quick-icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-icon-btn:hover {
  background-color: var(--border-subtle);
  color: var(--text-primary);
}
.quick-icon-btn.flagged {
  color: var(--status-flagged);
}

/* Right Reading Pane */
.outlook-reading-pane {
  flex: 1;
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.reading-pane-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-subtle);
  text-align: center;
  padding: 24px;
}

.reading-pane-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
}

.detail-subject-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.detail-subject {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sender-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sender-avatar-lg {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--outlook-blue);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sender-info-col {
  flex: 1;
}

.sender-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sender-display-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.sender-email-addr {
  font-size: 13px;
  color: var(--text-secondary);
}

.recipients-row {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Remote images banner */
.safety-warning-banner {
  background-color: #fff4ce;
  border-left: 4px solid #ffb900;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #323130;
}

.trust-images-btn {
  background: none;
  border: 1px solid #323130;
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}
.trust-images-btn:hover {
  background-color: rgba(0,0,0,0.05);
}

.reading-body-scroll {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  user-select: text;
}

.email-body-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Attachments bar */
.attachments-section {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-hover);
}

.attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.attachment-chip:hover {
  border-color: var(--outlook-blue);
  box-shadow: var(--shadow-fluent);
}

/* ==========================================================================
   Outlook Compose Window
   ========================================================================== */
.composer-window {
  position: fixed;
  bottom: 0;
  right: 24px;
  width: 680px;
  height: 520px;
  background-color: var(--bg-surface);
  border-radius: 8px 8px 0 0;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  transition: all 0.2s ease;
}

.composer-window.minimized {
  height: 42px;
}

.composer-window.maximized {
  top: 48px;
  bottom: 0;
  right: 0;
  left: 0;
  width: 100vw;
  height: calc(100vh - 48px);
  border-radius: 0;
}

.composer-header {
  height: 42px;
  background-color: var(--bg-hover);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-radius: 8px 8px 0 0;
}

.composer-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.composer-window-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.composer-ribbon {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-fields {
  display: flex;
  flex-direction: column;
}

.composer-field-row {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border-light);
}

.composer-field-label {
  width: 60px;
  font-size: 13px;
  color: var(--text-secondary);
}

.composer-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background: transparent;
}

.formatting-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-hover);
}

.fmt-btn {
  background: none;
  border: 1px solid transparent;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
}
.fmt-btn:hover {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
}

.composer-editor {
  flex: 1;
  padding: 16px;
  outline: none;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  user-select: text;
}

/* ==========================================================================
   Modals & Popups
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(2px);
}

.modal-card {
  background-color: var(--bg-surface);
  border-radius: 8px;
  box-shadow: var(--shadow-modal);
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Form controls */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  outline: none;
  transition: border-color 0.15s ease;
}
.form-control:focus {
  border-color: var(--outlook-blue);
  box-shadow: 0 0 0 1px var(--outlook-blue);
}

/* User Account Flyout / Dropdown Menu */
.user-account-dropdown {
  position: absolute;
  top: 48px;
  right: 12px;
  width: 290px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.12);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: flyoutFadeIn 0.12s ease-out;
}

@keyframes flyoutFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-hover);
  border-bottom: 1px solid var(--border-light);
}

.user-dropdown-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--outlook-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 120, 212, 0.35);
}

.user-dropdown-info {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.user-dropdown-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-email {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-mobile {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-divider {
  height: 1px;
  background-color: var(--border-light);
}

.user-dropdown-actions {
  padding: 6px 0;
}

.user-dropdown-item {
  width: 100%;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.1s ease, color 0.1s ease;
}

.user-dropdown-item:hover {
  background-color: var(--bg-hover);
  color: var(--outlook-blue);
}

.user-dropdown-footer {
  padding: 6px 0;
  background-color: var(--bg-primary);
}

.user-dropdown-signout {
  width: 100%;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  color: var(--status-error);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.1s ease;
}

.user-dropdown-signout:hover {
  background-color: #fde7e9;
}

/* Image Preview Lightbox / Overlay */
.image-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.88);
  backdrop-filter: blur(6px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.15s ease-out;
}

.image-preview-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(24, 24, 28, 0.75);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.image-preview-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50vw;
}

.image-preview-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.image-preview-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.image-preview-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.image-preview-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.image-preview-img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Utilities */
.hidden { display: none !important; }
