:root {
  --bg-1: #8eb8ff;
  --bg-2: #d7e7ff;
  --bg-3: #f6fbff;
  --glass: rgba(255, 255, 255, 0.28);
  --glass-strong: rgba(255, 255, 255, 0.42);
  --line: rgba(255, 255, 255, 0.45);
  --shadow: 0 24px 80px rgba(48, 79, 138, 0.18);
  --text: #12304f;
  --muted: rgba(18, 48, 79, 0.68);
  --accent: #0a84ff;
  --danger: #ff453a;
}

:root[data-theme="dark"] {
  --bg-1: #0a1624;
  --bg-2: #12263d;
  --bg-3: #1a3551;
  --glass: rgba(24, 38, 57, 0.54);
  --glass-strong: rgba(29, 44, 64, 0.72);
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --text: #ecf4ff;
  --muted: rgba(236, 244, 255, 0.66);
}

:root[data-theme="dark"] html,
:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 15% 20%, rgba(133, 170, 214, 0.16), transparent 18rem),
    radial-gradient(circle at 85% 15%, rgba(39, 90, 152, 0.34), transparent 18rem),
    radial-gradient(circle at 50% 100%, rgba(26, 53, 81, 0.82), transparent 24rem),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
}

:root[data-theme="dark"] .link-form-panel,
:root[data-theme="dark"] .file-form-panel,
:root[data-theme="dark"] .category-edit-panel,
:root[data-theme="dark"] .home-add-panel,
:root[data-theme="dark"] .confirm-modal-card {
  background: linear-gradient(180deg, rgba(16, 22, 31, 0.96), rgba(26, 33, 45, 0.94));
  color: #f4f8ff;
  border-color: rgba(255, 255, 255, 0.16);
}

:root[data-theme="dark"] .modal-head h3,
:root[data-theme="dark"] .upload-status,
:root[data-theme="dark"] .segmented-switch-button.active,
:root[data-theme="dark"] .confirm-modal-title,
:root[data-theme="dark"] .inline-chip {
  color: #f4f8ff;
}

:root[data-theme="dark"] .link-form-panel input,
:root[data-theme="dark"] .file-form-panel input,
:root[data-theme="dark"] .category-edit-panel input,
:root[data-theme="dark"] .link-form-panel select,
:root[data-theme="dark"] .file-form-panel select,
:root[data-theme="dark"] .category-edit-panel select,
:root[data-theme="dark"] .home-add-panel input,
:root[data-theme="dark"] .home-add-panel select {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f8ff;
  border-color: rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] .link-form-panel input::placeholder,
:root[data-theme="dark"] .file-form-panel input::placeholder,
:root[data-theme="dark"] .category-edit-panel input::placeholder,
:root[data-theme="dark"] .home-add-panel input::placeholder {
  color: rgba(244, 248, 255, 0.5);
}

:root[data-theme="dark"] .segmented-switch {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .segmented-switch-button {
  color: rgba(244, 248, 255, 0.7);
}

:root[data-theme="dark"] .home-category-card {
  background: linear-gradient(180deg, rgba(20, 29, 40, 0.52), rgba(14, 22, 32, 0.34));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .home-device-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 28px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] .weather-widget,
:root[data-theme="dark"] .tesla-widget {
  background: linear-gradient(180deg, #182433 0%, #121c29 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .weather-icon,
:root[data-theme="dark"] .tesla-visual-block,
:root[data-theme="dark"] .tesla-data-item,
:root[data-theme="dark"] .tesla-data-item span {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .tesla-battery-bar {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.95), transparent 18rem),
    radial-gradient(circle at 85% 15%, rgba(126, 179, 255, 0.6), transparent 18rem),
    radial-gradient(circle at 50% 100%, rgba(201, 230, 255, 0.92), transparent 24rem),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  backdrop-filter: saturate(120%);
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .page-enter .glass-card,
  .page-enter .file-row,
  .page-enter .link-tile,
  .page-enter .home-device-card,
  .page-enter .shared-preview-card {
    animation: cardBounceIn 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: transform, opacity;
  }

  .page-enter .top-grid > *:nth-child(1),
  .page-enter .nav-stack > *:nth-child(1),
  .page-enter .home-device-grid > *:nth-child(1),
  .page-enter .stack > *:nth-child(1),
  .page-enter .link-tile-grid > *:nth-child(1) { animation-delay: 0ms; }
  .page-enter .top-grid > *:nth-child(2),
  .page-enter .nav-stack > *:nth-child(2),
  .page-enter .home-device-grid > *:nth-child(2),
  .page-enter .stack > *:nth-child(2),
  .page-enter .link-tile-grid > *:nth-child(2) { animation-delay: 45ms; }
  .page-enter .top-grid > *:nth-child(3),
  .page-enter .nav-stack > *:nth-child(3),
  .page-enter .home-device-grid > *:nth-child(3),
  .page-enter .stack > *:nth-child(3),
  .page-enter .link-tile-grid > *:nth-child(3) { animation-delay: 90ms; }
  .page-enter .top-grid > *:nth-child(4),
  .page-enter .nav-stack > *:nth-child(4),
  .page-enter .home-device-grid > *:nth-child(4),
  .page-enter .stack > *:nth-child(4),
  .page-enter .link-tile-grid > *:nth-child(4) { animation-delay: 135ms; }
  .page-enter .top-grid > *:nth-child(5),
  .page-enter .nav-stack > *:nth-child(5),
  .page-enter .home-device-grid > *:nth-child(5),
  .page-enter .stack > *:nth-child(5),
  .page-enter .link-tile-grid > *:nth-child(5) { animation-delay: 180ms; }
  .page-enter .top-grid > *:nth-child(6),
  .page-enter .nav-stack > *:nth-child(6),
  .page-enter .home-device-grid > *:nth-child(6),
  .page-enter .stack > *:nth-child(6),
  .page-enter .link-tile-grid > *:nth-child(6) { animation-delay: 225ms; }
}

@keyframes cardBounceIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.92);
  }
  62% {
    opacity: 1;
    transform: translateY(-4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-screen,
.app-shell {
  min-height: 100vh;
}

.login-screen {
  display: grid;
  place-items: center;
  padding: 32px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 24px;
}

.glass-panel,
.glass-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.22));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
}

.side-panel {
  border-radius: 32px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.nav-stack,
.stack {
  display: grid;
  gap: 12px;
}

.nav-link,
.ghost-button,
button {
  border: 0;
  border-radius: 20px;
  padding: 14px 16px;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.nav-link,
.ghost-button {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link-icon {
  width: 24px;
  display: inline-grid;
  place-items: center;
  font-size: 1.05rem;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

button {
  background: linear-gradient(180deg, rgba(10, 132, 255, 0.95), rgba(10, 132, 255, 0.72));
  color: #fff;
  box-shadow: 0 12px 30px rgba(10, 132, 255, 0.24);
}

.ghost-button.danger,
.chip.danger {
  background: rgba(255, 69, 58, 0.16);
  color: #7f1d16;
  box-shadow: none;
}

.nav-link:hover,
.ghost-button:hover,
button:hover {
  transform: translateY(-1px);
}

.auth-card {
  width: min(100%, 420px);
  border-radius: 34px;
  padding: 28px;
  display: grid;
  gap: 18px;
}

.auth-card h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.content-area {
  display: grid;
  gap: 24px;
  align-content: start;
}

.mobile-bar,
.mobile-menu-dialog {
  display: none;
}

.mobile-bar {
  align-items: center;
  justify-content: space-between;
}

.mobile-brand {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.mobile-menu-button {
  width: 56px;
  height: 56px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.22));
  box-shadow: var(--shadow);
}

.mobile-menu-button svg {
  width: 22px;
  height: 22px;
  color: var(--text);
}

.mobile-menu-dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.mobile-menu-dialog.open {
  display: block;
}

.mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 22, 40, 0.18);
  border: 0;
  box-shadow: none;
}

.mobile-menu-sheet {
  position: absolute;
  top: 16px;
  right: 16px;
  left: 16px;
  padding: 18px;
  border-radius: 30px;
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brand.small {
  margin: 0;
  font-size: 1.5rem;
}

.icon-button {
  width: 46px;
  height: 46px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1.4rem;
}

.top-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  justify-content: stretch;
}

.stat-card,
.panel-block,
.form-card,
.item-card {
  border-radius: 30px;
  padding: 22px;
}

.stat-card span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-card strong {
  font-size: 1.7rem;
  letter-spacing: -0.05em;
}

.widget-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.compact-stat-card {
  grid-column: span 1;
  min-height: 88px;
  padding: 14px 16px;
  border-radius: 22px;
  justify-content: center;
  gap: 4px;
}

.compact-stat-card span {
  font-size: 0.78rem;
  margin-bottom: 2px;
}

.compact-stat-card strong {
  font-size: 1.25rem;
}

.stats-overview-card {
  grid-column: span 2;
  min-height: 0;
  padding: 14px;
  border-radius: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(244, 248, 255, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    0 18px 48px rgba(70, 102, 150, 0.12);
}

.stats-overview-item {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, background 160ms ease;
}

.stats-overview-item span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-overview-item strong {
  font-size: 1.28rem;
  letter-spacing: -0.05em;
}

.stats-overview-item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.72);
}

.widget-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: -0.02em;
}

.empty-state-inline {
  margin-top: auto;
  font-size: 0.95rem;
  color: var(--muted);
}

.weather-widget,
.tesla-widget {
  grid-column: span 2;
  width: 100%;
  min-height: 292px;
  aspect-ratio: 1 / 1;
  border-radius: 30px;
  padding: 20px;
  background: linear-gradient(180deg, #f7f9fd 0%, #edf2fb 100%);
  border: 1px solid rgba(214, 222, 236, 0.92);
  box-shadow: 0 18px 44px rgba(72, 96, 136, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.weather-widget {
  min-height: 208px;
  max-height: 208px;
  aspect-ratio: auto;
  justify-content: center;
  gap: 12px;
  padding: 16px 20px;
}

.tesla-widget {
  grid-column: span 2;
  min-height: 208px;
  max-height: 208px;
  aspect-ratio: auto;
  overflow: visible;
}

.weather-widget-main,
.tesla-widget-main {
  display: grid;
  gap: 14px;
  align-items: center;
}

.weather-widget-main {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  height: auto;
  flex: 0 0 auto;
}

.weather-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  background: linear-gradient(180deg, #ffffff 0%, #eef3fb 100%);
  border: 1px solid rgba(220, 228, 240, 0.96);
  box-shadow: 0 10px 24px rgba(122, 142, 172, 0.12);
}

.weather-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  align-self: center;
}

.weather-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.weather-copy strong {
  font-size: 1.18rem;
  letter-spacing: -0.04em;
}

.weather-copy span {
  color: var(--muted);
  text-transform: capitalize;
}

.weather-right {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 12px;
  text-align: right;
}

.weather-temp {
  font-size: 2.05rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  color: var(--weather-accent, #8fa5c8);
  text-shadow: 0 8px 20px color-mix(in srgb, var(--weather-accent, #8fa5c8) 30%, transparent);
}

.weather-room-temp {
  display: grid;
  gap: 2px;
}

.weather-room-temp span {
  font-size: 0.76rem;
  color: var(--muted);
}

.weather-room-temp strong {
  font-size: 0.92rem;
  color: var(--weather-accent, #8fa5c8);
}

.printer-widget {
  grid-column: span 2;
  min-height: 172px;
  border-radius: 28px;
  padding: 16px;
  background: linear-gradient(180deg, #f7f9fd 0%, #edf2fb 100%);
  border: 1px solid rgba(214, 222, 236, 0.92);
  box-shadow: 0 18px 44px rgba(72, 96, 136, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

:root[data-theme="dark"] .printer-widget {
  background: linear-gradient(180deg, #182433 0%, #121c29 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.printer-widget-main {
  display: grid;
  gap: 12px;
  align-content: center;
  height: 100%;
}

.printer-cover {
  position: relative;
  height: 92px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(220, 228, 240, 0.92);
}

:root[data-theme="dark"] .printer-cover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.printer-cover img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 6px;
}

.printer-cover-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
}

.printer-cover-placeholder span {
  font-size: 2rem;
  line-height: 1;
}

.printer-cover-placeholder small {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.printer-cover.has-image .printer-cover-placeholder {
  display: none;
}

.printer-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.printer-progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(181, 197, 223, 0.38);
  border: 1px solid rgba(203, 217, 240, 0.92);
}

:root[data-theme="dark"] .printer-progress {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.printer-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #22c55e);
}

.printer-progress-row strong,
.printer-meta strong {
  font-size: 0.95rem;
  letter-spacing: -0.03em;
}

.printer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(220, 228, 240, 0.92);
  background: rgba(255, 255, 255, 0.62);
}

:root[data-theme="dark"] .printer-meta {
  color: #ecf4ff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.tesla-widget-main {
  height: 100%;
  grid-template-columns: minmax(190px, 1.2fr) minmax(150px, 0.8fr);
  gap: 10px;
  align-items: stretch;
}

.tesla-visual-block {
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f2f5fb 100%);
  border: 1px solid rgba(220, 228, 240, 0.95);
  min-width: 0;
}

.tesla-visual {
  width: 100%;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(54, 86, 132, 0.18));
}

.tesla-battery-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: -2px;
}

.tesla-battery-value {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.tesla-battery-bar {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #dce7db;
  border: 1px solid rgba(183, 208, 182, 0.9);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.tesla-battery-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #22c55e);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.4);
}

.tesla-data-list {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: center;
}

.tesla-data-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 228, 240, 0.92);
}

.tesla-data-item span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: #f1f5fb;
  font-size: 0.78rem;
}

.tesla-data-item strong,
.tesla-data-item small {
  display: block;
}

.tesla-data-item strong {
  font-size: 0.72rem;
  margin-bottom: 1px;
}

.tesla-data-item small {
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tesla-action-item {
  padding: 0;
  overflow: hidden;
}

.tesla-action-button {
  width: 100%;
  min-height: 100%;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  box-shadow: none;
}

.tesla-action-button span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: #f1f5fb;
  font-size: 0.78rem;
}

.tesla-widget.tesla-alert-charging {
  border-color: rgba(52, 199, 89, 0.82);
  box-shadow:
    0 0 0 1px rgba(52, 199, 89, 0.36),
    0 0 24px rgba(52, 199, 89, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  animation: teslaChargePulse 1.6s ease-in-out infinite;
}

.tesla-widget.tesla-alert-sentry {
  border-color: rgba(255, 69, 58, 0.86);
  box-shadow:
    0 0 0 1px rgba(255, 69, 58, 0.4),
    0 0 26px rgba(255, 69, 58, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

:root[data-theme="dark"] .tesla-widget.tesla-alert-charging {
  border-color: rgba(52, 199, 89, 0.96);
  box-shadow:
    0 0 0 1px rgba(52, 199, 89, 0.46),
    0 0 30px rgba(52, 199, 89, 0.34),
    0 0 12px rgba(52, 199, 89, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .tesla-widget.tesla-alert-sentry {
  border-color: rgba(255, 69, 58, 0.98);
  box-shadow:
    0 0 0 1px rgba(255, 69, 58, 0.48),
    0 0 32px rgba(255, 69, 58, 0.34),
    0 0 14px rgba(255, 69, 58, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@keyframes teslaChargePulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(52, 199, 89, 0.36),
      0 0 18px rgba(52, 199, 89, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(52, 199, 89, 0.46),
      0 0 34px rgba(52, 199, 89, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }
}

.dashboard-grid,
.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.home-shell,
.home-groups {
  display: grid;
  gap: 18px;
}

.home-group-card,
.home-empty-card {
  border-radius: 30px;
  padding: 20px;
}

.home-toolbar-card {
  position: relative;
  z-index: 12;
  border-radius: 28px;
  padding: 16px 18px;
  overflow: visible;
}

.home-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-add-button {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.home-add-panel {
  position: absolute;
  top: 68px;
  left: 18px;
  z-index: 80;
  display: none;
  width: min(440px, calc(100% - 36px));
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 255, 0.9));
  backdrop-filter: blur(42px) saturate(150%);
  -webkit-backdrop-filter: blur(42px) saturate(150%);
  box-shadow: 0 30px 90px rgba(46, 75, 120, 0.18);
  color: #101828;
}

.home-add-panel.open {
  display: block;
}

.home-option-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.home-label-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-input {
  min-height: 38px;
  padding: 8px 12px;
}

.mini-save {
  min-width: 76px;
  min-height: 38px;
}

.emoji-input {
  text-align: center;
  font-size: 1.1rem;
}

.home-option-button {
  display: grid;
  justify-items: start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(175, 190, 220, 0.34);
  background: rgba(255, 255, 255, 0.82);
  color: #101828;
  box-shadow: none;
}

.home-option-button.selected {
  border-color: rgba(10, 132, 255, 0.58);
  background: rgba(232, 243, 255, 0.96);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.14);
}

.home-option-button span {
  color: var(--muted);
  font-size: 0.82rem;
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.group-head h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

.home-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 210px));
  gap: 14px;
  align-items: start;
  justify-content: start;
}

.home-category-stack {
  display: grid;
  gap: 16px;
}

.home-category-card {
  border-radius: 28px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.home-category-title {
  margin-bottom: 12px;
  font-size: 0.92rem;
  color: var(--muted);
}

.home-device-card {
  position: relative;
  display: grid;
  gap: 12px;
  width: 210px;
  min-height: 132px;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56), 0 10px 28px rgba(50, 78, 116, 0.08);
}

.home-device-card.tappable {
  cursor: pointer;
}

.home-device-card.active-light {
  border-color: color-mix(in srgb, var(--light-glow, rgba(255, 214, 102, 0.74)) 72%, white);
  box-shadow:
    0 0 0 1px var(--light-glow-ring, rgba(255, 214, 102, 0.44)),
    0 0 var(--light-glow-size, 24px) var(--light-glow, rgba(255, 214, 102, 0.74)),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

:root[data-theme="dark"] .home-device-card.active-light {
  border-color: color-mix(in srgb, var(--light-glow, rgba(255, 214, 102, 0.84)) 78%, white 22%);
  box-shadow:
    0 0 0 1px var(--light-glow-ring, rgba(255, 214, 102, 0.56)),
    0 0 calc(var(--light-glow-size, 24px) * 1.35) var(--light-glow, rgba(255, 214, 102, 0.84)),
    0 0 calc(var(--light-glow-size, 24px) * 0.55) rgba(var(--light-glow-rgb, 255, 214, 102), 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.home-device-card.active-plug {
  border-color: rgba(52, 199, 89, 0.78);
  box-shadow:
    0 0 0 1px rgba(52, 199, 89, 0.34),
    0 0 22px rgba(52, 199, 89, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

:root[data-theme="dark"] .home-device-card.active-plug {
  border-color: rgba(52, 199, 89, 0.92);
  box-shadow:
    0 0 0 1px rgba(52, 199, 89, 0.48),
    0 0 28px rgba(52, 199, 89, 0.4),
    0 0 12px rgba(52, 199, 89, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.home-content-card {
  display: grid;
}

.home-device-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.home-device-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(239, 245, 255, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.62);
  font-size: 1.45rem;
}

.home-device-icon-glyph {
  display: inline-grid;
  place-items: center;
}

.active-fan .home-device-icon-glyph {
  animation: fan-spin 1.2s linear infinite;
}

.home-device-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.home-device-copy strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-device-copy span,
.home-device-meta {
  color: var(--muted);
}

.home-device-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.84rem;
}

.home-toggle-button {
  width: 100%;
}

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

.home-edit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-brightness-form {
  position: relative;
  z-index: 2;
  margin-top: -2px;
}

.home-brightness-range {
  width: 100%;
  height: 24px;
  padding: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.home-brightness-range::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(214,229,255,0.78));
  border: 1px solid rgba(255,255,255,0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 8px 18px rgba(102, 146, 212, 0.12);
}

.home-brightness-range::-webkit-slider-thumb {
  appearance: none;
  margin-top: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(233,242,255,0.92));
  border: 1px solid rgba(255,255,255,0.88);
  box-shadow: 0 10px 20px rgba(58, 113, 188, 0.18);
}

.home-brightness-range::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(214,229,255,0.78));
  border: 1px solid rgba(255,255,255,0.92);
}

.home-brightness-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(233,242,255,0.92));
  border: 1px solid rgba(255,255,255,0.88);
  box-shadow: 0 10px 20px rgba(58, 113, 188, 0.18);
}

.home-order-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.home-order-actions form {
  margin: 0;
}

.mini-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
}

.home-delete-badge {
  min-width: 64px;
  min-height: 36px;
  padding: 7px 10px;
}

.mini-select {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 14px;
}

.home-toggle-form {
  display: none;
}

.home-card-hit {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: none;
}

.home-device-top,
.home-edit-bar {
  position: relative;
  z-index: 2;
}

.home-category-form {
  position: relative;
  z-index: 2;
  margin-top: -2px;
}

.link-preview-icon {
  position: relative;
}

.link-preview-fallback {
  width: 100%;
  height: 100%;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
}

@keyframes fan-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.single-grid {
  display: grid;
  grid-template-columns: minmax(0, 540px);
}

.files-layout {
  display: grid;
  gap: 18px;
}

.compact-stack {
  display: grid;
  gap: 10px;
}

.file-upload-card {
  padding: 16px 18px;
  border-radius: 24px;
}

.compact-input {
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 16px;
}

.file-picker {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.file-native-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.file-picker-name {
  min-width: 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.small-submit {
  width: fit-content;
  min-width: 98px;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 0.92rem;
}

.files-list-card {
  position: relative;
  padding: 16px 18px;
  border-radius: 26px;
}

.files-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.files-toolbar-search {
  flex: 1 1 220px;
  min-width: 0;
}

.files-toolbar-search .search-input {
  width: 100%;
  max-width: none;
}

.files-toolbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.links-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.search-input {
  max-width: 280px;
}

.shortlinks-layout {
  display: grid;
  gap: 18px;
}

.shortlinks-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 28px;
}

.shortlinks-hero {
  display: grid;
  place-items: center;
  min-height: 240px;
}

.shortlinks-form {
  width: min(540px, 100%);
  margin: 0 auto;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 248, 255, 0.84));
  box-shadow: 0 24px 80px rgba(55, 85, 130, 0.12);
}

.shortlink-preview-line {
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.82);
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #23406b;
  letter-spacing: -0.02em;
}

.shortlink-preview-editable {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
}

.shortlink-preview-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.shortlink-preview-inline[hidden],
.shortlink-inline-edit-form[hidden],
.shortlink-target-inline-form[hidden] {
  display: none !important;
}

.shortlink-preview-text {
  display: block;
}

.shortlink-preview-prefix {
  flex: 0 0 auto;
  white-space: nowrap;
  color: #23406b;
}

.domain-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.domain-switch-option {
  min-width: 72px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.domain-switch-option.active {
  background: linear-gradient(135deg, #0a84ff, #60a5fa);
  color: #fff;
  box-shadow: 0 10px 28px rgba(10, 132, 255, 0.3);
}

.slug-mode-switch {
  display: inline-flex;
  gap: 8px;
  align-self: center;
  padding: 5px;
  border-radius: 999px;
  background: rgba(223, 233, 250, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.slug-mode-option {
  min-width: 82px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #365176;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.slug-mode-option.active {
  background: rgba(255, 255, 255, 0.96);
  color: #0f2748;
  box-shadow: 0 10px 22px rgba(86, 110, 150, 0.18);
}

.shortlinks-input {
  text-align: center;
}

.shortlinks-slug-input {
  text-align: center;
  text-transform: lowercase;
}

.shortlinks-slug-input::placeholder {
  color: transparent;
}

.shortlinks-submit {
  align-self: center;
}

.shortlinks-list {
  display: grid;
  gap: 12px;
}

.shortlinks-list-toolbar {
  margin-bottom: 0;
}

.shortlink-row {
  align-items: center;
  cursor: pointer;
}

.shortlink-favicon-wrap {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
}

.shortlink-favicon-edit-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 8;
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.5rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 20px rgba(29, 47, 80, 0.18);
  display: inline-grid;
  place-items: center;
  pointer-events: auto;
}

.shortlink-mobile-edit-badge {
  display: none;
}

.shortlink-favicon {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  position: relative;
  z-index: 1;
}

.shortlink-favicon-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
  opacity: 0.55;
}

.shortlink-meta span,
.shortlink-target span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortlink-target {
  opacity: 0.72;
}

.shortlink-target-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.shortlink-target-row .shortlink-target {
  flex: 1 1 auto;
  min-width: 0;
}

.shortlink-target-edit-button {
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  font-size: 0.76rem;
}

.shortlink-target-inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.shortlink-target-inline-input {
  flex: 1 1 auto;
  min-width: 0;
}

.shortlink-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.shortlink-delete-button {
  min-width: 46px;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.shortlink-mobile-menu-button,
.shortlink-mobile-menu {
  display: none;
}

.shortlink-mobile-menu-button {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.shortlink-mobile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 110px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 30px 78px rgba(35, 56, 94, 0.32);
  pointer-events: auto;
}

.shortlink-mobile-menu.open {
  display: grid;
  gap: 8px;
}

.shortlink-mobile-menu .share-action-button {
  min-height: 38px;
  padding: 10px 12px;
  pointer-events: auto;
}

.shortlink-mobile-edit-modal .confirm-modal-card {
  width: min(360px, calc(100vw - 28px));
}

.shortlink-mobile-action-modal {
  z-index: 120;
}

.shortlink-mobile-edit-modal {
  z-index: 121;
}

.shortlink-mobile-action-card {
  width: min(320px, calc(100vw - 28px));
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.98);
  box-shadow: 0 34px 90px rgba(24, 37, 64, 0.34);
}

.shortlink-mobile-action-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.shortlink-mobile-action-list .ghost-button {
  min-height: 42px;
}

.shortlink-mobile-edit-input {
  text-align: left;
}

.shortlink-hit-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.78);
  color: #5d7292;
  font-size: 0.82rem;
  font-weight: 700;
}

.shortlink-title-row {
  display: block;
}

.shortlink-inline-edit-form {
  width: 100%;
}

.shortlink-inline-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.shortlink-inline-prefix {
  flex: 0 0 auto;
  font-size: 0.84rem;
  font-weight: 700;
  color: #60728f;
  white-space: nowrap;
}

.shortlink-inline-input {
  flex: 1 1 auto;
  min-width: 0;
}

.shortlink-inline-save {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
}

.shortlink-inline-status {
  text-align: left;
  margin-top: 6px;
}

.shortlink-edit-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  font-size: 0.96rem;
}

.shortlink-status {
  min-height: 18px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #60728f;
}

.shortlink-status[data-state="success"] {
  color: #1f9d55;
}

.shortlink-status[data-state="danger"] {
  color: #d14343;
}

.shortlink-status[data-state="loading"] {
  color: #3d6fd6;
}

.inline-alert {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 0.92rem;
  font-weight: 700;
}

.inline-alert.danger {
  background: rgba(255, 104, 104, 0.12);
  color: #bf2f45;
  border: 1px solid rgba(255, 104, 104, 0.2);
}

.plus-fab {
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
}

.link-form-panel {
  position: absolute;
  top: 70px;
  left: 18px;
  z-index: 8;
  display: none;
  width: min(360px, calc(100% - 36px));
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 255, 0.9));
  backdrop-filter: blur(42px) saturate(150%);
  -webkit-backdrop-filter: blur(42px) saturate(150%);
  box-shadow: 0 30px 90px rgba(46, 75, 120, 0.18);
  color: #101828;
}

.file-form-panel {
  position: absolute;
  top: 70px;
  left: 18px;
  z-index: 8;
  display: none;
  width: min(360px, calc(100% - 36px));
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 255, 0.9));
  backdrop-filter: blur(42px) saturate(150%);
  -webkit-backdrop-filter: blur(42px) saturate(150%);
  box-shadow: 0 30px 90px rgba(46, 75, 120, 0.18);
  color: #101828;
}

.segmented-switch {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: rgba(232, 239, 250, 0.78);
}

.segmented-switch-button {
  min-width: 94px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 14px;
  background: transparent;
  color: #48607e;
  box-shadow: none;
}

.segmented-switch-button.active {
  background: rgba(255, 255, 255, 0.92);
  color: #101828;
  box-shadow: 0 8px 18px rgba(58, 90, 138, 0.12);
}

.category-edit-panel {
  position: absolute;
  top: 70px;
  left: 18px;
  z-index: 8;
  display: none;
  width: min(390px, calc(100% - 36px));
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 255, 0.9));
  backdrop-filter: blur(42px) saturate(150%);
  -webkit-backdrop-filter: blur(42px) saturate(150%);
  box-shadow: 0 30px 90px rgba(46, 75, 120, 0.18);
  color: #101828;
}

.link-form-panel.open {
  display: block;
}

.file-form-panel.open {
  display: block;
}

.category-edit-panel.open {
  display: block;
}

.link-form-panel input,
.file-form-panel input,
.category-edit-panel input {
  background: rgba(255, 255, 255, 0.88);
  color: #101828;
  border-color: rgba(175, 190, 220, 0.34);
}

.link-form-panel input::placeholder,
.file-form-panel input::placeholder,
.category-edit-panel input::placeholder {
  color: rgba(16, 24, 40, 0.42);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.04em;
  color: #101828;
}

.upload-status-row {
  min-height: 20px;
}

.upload-status {
  color: rgba(16, 24, 40, 0.62);
  font-size: 0.88rem;
}

.upload-status.success {
  color: #1f8f53;
  font-weight: 700;
}

.upload-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.upload-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #48c0ff);
  transition: width 120ms ease;
}

.file-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.file-open-hit {
  position: absolute;
  inset: 0 110px 0 0;
  z-index: 1;
  border-radius: 22px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.link-row {
  cursor: pointer;
}

.link-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 22px;
}

.link-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.link-tile {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 10px;
  min-height: 132px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
  cursor: pointer;
}

.link-copy-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 12;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.8rem;
  pointer-events: auto;
}

.link-tile .file-main {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.link-tile .file-copy {
  width: 100%;
}

.link-tile .file-title-row {
  justify-content: center;
}

.link-tile:hover {
  transform: translateY(-2px);
}

.link-hover-url {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -10px;
  opacity: 0;
  transform: translateY(8px);
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 20, 30, 0.94);
  color: #f4f8ff;
  font-size: 0.78rem;
  line-height: 1.35;
  word-break: break-word;
  pointer-events: none;
  box-shadow: 0 16px 36px rgba(10, 12, 18, 0.28);
  transition: opacity 160ms ease, transform 160ms ease;
}

.link-tile:hover .link-hover-url {
  opacity: 1;
  transform: translateY(0);
}

.link-delete-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 12;
  pointer-events: auto;
}

.mini-delete {
  min-width: 54px !important;
  min-height: 34px;
  padding: 6px 10px;
}

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

.file-main {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.file-preview {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.file-preview.image {
  overflow: hidden;
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.file-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-title-row h3 {
  margin: 0;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.file-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.file-actions .inline-form {
  margin-top: 0;
}

.file-actions .ghost-button,
.file-actions .inline-form button {
  min-width: 84px;
  text-align: center;
}

.share-actions {
  position: relative;
  z-index: 6;
}

.share-action-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: none;
  min-width: 148px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995), rgba(244, 247, 255, 0.985));
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  box-shadow: 0 26px 68px rgba(35, 56, 94, 0.24);
}

.share-action-menu.open {
  display: grid;
  gap: 8px;
}

.share-action-button {
  width: 100%;
  min-width: 0 !important;
  min-height: 40px;
  padding: 10px 12px;
}

.share-action-form {
  margin: 0;
}

:root[data-theme="dark"] .share-action-menu {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(21, 29, 40, 0.985), rgba(14, 20, 30, 0.975));
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.48);
}

.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 12, 0.42);
  backdrop-filter: blur(32px) saturate(145%);
  -webkit-backdrop-filter: blur(32px) saturate(145%);
}

.confirm-modal-backdrop.open {
  display: flex;
}

.confirm-modal-dismiss {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.confirm-modal-card {
  position: relative;
  z-index: 1;
  width: min(320px, calc(100vw - 32px));
  padding: 18px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 249, 255, 0.92));
  box-shadow: 0 26px 90px rgba(46, 75, 120, 0.2);
  color: #101828;
}

.confirm-modal-title {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.confirm-modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.preview-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  padding: 20px;
  background: rgba(8, 12, 18, 0.34);
  backdrop-filter: blur(32px) saturate(150%);
  -webkit-backdrop-filter: blur(32px) saturate(150%);
}

.preview-modal-backdrop.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-modal-dismiss {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
}

.preview-modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 32px));
  max-height: min(88vh, 920px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 255, 0.92));
  box-shadow: 0 30px 100px rgba(25, 40, 67, 0.24);
  color: #101828;
}

.preview-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-copy-button {
  min-width: 82px;
  min-height: 42px;
}

.preview-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.preview-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.preview-size {
  font-size: 0.92rem;
  font-weight: 600;
}

.preview-download-group {
  display: grid;
  gap: 8px;
  justify-items: end;
  min-width: 180px;
}

.preview-download-button {
  min-width: 92px;
  min-height: 42px;
}

.preview-download-progress {
  width: 180px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(181, 197, 223, 0.34);
  border: 1px solid rgba(203, 217, 240, 0.9);
}

.preview-download-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #48c0ff);
}

.files-toolbar-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.active-filter {
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(255, 255, 255, 0.78);
}

:root[data-theme="dark"] .active-filter {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

:root[data-theme="dark"] .shortlinks-form {
  background: linear-gradient(180deg, rgba(26, 32, 44, 0.96), rgba(16, 21, 31, 0.9));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .domain-switch {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .shortlink-preview-line {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #eef4ff;
}

:root[data-theme="dark"] .shortlink-preview-prefix {
  color: #eef4ff;
}

:root[data-theme="dark"] .shortlink-inline-prefix {
  color: #c7d5ea;
}

:root[data-theme="dark"] .slug-mode-switch {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .slug-mode-option {
  color: #c6d4ec;
}

:root[data-theme="dark"] .slug-mode-option.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

:root[data-theme="dark"] .shortlink-favicon-wrap {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .shortlink-hit-count {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  color: #d5e2f4;
}

:root[data-theme="dark"] .shortlink-mobile-menu {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(18, 24, 34, 1);
  box-shadow: 0 30px 72px rgba(0, 0, 0, 0.56);
}

:root[data-theme="dark"] .shortlink-mobile-menu-button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .shortlink-mobile-action-card {
  background: rgba(18, 24, 34, 1);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.56);
}

:root[data-theme="dark"] .shortlink-favicon-edit-badge {
  background: rgba(24, 32, 44, 0.98);
  border-color: rgba(255, 255, 255, 0.12);
  color: #eef4ff;
}

:root[data-theme="dark"] .stats-overview-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 48px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .stats-overview-item {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .inline-alert.danger {
  background: rgba(255, 104, 104, 0.14);
  color: #ffb1bc;
  border-color: rgba(255, 104, 104, 0.22);
}

.shared-page {
  min-height: 100vh;
  padding: 18px;
  display: grid;
  gap: 18px;
}

.shared-header {
  display: flex;
  align-items: center;
}

.shared-brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.shared-preview-shell {
  display: grid;
  place-items: center;
}

.shared-preview-card {
  width: min(980px, 100%);
  padding: 18px;
  border-radius: 30px;
  display: grid;
  gap: 16px;
}

.shared-preview-copy {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.shared-preview-copy h1 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
}

.shared-preview-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.shared-preview-body {
  min-height: min(68vh, 720px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 26px;
  background: rgba(238, 243, 251, 0.9);
  border: 1px solid rgba(215, 224, 238, 0.92);
}

:root[data-theme="dark"] .shared-preview-body {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.shared-preview-image,
.shared-preview-frame {
  width: 100%;
  height: min(68vh, 720px);
  display: block;
  border: 0;
}

.shared-preview-image {
  object-fit: contain;
}

.shared-preview-file {
  display: grid;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.shared-preview-file-icon {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.56);
}

.file-preview-generic {
  font-size: 1.3rem;
}

.preview-generic-file {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.preview-generic-file strong {
  color: var(--text);
  word-break: break-word;
}

.preview-generic-icon {
  width: 92px;
  height: 92px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.56);
}

.shared-empty-page {
  align-content: start;
}

.shared-empty-card {
  min-height: 320px;
  justify-items: center;
  text-align: center;
  align-content: center;
  gap: 12px;
}

.shared-empty-card h1 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.05em;
}

.shared-empty-card p {
  margin: 0;
  color: var(--muted);
}

.shared-empty-icon {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.66);
}

.shared-preview-bottom {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.shared-preview-meta {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
}

.shared-download-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(181, 197, 223, 0.34);
  border: 1px solid rgba(203, 217, 240, 0.9);
}

.shared-download-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #48c0ff);
}

:root[data-theme="dark"] .preview-modal-card {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(21, 29, 40, 0.96), rgba(14, 20, 30, 0.94));
  color: #f6f8fc;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.42);
}

.preview-modal-body {
  min-height: 320px;
  max-height: calc(88vh - 90px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(238, 243, 251, 0.9);
  border: 1px solid rgba(215, 224, 238, 0.92);
}

:root[data-theme="dark"] .preview-modal-body {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.preview-loading {
  display: grid;
  gap: 12px;
  justify-items: center;
  color: var(--muted);
}

.preview-spinner {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid rgba(120, 143, 180, 0.2);
  border-top-color: #0a84ff;
  animation: previewSpin 0.9s linear infinite;
}

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

.preview-image {
  max-width: 100%;
  max-height: calc(88vh - 120px);
  display: block;
  object-fit: contain;
}

.preview-frame {
  width: 100%;
  height: calc(88vh - 120px);
  border: 0;
  display: block;
  background: #ffffff;
}

:root[data-theme="dark"] .preview-frame {
  background: #111827;
}

.empty-state-inline {
  padding: 18px 0 6px;
  color: var(--muted);
}

.folder-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.folder-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-title {
  color: var(--muted);
}

.home-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.category-title-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.24);
}

.back-link {
  min-width: 110px;
}

.small-icon-fab {
  font-size: 1.15rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.document-folder-grid {
  margin-bottom: 16px;
}

.folder-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.14));
}

.category-card {
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 156px;
  justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.folder-edit-link-wrap {
  position: absolute;
  top: 12px;
  right: 12px;
}

.mini-folder-edit {
  width: 36px;
  height: 36px;
  min-width: 36px;
  font-size: 0.95rem;
}

.category-card:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.18));
  box-shadow: 0 18px 44px rgba(18, 33, 58, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.folder-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(255,255,255,0.52), rgba(255,255,255,0.24));
}

.category-icon-box {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(239, 245, 255, 0.3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 16px 30px rgba(69, 93, 138, 0.12);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.category-icon-box span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 1.8rem;
  line-height: 1;
}

.category-icon-box.small {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 18px;
}

.category-icon-box.small span {
  font-size: 1.45rem;
}

.folder-copy {
  display: grid;
  gap: 4px;
}

.category-card .folder-copy {
  width: 100%;
}

.category-card .folder-copy strong {
  font-size: 1rem;
  line-height: 1.2;
}

.folder-copy span {
  color: var(--muted);
  font-size: 0.9rem;
}

.compact-settings-card {
  padding: 18px;
  border-radius: 24px;
  display: grid;
  gap: 12px;
  max-width: 340px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-row.vertical {
  flex-direction: column;
  align-items: stretch;
}

.settings-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.settings-label {
  font-size: 0.86rem;
  color: var(--muted);
}

.theme-select {
  min-width: 140px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.34);
  color: var(--text);
  border-radius: 16px;
  padding: 10px 12px;
}

.tiny-input {
  max-width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 14px;
}

.tiny-submit {
  min-width: 74px;
  min-height: 34px;
  padding: 7px 11px;
}

.settings-form {
  gap: 8px;
}

.settings-form .small-submit {
  min-width: 76px;
}

.inline-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  width: fit-content;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #101828;
  border: 1px solid rgba(175, 190, 220, 0.34);
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.icon-picker-option {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 18px;
  border: 1px solid rgba(175, 190, 220, 0.32);
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

.icon-picker-option input {
  display: none;
}

.icon-picker-option:has(input:checked) {
  border-color: rgba(10, 132, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.14);
}

.compact-icon-picker {
  margin-top: 2px;
}

.category-select {
  appearance: none;
}

.category-new-wrap {
  display: grid;
  gap: 10px;
}

.modal-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.panel-block h2,
.item-head h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

.list-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.list-row,
.item-head,
.row-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.list-row span,
.item-head span,
.plain-link,
.item-card p {
  color: var(--muted);
}

.item-card p {
  line-height: 1.55;
}

.inline-form,
.top-gap {
  margin-top: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.34);
  color: var(--text);
  border-radius: 20px;
  padding: 15px 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

input::placeholder,
textarea::placeholder {
  color: rgba(18, 48, 79, 0.46);
}

textarea {
  resize: vertical;
  min-height: 150px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.check-row input {
  width: 18px;
  height: 18px;
}

.chip {
  display: inline-flex;
  justify-self: start;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
}

@media (max-width: 1100px) {
  .app-shell,
  .home-summary-grid,
  .dashboard-grid,
  .split-grid,
  .single-grid {
    grid-template-columns: 1fr;
  }

  .top-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .weather-widget,
  .printer-widget {
    grid-column: span 2;
  }

  .compact-stat-card {
    grid-column: span 1;
  }

  .tesla-widget {
    grid-column: span 2;
  }

  .stats-overview-card {
    grid-column: span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
    gap: 14px;
  }

  .mobile-bar {
    display: flex;
    margin-bottom: -4px;
  }

  .content-area {
    gap: 12px;
  }

  .top-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .widget-card {
    min-height: 0;
  }

  .compact-stat-card {
    grid-column: span 1;
    min-height: 82px;
    padding: 12px 14px;
  }

  .stats-overview-card {
    grid-column: span 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
    gap: 8px;
  }

  .stats-overview-item {
    padding: 12px 14px;
    border-radius: 18px;
  }

  .weather-widget,
  .tesla-widget {
    width: 100%;
    min-height: 176px;
    aspect-ratio: auto;
    padding: 14px;
    border-radius: 24px;
  }

  .weather-widget {
    min-height: 176px;
    max-height: 176px;
    justify-content: center;
    gap: 8px;
  }

  .tesla-widget {
    grid-column: span 1;
    min-height: 236px;
    max-height: none;
  }

  .weather-widget,
  .compact-stat-card,
  .printer-widget {
    grid-column: span 1;
  }

  .weather-widget-main {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    height: auto;
    align-items: center;
  }

  .tesla-widget-main {
    grid-template-columns: minmax(124px, 1fr) minmax(128px, 0.96fr);
    gap: 10px;
    align-items: stretch;
  }

  .weather-left {
    gap: 10px;
    align-self: center;
  }

  .weather-right {
    align-content: center;
    gap: 8px;
  }

  .weather-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 1.45rem;
  }

  .weather-temp {
    font-size: 1.45rem;
  }

  .weather-room-temp strong {
    font-size: 0.8rem;
  }

  .tesla-visual {
    height: 92px;
  }

  .tesla-visual-block {
    padding: 12px;
    border-radius: 18px;
    align-content: space-between;
  }

  .tesla-battery-value {
    font-size: 1rem;
  }

  .tesla-battery-row {
    margin-top: -4px;
    gap: 8px;
  }

  .tesla-data-list {
    gap: 8px;
    align-content: stretch;
  }

  .tesla-data-item,
  .tesla-action-button {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 6px;
    padding: 7px 8px;
    border-radius: 14px;
  }

  .tesla-action-item {
    min-height: 0;
  }

  .tesla-data-item span,
  .tesla-action-button span {
    width: 26px;
    height: 26px;
    border-radius: 10px;
    font-size: 0.78rem;
  }

  .tesla-data-item strong {
    font-size: 0.72rem;
  }

  .tesla-data-item small {
    font-size: 0.74rem;
  }

  .printer-widget {
    min-height: 150px;
    padding: 14px;
    border-radius: 22px;
  }

  .printer-cover {
    height: 58px;
    border-radius: 14px;
  }

  .printer-progress-row strong,
  .printer-meta strong {
    font-size: 0.82rem;
  }

  .home-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stat-card,
  .panel-block,
  .form-card,
  .item-card,
  .files-list-card {
    border-radius: 24px;
    padding: 16px;
  }

  .stat-card strong {
    font-size: 1.6rem;
  }

  .dashboard-grid,
  .split-grid,
  .single-grid {
    gap: 16px;
  }

  .home-device-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .home-device-card {
    width: 100%;
    min-height: 120px;
  }

  .home-device-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-device-copy {
    width: 100%;
  }

  .home-device-copy strong,
  .home-device-copy span {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .home-category-card {
    padding: 14px;
  }

  .list-row,
  .item-head,
  .row-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .row-actions .ghost-button,
  .inline-form,
  .inline-form button,
  .row-actions a {
    width: 100%;
  }

  .file-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .file-main {
    width: 100%;
    align-items: flex-start;
  }

  .file-title-row {
    flex-wrap: wrap;
  }

  .file-actions,
  .file-actions .ghost-button {
    width: 100%;
  }

  .share-action-menu {
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    min-width: 0;
  }

  .file-open-hit {
    inset: 0 0 52px 0;
  }

  .preview-modal-card {
    width: calc(100vw - 20px);
    max-height: 84vh;
    padding: 14px;
    border-radius: 24px;
  }

  .preview-modal-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-download-group,
  .preview-download-progress {
    width: 100%;
  }

  .shared-page {
    padding: 14px;
  }

  .shared-preview-card {
    padding: 14px;
    border-radius: 24px;
  }

  .shared-preview-body,
  .shared-preview-image,
  .shared-preview-frame {
    min-height: 48vh;
    height: 48vh;
  }

  .preview-modal-body {
    min-height: 240px;
    max-height: calc(84vh - 78px);
  }

  .preview-image,
  .preview-frame {
    max-height: calc(84vh - 104px);
    height: calc(84vh - 104px);
  }

  .link-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .link-tile {
    min-height: 112px;
    padding: 12px;
    border-radius: 18px;
  }

  .link-tile .file-main {
    gap: 8px;
  }

  .link-tile .file-preview {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    border-radius: 14px;
    flex: 0 0 46px;
  }

  .link-preview-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
  }

  .link-delete-badge {
    top: 8px;
    right: 8px;
    left: 8px;
  }

  .link-delete-badge .mini-delete {
    width: 100%;
    min-width: 0 !important;
    min-height: 32px;
    border-radius: 12px;
    background: rgba(255, 69, 58, 0.92);
    color: #fff;
  }

  .search-input,
  .small-submit {
    max-width: none;
    width: 100%;
  }

  .links-toolbar {
    align-items: stretch;
  }

  .plus-fab {
    width: 48px;
    height: 48px;
  }

  .files-toolbar {
    align-items: stretch;
    gap: 10px;
  }

  .files-toolbar-tabs,
  .files-toolbar-search,
  .files-toolbar-actions {
    width: 100%;
  }

  .files-toolbar-actions {
    margin-left: 0;
    justify-content: stretch;
  }

  .files-toolbar-actions .plus-fab {
    flex: 1 1 0;
    width: 100%;
  }

  .link-form-panel {
    left: 16px;
    right: 16px;
    width: auto;
  }

  .file-form-panel {
    left: 16px;
    right: 16px;
    width: auto;
  }

  .home-add-panel {
    left: 16px;
    right: 16px;
    width: auto;
  }

  .category-edit-panel {
    left: 16px;
    right: 16px;
    width: auto;
  }

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

  .category-card {
    min-height: 138px;
    padding: 14px;
  }

  .compact-settings-card {
    max-width: none;
  }

  .icon-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .file-picker {
    grid-template-columns: 1fr;
  }

  .shortlinks-card {
    padding: 16px;
  }

  .shortlinks-hero {
    min-height: auto;
  }

  .shortlinks-form {
    width: 100%;
    padding: 14px;
    border-radius: 24px;
  }

  .domain-switch {
    width: 100%;
    justify-content: center;
  }

  .domain-switch-option {
    flex: 1 1 0;
    min-width: 0;
  }

  .slug-mode-switch {
    width: 100%;
    justify-content: center;
  }

  .slug-mode-option {
    flex: 1 1 0;
    min-width: 0;
  }

  .shortlink-actions {
    width: 58px;
    min-width: 58px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    margin-left: 0;
    align-self: stretch;
  }

  .shortlink-hit-count {
    order: 1;
    min-height: 28px;
    padding: 0 6px;
    font-size: 0.7rem;
    justify-content: center;
  }

  .shortlink-edit-button,
  .shortlink-target-edit-button,
  .shortlink-delete-button {
    display: none !important;
  }

  .shortlink-favicon-edit-badge {
    display: none !important;
  }

  .shortlink-mobile-edit-badge {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    font-size: 0.52rem;
    border-radius: 999px;
    padding: 0;
    order: 2;
    line-height: 1;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.98);
  }

  .shortlink-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .shortlink-row .file-main {
    width: 100%;
    gap: 10px;
  }

  .shortlink-row .file-preview {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 14px;
  }

  .shortlink-favicon {
    width: 22px;
    height: 22px;
  }

  .shortlink-row .file-copy {
    gap: 4px;
  }

  .shortlink-row .file-title-row h3 {
    font-size: 0.9rem;
    max-width: 100%;
  }

  .shortlink-target-row {
    gap: 4px;
  }

  .shortlink-target {
    font-size: 0.76rem;
  }

  .shortlink-target-edit-button {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    min-width: 22px;
    font-size: 0.64rem;
  }

  .shortlink-target-inline-input,
  .shortlink-inline-input {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .shortlink-inline-prefix {
    font-size: 0.72rem;
  }

  .shortlink-inline-status,
  .shortlink-status {
    font-size: 0.72rem;
  }

  .shortlink-actions .inline-form,
  .shortlink-actions .ghost-button {
    width: auto;
  }

  input,
  textarea,
  button,
  .ghost-button,
  .nav-link {
    border-radius: 18px;
    padding: 13px 14px;
  }
}
