/* ==================== POLAROIDS & IMAGES ==================== */
.pol {
  background: #fff;
  padding: 10px 10px 36px;
  box-shadow: 0 8px 24px rgba(42, 34, 26, 0.22);
  position: relative;
  z-index: 2;
  max-width: 44%;
  margin: 14px 0 18px;
  border-radius: 3px;
  transition: transform .25s ease, box-shadow .25s ease;
  box-sizing: border-box;
}

.pol:hover {
  transform: scale(1.02) rotate(-0.5deg);
  box-shadow: 0 14px 34px rgba(42, 34, 26, 0.32);
}

.pol.left { float: left; margin-right: 20px; }
.pol.right { float: right; margin-left: 20px; }
.pol.big { max-width: 48%; }

.pol img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  border-radius: 2px;
  filter: sepia(.05) contrast(1.03);
}

.pol figcaption {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-calligraphy);
  font-size: 13.5px;
  color: var(--ink2);
  letter-spacing: .04em;
  padding: 0 8px;
}

.tp {
  position: absolute;
  width: 76px;
  height: 22px;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  z-index: 3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.tp.t1 { background: var(--tp1); }
.tp.t2 { background: var(--tp2); transform: translateX(-50%) rotate(4deg); }
.tp.t3 { background: var(--tp3); transform: translateX(-50%) rotate(-5deg); }

.simg {
  margin: 24px auto;
  text-align: center;
  max-width: 100%;
  clear: both;
  box-sizing: border-box;
}

.simg img {
  width: 100%;
  max-width: 660px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(42, 34, 26, 0.22);
  cursor: zoom-in;
  filter: sepia(.04);
}

.simg figcaption {
  margin-top: 10px;
  font-family: var(--font-calligraphy);
  font-size: 14px;
  color: var(--ink2);
  letter-spacing: .05em;
}

/* ==================== TIMELINE & TRANSIT LOG ==================== */
.timeline-wrap {
  position: relative;
  padding: 14px 0 14px 20px;
  margin: 16px 0 24px;
  width: 100%;
  box-sizing: border-box;
}

.timeline-wrap::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 6px;
  width: 2.5px;
  background: linear-gradient(180deg, var(--gold), var(--red));
  border-radius: 2px;
}

.tl-item {
  position: relative;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.tl-item:last-child {
  margin-bottom: 0;
}

.tl-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--red);
  box-shadow: 0 0 0 2px rgba(184, 67, 42, 0.15);
}

.tl-item.gold .tl-dot {
  border-color: var(--gold);
}

.tl-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.tl-time {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--red);
  background: rgba(184, 67, 42, 0.08);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.tl-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.tl-transit-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(184, 146, 74, 0.15);
  color: #7b591d;
  border: 1px solid rgba(184, 146, 74, 0.3);
  white-space: nowrap;
}

.tl-body {
  font-size: 13.5px;
  color: var(--ink2);
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.65);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(222, 210, 189, 0.6);
  margin-top: 6px;
  word-break: break-word;
}

.tl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* ==================== GOURMET & DINING DIRECTORY ==================== */
.gourmet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 16px 0 22px;
  width: 100%;
  box-sizing: border-box;
}

.gourmet-card {
  background: #fff;
  border: 1px solid rgba(222, 210, 189, 0.8);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(42, 34, 26, 0.08);
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.gourmet-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(42, 34, 26, 0.14);
  border-color: var(--gold);
}

.gourmet-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--gold));
}

.gourmet-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gourmet-type {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(184, 146, 74, 0.15);
  color: #7b591d;
  font-weight: 600;
  white-space: nowrap;
}

.gourmet-loc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  word-break: break-word;
}

.gourmet-dishes {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.6;
  margin-bottom: 8px;
}

.gourmet-quote {
  font-family: var(--font-calligraphy);
  font-size: 14px;
  color: var(--red);
  background: rgba(184, 67, 42, 0.05);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--red);
  line-height: 1.55;
  word-break: break-word;
}

/* ==================== KNOWLEDGE & ENCYCLOPEDIA CARDS ==================== */
.info-box-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-left: 4.5px solid var(--gold);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0 20px;
  box-shadow: 0 4px 14px rgba(42, 34, 26, 0.06);
  box-sizing: border-box;
  width: 100%;
}

.info-box-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.info-box-badge {
  font-size: 11px;
  background: var(--gold);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.info-box-content {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink2);
  text-align: justify;
  word-break: break-word;
}

/* ==================== TABLE TENNIS MATCH CARD ==================== */
.tt-match-card {
  background: #fff;
  border: 1.5px solid var(--red);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 18px 0 22px;
  box-shadow: 0 6px 20px rgba(184, 67, 42, 0.1);
  position: relative;
  box-sizing: border-box;
  width: 100%;
}

.tt-match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid rgba(222, 210, 189, 0.8);
  padding-bottom: 10px;
  margin-bottom: 12px;
  gap: 8px;
}

.tt-match-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tt-match-result {
  font-size: 17px;
  font-weight: 900;
  color: var(--red);
  font-family: var(--font-mono);
}

.tt-players-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
  width: 100%;
}

.tt-player-box {
  background: rgba(246, 238, 219, 0.5);
  border: 1px solid rgba(222, 210, 189, 0.8);
  border-radius: 8px;
  padding: 8px 12px;
  box-sizing: border-box;
}

.tt-player-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 3px;
  color: var(--ink);
}

.tt-player-rubber {
  font-size: 12px;
  color: var(--ink2);
  line-height: 1.5;
}

.tt-tactics {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.7;
  background: rgba(184, 146, 74, 0.08);
  padding: 10px 12px;
  border-radius: 8px;
  box-sizing: border-box;
}

/* ==================== EXPENSE LEDGER & TABLES ==================== */
.tw, .ledger-table-wrap {
  margin: 16px 0 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(42, 34, 26, 0.06);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  touch-action: pan-x;
}

.tw table, .ledger-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
  min-width: 480px; /* Scrolls smoothly internally without stretching parent */
}

.tw th, .ledger-table th {
  background: linear-gradient(135deg, var(--gold), #9b7937);
  color: #fff;
  padding: 9px 12px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.tw td, .ledger-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(222, 210, 189, 0.6);
  color: var(--ink);
  vertical-align: middle;
  line-height: 1.5;
}

.tw tr:nth-child(even) td, .ledger-table tr:nth-child(even) td {
  background: rgba(246, 238, 219, 0.35);
}

.tw tr:last-child td, .ledger-table tr:last-child td {
  border-bottom: none;
}

.ledger-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.ledger-badge.transit { background: rgba(80, 130, 200, 0.15); color: #235492; }
.ledger-badge.dining { background: rgba(200, 90, 60, 0.15); color: #9c2e17; }
.ledger-badge.ticket { background: rgba(100, 160, 90, 0.15); color: #2e6e28; }
.ledger-badge.diy { background: rgba(180, 120, 200, 0.15); color: #6d2c88; }
.ledger-badge.supply { background: rgba(200, 150, 50, 0.15); color: #8a6012; }

.ledger-total-row td {
  font-weight: 700;
  background: rgba(184, 146, 74, 0.12) !important;
  color: var(--red);
}

/* ==================== WECHAT MOMENT COMPONENT ==================== */
.wechat-moment-card {
  width: 100%;
  max-width: 520px;
  margin: 20px auto 26px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(42, 34, 26, 0.14);
  padding: 16px 18px 14px;
  position: relative;
  clear: both;
  border: 1px solid #e4d8c0;
  box-sizing: border-box;
}

.wechat-moment-card.derek {
  border-top: 4px solid var(--red);
}

.wechat-moment-card.christine {
  border-top: 4px solid var(--gold);
}

.wm-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.wm-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #f0e6d2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  border: 1px solid rgba(184, 146, 74, 0.3);
  flex-shrink: 0;
}

.wm-user-info {
  flex: 1;
  min-width: 0;
}

.wm-user-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #3b5998;
}

.wm-time {
  font-size: 11px;
  color: var(--muted);
}

.wm-text {
  font-size: 14.5px;
  line-height: 1.6;
  color: #222;
  margin-bottom: 10px;
  font-family: var(--font-serif);
  word-break: break-word;
}

.wm-grid {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  width: 100%;
}

.wm-grid-6 {
  grid-template-columns: repeat(3, 1fr);
}

.wm-grid-9 {
  grid-template-columns: repeat(3, 1fr);
}

.wm-grid-thumb {
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  background: #eee;
  cursor: zoom-in;
}

.wm-grid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
}

.wm-grid-thumb:hover img {
  transform: scale(1.05);
}

.wm-loc {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: #576b95;
  margin-bottom: 8px;
}

.wm-likes-box {
  background: #f7f7f7;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
  color: #576b95;
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  line-height: 1.45;
  word-break: break-word;
}

.wm-likes-heart {
  color: #e55353;
  margin-top: 1px;
}

.wm-comments-box {
  background: #f7f7f7;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wm-comment-line {
  line-height: 1.45;
  word-break: break-word;
}

.wm-comment-user {
  color: #576b95;
  font-weight: 600;
}

.wm-comment-text {
  color: #333;
}

@media (max-width: 768px) {
  .pol, .pol.big {
    float: none;
    max-width: 100%;
    width: 100%;
    margin: 14px 0;
    box-sizing: border-box;
  }
  .pol.left, .pol.right {
    margin-left: 0;
    margin-right: 0;
  }
  .gourmet-grid {
    grid-template-columns: 1fr;
  }
  .tt-players-grid {
    grid-template-columns: 1fr;
  }
}
