/* Aria Files — Sky Cloud theme (Design 13).
   Airy light sky blue + white, soft cloud-like rounded shapes,
   calm and open professional look. English UI only. */
:root {
  --sky-900: #0b2545;
  --sky-700: #14558f;
  --sky-500: #2f80ed;
  --sky-400: #38bdf8;
  --sky-300: #7dd3fc;
  --sky-100: #e0f2fe;
  --sky-50: #f0f9ff;
  --bubble-me: #cfe6ff; /* WhatsApp-style sent bubble, Sky Cloud blue tint */
  --ink: #0f2a43;
  --muted: #5b7a99;
  --line: #dcecfb;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --err: #dc2626;
  --err-soft: #fee2e2;
  --card: #ffffff;
  --radius: 20px;
  --shadow: 0 8px 24px rgba(15, 60, 110, .08);
  --shadow-sm: 0 2px 8px rgba(15, 60, 110, .07);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0; color: var(--ink);
  background: linear-gradient(180deg, #dceefc 0%, #eef7ff 220px, #f7fbff 100%);
  min-height: 100vh;
}
button { font-family: inherit; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--sky-700); cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--sky-50); }

/* ---- screens ---- */
.screen { max-width: 720px; margin: 0 auto; padding: 20px 16px 32px; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
h2.section-title { margin: 4px 0 2px; font-size: 24px; font-weight: 800; color: var(--sky-900); letter-spacing: -.02em; }
.section-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
h3.section-head { margin: 22px 0 10px; font-size: 17px; font-weight: 700; color: var(--sky-900); }

/* ---- cards ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 12px 0; box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 8px; font-size: 16px; color: var(--sky-900); }

/* ---- buttons & inputs ---- */
button {
  background: linear-gradient(135deg, var(--sky-400), var(--sky-500));
  color: #fff; border: 0; padding: 11px 18px; border-radius: 999px; cursor: pointer;
  margin: 4px 0; font-size: 15px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(47, 128, 237, .28);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(47, 128, 237, .34); }
button:active { transform: translateY(0); }
button:disabled { opacity: .5; box-shadow: none; transform: none; }
button.ghost, .file button, .notif button {
  background: #fff; color: var(--sky-700); border: 1px solid var(--line);
  box-shadow: none; padding: 7px 13px; font-size: 13px; font-weight: 600;
}
button.ghost:hover, .file button:hover, .notif button:hover { background: var(--sky-50); box-shadow: none; transform: none; }
button.danger { background: #fff; color: var(--err); border: 1px solid #fecaca; box-shadow: none; }
label { display: block; margin: 10px 0 4px; font-size: 14px; font-weight: 600; color: var(--sky-900); }
input, select {
  padding: 11px 13px; border: 1.5px solid #cbdcee; border-radius: 12px;
  width: 100%; max-width: 420px; font-size: 15px; color: var(--ink);
  background: #fff; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { border-color: var(--sky-500); box-shadow: 0 0 0 3px rgba(47, 128, 237, .15); }
.msg { color: var(--err); font-size: 14px; min-height: 1.2em; }
.msg.info { color: var(--muted); }
.msg.ok { color: var(--ok); }
.hint { color: var(--muted); font-size: 13px; }
.badge {
  background: #ef4444; color: #fff; border-radius: 999px; padding: 1px 7px;
  font-size: 11px; font-weight: 700; margin-left: 4px; vertical-align: 2px;
}

/* ---- screen header (back button + title, Design 1) ---- */
.screen-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; }
.screen-head .section-title { margin: 0; }
.screen-head .head-action { margin-left: auto; }
.screen-back { flex: 0 0 36px; width: 36px; height: 36px; }
.screen-back svg { width: 18px; height: 18px; }

/* ---- Home quick-access grid (Design 1: 2x2 big cards) ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big-card {
  position: relative; width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0; box-shadow: var(--shadow-sm);
  color: var(--ink); text-align: left; display: block; cursor: pointer;
}
.big-card:hover { background: var(--sky-50); transform: none; box-shadow: var(--shadow-sm); }
.big-ic {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.big-ic svg { width: 24px; height: 24px; }
.tint-blue { background: #e0f2fe; color: #2f80ed; }
.tint-teal { background: #ccfbf1; color: #0d9488; }
.tint-violet { background: #ede9fe; color: #7c3aed; }
.tint-sky { background: #e0f2fe; color: #0284c7; }
.big-title { font-size: 16px; font-weight: 800; color: var(--sky-900); }
.big-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pill {
  position: absolute; top: 12px; right: 12px;
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: var(--sky-500); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.pill.red { background: #ef4444; }
.tint-amber { background: #fef3c7; color: #b45309; }
.tint-rose { background: #ffe4e6; color: #be123c; }

/* ---- Home hero + Today strip (V26) ---- */
.hero {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, var(--sky-400), var(--sky-500));
  border-radius: 24px; padding: 18px; color: #fff;
  box-shadow: 0 10px 24px rgba(47, 128, 237, .35);
}
.hero-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: #fff;
  display: flex; align-items:center; justify-content: center; flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(15, 60, 110, .18); overflow: hidden;
  color: var(--sky-500); font-size: 24px; font-weight: 800;
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-avatar svg { width: 30px; height: 30px; }
.hero-name {
  font-size: 22px; font-weight: 800; letter-spacing: -.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.today-strip {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 16px; margin-top: 12px; box-shadow: var(--shadow-sm);
  font-size: 13px; color: var(--muted); text-align: center;
}
.today-strip b { color: var(--sky-900); }
#sendFileBtn { width: 100%; justify-content: center; margin-top: 14px; }

/* ---- auth ---- */
.auth-wrap { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.auth-logo {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 24px;
  background: linear-gradient(135deg, var(--sky-400), var(--sky-500));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(47, 128, 237, .35);
}
.auth-logo svg { width: 42px; height: 42px; }
.auth-wrap h2 { font-size: 24px; margin: 0 0 4px; color: var(--sky-900); }
.auth-wrap .auth-sub { color: var(--muted); margin: 0 0 8px; font-size: 14px; }
.auth-card { text-align: left; }
.auth-card button { width: 100%; padding: 13px; font-size: 16px; margin-top: 10px; }
.auth-card .msg { text-align: center; }

/* ---- today stats ---- */
.counts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .counts { grid-template-columns: repeat(4, 1fr); } }
.counts .card { margin: 0; padding: 14px 12px; text-align: center; }
.stat-icon {
  width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 14px;
  background: var(--sky-100); color: var(--sky-500);
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-num { font-size: 26px; font-weight: 800; color: var(--sky-900); line-height: 1; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---- file rows ---- */
.filegrid { display: flex; flex-direction: column; gap: 10px; }
.file {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; word-break: break-word;
}
.file-icon {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px;
  background: var(--sky-100); color: var(--sky-500);
  display: flex; align-items: center; justify-content: center;
}
.file-icon svg { width: 21px; height: 21px; }
/* ---- browse file thumbnails (real image / video first frame) ---- */
.file-thumb { position: relative; overflow: hidden; }
.file-thumb img, .file-thumb video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; visibility: hidden;
}
.file-thumb.has-thumb img, .file-thumb.has-thumb video { visibility: visible; }
.file-thumb.has-thumb svg { display: none; }
.file-body { flex: 1; min-width: 160px; }
.file .name { font-weight: 700; font-size: 14.5px; color: var(--sky-900); }
.file .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.file-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.file button { margin: 0; }

/* ---- empty states ---- */
.empty {
  background: var(--card); border: 1.5px dashed #bcd9f5; border-radius: var(--radius);
  padding: 28px 18px; margin: 12px 0; text-align: center; color: var(--muted);
}
.empty b { display: block; font-size: 16px; color: var(--sky-900); margin-bottom: 4px; }
.empty p { margin: 4px 0 12px; font-size: 14px; }

/* ---- upload ---- */
.dropzone {
  border: 2px dashed var(--sky-300); border-radius: var(--radius);
  padding: 30px 18px; text-align: center; background: var(--sky-50);
  transition: background .15s ease, border-color .15s ease;
}
.dropzone.over { background: var(--sky-100); border-color: var(--sky-500); }
.dropzone-icon {
  width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 20px;
  background: linear-gradient(135deg, var(--sky-400), var(--sky-500));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(47, 128, 237, .3);
}
.dropzone-icon svg { width: 30px; height: 30px; }
.dropzone b { display: block; font-size: 16px; color: var(--sky-900); }
.dropzone p { color: var(--muted); font-size: 13.5px; margin: 4px 0 14px; }
#filePicker { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.upload-card .up-head { display: flex; align-items: center; gap: 10px; }
.upload-card .up-name { font-weight: 700; font-size: 14.5px; color: var(--sky-900); word-break: break-all; }
.upload-card .up-size { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.upload-card .status { font-size: 13.5px; color: var(--muted); display: block; margin-top: 2px; }
.progress { height: 10px; background: #dbeafe; border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.progress div {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--sky-400), var(--sky-500));
  transition: width .3s ease;
}
.upload-card.uploading .progress div {
  background-image: linear-gradient(90deg, var(--sky-400), var(--sky-500));
  background-size: 40px 100%;
  animation: shimmer 1s linear infinite;
}
@keyframes shimmer { from { background-position: 0 0; } to { background-position: 40px 0; } }
.upload-card.preparing .status::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 7px;
  border: 2px solid #bae6fd; border-top-color: var(--sky-500); border-radius: 50%;
  animation: spin .8s linear infinite; vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.upload-card.done { border-color: #bbf7d0; }
.upload-card.done .status { color: var(--ok); font-weight: 600; }
.upload-card.done .status::before { content: "\2713  "; font-weight: 800; }
.upload-card.error { border-color: #fecaca; }
.upload-card.error .status { color: var(--err); font-weight: 600; }
.upload-card.paused .status { color: #b45309; }

/* ---- Send File (Home) ---- */
.sendfile-hero { margin: 16px 0 4px; }
.sendfile-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; font-size: 16px;
}
.sendfile-btn svg { width: 20px; height: 20px; }
.sendfile-hero .hint { margin: 8px 0 0; }
#sendFilePanel h4 { margin: 16px 0 8px; font-size: 15px; color: var(--sky-900); }
#sendFilePanel h4:first-of-type { margin-top: 4px; }
.pick-row { cursor: pointer; }
.pick-row:hover { background: var(--sky-50); border-color: var(--sky-300); }
.pick-row .avatar { flex: 0 0 40px; }
#sendFileProgress { margin-top: 14px; }

/* ---- notifications ---- */
.notif { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 10px 0; box-shadow: var(--shadow-sm); }
.notif.unread { border-left: 4px solid var(--sky-500); }
.notif small { color: var(--muted); }

/* ---- settings ---- */
.bar { height: 12px; background: #dbeafe; border-radius: 999px; overflow: hidden; }
.bar div { height: 100%; background: linear-gradient(90deg, var(--sky-400), var(--sky-500)); }
.pin { font-size: 2em; letter-spacing: .3em; font-weight: 800; color: var(--sky-700); text-align: center; }
#scanVideo { width: 100%; max-width: 400px; border-radius: 16px; }
#searchBox { max-width: none; }
#qrBox { display: flex; justify-content: center; padding: 8px 0; }
#qrBox img { border-radius: 12px; }

/* ---- browse: quick chips ---- */
.chips { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.chip {
  background: #fff; border: 1.5px solid var(--line); color: var(--sky-700);
  padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: none; margin: 0;
}
.chip:hover { background: var(--sky-50); box-shadow: none; transform: none; }
.chip.active {
  background: linear-gradient(135deg, var(--sky-400), var(--sky-500));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(47, 128, 237, .28);
}

/* ---- browse: compact date field + calendar dropdown ---- */
.date-picker { position: relative; margin: 12px 0; }
.date-field {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  padding: 12px 14px; border-radius: 14px; box-shadow: var(--shadow-sm);
  font-size: 15px; font-weight: 700; text-align: left; margin: 0;
}
.date-field:hover { background: var(--sky-50); transform: none; box-shadow: var(--shadow-sm); }
.date-field-icon { color: var(--sky-500); display: flex; flex: 0 0 auto; }
.date-field-icon svg { width: 20px; height: 20px; }
#browseDateLabel { flex: 1; color: var(--sky-900); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-field-caret { color: var(--muted); display: flex; flex: 0 0 auto; }
.date-field-caret svg { width: 18px; height: 18px; }
.cal-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 14px 34px rgba(15, 60, 110, .18); padding: 12px;
}
.cal-dropdown .cal-title { font-size: 15px; }
.cal-dropdown .cal-nav { width: 32px; height: 32px; font-size: 19px; }
.cal-dropdown .cal-weekdays span { font-size: 11px; }
.cal-dropdown .cal-day { font-size: 13px; border-radius: 10px; }

/* ---- browse: calendar ---- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 800; color: var(--sky-900); font-size: 17px; }
.cal-nav {
  width: 36px; height: 36px; padding: 0; border-radius: 50%; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;
}
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day {
  position: relative; aspect-ratio: 1; border-radius: 12px; margin: 0; padding: 0;
  background: transparent; border: 0; box-shadow: none;
  color: var(--ink); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.cal-day:hover { background: var(--sky-50); transform: none; box-shadow: none; }
.cal-day.other-month { color: #b0c4d8; }
.cal-day:disabled { cursor: default; }
.cal-day.today { border: 1.5px solid var(--sky-400); }
.cal-day.selected {
  background: linear-gradient(135deg, var(--sky-400), var(--sky-500)); color: #fff;
  box-shadow: 0 4px 10px rgba(47, 128, 237, .3);
}
.cal-day.in-range { background: var(--sky-100); }
.cal-dot {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--sky-500);
}
.cal-day.selected .cal-dot { background: #fff; }

/* ---- browse: type folders ---- */
.folders { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 12px 0; }
.folder-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 16px 12px; margin: 0; box-shadow: var(--shadow-sm);
  color: var(--ink); text-align: center; display: block;
}
.folder-card:hover { background: var(--sky-50); }
.folder-card.open { border-color: var(--sky-500); box-shadow: 0 0 0 3px rgba(47, 128, 237, .15); }
.folder-icon {
  width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 14px;
  background: var(--sky-100); color: var(--sky-500);
  display: flex; align-items: center; justify-content: center;
}
.folder-icon svg { width: 23px; height: 23px; }
.folder-num { font-size: 24px; font-weight: 800; color: var(--sky-900); line-height: 1; }
.folder-label { font-size: 14px; font-weight: 700; color: var(--sky-900); margin-top: 3px; }
.folder-sub { font-size: 12px; color: var(--muted); }

/* ---- row buttons (Settings: devices dropdown, Users page) ---- */
.row-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: none; border: 0; box-shadow: none; padding: 0; margin: 0;
  font-size: 17px; font-weight: 700; color: var(--ink); text-align: left;
  cursor: pointer;
}
.row-btn-label { flex: 1; }
.row-btn .chev {
  width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted);
  transition: transform .2s;
}
.row-btn.open .chev { transform: rotate(180deg); }

/* ---- Users page dropdowns ("All users" / "Add new User") ---- */
#allUsersWrap, #addUserWrap { margin-top: 10px; }

/* ---- role cards + permission rows (Users page) ---- */
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: #fff; border: 2px solid var(--sky-100); border-radius: 14px;
  padding: 12px; margin: 0; box-shadow: none; text-align: left;
  color: var(--ink); cursor: pointer; font-size: 15px;
}
.role-card svg { width: 22px; height: 22px; color: var(--sky-500); }
.role-card.selected { border-color: var(--sky-500); background: var(--sky-50); }
.role-card:disabled { opacity: .55; cursor: default; }
.role-card .hint { font-size: 12px; }
.perm-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff; border: 1px solid var(--sky-100); border-radius: 12px;
  padding: 10px 12px; margin: 0 0 8px; cursor: pointer; font-weight: 400;
}
.perm-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--sky-500); flex: 0 0 auto; }
.perm-row b { display: block; font-size: 15px; }
.perm-row .hint { display: block; font-size: 12px; }

/* ---- chats (WhatsApp-style, Sky Cloud colors) ---- */
#chatSearchBox { max-width: none; margin-bottom: 10px; }
#chatList { gap: 0; }
.chat-row {
  cursor: pointer; align-items: center; background: transparent;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 12px 4px; box-shadow: none;
}
.chat-row:last-child { border-bottom: 0; }
.chat-row:hover { background: var(--sky-50); }
.chat-row .avatar { width: 48px; height: 48px; font-size: 20px; }
.chat-row-body { flex: 1; min-width: 0; }
.chat-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chat-row-name {
  font-weight: 700; font-size: 16px; color: var(--sky-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-row-time { font-size: 12px; color: var(--muted); white-space: nowrap; flex: 0 0 auto; }
.chat-row-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.chat-row-preview {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 14px;
}
.chat-row .badge {
  background: var(--sky-500); color: #fff; border-radius: 999px;
  min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px; flex: 0 0 auto; vertical-align: 0;
}
.avatar {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-400), var(--sky-500));
  color: #fff; font-weight: 700; font-size: 19px;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- profile (Settings → Account) ---- */
.profile-row { display: flex; align-items: center; gap: 12px; }
.profile-avatar {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-400), var(--sky-500));
  color: #fff; font-weight: 700; font-size: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-who { flex: 1; min-width: 0; }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-photo-row { display: flex; gap: 8px; align-items: center; }
.profile-photo-row button { flex: 1; }
.chat-card { padding: 0; border: 0; box-shadow: none; background: transparent; }
.chat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.chat-head .icon-btn { flex: 0 0 36px; width: 36px; height: 36px; }
.chat-head b { font-size: 17px; }
.chat-messages {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 60vh; overflow-y: auto; padding: 12px 16px; margin: 0 -16px;
  background: linear-gradient(180deg, #e6f3fe, #f2f9ff);
  border-radius: 0;
}
.date-pill {
  align-self: center; background: #fff; border: 1px solid var(--line);
  color: var(--muted); font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px; margin: 4px 0;
  box-shadow: 0 1px 2px rgba(11, 37, 69, .06);
}
.bubble {
  max-width: 85%; padding: 8px 11px 6px; border-radius: 12px;
  font-size: 15px; line-height: 1.45; word-break: break-word;
  background: #fff; border: 1px solid var(--line); align-self: flex-start;
  box-shadow: 0 1px 2px rgba(11, 37, 69, .06);
}
.bubble.me {
  align-self: flex-end; background: var(--bubble-me); color: var(--ink); border: 0;
  border-bottom-right-radius: 4px;
}
.bubble.them { border-bottom-left-radius: 4px; }
.bubble .mtime {
  display: flex; align-items: center; justify-content: flex-end; gap: 3px;
  font-size: 11px; margin-top: 3px; color: var(--muted);
}
.bubble.me .mtime { color: #6b8db0; }
.tick-wrap { display: inline-flex; flex: 0 0 auto; }
.tick { width: 16px; height: 12px; color: #8fa8bf; }
.tick.read { color: var(--sky-500); }
.chat-img, .chat-video { max-width: 100%; border-radius: 12px; display: block; }
.attach-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.attach-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-bar button { background: none; border: 0; box-shadow: none; color: var(--sky-500); padding: 0; margin: 0; font-size: 13px; font-weight: 600; }
.bubble.me .attach-bar button { color: var(--sky-700); }
.attach-card { display: flex; flex-direction: column; gap: 3px; }
.attach-card button { background: none; border: 0; box-shadow: none; color: var(--sky-500); padding: 0; margin: 0; font-size: 13px; font-weight: 600; align-self: flex-start; }
.bubble.me .attach-card button { color: var(--sky-700); }
.voice-row { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.voice-play {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, .25); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; margin: 0; box-shadow: none; border: 0;
}
.bubble.me .voice-play { background: var(--sky-500); color: #fff; }
.bubble.them .voice-play { background: var(--sky-100); color: var(--sky-500); }
.voice-play svg { width: 18px; height: 18px; }
.voice-bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.bubble.me .voice-bar { background: rgba(47, 128, 237, .25); }
.bubble.them .voice-bar { background: #dbeafe; }
.voice-bar div { height: 100%; width: 0%; background: #fff; border-radius: 3px; }
.bubble.me .voice-bar div { background: var(--sky-500); }
.bubble.them .voice-bar div { background: var(--sky-500); }
.voice-dur { font-size: 12px; white-space: nowrap; }
.chat-input { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.chat-input input { flex: 1; margin: 0; border-radius: 24px; padding: 10px 14px; }
.chat-input button { margin: 0; }
.chat-input .icon-btn { width: 44px; height: 44px; flex: 0 0 44px; }
.chat-input .icon-btn svg { width: 22px; height: 22px; }
#chatSendBtn {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
  padding: 0; display: inline-flex; align-items: center; justify-content: center;
}
#chatSendBtn svg { width: 20px; height: 20px; }
.chat-input .icon-btn.recording { background: #fee2e2; color: var(--err); }
.recording { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; color: var(--err); font-weight: 600; }
.recording .rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--err); animation: recpulse 1s infinite; }
@keyframes recpulse { 50% { opacity: .3; } }

/* ---- notes (Design 1: blue categories, yellow notes) ---- */
.cat-del {
  background: none; border: 0; box-shadow: none; color: #fff;
  padding: 2px 6px; margin: 0 0 0 5px; font-size: 20px; line-height: 1;
}
.cat-del:hover { background: none; transform: none; box-shadow: none; }
.note-preview {
  color: var(--muted); font-size: 13.5px; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#noteBody {
  width: 100%; min-height: 50vh; resize: vertical;
  font-size: 16px; line-height: 1.6; font-family: inherit;
  padding: 12px 13px; border: 1.5px solid #cbdcee; border-radius: 12px;
  background: #fff; color: var(--ink); outline: none;
}
#noteBody:focus { border-color: var(--sky-500); box-shadow: 0 0 0 3px rgba(47, 128, 237, .15); }
.editor-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.editor-actions button { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---- password fields with show/hide eye toggle ---- */
.pw-wrap { position: relative; max-width: 420px; }
.pw-wrap input { padding-right: 44px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; padding: 0; margin: 0;
  background: none; border: 0; box-shadow: none; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 8px;
}
.pw-eye:hover { background: var(--sky-50); color: var(--sky-500); transform: translateY(-50%); box-shadow: none; }
.pw-eye svg { width: 20px; height: 20px; }

/* ---- text-button link (e.g. "Forgot password?") ---- */
.linklike {
  background: none; border: 0; box-shadow: none; color: var(--sky-500);
  padding: 4px 0; margin: 6px 0 0; font-size: 14px; font-weight: 600;
  width: auto; display: inline-block; cursor: pointer;
}
.linklike:hover { background: none; box-shadow: none; transform: none; text-decoration: underline; }

/* ---- recovery PIN row (Settings → Account) ---- */
.row-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.row-line b { color: var(--sky-900); font-size: 14px; }
.row-line .spacer { flex: 1; }

/* ---- projects + per-file visibility (2026-11-09) ---- */
.proj-tag { display: inline-block; background: var(--sky-100); color: var(--sky-700); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.upload-opts { margin-bottom: 14px; }
.upload-opts label { display: block; font-weight: 600; margin: 8px 0 4px; color: var(--sky-900); }
.upload-opts select, .upload-opts input { width: 100%; }
.add-proj-row { display: flex; gap: 8px; margin-top: 8px; }
.add-proj-row input { flex: 1; margin: 0; }
.add-proj-row button { margin: 0; white-space: nowrap; }
.req { color: var(--err); }
.crumb { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.crumb .ghost { margin: 0; }
.crumb-path { font-weight: 700; color: var(--sky-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- profile photo crop (2026-11-09) ---- */
.crop-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(11, 37, 69, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.crop-overlay[hidden] { display: none; }
.crop-box { background: #fff; border-radius: 20px; padding: 18px; width: 100%; max-width: 380px; box-shadow: 0 12px 40px rgba(11, 37, 69, 0.35); }
.crop-box h3 { margin: 0 0 4px; color: var(--sky-900); }
.crop-box .hint { margin: 0 0 12px; }
.crop-stage { width: 300px; height: 300px; margin: 0 auto; position: relative; overflow: hidden; background: #0b2545; border-radius: 12px; touch-action: none; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; cursor: grab; user-select: none; -webkit-user-drag: none; }
.crop-controls { display: flex; align-items: center; gap: 14px; margin: 14px 0 4px; }
.crop-controls canvas { width: 64px; height: 64px; border-radius: 50%; flex: 0 0 auto; background: var(--sky-100); }

/* ---- app modal (replaces native confirm/alert/prompt) ---- */
.modal-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(11, 37, 69, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 20px; padding: 18px; width: 100%; max-width: 380px; box-shadow: 0 12px 40px rgba(11, 37, 69, 0.35); }
.modal-box h3 { margin: 0 0 6px; color: var(--sky-900); }
.modal-msg { margin: 0 0 8px; color: var(--ink); font-size: 15px; line-height: 1.5; }
.modal-msg[hidden] { display: none; }
.modal-box input { max-width: none; }
.modal-actions { justify-content: flex-end; margin-top: 14px; }
.crop-controls input[type="range"] { flex: 1; margin: 0; accent-color: var(--sky-500); }

/* ---- notes list: categories first (2026-11-09) ---- */
.notes-sort-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; }
.notes-sort-row label { font-weight: 600; font-size: 14px; color: var(--sky-700); white-space: nowrap; }
.notes-sort-row select { flex: 1; margin: 0; padding: 6px 10px; font-size: 14px; }
#notesCatFilterSel { border: 1.5px solid #2f80ed; border-radius: 12px; }
.cat-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 72px; }
.cat-block { display: flex; flex-direction: column; }
.cat-row { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #2f80ed, #38bdf8); color: #fff; border-radius: 14px; padding: 15px 16px; cursor: pointer; box-shadow: 0 2px 6px rgba(11,37,69,.12); }
.cat-row-name { flex: 1; font-size: 18px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row-count { font-size: 14px; font-weight: 700; color: #fff; background: rgba(255,255,255,.25); border-radius: 999px; min-width: 26px; height: 26px; padding: 0 8px; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.cat-row .chev { width: 18px; height: 18px; flex: 0 0 auto; color: #fff; transition: transform .2s; }
.cat-row.open .chev { transform: rotate(180deg); }
.cat-notes { padding: 6px 0 2px 10px; display: flex; flex-direction: column; }
.cat-note { display: flex; align-items: center; gap: 10px; background: #fff9c4; border: 1px solid #fde68a; border-left: none; border-radius: 12px; padding: 14px; margin-bottom: 8px; cursor: pointer; }
.cat-note-main { flex: 1; min-width: 0; }
.cat-note-title { font-size: 18px; font-weight: 400; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-note-by { font-size: 12.5px; color: #6b7280; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-note-date { flex: 0 0 auto; font-size: 13px; color: #6b7280; white-space: nowrap; }
.fab { position: fixed; right: 20px; bottom: 24px; z-index: 40; width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #2f80ed, #38bdf8); color: #fff; font-size: 30px; line-height: 1; padding: 0; margin: 0; box-shadow: 0 6px 18px rgba(47, 128, 237, 0.45); display: flex; align-items: center; justify-content: center; }
.fab[hidden] { display: none; }
.fab-menu { position: fixed; right: 20px; bottom: 92px; z-index: 40; background: #fff; border: 1px solid var(--sky-100); border-radius: 14px; box-shadow: 0 8px 24px rgba(11, 37, 69, 0.18); padding: 6px; display: flex; flex-direction: column; min-width: 168px; }
.fab-menu[hidden] { display: none; }
.fab-menu button { background: none; border: none; box-shadow: none; color: var(--ink); font-size: 15px; font-weight: 600; text-align: left; padding: 10px 12px; margin: 0; border-radius: 10px; width: 100%; }
.fab-menu button:hover { background: var(--sky-50); }
