:root {
  --desktop-bg-start: #0d63b5;
  --desktop-bg-end: #0a58a3;
  --desktop-text: #0b1b2b;
  --desktop-muted: #5b6b7a;
  --desktop-icon-size: 84px;
  --desktop-icon-gap: 14px;
  --desktop-icon-label: #e9eef6;
  --desktop-taskbar-color: #ffffff;
  --desktop-taskbar-border: rgba(0, 0, 0, 0.08);
  --desktop-taskbar-height: 54px;
}

body.desktop-shell {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
  color: #fff;
  background: linear-gradient(160deg, var(--desktop-bg-start), var(--desktop-bg-end)) fixed;
  overflow-x: hidden;
  overflow-y: auto;
}

.desktop-shell a {
  color: inherit;
  text-decoration: none;
}

.desktop-shell .brand {
  position: absolute;
  left: 24px;
  top: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 42px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  user-select: none;
}

.desktop-shell .desktop {
  position: absolute;
  inset: 0;
  padding: 110px 24px 90px 24px;
}

.desktop-shell .desktop .icons {
  position: relative;
  width: 100%;
  height: 100%;
}

.desktop-shell .desktop-feed-note {
  position: absolute;
  top: 120px;
  right: 42px;
  width: min(320px, calc(100% - 96px));
  max-width: 360px;
  color: #1f2937;
  pointer-events: auto;
  z-index: 30;
}

.desktop-shell .desktop-feed-note__inner {
  background: linear-gradient(180deg, #fff9c4, #fde68a 68%, #fcd34d 100%);
  border-radius: 18px 18px 26px 26px;
  box-shadow: 0 14px 32px rgba(148, 163, 184, 0.35);
  padding: 22px 24px 24px;
  position: relative;
  isolation: isolate;
  transform: rotate(-1.5deg);
}

.desktop-shell .desktop-feed-note__inner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.6), transparent 62%),
    radial-gradient(circle at bottom right, rgba(253, 224, 71, 0.35), transparent 70%);
  opacity: 0.65;
  pointer-events: none;
  z-index: -1;
}

.desktop-shell .desktop-feed-note__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #92400e;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color 0.16s ease, transform 0.16s ease;
}

.desktop-shell .desktop-feed-note__close:hover,
.desktop-shell .desktop-feed-note__close:focus-visible {
  color: #7c2d12;
  outline: none;
  transform: translateY(-1px);
}

.desktop-shell .desktop-feed-note__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.desktop-shell .desktop-feed-note__title {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 700;
  color: #b45309;
}

.desktop-shell .desktop-feed-note__refresh {
  border: 1px solid rgba(217, 119, 6, 0.45);
  background: rgba(252, 211, 77, 0.4);
  color: #92400e;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.desktop-shell .desktop-feed-note__refresh:hover,
.desktop-shell .desktop-feed-note__refresh:focus-visible {
  background: rgba(251, 191, 36, 0.7);
  outline: none;
  transform: translateY(-1px);
}

.desktop-shell .desktop-feed-note__content {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #78350f;
  white-space: pre-wrap;
  word-break: break-word;
}

.desktop-shell .desktop-feed-note__status {
  margin: 0;
  font-size: 0.78rem;
  color: #92400e;
}

.desktop-shell .desktop-icon {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  display: inline-grid;
  justify-items: center;
  gap: 10px;
  cursor: grab;
  color: var(--desktop-icon-label);
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.35));
  text-align: center;
  position: absolute;
  top: var(--icon-top, 0);
  left: var(--icon-left, 0);
  bottom: var(--icon-bottom, auto);
  right: var(--icon-right, auto);
  touch-action: none;
  user-select: none;
}

.desktop-shell .desktop-icon.dragging {
  cursor: grabbing;
}

.desktop-shell .desktop-icon:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 4px;
  border-radius: 10px;
}

.desktop-shell .icon-image {
  width: var(--desktop-icon-size);
  height: var(--desktop-icon-size);
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: transparent;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.desktop-shell .icon-image img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
}

.desktop-shell .desktop-icon:hover .icon-image {
  transform: translateY(-2px);
}

.desktop-shell .desktop-icon span {
  max-width: 120px;
  display: block;
}

.desktop-shell .taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--desktop-taskbar-height);
  background: var(--desktop-taskbar-color);
  border-top: 1px solid var(--desktop-taskbar-border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: #1f2937;
}

.desktop-shell .taskbar * {
  color: inherit;
}

.desktop-shell .start-button {
  display: grid;
  place-items: center;
  width: 174px;
  height: 54px;
  padding: 0;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.05);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.desktop-shell .start-button:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.35);
  transform: translateY(-1px);
}

.desktop-shell .start-button:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.55);
  outline-offset: 2px;
}

.desktop-shell .start-button[aria-expanded="true"] {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(14, 165, 233, 0.45);
}

.desktop-shell .start-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.desktop-shell .taskbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.desktop-shell .tray {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #374151;
}

.desktop-shell .start-menu {
  position: fixed;
  left: 18px;
  bottom: calc(var(--desktop-taskbar-height) + 16px);
  width: min(360px, calc(100% - 36px));
  max-height: calc(100vh - (var(--desktop-taskbar-height) + 36px));
  background: rgba(248, 250, 252, 0.95);
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 28px 55px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(22px);
  padding: 18px 18px 20px;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 50;
  overflow-y: auto;
}

.desktop-shell .start-menu[hidden] {
  display: none;
}

.desktop-shell .start-menu-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.desktop-shell .start-menu-header strong {
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.desktop-shell .start-menu-header span {
  font-size: 0.85rem;
  color: #475569;
}

.desktop-shell .start-menu-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.desktop-shell .start-menu-separator {
  height: 1px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.58), rgba(148, 163, 184, 0.12));
  border-radius: 999px;
  margin: 2px 4px 6px;
}

.desktop-shell .start-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
  color: inherit;
}

.desktop-shell .start-menu-item:hover,
.desktop-shell .start-menu-item:focus-visible {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.24);
  outline: none;
  transform: translateY(-1px);
}

.desktop-shell .start-menu-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.18), rgba(14, 165, 233, 0.08));
  display: grid;
  place-items: center;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35);
}

.desktop-shell .start-menu-icon img {
  width: 60%;
  height: 60%;
  object-fit: contain;
  display: block;
}

.desktop-shell .start-menu-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.desktop-shell .start-menu-title {
  font-weight: 600;
  color: #0f172a;
}

.desktop-shell .start-menu-subtitle {
  font-size: 0.82rem;
  color: #4b5563;
}

.desktop-shell .desktop-app-root {
  position: fixed;
  right: 24px;
  bottom: calc(var(--desktop-taskbar-height) + 24px);
  width: min(560px, calc(100% - 72px));
  max-height: calc(100% - 180px);
  background: rgba(248, 250, 252, 0.98);
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 32px 65px rgba(15, 23, 42, 0.32);
  padding: 22px 24px;
  overflow: auto;
  color: #0f172a;
  z-index: 60;
}

.desktop-shell .desktop-app-root[hidden] {
  display: none;
}

.desktop-shell .desktop-app-root h2 {
  margin-top: 0;
}

.desktop-shell .desktop-app-placeholder {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.desktop-shell .desktop-app-placeholder p {
  margin: 0;
  color: #475569;
}

.desktop-shell .desktop-app-placeholder button {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.15);
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
}

.desktop-shell .settings-app {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.desktop-shell .settings-app__intro {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
}

.desktop-shell .settings-app__form {
  margin: 0;
}

.desktop-shell .settings-app__fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.desktop-shell .settings-app__fieldset legend {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.desktop-shell .settings-admin {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.desktop-shell .settings-admin__form {
  margin: 0;
}

.desktop-shell .settings-admin__fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.desktop-shell .settings-admin__label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: #0f172a;
}

.desktop-shell .settings-admin__label input,
.desktop-shell .settings-admin__label textarea {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.85);
  font: inherit;
  color: inherit;
}

.desktop-shell .settings-admin__textarea {
  min-height: 160px;
  resize: vertical;
}

.desktop-shell .settings-admin__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.desktop-shell .settings-admin__submit {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.15);
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
}

.desktop-shell .settings-admin__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.desktop-shell .settings-admin__force {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #0f172a;
}

.desktop-shell .settings-admin__force input {
  width: 20px;
  height: 20px;
  accent-color: #f59e0b;
}

.desktop-shell .settings-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(241, 245, 249, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.desktop-shell .settings-option:hover,
.desktop-shell .settings-option:focus-within {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 12px 24px rgba(148, 163, 184, 0.22);
  transform: translateY(-1px);
}

.desktop-shell .settings-option__control {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: #f59e0b;
}

.desktop-shell .settings-option__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.desktop-shell .settings-option__title {
  font-weight: 700;
  color: #0f172a;
}

.desktop-shell .settings-option__description {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.4;
}

.desktop-shell .settings-status {
  margin: 0;
  font-size: 0.85rem;
  color: #0f172a;
}

@media (min-width: 1200px) {
  .desktop-shell .brand {
    left: 36px;
    top: 32px;
    font-size: 46px;
  }

  .desktop-shell .desktop {
    padding-left: 36px;
  }
}

.about-dialog-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  z-index: 80;
}

.about-dialog {
  width: min(420px, calc(100% - 48px));
  background: rgba(248, 250, 252, 0.98);
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
  padding: 26px 28px 24px;
  color: #0f172a;
}

.about-dialog h2 {
  margin: 0 0 14px;
  font-size: 1.4rem;
}

.about-dialog__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 0.98rem;
}

.about-dialog__body p {
  margin: 0;
  line-height: 1.5;
  color: #1f2937;
}

.about-dialog__body a {
  color: #0ea5e9;
  font-weight: 600;
  text-decoration: none;
}

.about-dialog__body a:hover,
.about-dialog__body a:focus {
  text-decoration: underline;
}

.about-dialog__actions {
  display: flex;
  justify-content: flex-end;
}

.about-dialog__button {
  padding: 10px 22px;
  border-radius: 12px;
  border: 1px solid rgba(14, 165, 233, 0.45);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.92), rgba(59, 130, 246, 0.88));
  color: #f8fafc;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(14, 116, 233, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.about-dialog__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(14, 116, 233, 0.3);
}

.about-dialog__button:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.55);
  outline-offset: 3px;
}
