:root {
  --ink: #10303b;
  --ink2: #4a6670;
  --bg: #eef1ef;
  --card: #fff;
  --line: #d3dcd9;
  --river: #1d7a8c;
  --amber: #f2a900;
  --deep: #0d2a33;
  --deep-ink: #e8f1f0;
  --mark: #ffe29a;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6efee;
    --ink2: #9db6b8;
    --bg: #0b1b21;
    --card: #12292f;
    --line: #24424a;
    --river: #5cc0d3;
    --deep: #071418;
    --mark: #6b5200;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #e6efee;
  --ink2: #9db6b8;
  --bg: #0b1b21;
  --card: #12292f;
  --line: #24424a;
  --river: #5cc0d3;
  --deep: #071418;
  --mark: #6b5200;
  color-scheme: dark;
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15.5px/1.55 "Public Sans", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--deep);
  z-index: 40;
}

h1, h2, h3 {
  font-family: "Nunito", "Public Sans", system-ui, sans-serif;
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 6px;
}

header.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--deep);
  color: var(--deep-ink);
}

.bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  max-width: 1360px;
  margin: 0 auto;
}

.bar .brand {
  flex: none;
}

.bar img {
  height: 44px;
  width: auto;
  display: block;
}

.bar .bar-title {
  flex: 1;
  min-width: 0;
}

.bar small {
  display: block;
  font-size: 12px;
  color: #a9c4c6;
  line-height: 1.3;
}

.bar h1 {
  font-size: 19px;
  font-weight: 800;
}

.th {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #2c525b;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 17px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.th:first-of-type {
  margin-left: auto;
}

.th:hover {
  border-color: var(--river);
  background: color-mix(in srgb, var(--river) 8%, transparent);
}

@media (max-width: 600px) {
  .bar small {
    display: none;
  }
  .bar img {
    height: 38px;
  }
}

.app {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 18px 40px;
  align-items: start;
}

.side {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 76px);
  max-height: calc(100dvh - 96px - env(safe-area-inset-top, 0px));
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.sq {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.sq form {
  margin: 0;
}

.sq input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px 0 42px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234a6670' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") 13px center no-repeat;
  color: var(--ink);
  font: 400 16px "Public Sans", sans-serif;
}

.sq input:focus {
  outline: none;
  border-color: var(--river);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--river) 28%, transparent);
}

.cnt {
  font-size: 13px;
  color: var(--ink2);
  margin: 8px 2px 0;
}

.list {
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.it {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  border: 1.5px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.it:hover {
  background: color-mix(in srgb, var(--river) 9%, transparent);
}

.it.on {
  border-color: var(--river);
  background: color-mix(in srgb, var(--river) 12%, transparent);
}

.th72 {
  width: 72px;
  height: 60px;
  border-radius: 9px;
  background: var(--line) center/cover;
  display: grid;
  place-items: center;
  color: var(--ink2);
  flex-shrink: 0;
}

.it b {
  font: 700 15px "Nunito", sans-serif;
  display: block;
}

.it span {
  display: block;
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.35;
}

mark {
  background: var(--mark);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.tag {
  display: inline-block;
  font-family: "Nunito", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--amber) 28%, transparent);
  margin-left: 6px;
  vertical-align: 1px;
}

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--ink2);
}

.sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.sh {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
}

.sh img {
  height: 64px;
  width: auto;
  flex: none;
}

.sh small {
  display: block;
  font-family: "Nunito", sans-serif;
  font-size: 12.5px;
  color: var(--ink2);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  margin-top: 8px;
  font-size: 14.5px;
}

.kv dt {
  color: var(--ink2);
  font-family: "Nunito", sans-serif;
  font-weight: 600;
}

.kv dd {
  margin: 0;
  font-weight: 600;
}

.kv dd.big {
  font: 800 22px "Nunito", sans-serif;
}

.band {
  background: var(--deep);
  color: var(--deep-ink);
  font-size: 14px;
  font-weight: 700;
  padding: 9px 20px;
  font-family: "Nunito", sans-serif;
  letter-spacing: 0.02em;
}

.ph {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 16px 20px 20px;
}

.ph figure {
  margin: 0;
}

.ph button, .ph .na {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 0;
  background: var(--bg);
  cursor: zoom-in;
  transition: border-color 0.2s ease;
}

.ph button:hover {
  border-color: var(--river);
}

.ph .na {
  display: grid;
  place-items: center;
  cursor: default;
  border-style: dashed;
  color: var(--ink2);
  font-size: 13px;
  text-align: center;
  padding: 8px;
}

.ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ph figcaption {
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  margin-top: 7px;
}

.info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  margin: 0;
  border-top: 1px solid var(--line);
}

.info div {
  background: var(--card);
  padding: 12px 20px;
}

.info dt {
  font-family: "Nunito", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
}

.info dd {
  margin: 2px 0 0;
  font: 700 19px "Nunito", sans-serif;
}

.info dd small {
  font: 500 13px "Public Sans", sans-serif;
  color: var(--ink2);
  display: block;
}

.acts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  font: 600 14.5px "Public Sans", sans-serif;
  text-decoration: none;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  border-color: var(--river);
}

.btn.p {
  background: var(--amber);
  border-color: var(--amber);
  color: #3a2a00;
}

.btn.p:hover {
  background: color-mix(in srgb, var(--amber) 90%, black);
}

.back {
  display: none;
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--river);
  text-decoration: none;
}

.back:hover {
  text-decoration: underline;
}

.hint {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink2);
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100dvh;
  width: min(1000px, 96vw);
  color: #fff;
}

dialog::backdrop {
  background: rgba(5, 15, 18, 0.88);
}

.lb {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.lb img {
  width: 100%;
  max-height: 78dvh;
  object-fit: contain;
  border-radius: 10px;
}

.lb .c {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.lb button {
  min-height: 44px;
  min-width: 44px;
  border-radius: 10px;
  border: 1px solid #ffffff55;
  background: #0d2a33;
  color: #fff;
  font: 600 15px "Public Sans", sans-serif;
  cursor: pointer;
  padding: 0 14px;
  transition: background 0.2s ease;
}

.lb button:hover {
  background: #1a3d4a;
}

.lb #lbCaption {
  flex: 1;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    padding: 14px 12px 32px;
  }
  .side {
    position: static;
    max-height: none;
  }
  .list {
    overflow: visible;
  }
  body.sel .side {
    display: none;
  }
  body:not(.sel) .main {
    display: none;
  }
  .back {
    display: inline-block;
  }
  .sh {
    padding: 14px;
  }
  .ph {
    padding: 12px 14px 16px;
    gap: 10px;
  }
  .band {
    padding: 9px 14px;
  }
  .info div {
    padding: 11px 14px;
  }
  .acts {
    padding: 14px;
  }
}

@media (max-width: 420px) {
  .sh {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media print {
  header.top, .side, .back, .acts, .th {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .app {
    display: block;
    padding: 0;
  }
  .main {
    display: block !important;
  }
  .sheet {
    border: 0;
    border-radius: 0;
  }
  .ph figure {
    break-inside: avoid;
  }
  .band, .info div {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
