:root {
  --page-bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --line: #d9e0e8;
  --text: #17202a;
  --muted: #5d6b7a;
  --nav: #24313d;
  --nav-hover: #344554;
  --accent: #2f8f5b;
  --accent-hover: #26764c;
  --danger: #b42318;
  --shadow: 0 8px 24px rgba(23, 32, 42, 0.08);
  --radius: 8px;
}

* { box-sizing: border-box; }

html { background: var(--page-bg); }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.topnav {
  background: var(--nav) !important;
  min-height: 56px;
  box-shadow: 0 2px 12px rgba(23, 32, 42, 0.18);
}

.topnav a {
  color: #fff !important;
  padding: 17px 18px !important;
  font-size: 16px !important;
  font-weight: 600;
  line-height: 22px;
}

.topnav a:hover {
  background: var(--nav-hover) !important;
  color: #fff !important;
}

.topnav a.active {
  background: var(--accent) !important;
  color: #fff !important;
}

body > div[style*="padding-left:16px"] {
  max-width: 1220px;
  margin: 24px auto;
  padding: 0 20px !important;
}

h1, h2 {
  margin: 0 0 22px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
}

h2 { font-size: 28px; }

p {
  max-width: 980px;
  margin: 0 0 14px;
  color: var(--text);
}

a { color: #1f5fbf; }

table {
  border-collapse: separate;
  border-spacing: 0;
}

table:not(.guest-wishlist-table) {
  width: auto;
}

#members table,
.guest-wishlist-table {
  width: 100%;
  max-width: 1180px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

#members th,
.guest-wishlist-table th {
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

#members td,
.guest-wishlist-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

#members tr:last-child td,
.guest-wishlist-table tr:last-child td {
  border-bottom: 0;
}

#members tr[bgcolor="lightgrey"],
.guest-wishlist-table tr[bgcolor="lightgrey"] {
  background: #f0f3f7 !important;
}

#members tr:not([bgcolor]) { background: #fff; }

button,
input[type="button"],
input[type="submit"] {
  appearance: none;
  border: 1px solid #b8c4d0;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 6px 12px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(23, 32, 42, 0.08);
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
  background: #eef4ff;
  border-color: #8aa8d8;
}

input[type="submit"],
input[name="create_wish_submit_button"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

input[type="submit"]:hover,
input[name="create_wish_submit_button"]:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea {
  border: 1px solid #b8c4d0;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

input[type="text"],
input[type="password"],
textarea {
  min-width: min(360px, 82vw);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

form table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

form td { padding: 8px; }

.wish-thumb {
  width: 56px !important;
  height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
}

.wish-thumb:hover {
  transform: scale(2.15);
  position: relative;
  z-index: 20;
  box-shadow: 0 8px 28px rgba(23, 32, 42, 0.24);
}

.wish-image-cell {
  width: 78px !important;
  min-width: 78px;
  text-align: center;
}

.wishlist-drag-handle {
  color: var(--muted) !important;
}

.wishlist-row-drop-target {
  outline: 2px dashed var(--accent) !important;
  outline-offset: -3px;
}

.image-popup {
  background: rgba(8, 13, 20, 0.76) !important;
}

.image-popup img {
  border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(0,0,0,0.32);
}

.image-popup-close {
  background: rgba(23, 32, 42, 0.88) !important;
}

@media screen and (max-width: 700px) {
  body { font-size: 15px; }
  h2 { font-size: 24px; }
  body > div[style*="padding-left:16px"] {
    margin: 16px auto;
    padding: 0 10px !important;
  }
  .topnav a { padding: 14px 16px !important; }
  #members table,
  .guest-wishlist-table {
    font-size: 14px;
  }
  #members th,
  #members td,
  .guest-wishlist-table th,
  .guest-wishlist-table td {
    padding: 8px 6px;
  }
  button,
  input[type="button"],
  input[type="submit"] {
    padding: 5px 9px;
  }
}
