[v-cloak] {
  display: none;
}

:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  background: #111214;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#app {
  min-height: 100vh;
  --bg: #111214;
  --panel: #191b1f;
  --panel-hover: #202329;
  --text: #eceff3;
  --muted: #8e959f;
  --border: #2a2d33;
  --accent: #d8dbe0;
  --danger: #d97878;

  background-color: var(--bg);
  color: var(--text);
}

#app.theme-light {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-hover: #f0f1f3;
  --text: #202328;
  --muted: #727982;
  --border: #d9dde2;
  --accent: #30343a;
  --danger: #a64f4f;
}

#app.bg-plain {
  background-image: none;
}

#app.bg-grid {
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--border) 35%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--border) 35%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
}

#app.bg-dots {
  background-image:
    radial-gradient(circle, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1.5px);
  background-size: 24px 24px;
}

#app.bg-radial {
  background-image:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--panel-hover) 70%, transparent), transparent 45%);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.page {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 9vh 0 36px;
}

.hero {
  text-align: center;
  margin-bottom: 64px;
}

.clock {
  font-size: clamp(4rem, 11vw, 8.5rem);
  font-weight: 250;
  line-height: .95;
  letter-spacing: -.07em;
}

.date {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
  text-transform: capitalize;
}

.search {
  display: flex;
  width: min(680px, 100%);
  margin: 38px auto 0;
  gap: 8px;
}

.search select {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--muted);
  padding: 0 12px;
  outline: none;
  cursor: pointer;
}

.search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  padding: 15px 18px;
  outline: none;
  transition:
    border-color .15s ease,
    background .15s ease;
}

.search input:focus {
  border-color: #4a4f58;
  background: var(--panel-hover);
}

.groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 36px;
}

.group-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-bottom: 12px;
}

.group h2 {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
}

.group-actions {
  position: absolute;
  right: 0;
  display: flex;
  gap: 6px;
}

.group-actions button,
.footer button,
.import-label {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.group-actions button:hover,
.footer button:hover,
.import-label:hover {
  color: var(--text);
}

.links {
  display: grid;
  gap: 8px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  text-decoration: none;
  transition:
    background .12s ease,
    border-color .12s ease,
    transform .12s ease;
}

.link:hover {
  background: var(--panel);
  border-color: var(--border);
  transform: translateY(-1px);
}

.link-icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  overflow: hidden;
  font-size: .9rem;
  font-weight: 700;
}

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

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

.add-link {
  width: 100%;
  border: 1px dashed var(--border);
  background: transparent;
  cursor: pointer;
}

.edit-link {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: .65;
}

.edit-link:hover {
  opacity: 1;
  color: var(--text);
}

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 70px;
  color: var(--muted);
  font-size: .82rem;
  flex-wrap: wrap;
}

.footer .danger {
  color: var(--danger);
}

.footer-select {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.footer-select:hover,
.footer-select:focus {
  color: var(--text);
  outline: none;
}

.import-label input {
  display: none;
}

dialog {
  width: min(520px, calc(100% - 32px));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 20px 70px rgb(0 0 0 / .45);
}

dialog::backdrop {
  background: rgb(0 0 0 / .55);
  backdrop-filter: blur(3px);
}

.dialog-form {
  padding: 24px;
}

.dialog-form h3 {
  margin: 0 0 24px;
}

.dialog-form label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: .85rem;
}

.dialog-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

.dialog-form input:focus {
  border-color: #4a4f58;
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.dialog-actions button {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  padding: 9px 13px;
  cursor: pointer;
}

.dialog-actions .primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.dialog-actions .danger {
  color: var(--danger);
}

.help-text {
  color: var(--muted);
  line-height: 1.55;
}

.json-example {
  overflow-x: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: .8rem;
  line-height: 1.5;
}

.spacer {
  flex: 1;
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 28px, 1180px);
    padding-top: 7vh;
  }

  .hero {
    margin-bottom: 46px;
  }

  .groups {
    gap: 30px;
  }

  .footer {
    margin-top: 48px;
  }
}

@media (max-width: 520px) {
  .search {
    flex-direction: column;
  }

  .search select {
    min-height: 46px;
  }
}
