:root {
  --bg: #07151f;
  --bg-mid: #0c2433;
  --surface: rgba(14, 42, 58, 0.82);
  --surface-solid: #123447;
  --surface-hover: #18445c;
  --border: rgba(94, 196, 214, 0.22);
  --text: #eef8fb;
  --text-muted: #8fb4c4;
  --accent: #2ec4a0;
  --accent-hover: #45d9b4;
  --accent-deep: #1a9b7a;
  --accent-light: rgba(46, 196, 160, 0.16);
  --cyan: #3ec7e0;
  --cyan-soft: rgba(62, 199, 224, 0.16);
  --amber: #f0b429;
  --amber-soft: rgba(240, 180, 41, 0.16);
  --sky: #6eb8ff;
  --sky-soft: rgba(110, 184, 255, 0.16);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.14);
  --shadow: 0 10px 36px rgba(2, 16, 24, 0.55);
  --radius: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background:
    radial-gradient(ellipse 90% 55% at 12% -10%, rgba(62, 199, 224, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 45% at 92% 8%, rgba(46, 196, 160, 0.22), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(240, 180, 41, 0.08), transparent 55%),
    linear-gradient(165deg, #06121c 0%, #0a2a3a 45%, #071820 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  color-scheme: dark;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.header {
  padding: 2.75rem 0 2rem;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.header::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 3px;
  margin: 1.25rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--accent), var(--amber));
}

.header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, #dffaff 10%, var(--cyan) 45%, var(--accent) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background:
    linear-gradient(145deg, rgba(28, 78, 98, 0.55), rgba(12, 36, 50, 0.9)),
    var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.form-section {
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--cyan), var(--accent)) 1;
  border-image-slice: 1;
  border-width: 2px 1px 1px;
  border-style: solid;
  border-color: transparent var(--border) var(--border);
  border-top-color: transparent;
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(120, 220, 240, 0.12);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #d7f6ff;
}

.form-section-title {
  margin: 0.5rem 0 0.85rem;
  font-size: 0.9rem;
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.trip-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
}

.form-row--full {
  grid-template-columns: minmax(0, 1fr);
}

.form-row--submit {
  display: flex;
  justify-content: center;
  padding-top: 0.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.form-group label {
  font-size: 0.85rem;
  color: #9ec9d8;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 0.75rem;
  border: 1px solid rgba(94, 196, 214, 0.28);
  border-radius: 8px;
  background: rgba(5, 20, 30, 0.72);
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-group input,
.form-group select {
  height: 2.75rem;
}

.form-group input[type="date"],
.form-group input[type="time"] {
  display: block;
  -webkit-appearance: none;
  appearance: none;
  padding-inline: 0.65rem;
  font-size: 16px;
  overflow: hidden;
}

.form-group input[type="date"]::-webkit-date-and-time-value,
.form-group input[type="time"]::-webkit-date-and-time-value {
  text-align: left;
  min-width: 0;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="time"]::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 0;
  width: 1.1rem;
  height: 1.1rem;
  opacity: 0.7;
}

.form-group textarea {
  padding: 0.75rem 0.85rem;
  min-height: 6.5rem;
  resize: vertical;
  line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(62, 199, 224, 0.2);
  background: rgba(8, 28, 40, 0.9);
}

.btn {
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s, color 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-primary {
  background: linear-gradient(135deg, #1eb896 0%, #2ec4a0 45%, #3ec7e0 100%);
  color: #042018;
  min-width: 10rem;
  padding: 0.75rem 2rem;
  box-shadow: 0 6px 20px rgba(46, 196, 160, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #24c9a4 0%, #45d9b4 45%, #57d4ea 100%);
  box-shadow: 0 8px 24px rgba(62, 199, 224, 0.4);
}

.btn-secondary {
  background: rgba(20, 55, 72, 0.8);
  color: var(--text);
  border: 1px solid var(--border);
}

.badge {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-light), var(--cyan-soft));
  color: var(--accent);
  border: 1px solid rgba(46, 196, 160, 0.35);
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 1.15rem;
  padding: 0.3rem;
  background: rgba(5, 20, 30, 0.55);
  border: 1px solid rgba(94, 196, 214, 0.2);
  border-radius: 12px;
}

.tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.7rem 0.5rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tab.is-active {
  background: linear-gradient(135deg, rgba(46, 196, 160, 0.28), rgba(62, 199, 224, 0.22));
  color: #e8fffa;
  box-shadow: inset 0 0 0 1px rgba(94, 220, 200, 0.25);
}

.tab-panel[hidden] {
  display: none;
}

.list-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.filter-summary,
.match-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.trip-list,
.similar-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.empty-message {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1.5rem 0;
  text-align: center;
}

.trip-card {
  background: linear-gradient(160deg, rgba(10, 36, 48, 0.95), rgba(8, 28, 38, 0.98));
  border: 1px solid rgba(94, 196, 214, 0.2);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--accent);
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.trip-card:hover {
  border-color: rgba(62, 199, 224, 0.4);
  box-shadow: 0 6px 18px rgba(8, 40, 52, 0.45);
}

.trip-card__header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.trip-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e6fbff;
  padding-right: 0.25rem;
}

.trip-card__date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.trip-card__menu {
  position: relative;
  flex-shrink: 0;
}

.menu-toggle {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(94, 196, 214, 0.28);
  border-radius: 999px;
  background: rgba(5, 20, 30, 0.65);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.menu-toggle[aria-expanded="true"] {
  border-color: var(--cyan);
  background: rgba(62, 199, 224, 0.16);
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 8.5rem;
  padding: 0.35rem;
  background: #0d2736;
  border: 1px solid rgba(94, 196, 214, 0.35);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.menu-dropdown[hidden] {
  display: none;
}

.menu-item {
  width: 100%;
  display: block;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}

.menu-item:hover {
  background: rgba(62, 199, 224, 0.12);
}

.menu-item--danger {
  color: #ff8f8f;
}

.menu-item--danger:hover {
  background: rgba(255, 107, 107, 0.14);
}

.trip-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.chip--accent {
  background: var(--accent-light);
  border-color: rgba(46, 196, 160, 0.4);
  color: #6eebc8;
}

.chip--weather {
  background: var(--sky-soft);
  border-color: rgba(110, 184, 255, 0.4);
  color: #9dceff;
}

.chip--wind {
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.35);
  color: #c4b5fd;
}

.chip--temp {
  background: var(--amber-soft);
  border-color: rgba(240, 180, 41, 0.4);
  color: #f5cc5c;
}

.chip--catch {
  background: linear-gradient(135deg, var(--accent-light), var(--cyan-soft));
  border-color: rgba(46, 196, 160, 0.45);
  color: #6eebc8;
  font-weight: 700;
}

.chip--water {
  background: rgba(62, 199, 224, 0.12);
  border-color: rgba(62, 199, 224, 0.35);
  color: #7adff0;
}

.trip-card__note {
  font-size: 0.9rem;
  color: #d5ebf2;
  white-space: pre-wrap;
  line-height: 1.55;
}

.similar-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  background: linear-gradient(160deg, rgba(10, 36, 48, 0.95), rgba(8, 28, 38, 0.98));
  border: 1px solid rgba(94, 196, 214, 0.2);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.similar-item__main strong {
  display: block;
  margin-bottom: 0.2rem;
  color: #e6fbff;
}

.similar-item__sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.similar-item__score {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--amber);
  white-space: nowrap;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--amber-soft);
  border: 1px solid rgba(240, 180, 41, 0.35);
}

.footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(94, 196, 214, 0.18);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  .app {
    padding: 0 0.75rem 1.5rem;
  }

  .card {
    padding: 1rem;
  }

  .form-row,
  .list-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-group input[type="date"],
  .form-group input[type="time"] {
    min-height: 2.75rem;
    padding-left: 0.65rem;
    padding-right: 0.4rem;
  }

  .tab {
    font-size: 0.8rem;
    padding: 0.65rem 0.35rem;
  }

  .similar-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .similar-item__score {
    justify-self: start;
  }
}
