/* ==========================================================================
   Calo One · iCloud light theme (v4)
   Loaded after styles.css. Replaces the console chrome with a light top bar +
   app rail and adds the dashboard cards, photos grid and home editor.
   ========================================================================== */

:root {
  color-scheme: light;

  --ic-panel: rgba(255, 255, 255, 0.72);
  --ic-line: rgba(15, 35, 70, 0.09);
  --ic-text: #101828;
  --ic-muted: #5b6b81;
  --ic-muted-2: #8593a6;
  --ic-accent: #0a7cff;

  --text: #101828;
  --muted: #5b6b81;
  --muted-2: #8593a6;
  --border: rgba(15, 35, 70, 0.1);
  --border-strong: rgba(15, 35, 70, 0.16);
  --accent: #0a7cff;
  --accent-soft: rgba(10, 124, 255, 0.09);
  --accent-strong: #0060d0;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --radius: 12px;
  --radius-lg: 18px;
}

body {
  color: var(--ic-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text",
    "Segoe UI", "Inter", "Helvetica Neue", "Noto Sans SC", Arial, sans-serif;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

/* the colour field that the glass picks up */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 560px at 6% -6%, rgba(86, 158, 255, 0.82) 0%, rgba(86, 158, 255, 0) 62%),
    radial-gradient(700px 520px at 94% 0%, rgba(120, 176, 255, 0.72) 0%, rgba(120, 176, 255, 0) 60%),
    radial-gradient(560px 480px at 34% 42%, rgba(96, 196, 255, 0.5) 0%, rgba(96, 196, 255, 0) 66%),
    radial-gradient(620px 540px at 72% 66%, rgba(150, 132, 255, 0.52) 0%, rgba(150, 132, 255, 0) 66%),
    radial-gradient(600px 520px at 8% 92%, rgba(96, 222, 205, 0.55) 0%, rgba(96, 222, 205, 0) 66%),
    linear-gradient(180deg, #eef5ff 0%, #e6eefb 46%, #e2ebf8 100%);
}

a {
  color: var(--ic-accent);
}
a:hover {
  text-decoration: none;
}

/* ------------------------------------------------------------------ shell */
#app.app-shell {
  display: block;
  grid-template-columns: none;
  position: relative;
  z-index: 1;
}
.ic-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ic-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 26px;
  background: rgba(252, 253, 255, 0.7);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(15, 35, 70, 0.06);
}

.ic-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ic-text);
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.014em;
  padding: 4px 10px 4px 4px;
  border-radius: 12px;
}
.ic-brand:hover {
  background: rgba(15, 35, 70, 0.05);
  text-decoration: none;
}
.ic-brand .ic-logo {
  width: 34px;
  height: 26px;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(24, 70, 130, 0.18));
}
.ic-brand .uname {
  color: var(--ic-muted-2);
  font-weight: 500;
  font-size: 13px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid rgba(15, 35, 70, 0.12);
}

.ic-top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ic-iconbtn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ic-muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 35, 70, 0.08);
  font-size: 11.5px;
  font-weight: 620;
  cursor: pointer;
  transition: background 0.16s ease;
}
.ic-iconbtn:hover {
  background: #fff;
}

.ic-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 650;
  color: #fff;
  flex: none;
  background: linear-gradient(160deg, #8fc6ff, #3f83e0 55%, #2a63b8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 10px -6px rgba(16, 60, 120, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.ic-accountbtn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 11px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 35, 70, 0.08);
  cursor: pointer;
  transition: background 0.16s ease;
}
.ic-accountbtn:hover {
  background: #fff;
}
.ic-accountbtn .who {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}
.ic-accountbtn .who b {
  font-size: 12.5px;
  font-weight: 620;
  color: var(--ic-text);
}
.ic-accountbtn .who span {
  font-size: 10.5px;
  color: var(--ic-muted-2);
}
.ic-accountbtn .caret {
  color: var(--ic-muted-2);
  transition: transform 0.18s ease;
}
.ic-accountbtn[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}

.ic-topwrap {
  position: relative;
}
.ic-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 292px;
  padding: 6px;
  border-radius: 18px;
  z-index: 60;
  opacity: 0;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.2s cubic-bezier(0.32, 1.4, 0.5, 1);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 24px 60px -18px rgba(18, 45, 85, 0.28),
    0 2px 8px rgba(18, 45, 85, 0.08);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
}
.ic-pop.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.ic-pop-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px 10px;
}
.ic-pop-head .ic-avatar {
  width: 38px;
  height: 38px;
  font-size: 13px;
}
.ic-pop-head .who b {
  display: block;
  font-size: 13.5px;
  font-weight: 620;
  color: var(--ic-text);
}
.ic-pop-head .who span {
  display: block;
  font-size: 11.5px;
  color: var(--ic-muted-2);
  margin-top: 2px;
}
.ic-pop-sep {
  height: 1px;
  margin: 4px 10px;
  background: rgba(15, 35, 70, 0.08);
}
.ic-pop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ic-text);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}
.ic-pop-row:hover {
  background: rgba(10, 124, 255, 0.08);
}
.ic-pop-row .grow {
  margin-left: auto;
  color: var(--ic-muted-2);
  font-size: 11.5px;
}
.ic-pop-row .swatch {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(10, 124, 255, 0.1);
  color: var(--ic-accent);
  flex: none;
}
.ic-pop-meter {
  padding: 4px 12px 10px;
}
.ic-pop-meter .lbl {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ic-muted-2);
  margin-bottom: 6px;
}
.ic-pop-meter .bar {
  height: 5px;
  border-radius: 99px;
  background: rgba(15, 35, 70, 0.09);
  overflow: hidden;
}
.ic-pop-meter .bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #5fa8ff, #0a7cff);
}

/* ------------------------------------------------------------------- body */
.ic-body {
  flex: 1;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 26px 40px;
}

.ic-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ic-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 2px 2px 16px;
}
.ic-head h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 680;
  letter-spacing: -0.032em;
  color: var(--ic-text);
}
.ic-head .sub {
  font-size: 12.5px;
  color: var(--ic-muted-2);
}

/* ------------------------------------------------------------- glass base */
.glass {
  position: relative;
  border-radius: 20px;
  background-image:
    linear-gradient(118deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.06) 24%, rgba(255, 255, 255, 0) 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(246, 251, 255, 0.2) 54%, rgba(255, 255, 255, 0.26) 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.55),
    inset 1px 0 0 rgba(255, 255, 255, 0.6),
    inset -1px 0 0 rgba(255, 255, 255, 0.4),
    inset 0 -26px 40px -32px rgba(255, 255, 255, 0.75),
    0 0 0 1px rgba(24, 56, 104, 0.05),
    0 2px 4px rgba(18, 45, 85, 0.06),
    0 22px 52px -24px rgba(18, 45, 85, 0.42),
    0 8px 20px -14px rgba(18, 45, 85, 0.24);
  backdrop-filter: blur(40px) saturate(215%) brightness(1.03) contrast(0.99);
  -webkit-backdrop-filter: blur(40px) saturate(215%) brightness(1.03) contrast(0.99);
  isolation: isolate;
  overflow: hidden;
}
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image:
    radial-gradient(120% 66% at 4% -20%, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0) 54%),
    radial-gradient(70% 50% at 104% 108%, rgba(180, 218, 255, 0.4) 0%, rgba(180, 218, 255, 0) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0) 11%);
  opacity: 0.9;
}

/* ---------------------------------------------------------------- the rail */
.ic-rail {
  width: 232px;
  flex: none;
  align-self: flex-start;
  padding: 14px;
  position: sticky;
  top: 76px;
}
.rail-title {
  font-size: 10.5px;
  font-weight: 660;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ic-muted-2);
  padding: 2px 4px 10px;
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 2px;
}
.app-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 2px;
  border-radius: 11px;
  background: none;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.app-btn:hover {
  background: rgba(10, 124, 255, 0.07);
}
.app-btn.is-active {
  background: rgba(10, 124, 255, 0.1);
}
.app-label {
  font-size: 9.5px;
  color: var(--ic-muted);
  white-space: nowrap;
}

/* squircle app icons */
.app-tile {
  --c1: #6fb4ff;
  --c2: #2f7ce0;
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 22.5%;
  background: linear-gradient(168deg, var(--c1) 0%, var(--c2) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 5px 12px -6px rgba(18, 45, 85, 0.4);
  overflow: hidden;
  flex: none;
}
.app-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 50%);
}
.app-tile svg {
  position: relative;
  z-index: 1;
  width: 21px;
  height: 21px;
  color: #fff;
  filter: drop-shadow(0 1px 1px rgba(0, 20, 46, 0.25));
}
.c-doc {
  --c1: #ffd27a;
  --c2: #e8971a;
}
.c-files {
  --c1: #7ad7ff;
  --c2: #1f8ad6;
}
.c-photos {
  --c1: #ffb27a;
  --c2: #e0603a;
}
.c-sites {
  --c1: #8fe0b4;
  --c2: #1f9b6b;
}
.c-store {
  --c1: #9fb6ff;
  --c2: #4a5fd6;
}
.c-activity {
  --c1: #ff9fb2;
  --c2: #d8406b;
}
.c-api {
  --c1: #c7b3ff;
  --c2: #7446d6;
}
.c-bill {
  --c1: #a8f0e4;
  --c2: #159f92;
}
.c-set {
  --c1: #cfd8e6;
  --c2: #7b8ca3;
}

.rail-sep {
  height: 1px;
  margin: 12px 4px 9px;
  background: rgba(15, 35, 70, 0.08);
}
.rail-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rail-links button,
.rail-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 11.5px;
  color: var(--ic-text);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}
.rail-links button:hover,
.rail-links a:hover {
  background: rgba(10, 124, 255, 0.07);
  text-decoration: none;
}
.rail-links .chev {
  margin-left: auto;
  color: var(--ic-muted-2);
  font-size: 10.5px;
}

/* --------------------------------------------------------------- dashboard */
.dash {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tile {
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.24s ease;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 24px 54px -24px rgba(18, 45, 85, 0.3);
}
.span-2 {
  grid-column: span 2;
}
.tile-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.tile-head h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 640;
  color: var(--ic-text);
}
.tile-head .more {
  margin-left: auto;
  font-size: 11px;
  color: var(--ic-muted-2);
  padding: 3px 7px;
  border-radius: 8px;
  background: none;
  border: 0;
  cursor: pointer;
}
.tile-head .more:hover {
  background: rgba(10, 124, 255, 0.08);
  color: var(--ic-accent);
}
.tile-head .app-tile {
  width: 28px;
  height: 28px;
  border-radius: 23%;
}
.tile-head .app-tile svg {
  width: 15px;
  height: 15px;
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 -5px;
}
.row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px;
  border-radius: 9px;
  font-size: 12.5px;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ic-text);
}
.row:hover {
  background: rgba(10, 124, 255, 0.07);
}
.rdot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  flex: none;
  background: #3d9bff;
}
.rname {
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ic-text);
}
.rmeta {
  margin-left: auto;
  line-height: 1.25;
  font-size: 10.5px;
  color: var(--ic-muted-2);
  flex: none;
}

.storage .big {
  font-size: 27px;
  font-weight: 680;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  color: var(--ic-text);
}
.storage .big small {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ic-muted-2);
}
.storage .foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--ic-muted-2);
}

.sites-body {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 13px;
}
.mini {
  width: 86px;
  height: 58px;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #eef3fa);
  border: 1px solid rgba(15, 35, 70, 0.09);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: none;
}
.mini i {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: rgba(15, 35, 70, 0.14);
}
.mini i:nth-child(1) {
  width: 46%;
  background: rgba(15, 35, 70, 0.3);
}
.mini i:nth-child(2) {
  width: 82%;
}
.mini i:nth-child(3) {
  width: 64%;
}
.site-meta .nm {
  font-size: 12.5px;
  font-weight: 620;
}
.site-meta .url {
  font-size: 11px;
  color: var(--ic-accent);
  margin-top: 2px;
  word-break: break-all;
}
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-size: 10px;
  color: #0f8a5f;
  background: rgba(46, 192, 133, 0.14);
  border: 1px solid rgba(46, 192, 133, 0.26);
  padding: 2px 8px;
  border-radius: 99px;
}
.badge-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #23c084;
}

/* photo strip on the dashboard */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex: 1;
}
.photo-strip figure {
  margin: 0;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(15, 35, 70, 0.05);
  aspect-ratio: 1;
  cursor: pointer;
}
.photo-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-strip .more-slot {
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--ic-muted-2);
  border: 1px dashed rgba(15, 35, 70, 0.16);
  border-radius: 9px;
  cursor: pointer;
  background: none;
}
.photo-strip .more-slot:hover {
  background: rgba(10, 124, 255, 0.06);
}

/* ------------------------------------------------------------ photos view */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.photo-cell {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1;
  background: rgba(15, 35, 70, 0.05);
  cursor: zoom-in;
  box-shadow: 0 8px 22px -14px rgba(18, 45, 85, 0.4);
}
.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.photo-cell:hover img {
  transform: scale(1.03);
}
.photo-cell .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px 8px 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, transparent, rgba(0, 8, 20, 0.6));
  opacity: 0;
  transition: opacity 0.2s ease;
  text-align: left;
}
.photo-cell:hover .cap {
  opacity: 1;
}
.photo-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(15, 35, 70, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: #c0392b;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.photo-cell:hover .photo-del,
.photo-cell:focus-within .photo-del {
  opacity: 1;
}
.photo-del:disabled { opacity: 0.5; cursor: default; }
@media (hover: none) {
  .photo-del { opacity: 1; }
}
.lightbox .lb-delete {
  position: absolute;
  top: 16px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 35, 70, 0.1);
  color: #c0392b;
  cursor: pointer;
  font-size: 12px;
}
.lightbox .lb-delete:disabled { opacity: 0.5; cursor: default; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 40px;
  background: rgba(234, 240, 249, 0.72);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 14px;
  box-shadow: 0 40px 80px -30px rgba(18, 45, 85, 0.45);
}
.lightbox .lb-bar {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ic-muted);
}
.lightbox .lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 35, 70, 0.1);
  color: var(--ic-text);
  cursor: pointer;
  font-size: 15px;
}

/* ------------------------------------------------------------- home editor */
.home-edit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 10px 12px;
}
.home-edit-bar .hint {
  font-size: 11.5px;
  color: var(--ic-muted-2);
  margin-right: 4px;
}
.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  border: 1px solid rgba(15, 35, 70, 0.12);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ic-muted);
  cursor: pointer;
}
.chip-toggle.on {
  background: rgba(10, 124, 255, 0.12);
  border-color: rgba(10, 124, 255, 0.3);
  color: var(--ic-accent);
}
.card-move {
  display: inline-flex;
  gap: 2px;
  margin-left: auto;
}
.card-move button {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 35, 70, 0.1);
  color: var(--ic-muted);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}
.card-move button:hover {
  background: #fff;
  color: var(--ic-accent);
}
.ic-dock {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 35;
}
.ic-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ic-text);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.95);
  cursor: pointer;
  box-shadow: 0 12px 30px -14px rgba(18, 45, 85, 0.3);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
}
.ic-pill:hover {
  background: #fff;
}

/* ------------------------------------------- legacy components, re-skinned */
.ic-main .card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.7) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 14px 38px -22px rgba(18, 45, 85, 0.22);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  padding: 16px 18px;
  color: var(--ic-text);
}
.ic-main .card-title {
  color: var(--ic-muted);
  font-size: 11.5px;
  letter-spacing: 0.01em;
}
.ic-main .metric {
  color: var(--ic-text);
  font-size: 24px;
  font-weight: 660;
  letter-spacing: -0.02em;
}
.ic-main .metric small {
  color: var(--ic-muted-2);
  font-size: 12px;
  font-weight: 500;
}
.ic-main .section-head h2 {
  font-size: 15px;
  font-weight: 640;
}
.ic-main .meta-row {
  color: var(--ic-muted-2);
  font-size: 11px;
}
.ic-main .bar {
  background: rgba(15, 35, 70, 0.1);
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
}
.ic-main .bar > span {
  background: linear-gradient(90deg, #5fa8ff, #0a7cff);
  border-radius: 99px;
}
.ic-main .bar.warn > span {
  background: linear-gradient(90deg, #ffc46b, #f0982d);
}
.ic-main .btn {
  border-radius: 10px;
  border: 1px solid rgba(15, 35, 70, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ic-text);
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(18, 45, 85, 0.05);
}
.ic-main .btn:hover {
  background: #fff;
  text-decoration: none;
}
.ic-main .btn-primary {
  background: linear-gradient(180deg, #4b9bff, #0a7cff);
  border-color: rgba(10, 124, 255, 0.45);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 6px 16px -8px rgba(10, 124, 255, 0.55);
}
.ic-main .btn-danger {
  background: rgba(255, 69, 88, 0.08);
  border-color: rgba(255, 69, 88, 0.2);
  color: #d92b3f;
}
.ic-main .btn-sm {
  padding: 5px 10px;
  font-size: 11.5px;
}
.ic-main .list {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  box-shadow: 0 14px 38px -24px rgba(18, 45, 85, 0.2);
}
.ic-main .file-row {
  border-color: rgba(15, 35, 70, 0.07);
  padding: 11px 14px;
}
.ic-main .file-row:hover {
  background: rgba(10, 124, 255, 0.04);
}
.ic-main .file-icon {
  background: rgba(10, 124, 255, 0.1);
  color: var(--ic-accent);
  border-radius: 9px;
}
.ic-main .dropzone {
  border-radius: 16px;
  border: 1px dashed rgba(15, 35, 70, 0.18);
  background: rgba(255, 255, 255, 0.5);
}
.ic-main .dropzone:hover {
  border-color: rgba(10, 124, 255, 0.45);
  background: rgba(10, 124, 255, 0.05);
}
.ic-main input,
.ic-main textarea,
.ic-main select {
  background: #fff;
  border: 1px solid rgba(15, 35, 70, 0.12);
  border-radius: 10px;
  color: var(--ic-text);
  padding: 8px 10px;
}
.ic-main input:focus,
.ic-main textarea:focus,
.ic-main select:focus {
  outline: none;
  border-color: rgba(10, 124, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(10, 124, 255, 0.12);
}
.ic-main .empty {
  border-radius: 16px;
  border: 1px dashed rgba(15, 35, 70, 0.14);
  color: var(--ic-muted-2);
  background: rgba(255, 255, 255, 0.5);
  padding: 26px;
}
.ic-main .code-block,
.ic-main .mono {
  background: rgba(244, 247, 252, 0.95);
  border: 1px solid rgba(15, 35, 70, 0.1);
  border-radius: 10px;
  color: #24405f;
}
.ic-main .modal,
.ic-main .panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  box-shadow: 0 30px 70px -24px rgba(18, 45, 85, 0.3);
}
.modal-backdrop {
  background: rgba(230, 238, 248, 0.6);
  backdrop-filter: blur(8px);
}

/* ------------------------------------------------------------------ toast */
.toast-root .toast {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.95);
  color: var(--ic-text);
  border-radius: 12px;
  box-shadow: 0 12px 30px -14px rgba(18, 45, 85, 0.28);
  backdrop-filter: blur(20px);
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 1020px) {
  .ic-body {
    flex-direction: column;
  }
  .ic-rail {
    width: 100%;
    position: static;
    order: -1;
  }
  .app-grid {
    grid-template-columns: repeat(8, 1fr);
  }
  .rail-links {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .rail-links .chev {
    display: none;
  }
}
@media (max-width: 720px) {
  .ic-top {
    padding: 10px 14px;
  }
  .ic-body {
    padding: 14px 14px 90px;
  }
  .dash {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .ic-head h1 {
    font-size: 22px;
  }
  .app-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .ic-accountbtn .who {
    display: none;
  }
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================ settings v2 */
.set-wrap {
  display: grid;
  gap: 14px;
  max-width: 880px;
}
.set-card {
  padding: 20px 22px;
}
.set-card > h3 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.set-card > .sub {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--ic-muted);
}
.idcard {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--ic-line);
}
.avatar-xl {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 21px;
  display: grid;
  place-items: center;
  font-size: 23px;
  font-weight: 650;
  color: #fff;
  letter-spacing: 0.02em;
  background: linear-gradient(165deg, #7cb8ff 0%, #4b8dfb 48%, #3b6ef0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 22px -10px rgba(59, 110, 240, 0.7);
}
.idcard .who b {
  display: block;
  font-size: 16px;
}
.idcard .who span {
  font-size: 12.5px;
  color: var(--ic-muted);
}
.set-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--ic-line);
}
.set-row:first-of-type {
  border-top: 0;
}
.set-row > .k {
  width: 168px;
  flex: none;
  padding-top: 8px;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--ic-muted);
}
.set-row > .v {
  flex: 1;
  min-width: 0;
}
.set-row .input {
  width: 100%;
  height: 38px;
}
.set-note {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ic-muted-2);
}
.set-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 560;
  color: var(--ic-muted);
  background: rgba(15, 35, 70, 0.05);
  border: 1px solid var(--ic-line);
}
.meter {
  height: 8px;
  border-radius: 5px;
  background: rgba(15, 35, 70, 0.08);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #59a5ff, #2f7cf6);
}
.meter-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ic-muted);
  margin-bottom: 7px;
}
.set-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--ic-line);
}
.set-actions .ok {
  font-size: 12px;
  color: #12855b;
}
.danger-card {
  border-color: rgba(255, 90, 110, 0.28);
}
.btn-quiet {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--ic-line);
}

/* ============================================================= doc editor */
.doc-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  padding: 6px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--ic-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.doc-toolbar .tb {
  height: 28px;
  min-width: 28px;
  padding: 0 7px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #2b3a51;
  font-size: 12px;
  font-weight: 560;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.doc-toolbar .tb:hover {
  background: rgba(10, 124, 255, 0.1);
  color: var(--ic-accent);
}
.doc-toolbar .tb-sep {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--ic-line);
}
.doc-toolbar .grow {
  flex: 1;
}
.doc-toolbar .tb-label {
  font-size: 11.5px;
  color: var(--ic-muted);
  padding: 0 4px;
}
.doc-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}
.doc-split.is-wide {
  grid-template-columns: 1fr;
}
.doc-split textarea.content {
  min-height: 340px;
  height: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  border-radius: 14px;
  border: 1px solid var(--ic-line);
  background: rgba(255, 255, 255, 0.78);
  padding: 14px 15px;
  resize: vertical;
}
.doc-split .preview {
  min-height: 340px;
  max-height: 620px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--ic-line);
  background: rgba(255, 255, 255, 0.6);
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.72;
}
.doc-split .preview:empty::before {
  content: "Nothing to preview yet";
  color: var(--ic-muted-2);
  font-size: 12.5px;
}
.doc-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--ic-muted);
  padding: 0 2px;
}
.doc-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd5e1;
}
.doc-status.is-dirty .dot {
  background: #f0a020;
}
.doc-status.is-saved .dot {
  background: #18a06a;
}
.doc-status .grow {
  flex: 1;
}
.menu-wrap {
  position: relative;
}
.menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  padding: 6px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--ic-line);
  box-shadow: 0 18px 40px -18px rgba(18, 45, 85, 0.4);
  display: none;
  z-index: 40;
  backdrop-filter: blur(20px);
}
.menu-pop.is-open {
  display: block;
}
.menu-pop button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 12.5px;
  color: #22304a;
  text-align: left;
  cursor: pointer;
}
.menu-pop button:hover {
  background: rgba(10, 124, 255, 0.09);
  color: var(--ic-accent);
}
.menu-pop .hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--ic-muted-2);
}
.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.doc-actions .spacer {
  flex: 1;
}
.doc-actions .share-permission {
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.75);
  color: #1d1f23;
  font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}
.doc-actions .share-permission:focus {
  outline: 2px solid rgba(0,122,255,.35);
  outline-offset: 1px;
}
.doc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 560;
  background: rgba(15, 35, 70, 0.05);
  color: var(--ic-muted);
}
.doc-pill.ok {
  background: rgba(24, 160, 106, 0.1);
  color: #0f7a52;
}

/* ================================================================= admin */
.adm-root {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.adm-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 26px;
  border-bottom: 1px solid rgba(15, 35, 70, 0.08);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(30px) saturate(180%);
  position: sticky;
  top: 0;
  z-index: 20;
}
.adm-top .badge {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(160deg, #ff7a8a, #e8404f);
  padding: 3px 8px;
  border-radius: 7px;
}
.adm-top .spacer {
  flex: 1;
}
.adm-body {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 26px 80px;
}
.adm-body h1 {
  font-size: 24px;
  margin: 0 0 4px;
}
.adm-body .sub {
  font-size: 12.5px;
  color: var(--ic-muted);
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .doc-split {
    grid-template-columns: 1fr;
  }
  .set-row {
    flex-direction: column;
    gap: 6px;
  }
  .set-row > .k {
    width: auto;
    padding-top: 0;
  }
}


/* ======================================================== markdown preview */
.preview {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--ic-line);
  color: var(--ic-text);
  max-height: none;
}
.preview p,
.preview li,
.preview td,
.preview dd {
  color: #24324a;
}
.preview h1,
.preview h2,
.preview h3,
.preview h4 {
  color: #101828;
}
.preview a {
  color: var(--ic-accent);
  text-decoration: none;
}
.preview a:hover {
  text-decoration: underline;
}
.preview code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(15, 35, 70, 0.07);
  border: 1px solid transparent;
  color: #1d3452;
  font-size: 0.88em;
}
.preview pre {
  background: #f3f7fd;
  border: 1px solid var(--ic-line);
  color: #1b2b3f;
}
.preview pre code {
  background: none;
  color: inherit;
}
.preview blockquote {
  border-left: 3px solid #c9dcf5;
  color: var(--ic-muted);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0 8px 8px 0;
  padding: 6px 14px;
}
.preview table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 1em;
  font-size: 12.5px;
}
.preview th,
.preview td {
  border: 1px solid var(--ic-line);
  padding: 7px 10px;
  text-align: left;
}
.preview th {
  background: rgba(15, 35, 70, 0.04);
  font-weight: 600;
}
.preview hr {
  border: 0;
  border-top: 1px solid var(--ic-line);
  margin: 1.4em 0;
}
.preview img {
  max-width: 100%;
  border-radius: 8px;
}

/* admin cards get the same frosted treatment */
.adm-body .card {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 18px 44px -24px rgba(18, 45, 85, 0.32);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

/* ========================================================== editor layout
   The writing surface owns the screen; the app rail shrinks to an icon strip
   and the document list becomes a narrow glass column.
   ------------------------------------------------------------------------ */
.ic-root.is-editor .ic-body {
  max-width: 1680px;
  gap: 12px;
  padding: 16px 20px 26px;
  align-items: flex-start;
}

.ic-root.is-editor .ic-rail {
  width: 78px;
  padding: 9px 7px;
  border-radius: 20px;
}
.ic-root.is-editor .rail-title {
  display: none;
}
.ic-root.is-editor .app-grid {
  grid-template-columns: 1fr;
  gap: 3px;
}
.ic-root.is-editor .app-btn {
  padding: 7px 0;
  border-radius: 14px;
}
.ic-root.is-editor .app-btn.is-active {
  background: rgba(10, 124, 255, 0.12);
}
.ic-root.is-editor .app-label,
.ic-root.is-editor .rail-sep,
.ic-root.is-editor .rail-links {
  display: none;
}

.doc-layout {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.doc-side {
  position: sticky;
  top: 74px;
  padding: 12px;
  border-radius: 18px;
}
.doc-side .list {
  max-height: calc(100vh - 306px);
  overflow-y: auto;
  padding-right: 2px;
}
.doc-side .list::-webkit-scrollbar {
  width: 6px;
}
.doc-side .list::-webkit-scrollbar-thumb {
  background: rgba(15, 35, 70, 0.14);
  border-radius: 99px;
}
.doc-side .list-item {
  padding: 9px 10px;
  border-radius: 11px;
}
.doc-count {
  margin-top: 9px;
  padding-left: 2px;
  font-size: 11px;
  color: var(--ic-muted-2);
}
.doc-main {
  min-width: 0;
}
.doc-main .editor {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  padding: 16px 16px 14px;
  min-height: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 22px 54px -26px rgba(18, 45, 85, 0.32),
    0 3px 10px -6px rgba(18, 45, 85, 0.14);
  backdrop-filter: blur(34px) saturate(170%);
  -webkit-backdrop-filter: blur(34px) saturate(170%);
}
.doc-main .editor-row {
  grid-template-columns: 1fr 232px;
}
.doc-main .doc-split {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.doc-main .doc-split textarea.content {
  min-height: 540px;
  height: 540px;
  font-size: 13px;
  line-height: 1.75;
}
.doc-main .doc-split .preview {
  min-height: 540px;
  max-height: 540px;
  overflow: auto;
  font-size: 14px;
}
.doc-main .doc-split .preview h1 {
  font-size: 25px;
}
.doc-main .doc-split .preview h2 {
  font-size: 19px;
}
.doc-main .doc-split .preview h3 {
  font-size: 16px;
}
.doc-main .doc-toolbar {
  background: rgba(255, 255, 255, 0.8);
}
.doc-main .ai-box {
  border-radius: 14px;
}
.doc-main .editor textarea.content {
  min-height: 540px;
}
.ic-root.is-editor .ic-head {
  padding: 0 2px 12px;
}
.ic-root.is-editor .ic-head h1 {
  font-size: 24px;
}
.ic-root.is-editor .ic-head .sub {
  font-size: 12px;
}

@media (max-width: 1180px) {
  .ic-root.is-editor .ic-rail {
    width: 100%;
    padding: 8px;
  }
  .ic-root.is-editor .app-grid {
    grid-template-columns: repeat(8, 1fr);
  }
  .doc-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }
  .doc-side {
    position: static;
  }
  .doc-side .list {
    max-height: 220px;
  }
  .doc-main .doc-split {
    grid-template-columns: 1fr;
  }
  .doc-main .doc-split textarea.content,
  .doc-main .doc-split .preview {
    min-height: 380px;
    height: auto;
    max-height: 460px;
  }
}

/* ============================================================== popover
   Opaque enough to read over the icon rail behind it.
   ------------------------------------------------------------------------ */
.ic-pop {
  background: rgba(252, 253, 255, 0.985);
  border: 1px solid #ffffff;
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 0 0 1px rgba(15, 38, 72, 0.06),
    0 30px 68px -20px rgba(15, 38, 72, 0.42),
    0 6px 18px -8px rgba(15, 38, 72, 0.2);
  backdrop-filter: blur(48px) saturate(150%);
  -webkit-backdrop-filter: blur(48px) saturate(150%);
}
.ic-pop-head .who b {
  color: #0d1524;
}
.ic-pop-head .who span {
  color: #5b6b81;
}
.ic-pop-meter .lbl {
  color: #5b6b81;
}
.ic-pop-row {
  color: #16223a;
  font-weight: 520;
}
.ic-pop-row:hover {
  background: rgba(10, 124, 255, 0.1);
}
.ic-pop-row .grow {
  color: #8a97a9;
}
.ic-pop-sep {
  background: rgba(15, 35, 70, 0.1);
}

/* =========================================================================
   Adaptive layouts (device tiers) + app-like interaction tuning.
   Tiers are set on <html data-device> from JS: phone | tablet | desktop.
   ========================================================================= */

/* --- app-like feel: kill tap delay, highlight, rubber-band, text selection */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}
button,
.app-btn,
.tab-btn,
[data-nav],
.ic-pop-row,
.sheet-row,
.list-item {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ic-root,
.ic-main,
.doc-layout,
.list {
  -webkit-overflow-scrolling: touch;
}
.ic-brand,
.app-btn,
.tab-btn,
.ic-pop-row,
.sheet-row {
  -webkit-user-select: none;
  user-select: none;
}

/* PWA standalone: full-bleed, use safe areas, no overscroll glow */
html.is-pwa,
html.is-pwa body {
  overscroll-behavior: none;
  background: #eef5ff;
}
html.is-pwa .ic-top {
  padding-top: calc(13px + env(safe-area-inset-top, 0px));
  padding-left: calc(26px + env(safe-area-inset-left, 0px));
  padding-right: calc(26px + env(safe-area-inset-right, 0px));
}
html.is-pwa .ic-body {
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

/* =========================================================================
   PHONE — bottom tab bar, compact top bar, hidden rail, stacked docs
   ========================================================================= */
html[data-device='phone'] body::before {
  /* lighter field reduces blur cost on mobile GPUs */
  background:
    radial-gradient(520px 420px at 0% -4%, rgba(86, 158, 255, 0.7) 0%, rgba(86, 158, 255, 0) 64%),
    radial-gradient(480px 380px at 100% 4%, rgba(120, 176, 255, 0.6) 0%, rgba(120, 176, 255, 0) 62%),
    linear-gradient(180deg, #eef5ff 0%, #e4edfb 100%);
}
html[data-device='phone'] .ic-root {
  min-height: 100dvh;
}
html[data-device='phone'] .ic-top {
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  gap: 8px;
}
html[data-device='phone'] .ic-brand .uname {
  display: none;
}
html[data-device='phone'] .ic-brand > span:not(.uname) {
  font-size: 15px;
}
html[data-device='phone'] .ic-accountbtn .who {
  display: none;
}
html[data-device='phone'] .ic-accountbtn {
  padding: 4px;
  min-width: 40px;
  min-height: 40px;
  justify-content: center;
}
html[data-device='phone'] .ic-accountbtn .caret {
  display: none;
}
html[data-device='phone'] .ic-body {
  flex-direction: column;
  padding: 14px 14px calc(96px + env(safe-area-inset-bottom, 0px));
  gap: 12px;
}
html[data-device='phone'] .ic-rail {
  display: none;
}
html[data-device='phone'] .ic-head {
  padding: 0 2px 12px;
}
html[data-device='phone'] .ic-head h1 {
  font-size: 21px;
}
html[data-device='phone'] .ic-head .sub {
  font-size: 11.5px;
  line-height: 1.45;
}

/* bottom tab bar */
.ic-tabbar {
  display: none;
}
html[data-device='phone'] .ic-tabbar {
  display: flex;
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  align-items: stretch;
  justify-content: space-around;
  padding: 7px 6px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
    0 10px 30px -12px rgba(18, 45, 85, 0.5);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 2px;
  border: 0;
  background: none;
  color: var(--ic-muted);
  border-radius: 14px;
  min-height: 50px;
}
.tab-btn .tab-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #7d8da3;
  transition: color 0.12s ease, transform 0.12s ease;
}
.tab-btn .tab-ico svg {
  width: 22px;
  height: 22px;
}
.tab-btn .tab-lbl {
  font-size: 9.5px;
  font-weight: 560;
  line-height: 1;
}
.tab-btn.is-active {
  color: var(--ic-accent);
}
.tab-btn.is-active .tab-ico {
  color: var(--ic-accent);
  transform: translateY(-1px);
}
.tab-btn:active .tab-ico {
  transform: scale(0.9);
}

/* More sheet */
.sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 69;
  background: rgba(16, 24, 40, 0.32);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.sheet-backdrop.is-open {
  display: block;
  opacity: 1;
}
.ic-sheet {
  display: none;
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}
.ic-sheet.is-open {
  display: block;
  transform: translateY(0);
  opacity: 1;
}
.sheet-grab {
  width: 38px;
  height: 4px;
  border-radius: 3px;
  background: rgba(15, 35, 70, 0.16);
  margin: 0 auto 10px;
}
.sheet-head {
  font-weight: 650;
  font-size: 14px;
  padding: 2px 6px 10px;
}
.sheet-head span {
  color: var(--ic-muted-2);
  font-weight: 500;
  font-size: 12px;
  margin-left: 6px;
}
.sheet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 8px 8px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ic-text);
  font-size: 14px;
  text-align: left;
}
.sheet-row .swatch {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(10, 124, 255, 0.1);
  color: var(--ic-accent);
}
.sheet-row .grow {
  margin-left: auto;
  color: var(--ic-muted-2);
}
.sheet-row:active {
  background: rgba(10, 124, 255, 0.08);
}

/* phone: dashboard + grids collapse naturally */
html[data-device='phone'] .dash {
  grid-template-columns: 1fr;
}
html[data-device='phone'] .span-2 {
  grid-column: auto;
}
html[data-device='phone'] .photo-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* phone editor: list becomes a horizontal strip above the editor */
html[data-device='phone'] .ic-root.is-editor .ic-body {
  padding: 12px 12px calc(96px + env(safe-area-inset-bottom, 0px));
}
html[data-device='phone'] .doc-layout {
  grid-template-columns: 1fr;
  gap: 10px;
}
html[data-device='phone'] .doc-side {
  position: static;
  width: 100%;
  padding: 12px;
}
html[data-device='phone'] .doc-side .list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-height: none;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}
html[data-device='phone'] .doc-side .list-item {
  flex: 0 0 auto;
  min-width: 150px;
  scroll-snap-align: start;
}
html[data-device='phone'] .doc-side .doc-count {
  display: none;
}
html[data-device='phone'] .doc-main .doc-split {
  grid-template-columns: 1fr;
}
html[data-device='phone'] .doc-main .doc-split textarea.content,
html[data-device='phone'] .doc-main .doc-split .preview {
  min-height: 320px;
}
html[data-device='phone'] .doc-actions {
  flex-wrap: wrap;
}

/* =========================================================================
   TABLET — compact top rail (icons only), comfortable reading width
   ========================================================================= */
html[data-device='tablet'] .ic-body {
  max-width: 1024px;
  padding: 18px 20px 40px;
}
html[data-device='tablet'] .ic-rail {
  width: 100%;
  position: static;
  order: -1;
  padding: 10px 12px;
  align-self: stretch;
}
html[data-device='tablet'] .rail-title,
html[data-device='tablet'] .rail-links,
html[data-device='tablet'] .rail-sep {
  display: none;
}
html[data-device='tablet'] .app-grid {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  justify-content: space-between;
}
html[data-device='tablet'] .app-btn {
  flex-direction: row;
  gap: 7px;
  padding: 6px 10px;
  flex: 0 0 auto;
}
html[data-device='tablet'] .app-tile {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}
html[data-device='tablet'] .app-tile svg {
  width: 17px;
  height: 17px;
}
html[data-device='tablet'] .app-label {
  font-size: 11px;
}

/* reduced motion preference: instant, no lag */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Ensure tier rules win over the editor-specific rail (higher specificity). */
html[data-device='phone'] .ic-root .ic-rail {
  display: none !important;
}
html[data-device='tablet'] .ic-root .ic-rail {
  width: 100%;
  position: static;
  order: -1;
  padding: 10px 12px;
}
html[data-device='tablet'] .ic-root .app-grid {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

/* phone editor refinements: single-column metadata + scrollable toolbar */
html[data-device='phone'] .doc-main .editor-row {
  grid-template-columns: 1fr;
  gap: 10px;
}
html[data-device='phone'] .doc-toolbar {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 6px;
}
html[data-device='phone'] .doc-toolbar .tb {
  flex: 0 0 auto;
}
html[data-device='phone'] .ai-row {
  flex-wrap: wrap;
}

/* Calo One — Organization workspace & in-app notifications */

/* App tile tone */
.c-org {
  background: linear-gradient(145deg, #7c9dff, #5368e8);
  color: #fff;
  box-shadow: 0 6px 14px rgba(83, 104, 232, .3);
}

.org-notify { position: relative; }
.org-notify-btn {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid rgba(16, 40, 80, .1); border-radius: 12px;
  background: rgba(255, 255, 255, .62); color: #2a3f63; cursor: pointer;
  transition: background .16s, transform .16s;
}
.org-notify-btn:hover { background: #fff; transform: translateY(-1px); }
.org-notify-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 9px;
  background: #e04157; color: #fff; font-size: 10px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(224, 65, 87, .35);
}
.org-notify-badge[hidden] { display: none; }
.org-notify-pop {
  position: absolute; z-index: 80; top: 48px; right: 0; width: min(370px, calc(100vw - 28px));
  max-height: 420px; overflow: auto; padding: 10px; border-radius: 16px;
  box-shadow: 0 18px 50px rgba(18, 42, 80, .18);
}
.org-notify-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.org-notify-head b { font-size: 13px; }
.org-notify-head button { border: 0; background: none; color: #0a7cff; font-size: 11.5px; cursor: pointer; }
.org-notify-empty { padding: 28px 12px; text-align: center; color: #7b8aa0; font-size: 12.5px; }
.org-notify-row { display: flex; gap: 10px; padding: 11px 8px; border-radius: 11px; }
.org-notify-row.is-unread { background: rgba(10, 124, 255, .07); }
.org-notify-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: #c7d2e2; flex: none; }
.org-notify-row.is-unread .org-notify-dot { background: #0a7cff; }
.org-notify-body { flex: 1; min-width: 0; }
.org-notify-body b { display: block; font-size: 12.5px; }
.org-notify-body p { margin: 3px 0; font-size: 12px; color: #455a78; line-height: 1.5; }
.org-notify-body small { color: #90a0b6; font-size: 10.5px; }
.org-notify-actions { display: flex; gap: 7px; margin-top: 9px; }

.org-toolbar { display: flex; justify-content: flex-end; margin: 0 0 14px; }
.org-create-form { display: flex; gap: 8px; padding: 12px; margin-bottom: 16px; border-radius: 14px; }
.org-create-form input { flex: 1; min-width: 0; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.org-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 18px; border: 1px solid rgba(16, 40, 80, .09); border-radius: 16px;
  background: rgba(255, 255, 255, .72); text-align: left; cursor: pointer;
  transition: transform .16s, box-shadow .16s;
}
.org-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(20, 50, 90, .12); }
.org-card-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fff;
  background: linear-gradient(145deg, #7c9dff, #5368e8); }
.org-card b { font-size: 14px; }
.org-card-meta { color: #71839b; font-size: 11.5px; }
.org-card-role { margin-top: 2px; padding: 3px 8px; border-radius: 6px; background: rgba(10, 124, 255, .09); color: #0a7cff; font-size: 10.5px; }
.org-empty { padding: 60px 24px; text-align: center; border-radius: 18px; }
.org-empty-mark { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  color: #fff; background: linear-gradient(145deg, #7c9dff, #5368e8); }
.org-empty h2 { margin: 0 0 6px; font-size: 16px; }
.org-empty p { margin: 0; color: #7b8aa0; font-size: 12.5px; }
.org-empty-inline { padding: 34px 14px; text-align: center; color: #8b9ab0; font-size: 12.5px; }

.org-panel { padding: 18px; border-radius: 16px; margin-bottom: 16px; }
.org-panel-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.org-panel-head h2 { margin: 0; font-size: 14px; }
.org-count { padding: 2px 8px; border-radius: 7px; background: rgba(16, 40, 80, .07); color: #63758d; font-size: 11px; }
.org-invites { border-color: rgba(10, 124, 255, .28); }
.org-invite-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(16,40,80,.07); }
.org-invite-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #fff;
  background: linear-gradient(145deg, #7c9dff, #5368e8); flex: none; }
.org-invite-text { flex: 1; min-width: 0; }
.org-invite-text b { display: block; font-size: 13px; }
.org-invite-text span { display: block; margin-top: 2px; color: #71839b; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-invite-actions { display: flex; gap: 8px; }

.org-detail { max-width: 900px; }
.org-back { display: inline-block; margin-bottom: 14px; border: 0; background: none; color: #0a7cff; font-size: 12.5px; cursor: pointer; }
.org-detail-head { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; margin-bottom: 14px; }
.org-detail-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff;
  background: linear-gradient(145deg, #7c9dff, #5368e8); }
.org-detail-head h2 { margin: 0; font-size: 17px; }
.org-detail-head p { margin: 3px 0 0; color: #71839b; font-size: 12px; }
.org-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.org-tab { padding: 8px 14px; border: 1px solid rgba(16, 40, 80, .1); border-radius: 10px; background: rgba(255,255,255,.6);
  color: #52657f; font-size: 12.5px; cursor: pointer; }
.org-tab.is-active { background: #0a7cff; border-color: #0a7cff; color: #fff; }

.org-upload { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.org-upload-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.org-hint { color: #8b9ab0; font-size: 11.5px; }
.org-file-list, .org-member-list, .org-event-list { display: flex; flex-direction: column; }
.org-file-row, .org-member-row, .org-event-row { display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-top: 1px solid rgba(16, 40, 80, .07); }
.org-file-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: rgba(10, 124, 255, .1); color: #0a7cff; flex: none; }
.org-file-main { flex: 1; min-width: 0; }
.org-file-main b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-file-main small { display: block; margin-top: 2px; color: #8b9ab0; font-size: 10.5px; }
.org-file-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.org-danger { color: #e04157; }
.org-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: #e8f0ff; color: #2f6fe0; font-size: 12px; font-weight: 700; flex: none; }
.org-sub-title { margin: 16px 0 6px; font-size: 11.5px; color: #8b9ab0; }
.org-invite-form { display: flex; gap: 8px; margin-bottom: 14px; }
.org-invite-form input { flex: 1; min-width: 0; }
.org-event-dot { width: 8px; height: 8px; border-radius: 50%; background: #7c9dff; flex: none; }
.org-event-row time { color: #8b9ab0; font-size: 10.5px; white-space: nowrap; }
.org-share-box { display: flex; align-items: center; gap: 8px; padding: 10px; margin-bottom: 12px; border-radius: 10px;
  background: rgba(10, 124, 255, .07); font-size: 11px; color: #52657f; flex-wrap: wrap; }
.org-share-box input { flex: 1; min-width: 180px; }

@media (max-width: 700px) {
  .org-file-row, .org-invite-row { flex-wrap: wrap; }
  .org-file-actions { width: 100%; }
  .org-invite-actions { width: 100%; }
  .org-event-row time { width: 100%; padding-left: 20px; }
}

/* ------------------------------------------------------------ app grid fit */
/* Long labels and extra tiles must not push the right column outside the rail. */
.app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.app-grid .app-btn { min-width: 0; }
.app-grid .app-label {
  max-width: 100%;
  font-size: 8.5px;
  white-space: nowrap;
  text-align: center;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
html[data-device='tablet'] .ic-root .app-grid,
html[data-device='tablet'] .app-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
  justify-content: flex-start;
}
html[data-device='tablet'] .app-btn {
  flex-direction: column;
  gap: 5px;
  padding: 6px 2px;
  flex: 0 0 auto;
  width: calc(25% - 5px);
}

/* Drive tile tone */
.c-drive {
  --c1: #c2aaff;
  --c2: #6c47e0;
}

.org-drive-tabs { flex-wrap: wrap; }
