:root {
  color-scheme: dark;
  --ink: #f4f3f0;
  --muted: #a6a19a;
  --accent: #ffb05a;
  --accent-dark: #ff8a3d;
  --card: rgba(12, 16, 24, 0.68);
  --stroke: rgba(255, 255, 255, 0.12);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans JP", "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(68, 123, 150, 0.35), transparent 55%),
    radial-gradient(circle at 85% 20%, rgba(182, 120, 84, 0.25), transparent 55%),
    radial-gradient(circle at 50% 90%, rgba(58, 90, 130, 0.35), transparent 60%),
    linear-gradient(140deg, #0a0c12 0%, #121926 55%, #0b0f17 100%);
  background-size: 140% 140%, 140% 140%, 140% 140%, 180% 180%;
  background-position: 10% 20%, 85% 20%, 50% 90%, 0% 0%;
  animation: gradientShift 22s ease-in-out infinite alternate;
  overflow-x: hidden;
}

body video {
  position: fixed;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.18;
  z-index: 0;
  animation: drift 18s ease-in-out infinite alternate;
}

body::before {
  top: -140px;
  left: -120px;
  background: radial-gradient(circle, #3f6f8c 0%, transparent 68%);
}

body::after {
  bottom: -160px;
  right: -140px;
  background: radial-gradient(circle, #b47a4b 0%, transparent 68%);
  animation-delay: 4s;
}

.page {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 0 auto;
  padding: 72px 24px 64px;
  min-height: 100vh;
  display: grid;
  gap: 26px;
}

.hero,
.search-card,
.pins,
.foot {
  width: 100%;
  max-width: 1290px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  row-gap: 10px;
  font-size: 0.95rem;
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 3;
  width: auto;
  max-width: none;
  margin: 0;
}

.top-links {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.material-symbols-rounded {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
  font-size: 20px;
  line-height: 1;
}

.service {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 16, 24, 0.48);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.service:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(22, 28, 40, 0.72);
  color: var(--accent);
}

.hero {
  display: grid;
  gap: 10px;
  align-items: center;
  text-align: center;
  animation: rise 700ms ease forwards;
}

.badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  font-family: "Zen Kaku Gothic New", "Fraunces", "Times New Roman", serif;
  font-size: clamp(2.3rem, 4.6vw, 3.8rem);
  margin: 0;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 520px;
  margin-inline: auto;
}

.search-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  animation: rise 900ms ease 80ms forwards;
  opacity: 0;
}

.search-field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 14, 22, 0.58);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.search-field:focus-within {
  border-color: rgba(255, 176, 90, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 176, 90, 0.2);
}

.icon {
  width: 22px;
  height: 22px;
  fill: rgba(255, 255, 255, 0.65);
}

#query {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  font-family: inherit;
  color: var(--ink);
  outline: none;
}

#query::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.search-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 16, 24, 0.5);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(20, 26, 36, 0.85);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.logo {
  width: 22px;
  height: 22px;
  display: block;
}

.chatgpt-logo {
  color: #dcd6cc;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.long-prompt {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 176, 90, 0.4);
  background: rgba(255, 176, 90, 0.1);
  color: var(--ink);
  font-weight: 600;
  box-shadow:
    0 0 0 1px rgba(255, 176, 90, 0.18),
    0 14px 28px rgba(0, 0, 0, 0.35);
}

.long-prompt.show {
  display: flex;
}

.prompt-text {
  flex: 1;
}

.prompt-btn {
  border: 1px solid rgba(255, 176, 90, 0.6);
  background: rgba(255, 176, 90, 0.2);
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
  white-space: nowrap;
}

.prompt-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 176, 90, 0.32);
  border-color: rgba(255, 176, 90, 0.85);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.tip {
  font-weight: 500;
}

.suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.suggestions[hidden] {
  display: none;
}

.suggestions.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.suggestions li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(12, 16, 24, 0.66);
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
  animation: fadeIn 280ms ease forwards;
}

.suggestions li:hover,
.suggestions li.active {
  border-color: rgba(255, 176, 90, 0.5);
  transform: translateY(-1px);
}

.suggest-text {
  font-weight: 500;
}

.suggest-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.foot {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.pins {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 14, 22, 0.5);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
}

.pins-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pins-head h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.pins-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

.pin-edit-toggle {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
  white-space: nowrap;
}

.pin-edit-toggle:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.pin-edit-toggle[aria-pressed="true"] {
  border-color: rgba(255, 176, 90, 0.6);
  color: var(--accent);
}

.pin-slot {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(12, 16, 24, 0.5);
  color: rgba(255, 255, 255, 0.65);
  font: inherit;
  cursor: pointer;
  display: grid;
  align-items: center;
  justify-items: start;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  text-align: left;
  font-size: 0.9rem;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease;
  appearance: none;
}

.pin-slot:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--ink);
}

.pin-slot.filled {
  border-style: solid;
  color: var(--ink);
  background: rgba(18, 24, 34, 0.68);
}

.pin-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  width: 100%;
}

.pin-data {
  display: none;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  width: 100%;
}

.pin-slot.filled .pin-empty {
  display: none;
}

.pin-slot.filled .pin-data {
  display: grid;
}

.pin-slot .material-symbols-rounded {
  font-size: 22px;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.pin-favicon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  grid-row: 1 / span 2;
}

.pin-title {
  font-weight: 600;
  color: var(--ink);
}

.pin-url {
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-word;
}

.pin-label {
  font-weight: 600;
  word-break: break-word;
}

.pins.editing .pin-slot {
  border-color: rgba(255, 176, 90, 0.4);
}

.pins.editing .pin-slot:hover {
  border-color: rgba(255, 176, 90, 0.7);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: 5;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(420px, 92vw);
  background: rgba(12, 16, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

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

.modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
}

.modal-close:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.modal-form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.field input {
  background: rgba(8, 12, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.modal-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-form .ghost {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.modal-form .ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.modal-form .primary {
  border: none;
  background: var(--accent);
  color: #1c130a;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.modal-form .ghost:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.modal-form .primary:hover {
  background: var(--accent-dark);
}

body.modal-open {
  overflow: hidden;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translateY(0) translateX(0);
  }

  to {
    transform: translateY(24px) translateX(18px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShift {
  from {
    background-position: 10% 20%, 85% 20%, 50% 90%, 0% 0%;
  }

  to {
    background-position: 20% 10%, 75% 30%, 60% 80%, 100% 100%;
  }
}

@media (max-width: 720px) {
  .page {
    padding-top: 56px;
  }

  .topbar {
    justify-content: flex-end;
    top: 16px;
    right: 16px;
  }

  .search-field {
    grid-template-columns: auto 1fr;
  }

  .search-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .long-prompt {
    flex-direction: column;
    align-items: flex-start;
  }

  .prompt-btn {
    width: 100%;
  }

  .pins-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .pin-edit-toggle {
    width: 100%;
    text-align: center;
  }

  .meta {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* 一時的に情報を削除 */
.pin-favicon {
  width: 32px;
  height: 32px;
}

.pin-slot.filled .pin-data span {
  display: none;
}

.pin-slot.filled .pin-data {
  display: flex;
  align-content: center;
  justify-content: center;
}

/* 一時的に情報を削除 終わり*/