:root {
  color-scheme: light;
  --background: #f2f2f7;
  --surface: #ffffff;
  --surface-secondary: #f7f7fb;
  --surface-tertiary: #fbfbfd;
  --border: rgba(60, 60, 67, 0.18);
  --border-strong: rgba(60, 60, 67, 0.28);
  --text: #1c1c1e;
  --secondary: rgba(60, 60, 67, 0.72);
  --tertiary: rgba(60, 60, 67, 0.46);
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.12);
  --danger: #ff3b30;
  --success: #34c759;
  --warning: #ff9f0a;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  --radius-home: 16px;
  --radius-location: 12px;
  --radius-container: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(242, 242, 247, 0) 220px),
    var(--background);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.48;
}

.app-root {
  min-height: 100vh;
}

.launch-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: calc(var(--safe-top) + 24px) 24px calc(var(--safe-bottom) + 24px);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.42) 54%, rgba(0, 0, 0, 0.18)),
    url("./assets/app-launch-photo.jpg") center / cover;
  color: #ffffff;
  font-weight: 700;
  text-align: center;
}

.launch-screen img {
  justify-self: center;
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.launch-screen div {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
}

.marketing-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fbf6ef 0%, #f4faf7 42%, #fffaf2 100%);
  color: #27231f;
}

.marketing-page a {
  color: inherit;
  text-decoration: none;
}

.marketing-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: calc(var(--safe-top) + 10px) max(20px, calc((100vw - 1160px) / 2 + 24px)) 10px;
  border-bottom: 1px solid rgba(90, 67, 48, 0.1);
  background: rgba(251, 246, 239, 0.86);
  backdrop-filter: blur(18px);
}

.marketing-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 850;
}

.marketing-brand img {
  flex: 0 0 auto;
  border-radius: 8px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
}

.marketing-links {
  display: flex;
  gap: 22px;
  color: rgba(39, 35, 31, 0.68);
  font-size: 14px;
  font-weight: 650;
}

.marketing-links a:hover {
  color: #27231f;
}

.marketing-sign-in {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #2f554a;
  color: #ffffff;
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(47, 85, 74, 0.18);
}

.marketing-main {
  overflow: hidden;
}

.shared-link-page {
  min-height: 100vh;
}

.shared-link-main {
  display: grid;
  min-height: calc(100vh - 64px);
  place-items: center;
  padding: 42px max(20px, calc((100vw - 720px) / 2 + 24px));
}

.shared-link-panel {
  display: grid;
  width: min(100%, 520px);
  gap: 16px;
  justify-items: center;
  padding: 28px;
  border: 1px solid rgba(90, 67, 48, 0.1);
  border-radius: 18px;
  background: #fffaf2;
  box-shadow: 0 18px 48px rgba(74, 55, 38, 0.12);
  text-align: center;
}

.shared-link-icon {
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.shared-link-panel .marketing-kicker {
  margin: 0;
  color: rgba(39, 35, 31, 0.58);
}

.shared-link-panel h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: 0;
}

.shared-link-copy {
  max-width: 410px;
  margin: 0;
  color: rgba(39, 35, 31, 0.66);
  line-height: 1.45;
}

.shared-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.shared-link-auth {
  display: grid;
  width: min(100%, 340px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.marketing-hero {
  display: flex;
  min-height: 76svh;
  align-items: center;
  padding: 74px max(24px, calc((100vw - 1160px) / 2 + 24px)) 58px;
  background-color: #31423b;
  background-image:
    linear-gradient(90deg, rgba(37, 43, 36, 0.9) 0%, rgba(48, 63, 52, 0.78) 38%, rgba(48, 63, 52, 0.28) 70%, rgba(48, 63, 52, 0.08) 100%),
    linear-gradient(180deg, rgba(206, 121, 82, 0.12), rgba(41, 126, 112, 0.08)),
    url("./assets/landing-hero.jpg");
  background-position: center;
  background-size: cover;
  color: #ffffff;
}

.marketing-hero-copy {
  width: min(100%, 630px);
}

.marketing-kicker {
  max-width: 520px;
  margin: 0 0 16px;
  color: rgba(255, 242, 222, 0.82);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.marketing-hero h1 {
  margin: 0;
  font-size: 72px;
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.marketing-lede {
  max-width: 570px;
  margin: 22px 0 0;
  color: rgba(255, 250, 241, 0.88);
  font-size: 21px;
  line-height: 1.42;
}

.marketing-actions,
.marketing-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
}

.marketing-primary,
.marketing-secondary {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 800;
  line-height: 1;
}

.marketing-primary {
  background: #fff3df;
  color: #28332f;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.marketing-secondary {
  border: 1px solid rgba(255, 243, 224, 0.48);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  backdrop-filter: blur(12px);
}

.button-reset {
  font: inherit;
}

.marketing-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 570px;
  margin: 38px 0 0;
}

.marketing-proof div {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.marketing-proof dt {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 850;
}

.marketing-proof dd {
  margin: 0;
  color: rgba(255, 242, 222, 0.74);
  font-size: 13px;
}

.marketing-section {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0;
}

.marketing-section-heading {
  max-width: 760px;
}

.marketing-section-heading p {
  margin: 0 0 10px;
  color: #2f7d6f;
  font-size: 14px;
  font-weight: 850;
}

.marketing-section-heading h2 {
  margin: 0;
  color: #27231f;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
}

.marketing-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.marketing-feature-card {
  min-width: 0;
  min-height: 250px;
  padding: 22px;
  border: 1px solid rgba(90, 67, 48, 0.12);
  border-radius: 8px;
  background: #fffaf2;
  box-shadow: 0 10px 28px rgba(74, 55, 38, 0.07);
}

.marketing-feature-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #e9f3ee;
  color: #28724f;
}

.marketing-feature-card:nth-child(2) .marketing-feature-icon {
  background: #f9ead8;
  color: #ad633a;
}

.marketing-feature-card:nth-child(3) .marketing-feature-icon {
  background: #f7e2e5;
  color: #b44d58;
}

.marketing-feature-card:nth-child(4) .marketing-feature-icon {
  background: #e8e8f8;
  color: #5352a3;
}

.marketing-feature-icon .svg-icon {
  width: 22px;
  height: 22px;
}

.marketing-feature-card h3,
.marketing-detail-row h3 {
  margin: 18px 0 8px;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.marketing-feature-card p,
.marketing-detail-row p {
  margin: 0;
  color: rgba(39, 35, 31, 0.68);
  font-size: 15px;
  line-height: 1.48;
}

.marketing-detail-band {
  border-top: 1px solid rgba(111, 81, 56, 0.14);
  border-bottom: 1px solid rgba(111, 81, 56, 0.14);
}

.marketing-detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 36px;
}

.marketing-detail-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding-top: 22px;
  border-top: 2px solid #d98c62;
}

.marketing-detail-row > .svg-icon {
  width: 26px;
  height: 26px;
  color: #a65735;
}

.marketing-detail-row h3 {
  margin-top: 0;
}

.marketing-access {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  padding-bottom: 88px;
}

.marketing-access .marketing-secondary {
  border-color: rgba(39, 35, 31, 0.14);
  background: #fffaf2;
  color: #27231f;
  box-shadow: none;
}

.marketing-access .marketing-secondary .svg-icon {
  width: 18px;
  height: 18px;
}

.marketing-access .marketing-primary {
  background: #2f554a;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(47, 85, 74, 0.2);
}

.marketing-sign-in:active,
.marketing-primary:active,
.marketing-secondary:active {
  transform: scale(0.98);
}

@media (max-width: 980px) {
  .marketing-hero {
    padding-top: 58px;
    background-position: center right 34%;
  }

  .marketing-hero h1 {
    font-size: 58px;
  }

  .marketing-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketing-detail-list,
  .marketing-access {
    grid-template-columns: 1fr;
  }

  .marketing-access-actions {
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .marketing-nav {
    gap: 12px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .marketing-brand span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .marketing-links {
    display: none;
  }

  .marketing-sign-in {
    min-height: 36px;
    padding: 7px 12px;
  }

  .marketing-hero {
    min-height: 72svh;
    padding: 42px 18px 44px;
    background-position: center right 28%;
  }

  .shared-link-main {
    padding: 24px 16px;
  }

  .shared-link-panel {
    padding: 22px 16px;
    border-radius: 14px;
  }

  .shared-link-panel h1 {
    font-size: 30px;
  }

  .marketing-hero h1 {
    font-size: 48px;
    line-height: 1;
  }

  .marketing-lede {
    font-size: 18px;
  }

  .marketing-proof {
    gap: 10px;
    margin-top: 28px;
  }

  .marketing-proof dd {
    font-size: 12px;
  }

  .marketing-section {
    width: calc(100% - 32px);
    padding: 54px 0;
  }

  .marketing-section-heading h2 {
    font-size: 30px;
    line-height: 1.12;
  }

  .marketing-feature-grid {
    grid-template-columns: 1fr;
  }

  .marketing-feature-card {
    min-height: 0;
  }

  .marketing-detail-list {
    gap: 18px;
  }

  .marketing-access {
    padding-bottom: 64px;
  }

  .marketing-primary,
  .marketing-secondary {
    width: 100%;
  }
}

.mobile-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--background);
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: rgba(242, 242, 247, 0.86);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.08);
  backdrop-filter: blur(18px);
}

.nav-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 38px;
}

.nav-title {
  min-width: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-spacer {
  width: 44px;
  height: 44px;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
}

.icon-button:active,
.chip-button:active,
.row-button:active,
.sheet-action:active {
  transform: scale(0.98);
}

.avatar-button {
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.search-wrap {
  position: relative;
  min-width: 0;
}

.search-wrap .svg-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--tertiary);
  transform: translateY(-50%);
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  background: rgba(118, 118, 128, 0.12);
  color: var(--text);
}

.search-input::placeholder {
  color: var(--tertiary);
}

.search-input:focus {
  border-color: rgba(10, 132, 255, 0.32);
  background: var(--surface);
}

.flag-filter {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0.75px solid rgba(255, 159, 10, 0.34);
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--warning);
}

.flag-filter.is-active {
  border-color: transparent;
  background: var(--warning);
  color: #ffffff;
}

.flag-filter .svg-icon {
  width: 17px;
  height: 17px;
}

.flag-filter .svg-icon,
.item-flag .svg-icon {
  fill: currentColor;
}

.breadcrumb {
  position: fixed;
  top: calc(var(--safe-top) + 100px);
  left: max(14px, calc((100vw - 520px) / 2 + 14px));
  z-index: 18;
  display: flex;
  max-width: min(calc(100vw - 28px), 492px);
  gap: 5px;
  align-items: center;
  padding: 7px 12px;
  border: 0.5px solid rgba(60, 60, 67, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.2;
  pointer-events: none;
  transform: translateY(0);
  transition: opacity 0.16s ease, transform 0.16s ease;
  backdrop-filter: blur(16px);
}

.breadcrumb strong {
  max-width: 130px;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb.is-hidden {
  opacity: 0;
  transform: translateY(-6px);
}

.content {
  padding: 12px 14px calc(var(--safe-bottom) + 28px);
}

.status-strip {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--secondary);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--tertiary);
}

.status-dot.connected {
  background: var(--success);
}

.home-list {
  display: grid;
  gap: 10px;
}

.tree-card {
  position: relative;
  overflow: hidden;
  border: 0.75px solid var(--border);
  color: var(--text);
}

.home-card {
  border-radius: var(--radius-home);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.045);
}

.floor-card {
  margin: 8px 10px 0;
  border-radius: var(--radius-location);
  background: var(--surface-secondary);
}

.room-card {
  margin: 8px 10px 0;
  border-radius: var(--radius-location);
  background: var(--surface-tertiary);
}

.container-card {
  margin: 6px 8px 0;
  border-radius: var(--radius-container);
  background: rgba(255, 255, 255, 0.72);
}

.node-header {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto 34px;
  gap: 4px;
  align-items: center;
  min-height: 42px;
  padding: 5px 8px;
}

.home-card > .node-header {
  min-height: 48px;
  padding: 8px 10px;
}

.container-card > .node-header {
  min-height: 36px;
  padding: 4px 6px;
}

.collapse-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--secondary);
}

.collapse-button .svg-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.16s ease;
}

.collapse-button.is-collapsed .svg-icon {
  transform: rotate(-90deg);
}

.node-title {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
}

.node-title-text {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-card .node-title-text {
  font-size: 19px;
}

.container-card .node-title-text {
  font-size: 14px;
}

.symbol {
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  color: var(--text);
}

.symbol .svg-icon {
  width: 19px;
  height: 19px;
}

.summary {
  min-width: 0;
  overflow: hidden;
  color: var(--secondary);
  font-size: 11px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: transparent;
  color: var(--secondary);
}

.menu-button .svg-icon {
  width: 19px;
  height: 19px;
}

.node-divider {
  height: 0.5px;
  margin: 0 12px;
  background: var(--border);
}

.item-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 0;
}

.container-card .item-flow {
  padding: 6px 10px 0;
}

.item-chip,
.add-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 0.5px solid rgba(60, 60, 67, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  line-height: 1.15;
}

.item-chip {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.item-chip.is-deep-linked {
  border-color: rgba(10, 132, 255, 0.58);
  background: rgba(10, 132, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}

.item-chip .svg-icon,
.add-chip .svg-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quantity {
  color: var(--secondary);
  font-size: 11px;
  font-weight: 700;
}

.item-flag {
  display: inline-grid;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--warning);
}

.item-flag .svg-icon {
  width: 12px;
  height: 12px;
}

.add-chip {
  border-color: rgba(10, 132, 255, 0.18);
  background: rgba(10, 132, 255, 0.06);
  color: var(--secondary);
  font-weight: 600;
}

.inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px 36px;
  gap: 8px;
  align-items: center;
  padding: 8px 12px 0;
}

.inline-add input {
  min-width: 0;
  height: 36px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  background: rgba(118, 118, 128, 0.12);
}

.inline-add input:focus {
  border-color: rgba(10, 132, 255, 0.28);
  background: var(--surface);
}

.inline-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: var(--secondary);
}

.inline-icon.commit {
  color: var(--success);
}

.inline-icon .svg-icon {
  width: 22px;
  height: 22px;
}

.home-card > .card-bottom,
.floor-card > .card-bottom,
.room-card > .card-bottom,
.container-card > .card-bottom {
  height: 10px;
}

.container-card > .card-bottom {
  height: 7px;
}

.page-command {
  display: inline-flex;
  min-height: 38px;
  gap: 7px;
  align-items: center;
  justify-content: center;
  margin: 10px 0 4px;
  padding: 7px 10px;
  border-radius: 9px;
  background: transparent;
  color: var(--secondary);
  font-weight: 600;
}

.page-command .svg-icon {
  width: 16px;
  height: 16px;
}

.empty-state,
.loading-state,
.no-results {
  display: grid;
  min-height: 48vh;
  place-items: center;
  padding: 28px 20px;
  text-align: center;
}

.empty-panel {
  display: grid;
  max-width: 330px;
  gap: 12px;
  justify-items: center;
}

.empty-panel img {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.empty-panel h2 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.empty-panel p {
  margin: 0;
  color: var(--secondary);
  line-height: 1.4;
}

.auth-content {
  min-height: calc(100vh - 64px);
}

.auth-required {
  min-height: calc(100vh - 120px);
}

.auth-actions {
  display: grid;
  width: min(100%, 320px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.auth-actions:empty {
  display: none;
}

.auth-unavailable {
  padding: 14px 16px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.sign-in-panel {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 16px 6px 8px;
  text-align: center;
}

.sign-in-panel img {
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.sign-in-panel h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.sign-in-panel p {
  max-width: 350px;
  margin: 0 0 4px;
  color: var(--secondary);
  line-height: 1.4;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.secondary-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.danger-button {
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.28);
}

.sheet {
  width: min(100%, 520px);
  max-height: min(86vh, 760px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  background: var(--background);
  box-shadow: 0 -16px 42px rgba(0, 0, 0, 0.2);
}

.sheet-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  min-height: 54px;
  padding: 6px 10px;
  border-bottom: 0.5px solid var(--border);
  background: rgba(242, 242, 247, 0.86);
  backdrop-filter: blur(18px);
}

.sheet-title {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.sheet-close,
.sheet-save {
  min-height: 40px;
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.sheet-save {
  justify-self: end;
}

.sheet-close {
  justify-self: start;
}

.sheet-body {
  max-height: calc(min(86vh, 760px) - 54px);
  overflow: auto;
  padding: 14px 14px calc(var(--safe-bottom) + 18px);
}

.action-list {
  display: grid;
  gap: 10px;
}

.sheet-action {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.sheet-action .svg-icon {
  width: 21px;
  height: 21px;
  color: var(--secondary);
}

.sheet-action.danger {
  color: var(--danger);
}

.sheet-action.danger .svg-icon {
  color: var(--danger);
}

.form-section {
  margin-bottom: 16px;
}

.section-title {
  margin: 0 0 7px 14px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.form-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.form-row {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 9px 12px;
  border-bottom: 0.5px solid var(--border);
}

.form-row:last-child {
  border-bottom: 0;
}

.form-row label,
.row-label {
  color: var(--text);
  font-weight: 500;
}

.form-row > strong {
  min-width: 0;
  color: var(--secondary);
  font-weight: 600;
  text-align: right;
}

.form-row input,
.form-row textarea,
.form-row select,
.full-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  text-align: right;
}

.form-row input[type="checkbox"] {
  justify-self: end;
  width: 22px;
  height: 22px;
  accent-color: var(--warning);
}

.form-row textarea {
  min-height: 70px;
  resize: vertical;
  text-align: left;
}

.form-row select {
  direction: rtl;
}

.form-row select option {
  direction: ltr;
}

.full-row {
  display: block;
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--border);
}

.full-row:last-child {
  border-bottom: 0;
}

.property-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 0.5px solid var(--border);
}

.property-fields {
  display: grid;
  gap: 4px;
}

.property-fields input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
}

.property-fields input:first-child {
  color: var(--secondary);
  font-size: 12px;
}

.property-delete {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: var(--danger);
}

.icon-grid,
.icon-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 10px;
}

.icon-option {
  display: grid;
  min-height: 68px;
  gap: 5px;
  place-items: center;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-tertiary);
  color: var(--text);
}

.icon-option .svg-icon {
  width: 23px;
  height: 23px;
}

.icon-option span {
  max-width: 100%;
  overflow: hidden;
  color: var(--secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.account-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.account-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(118, 118, 128, 0.18);
  color: #ffffff;
}

.account-avatar .svg-icon {
  width: 30px;
  height: 30px;
}

.account-meta {
  min-width: 0;
}

.account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.account-email,
.footnote {
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.35;
}

.row-button {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
}

.row-button:last-child {
  border-bottom: 0;
}

.row-button.danger {
  color: var(--danger);
}

.provider-button-host {
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 6px 12px;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
}

.provider-apple {
  background: #000000;
  color: #ffffff;
}

.attachment-list {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

.attachment-link {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
}

.attachment-link .svg-icon {
  width: 18px;
  height: 18px;
}

.toast {
  position: fixed;
  right: max(14px, calc((100vw - 520px) / 2 + 14px));
  bottom: calc(var(--safe-bottom) + 18px);
  left: max(14px, calc((100vw - 520px) / 2 + 14px));
  z-index: 80;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(28, 28, 30, 0.92);
  color: #ffffff;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(10, 132, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.svg-icon {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #1c1c1e;
    --surface: #2c2c2e;
    --surface-secondary: #262629;
    --surface-tertiary: #242427;
    --border: rgba(235, 235, 245, 0.14);
    --border-strong: rgba(235, 235, 245, 0.22);
    --text: #f5f5f7;
    --secondary: rgba(235, 235, 245, 0.66);
    --tertiary: rgba(235, 235, 245, 0.42);
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
  }

  body {
    background:
      linear-gradient(180deg, rgba(44, 44, 46, 0.62), rgba(28, 28, 30, 0) 220px),
      var(--background);
  }

  .top-bar,
  .sheet-header {
    background: rgba(28, 28, 30, 0.82);
  }

  .breadcrumb {
    background: rgba(44, 44, 46, 0.76);
  }
}
