:root {
  color-scheme: light;
  --ink: #302d49;
  --muted: #807d96;
  --line: #e9e6f1;
  --surface: #ffffff;
  --canvas: #f8f7fd;
  --accent: #f36b70;
  --accent-dark: #d94f5e;
  --accent-soft: #fff0f0;
  --pink: #f184ad;
  --pink-soft: #fff0f6;
  --mint: #36a887;
  --mint-soft: #e6f7f0;
  --amber: #bd781b;
  --amber-soft: #fff4d8;
  --red: #d94f5e;
  --red-soft: #fff0f0;
  --shadow: 0 9px 28px rgb(73 59 123 / 8%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 91% 3%, rgb(255 195 205 / 42%), transparent 28rem),
    radial-gradient(ellipse at 44% 48%, rgb(255 229 166 / 30%), transparent 32rem),
    #f8f7fd;
  color: var(--ink);
  font: 15px/1.55 "Leelawadee UI", Tahoma, system-ui, sans-serif;
}

h2, h3, p { margin-top: 0; }
h2, h3 { color: var(--ink); }
small { color: var(--muted); }

aside {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 3;
  width: 252px;
  padding: 27px 18px 20px;
  background: rgb(255 254 250 / 96%);
  border-right: 1px solid var(--line);
  box-shadow: 5px 0 22px rgb(73 59 123 / 4%);
}

aside h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 5px;
  font-size: 23px;
  letter-spacing: -.5px;
}

aside h2 small {
  align-self: flex-start;
  margin: 2px 0 0 -7px;
  font-size: 11px;
}

.logo {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #ff9a76, #f05e79);
  box-shadow: 0 6px 13px rgb(240 94 121 / 28%);
  color: #fff;
  font-weight: 800;
}

.navlabel {
  margin: 35px 11px 11px;
  color: #aaa4bd;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.8px;
}

nav { display: grid; gap: 5px; }

nav button {
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #68657d;
  text-align: left;
  font-weight: 550;
}

nav button.active {
  background: linear-gradient(110deg, #ffe8e9, #fff0d7);
  color: #c94d5d;
  font-weight: 700;
}

nav button:hover:not(.active) { background: #f8f5ff; }
aside > p { margin: 30px 6px 0; }

aside::after {
  position: absolute;
  right: 18px;
  bottom: 76px;
  left: 18px;
  display: grid;
  height: 164px;
  align-content: end;
  border: 1px solid #f4e6d2;
  border-radius: 18px;
  padding: 0 10px 12px;
  background: url("mascot.svg") center 4px / 112px auto no-repeat, linear-gradient(145deg, #ffe8dc, #fff2c9);
  box-shadow: 0 10px 24px rgb(225 126 105 / 16%);
  color: #85536a;
  content: "น้องฮับ · ผู้ช่วยตัวจิ๋ว\Aคอยส่งกำลังใจให้ทุกวัน!";
  font-size: 12px;
  font-weight: 750;
  line-height: 1.6;
  text-align: center;
  white-space: pre-line;
  animation: mascot-float 4s ease-in-out infinite;
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

main {
  max-width: 1600px;
  min-height: 100vh;
  margin-left: 252px;
  padding: 34px clamp(22px, 4vw, 56px) 48px;
}

header, .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

header {
  position: relative;
  overflow: hidden;
  margin-bottom: 25px;
  border: 1px solid rgb(255 255 255 / 85%);
  border-radius: 22px;
  padding: 21px 24px;
  background:
    radial-gradient(circle at 75% 15%, rgb(255 255 255 / 72%) 0 4px, transparent 5px),
    radial-gradient(circle at 80% 75%, rgb(255 255 255 / 58%) 0 7px, transparent 8px),
    linear-gradient(112deg, #ffe8df 0%, #fff0cc 52%, #ffebee 100%);
  box-shadow: 0 10px 26px rgb(230 117 105 / 10%);
}
header > div > small { font-size: 13px; }
header h2 { margin: 3px 0 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.6px; }
.header-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.theme-toggle { background: rgb(255 255 255 / 78%); color: #704b54; }

button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

button:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgb(73 59 123 / 12%); }
button:active { transform: translateY(0); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .drop:focus-visible {
  outline: 3px solid rgb(243 107 112 / 28%);
  outline-offset: 2px;
}

button.primary {
  background: linear-gradient(110deg, #f47770, #ec5d79);
  box-shadow: 0 6px 15px rgb(236 93 121 / 26%);
  color: #fff;
}

button.primary:hover { background: linear-gradient(110deg, #e96562, #d94f5e); }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin: 0 0 21px;
}

.card, section {
  margin-bottom: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 18px 20px;
  color: #6d6981;
  font-size: 13px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.card::before {
  position: absolute;
  top: 13px;
  right: 15px;
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 80%);
  border-radius: 13px;
  background: #fff0ef;
  content: "🧸";
  font-size: 19px;
}

.card:nth-child(2)::before { background: var(--amber-soft); content: "⏰"; }
.card:nth-child(3)::before { background: #f0ebff; content: "💤"; }
.card:nth-child(4)::before { background: var(--mint-soft); content: "🔎"; }
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgb(73 59 123 / 13%); }
.card::after {
  position: absolute;
  right: -17px;
  bottom: -30px;
  width: 85px;
  height: 85px;
  border-radius: 50%;
  background: var(--card-tint, var(--accent-soft));
  content: "";
  opacity: .8;
}

.card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 5px;
  color: var(--card-color, var(--accent));
  font-size: 34px;
  line-height: 1.2;
}

.card:nth-child(1) { --card-color: #e85f68; --card-tint: #ffdfe0; background: #fff2f1; }
.card:nth-child(2) { --card-color: #cf7634; --card-tint: #ffe8b5; background: #fff8e6; }
.card:nth-child(3) { --card-color: #795dc1; --card-tint: #e9e1ff; background: #f7f3ff; }
.card:nth-child(4) { --card-color: #258f75; --card-tint: #d4f1e4; background: #eefaf4; }

section { padding: 20px; }
section h3 { margin: 0 0 14px; font-size: 17px; }
section h3::before { margin-right: 7px; content: "🌼"; font-size: 16px; }
section h3 small { font-size: 13px; font-weight: 500; }

.scroll { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; text-align: left; }
th, td { padding: 13px 10px; border-bottom: 1px solid #eeebf3; vertical-align: middle; }
th {
  background: #f7f5fb;
  color: #77738b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
th:first-child { border-radius: 9px 0 0 9px; }
th:last-child { border-radius: 0 9px 9px 0; }
td { font-size: 13px; }
td b { color: #39354f; font-size: 14px; }
td:first-child b::before { margin-right: 6px; content: "✨"; font-size: 13px; }
tbody tr:nth-child(4n + 2) td:first-child b::before { content: "🧸"; }
tbody tr:nth-child(4n + 3) td:first-child b::before { content: "🌱"; }
tbody tr:nth-child(4n + 4) td:first-child b::before { content: "⭐"; }
td small { display: inline-block; margin-top: 2px; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfaff; }
td button { padding: 7px 12px; font-size: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 4px 9px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.done { background: var(--mint-soft); color: #25866e; }
.badge.done::before { margin-right: 4px; content: "✓"; font-weight: 800; }
.badge.warn::before { margin-right: 4px; content: "⏳"; }
.badge.danger::before { margin-right: 4px; content: "⚠"; }

input, select, textarea {
  width: 100%;
  border: 1px solid #e6e2ed;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input::placeholder, textarea::placeholder { color: #aaa6b8; }
input:focus, select:focus, textarea:focus {
  border-color: #f39a91;
  outline: 0;
  box-shadow: 0 0 0 3px rgb(243 107 112 / 13%);
}

section > input[placeholder] {
  max-width: 460px;
  margin: 0 0 14px;
  padding-left: 40px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23807d96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 13px center;
}

label { display: block; margin: 11px 0 5px; font-size: 13px; font-weight: 650; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; }
.routine {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  margin: 0;
  padding: 10px 6px;
  border-bottom: 1px solid #eeebf3;
  font-size: 14px;
  font-weight: 500;
}
.routine:last-child { border-bottom: 0; }
.routine input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

dialog {
  width: min(780px, 95vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgb(48 45 73 / 22%);
}
dialog::backdrop { background: rgb(48 45 73 / 42%); backdrop-filter: blur(3px); }
dialog .row:first-child { margin-bottom: 10px; }
dialog .row:first-child h3 { margin: 0; font-size: 19px; }
dialog .row:first-child button { width: 38px; height: 38px; padding: 0; background: #f7f5fb; color: #77738b; }
dialog label { margin-top: 12px; }
dialog .row:last-child {
  position: sticky;
  bottom: -26px;
  justify-content: flex-end;
  margin: 17px 0 -10px;
  padding: 13px 0 2px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.drop {
  border: 2px dashed #ffc4ad;
  border-radius: 13px;
  padding: 19px;
  background: #fff7ee;
  color: var(--accent-dark);
  cursor: pointer;
  text-align: center;
}
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop small { display: block; margin-top: 5px; }
#picmsg { display: block; margin: 8px 0; font-size: 12px; }
.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin: 12px 0; }
.attachment { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; padding: 6px; }
.attachment img { width: 100%; height: 92px; background: #fff8f1; object-fit: contain; cursor: zoom-in; }
.attachment small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment button { position: absolute; top: 8px; right: 8px; padding: 3px 8px; background: #fff; color: var(--red); }
#history p { margin: 8px 0; border-radius: 10px; padding: 10px 12px; background: #f8f6fc; }

#viewer { width: min(1000px, 95vw); }
#largepic { display: block; max-width: 100%; max-height: 75vh; margin: 12px auto; }

@media (max-width: 1100px) {
  aside { width: 220px; }
  main { margin-left: 220px; padding-inline: 18px; }
  section { padding: 15px; }
  table { min-width: 700px; }
  th:nth-child(4), td:nth-child(4) { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  aside {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    padding: 11px 14px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  aside h2 { display: inline-flex; margin: 0; font-size: 19px; }
  .logo { width: 32px; height: 32px; border-radius: 11px; }
  aside > small, aside > p, aside::after, .navlabel { display: none; }
  nav {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    margin-top: 8px;
    scrollbar-width: thin;
  }
  nav button { width: auto; flex: 0 0 auto; padding: 8px 11px; font-size: 12px; }
  main { min-height: auto; margin: 0; padding: 20px 14px 35px; }
  header { align-items: flex-start; margin-bottom: 19px; }
  header h2 { font-size: 25px; }
  header > button { padding: 9px 11px; font-size: 13px; }
  .cards { gap: 9px; margin-bottom: 14px; }
  .card { min-height: 94px; padding: 13px; font-size: 12px; }
  .card strong { font-size: 29px; }
  section { margin-bottom: 13px; padding: 14px; border-radius: 14px; }
  section h3 { font-size: 16px; }
  .scroll { margin-inline: -8px; }
  table { min-width: 760px; }
  th:nth-child(4), td:nth-child(4) { display: table-cell; }
  th, td { padding: 11px 8px; }
  .grid { grid-template-columns: 1fr; gap: 3px; }
  dialog { padding: 18px; border-radius: 17px; }
  dialog .row:last-child { bottom: -18px; }
}

@media (max-width: 380px) {
  main { padding-inline: 10px; }
  .card { padding: 11px; }
  header { gap: 8px; }
  header h2 { font-size: 22px; }
  header > button { font-size: 12px; }
}

@media (max-height: 700px) and (min-width: 761px) {
  aside::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5efff;
  --muted: #b7aecb;
  --line: #40384f;
  --surface: #282434;
  --canvas: #1d1a27;
  --accent: #ff8587;
  --accent-dark: #ffc0ae;
  --accent-soft: #49303e;
  --pink-soft: #482d40;
  --mint-soft: #243f3c;
  --amber-soft: #483a29;
  --red-soft: #4a2d39;
  --shadow: 0 10px 28px rgb(0 0 0 / 22%);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 92% 3%, rgb(167 80 111 / 16%), transparent 28rem),
    radial-gradient(ellipse at 44% 48%, rgb(117 91 174 / 13%), transparent 32rem),
    #1d1a27;
}

:root[data-theme="dark"] aside {
  background: rgb(35 31 47 / 97%);
  box-shadow: 5px 0 22px rgb(0 0 0 / 15%);
}

:root[data-theme="dark"] .navlabel { color: #958ba8; }
:root[data-theme="dark"] nav button { color: #c5bdd4; }
:root[data-theme="dark"] nav button.active {
  background: linear-gradient(110deg, #503447, #45354c);
  color: #ffc0ae;
}
:root[data-theme="dark"] nav button:hover:not(.active) { background: #302b3e; }

:root[data-theme="dark"] aside::after {
  border-color: #564254;
  background: url("mascot.svg") center 4px / 112px auto no-repeat, linear-gradient(145deg, #3c2e40, #41382f);
  color: #ffe0bd;
}

:root[data-theme="dark"] header {
  border-color: #554151;
  background:
    radial-gradient(circle at 75% 15%, rgb(255 255 255 / 12%) 0 4px, transparent 5px),
    radial-gradient(circle at 80% 75%, rgb(255 255 255 / 10%) 0 7px, transparent 8px),
    linear-gradient(112deg, #3d2c43 0%, #493342 52%, #39344b 100%);
  box-shadow: 0 10px 26px rgb(0 0 0 / 17%);
}

:root[data-theme="dark"] .theme-toggle { background: #383247; color: #ffe0a6; }
:root[data-theme="dark"] button { background: #403149; color: #f3c9df; }
:root[data-theme="dark"] button.primary {
  background: linear-gradient(110deg, #ff8587, #f06c91);
  color: #291d2c;
}
:root[data-theme="dark"] button.primary:hover { background: linear-gradient(110deg, #ff9a8b, #ff7fa0); }
:root[data-theme="dark"] button:focus-visible,
:root[data-theme="dark"] input:focus-visible,
:root[data-theme="dark"] select:focus-visible,
:root[data-theme="dark"] textarea:focus-visible,
:root[data-theme="dark"] .drop:focus-visible { outline-color: rgb(255 133 135 / 45%); }

:root[data-theme="dark"] .card,
:root[data-theme="dark"] section { border-color: var(--line); background: var(--surface); }
:root[data-theme="dark"] .card { color: #c5bdd4; }
:root[data-theme="dark"] .card:nth-child(1) { --card-color: #ff9b9f; --card-tint: #573343; background: #382a3a; }
:root[data-theme="dark"] .card:nth-child(2) { --card-color: #ffc16f; --card-tint: #51402b; background: #383127; }
:root[data-theme="dark"] .card:nth-child(3) { --card-color: #c1a8ff; --card-tint: #45395e; background: #302b40; }
:root[data-theme="dark"] .card:nth-child(4) { --card-color: #72d6b3; --card-tint: #2a4d45; background: #263a38; }
:root[data-theme="dark"] .card::before { border-color: rgb(255 255 255 / 8%); background: #503442; }
:root[data-theme="dark"] .card:nth-child(2)::before { background: #50402b; }
:root[data-theme="dark"] .card:nth-child(3)::before { background: #44395d; }
:root[data-theme="dark"] .card:nth-child(4)::before { background: #2a4b43; }

:root[data-theme="dark"] th {
  background: #332e42;
  color: #b9b1ca;
}
:root[data-theme="dark"] th,
:root[data-theme="dark"] td,
:root[data-theme="dark"] .routine { border-color: #3d374b; }
:root[data-theme="dark"] td b { color: #f1eafa; }
:root[data-theme="dark"] tbody tr:hover { background: #302b3e; }
:root[data-theme="dark"] .badge { background: #41324d; color: #e0cbff; }
:root[data-theme="dark"] .badge.warn { background: #493b29; color: #ffd17e; }
:root[data-theme="dark"] .badge.danger { background: #4a2d39; color: #ffb0b0; }
:root[data-theme="dark"] .badge.done { background: #24413a; color: #8de0bd; }

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  border-color: #51485e;
  background-color: #262232;
  color: #f5efff;
}
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: #a79db7; }
:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus { border-color: #ff9290; }
:root[data-theme="dark"] section > input[placeholder] {
  background-color: #262232;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b7aecb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] .routine input { accent-color: #ff8587; }
:root[data-theme="dark"] dialog {
  border-color: #51475d;
  background: #282434;
  color: #f5efff;
}
:root[data-theme="dark"] dialog .row:first-child button { background: #393347; color: #eee5fa; }
:root[data-theme="dark"] dialog .row:last-child { border-color: #40384f; background: #282434; }
:root[data-theme="dark"] .drop {
  border-color: #72505b;
  background: #33293a;
  color: #ffc0ae;
}
:root[data-theme="dark"] .drop:hover,
:root[data-theme="dark"] .drop.drag { border-color: #ff8587; background: #49303e; }
:root[data-theme="dark"] .attachment { border-color: #494154; }
:root[data-theme="dark"] .attachment img { background: #211e2c; }
:root[data-theme="dark"] .attachment button { background: #393347; color: #ffaaaa; }
:root[data-theme="dark"] #history p { background: #332e42; }

.cloud-gate {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 20px;
  background:
    radial-gradient(ellipse at 85% 15%, rgb(255 195 205 / 48%), transparent 25rem),
    radial-gradient(ellipse at 18% 82%, rgb(255 229 166 / 42%), transparent 27rem),
    #f8f7fd;
}
.cloud-gate[hidden] { display: none; }
.cloud-card {
  width: min(460px, 100%);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 23px;
  padding: 30px;
  background: var(--surface);
  box-shadow: 0 20px 70px rgb(73 59 123 / 15%);
  text-align: center;
}
.cloud-mark { font-size: 43px; }
.cloud-card h1 { margin: 7px 0; color: var(--ink); font-size: 25px; }
.cloud-card > p { color: var(--muted); }
.cloud-card form { text-align: left; }
.cloud-card form button { width: 100%; margin-top: 15px; }
.cloud-migration {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  text-align: left;
}
.cloud-migration > button { width: 100%; }
.cloud-migration label { margin-top: 13px; }
.cloud-migration input[type="file"] { padding: 8px; font-size: 12px; }
.cloud-migration small { display: block; margin-top: 6px; line-height: 1.5; }
.cloud-message { min-height: 24px; margin: 14px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.cloud-status { max-width: 240px; color: var(--muted); font-size: 12px; }
.cloud-status[data-state="error"] { color: var(--red); }
.cloud-status[data-state="pending"] { color: var(--amber); }
.cloud-invite { position: relative; }
.cloud-invite summary {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.cloud-invite summary::-webkit-details-marker { display: none; }
.cloud-invite form {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  right: 0;
  width: min(310px, 85vw);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.cloud-invite form button { width: 100%; margin: 10px 0; }
.cloud-invite form small { display: block; line-height: 1.5; }
:root[data-theme="dark"] .cloud-gate {
  background:
    radial-gradient(ellipse at 85% 15%, rgb(167 80 111 / 20%), transparent 25rem),
    radial-gradient(ellipse at 18% 82%, rgb(117 91 174 / 16%), transparent 27rem),
    #1d1a27;
}
:root[data-theme="dark"] .cloud-card { border-color: var(--line); background: var(--surface); }
:root[data-theme="dark"] .cloud-invite summary { border-color: var(--line); background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .cloud-migration { border-color: var(--line); }

@media (max-width: 760px) {
  .cloud-card { padding: 23px 19px; }
  .cloud-status { flex: 1 1 100%; max-width: none; }
  .cloud-invite form { right: auto; left: 0; }
}
