:root {
  color-scheme: light;
  --page-background: #ffffff;
  --panel-background: #ffffff;
  --text-primary: #161616;
  --text-secondary: #161616;
  --accent: #0b99ff;
  --app-cursor: url("./Cursor.svg") 6 6, default;
  --panel-border: rgba(11, 153, 255, 0.2);
  --plugin-background:
    linear-gradient(180deg, rgba(11, 153, 255, 0.1) 0%, rgba(255, 255, 255, 0.1) 100%),
    linear-gradient(90deg, #ffffff 0%, #ffffff 100%);
  --placeholder-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.03),
    0 2px 5px -2px rgba(0, 0, 0, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--page-background);
  color: var(--text-primary);
  cursor: var(--app-cursor);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: var(--app-cursor);
}

a {
  cursor: var(--app-cursor);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.web-page {
  width: min(768px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.top-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 40px;
}

.brand-mark {
  width: 40px;
  height: 40px;
}

.brand-name {
  margin: 0;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.plugin-container {
  min-height: 432px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0.6px solid var(--panel-border);
  border-radius: 9px;
  background: var(--plugin-background);
}

.plugin-placeholder {
  --plugin-ui-bg: #ffffff;
  --plugin-ui-bg-hover: #f5f5f5;
  --plugin-ui-bg-secondary: #f3f3f3;
  --plugin-ui-bg-tertiary: #ebebeb;
  --plugin-ui-border: #e6e6e6;
  --plugin-ui-text: #1e1e1e;
  --plugin-ui-text-secondary: #757575;
  --plugin-ui-text-tertiary: #b3b3b3;
  --plugin-ui-icon: #1e1e1e;
  --plugin-ui-icon-tertiary: #b3b3b3;
  --plugin-ui-icon-onbrand: #ffffff;
  --plugin-ui-brand: var(--accent);
  width: 224px;
  height: auto;
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel-background);
  box-shadow: var(--placeholder-shadow);
}

.plugin-placeholder .app {
  display: flex;
  flex-direction: column;
  background: var(--plugin-ui-bg);
  color: var(--plugin-ui-text);
}

.plugin-placeholder .header-bar {
  padding: 8px;
  border-bottom: 1px solid var(--plugin-ui-border);
  background: var(--plugin-ui-bg);
  flex-shrink: 0;
}

.plugin-placeholder .tab-group {
  display: flex;
  gap: 4px;
  align-items: center;
}

.plugin-placeholder .tab {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--plugin-ui-text-secondary);
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  cursor: default;
  outline: none;
}

.plugin-placeholder .tab:hover {
  background: var(--plugin-ui-bg-hover);
}

.plugin-placeholder .tab.selected {
  background: var(--plugin-ui-bg-secondary);
  color: var(--plugin-ui-text);
}

.plugin-placeholder .item-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: var(--plugin-ui-bg);
}

.plugin-placeholder .todo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-left: 8px;
  border-radius: 5px;
  position: relative;
  cursor: default;
}

.plugin-placeholder .todo-item:hover {
  background: var(--plugin-ui-bg-hover);
}

.plugin-placeholder .item-inner {
  display: flex;
  flex: 1 0 0;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  min-height: 1px;
  padding: 4px 0;
}

.plugin-placeholder .radio-container {
  display: flex;
  align-items: center;
  padding-top: 1px;
  flex-shrink: 0;
}

.plugin-placeholder .radio-btn {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.plugin-placeholder .item-text {
  flex: 1 0 0;
  min-width: 0;
  min-height: 1px;
  color: var(--plugin-ui-text);
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.plugin-placeholder .todo-item.done .item-text {
  color: var(--plugin-ui-text-tertiary);
}

.plugin-placeholder .btn-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  visibility: hidden;
  pointer-events: none;
  flex-shrink: 0;
}

.plugin-placeholder .btn-remove:hover {
  background: var(--plugin-ui-bg-tertiary);
}

.plugin-placeholder .todo-item:hover .btn-remove {
  visibility: visible;
  pointer-events: auto;
}

.plugin-placeholder .action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  cursor: default;
  flex-shrink: 0;
}

.plugin-placeholder .action-row:hover {
  background: var(--plugin-ui-bg-hover);
}

.plugin-placeholder .action-row.editing:hover {
  background: transparent;
}

.plugin-placeholder .action-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plugin-placeholder .action-label {
  color: var(--plugin-ui-text);
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
}

.plugin-placeholder .inline-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--plugin-ui-text);
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  outline: none;
  cursor: text;
}

.plugin-placeholder .todo-item.dragging {
  opacity: 0.4;
}

.plugin-placeholder .todo-item.drag-over {
  background: transparent;
}

.plugin-placeholder .todo-item.drag-over::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--plugin-ui-brand);
}

.bottom-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.credit-copy {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
}

.credit-link {
  color: var(--accent);
  text-decoration: none;
}

.credit-link:hover,
.credit-link:focus-visible {
  text-decoration: underline;
}

.install-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 24px;
  padding: 0 8px 0 10px;
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 140ms ease, transform 140ms ease;
}

.install-button:hover {
  filter: brightness(0.96);
  cursor: var(--app-cursor);
}

.install-button:active {
  transform: translateY(1px);
}

.install-button:focus-visible {
  outline: 2px solid #7cc8ff;
  outline-offset: 2px;
}

.install-button__icon {
  width: 9.7489871979px;
  height: 14px;
  flex: 0 0 auto;
}

@keyframes fade-up {
  from {
    opacity: 0;
    translate: 0 10px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.top-row,
.plugin-container,
.bottom-row {
  animation: fade-up 400ms ease both;
}

.top-row        { animation-delay:   0ms; }
.plugin-container { animation-delay: 100ms; }
.bottom-row     { animation-delay: 200ms; }

@media (prefers-reduced-motion: reduce) {
  .top-row,
  .plugin-container,
  .bottom-row {
    animation: none;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page-background:
      radial-gradient(circle at top, rgba(68, 68, 68, 0.8) 0%, rgba(44, 44, 44, 0.98) 28%, #1f1f1f 100%);
    --panel-background: #2c2c2c;
    --text-primary: #ffffff;
    --text-secondary: #c0c0c0;
    --panel-border: rgba(255, 255, 255, 0.1);
    --plugin-background:
    linear-gradient(180deg, rgba(11, 153, 255, 0.10) 0%, rgba(39, 39, 39, 0.10) 100%), #2C2C2C;
    --placeholder-shadow:
      0 24px 48px -20px rgba(0, 0, 0, 0.85),
      0 12px 24px -12px rgba(0, 0, 0, 0.45);
  }

  .plugin-placeholder {
    --plugin-ui-bg: #2c2c2c;
    --plugin-ui-bg-hover: #383838;
    --plugin-ui-bg-secondary: #383838;
    --plugin-ui-bg-tertiary: #444444;
    --plugin-ui-border: #444444;
    --plugin-ui-text: #ffffff;
    --plugin-ui-text-secondary: #c0c0c0;
    --plugin-ui-text-tertiary: rgba(255, 255, 255, 0.3);
    --plugin-ui-icon: #ffffff;
    --plugin-ui-icon-tertiary: #ffffff;
    --plugin-ui-icon-onbrand: #ffffff;
  }

  .plugin-container {
    border-color: rgba(255, 255, 255, 0.08);
  }

  .credit-link {
    color: #52b6ff;
  }

  .install-button {
    box-shadow: 0 10px 20px -12px rgba(11, 153, 255, 0.7);
  }

  .install-button:focus-visible {
    outline-color: #a4ddff;
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding: 20px 16px;
    place-items: start;
  }

  .plugin-container {
    height: 70vh;
    min-height: 280px;
    padding: 24px;
  }

  .plugin-placeholder {
    width: min(224px, calc(100% - 48px));
  }

  .bottom-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand-name, .credit-copy, .install-button {
    font-size: 13px;
    line-height: 18px;
  }
  .credit-copy {
    text-wrap: balance;
  }

  .install-button {
    height: 28px;
  }
}

@media (hover: none) {
  .plugin-placeholder .btn-remove {
    visibility: visible;
    pointer-events: auto;
  }
}
