:root {
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface2: #fbfdff;

  --text: #0f172a;
  --muted: #5b6b80;

  --border: #e3ecfb;
  --border2: #edf3ff;
  --borderStrong: #d5e3fb;

  --accent: #1f5cff;
  --accent2: #1847c7;

  --accentSoft: rgba(31, 92, 255, .06);
  --btnFill: rgba(31, 92, 255, .06);
  --btnFillHover: rgba(31, 92, 255, .10);
  --btnBorder: rgba(31, 92, 255, .18);
  --btnBorderHover: rgba(31, 92, 255, .28);

  --header-h: 64px;
  --max: 1200px;

  --title-size: 28px;
  --title-lh: 1.12;
  --title-weight: 850;
  --title-track: -0.03em;

  --title-size-mobile: 22px;
  --title-lh-mobile: 1.15;

  --title-size-sm: 26px;
  --title-size-sm-mobile: 20px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

body.wrap--wide {
  --max: 1200px;
}

body.wrap--narrow {
  --max: 900px;
}

a {
  color: var(--accent);
  text-decoration: none
}

a:hover {
  color: var(--accent2);
  text-decoration: underline
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--header-h) + 16px) 14px 24px;
}

/* header */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(10px);
  z-index: 50;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, rgba(31, 92, 255, .28), rgba(31, 92, 255, 0));
  pointer-events: none;
}

.topbar .inner {
  height: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* header buttons */
.iconbtn {
  appearance: none;
  border: 1px solid var(--btnBorder);
  background: var(--btnFill);
  color: var(--text);
  height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.iconbtn:hover {
  border-color: var(--btnBorderHover);
  background: var(--btnFillHover)
}

.iconbtn:active {
  transform: translateY(1px)
}

.iconbtn:focus-visible {
  outline: 2px solid rgba(31, 92, 255, .18);
  outline-offset: 2px
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px
}

/* pill button (Back/Source) */
.pillbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--btnBorder);
  background: var(--btnFill);
  color: #1e3a8a;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
}

.pillbtn:hover {
  background: var(--btnFillHover);
  border-color: var(--btnBorderHover);
  text-decoration: none;
}

/* search */
.search {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  border: 1px solid var(--borderStrong);
  border-radius: 999px;
  background: var(--surface);
  min-width: 160px;
  overflow: hidden;
}

.search:hover {
  border-color: #cfe0fb
}

.search:focus-within {
  border-color: rgba(31, 92, 255, .32);
  background: #fff
}

.search .zemoji {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

.search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  height: 100%;
  font-size: 14px;
  color: var(--text);
  padding: 0 12px 0 44px;
}

.search input::placeholder {
  color: #7b8aa2
}

/* menu + drawer */
.menu-panel {
  position: fixed;
  top: calc(var(--header-h) + 10px);
  left: 14px;
  width: 320px;
  max-width: calc(100vw - 28px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  z-index: 60;
  display: none;
  overflow: hidden;
}

body.menu-open .menu-panel {
  display: block
}

.menu-panel .menu-head {
  padding: 12px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface2);
}

.menu-title {
  font-weight: 900;
  font-size: 14px
}

.menu-close {
  border: 1px solid var(--btnBorder);
  background: var(--btnFill);
  border-radius: 999px;
  height: 34px;
  min-width: 34px;
  cursor: pointer;
}

.menu-close:hover {
  border-color: var(--btnBorderHover);
  background: var(--btnFillHover)
}

.menu-panel .menu-body {
  padding: 10px
}

.drawer {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(15, 23, 42, .24);
  z-index: 55;
  display: none;
}

body.drawer-open .drawer {
  display: block
}

.drawer .panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(88vw, 340px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.drawer .panel .menu-head {
  padding: 12px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  background: var(--surface2);
}

.drawer .panel .menu-body {
  padding: 10px
}

.menu-panel .menu-body a,
.drawer .menu-body a {
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}

.menu-panel .menu-body a:hover,
.drawer .menu-body a:hover {
  border-color: rgba(31, 92, 255, .14);
  background: rgba(31, 92, 255, .06);
  text-decoration: none;
}

/* flash */
.flash {
  margin: 0 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid rgba(31, 92, 255, .28);
  border-radius: 18px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 14px;
}

/* layout */
.grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

.col.left,
.col.right {
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-color: var(--border2);
}

.col.main {
  border-color: var(--borderStrong);
  border-top: 4px solid rgba(31, 92, 255, .18);
  background: #fff;
}

.pad {
  padding: 18px
}

.col.left,
.col.right {
  position: sticky;
  top: calc(var(--header-h) + 18px);
}

/* titles */
.site-title,
.card-title,
.lawtitle {
  font-size: var(--title-size);
  line-height: var(--title-lh);
  font-weight: var(--title-weight);
  letter-spacing: var(--title-track);
}

.site-title {
  margin: 0 0 8px
}

.card-title {
  margin: 0 0 6px
}

.lawtitle {
  margin: 0 0 6px
}

.list-head .title {
  margin: 0;
  font-size: var(--title-size-sm);
  line-height: var(--title-lh);
  font-weight: var(--title-weight);
  letter-spacing: var(--title-track);
}

.col.right .card-title {
  font-size: var(--title-size-sm)
}

/* supporting text */
.site-desc,
.card-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.card-sub {
  margin: 0 0 12px
}

.section-title {
  margin: 14px 0 10px;
  font-size: 14px;
  font-weight: 950;
}

/* chips */
.left-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

.leftlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--btnBorder);
  background: var(--btnFill);
  color: #1e3a8a;
  font-weight: 800;
  text-decoration: none;
}

.leftlink:hover {
  background: var(--btnFillHover);
  border-color: var(--btnBorderHover);
  text-decoration: none
}

.chips {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* feed */
.list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 12px;
}

.list-head .meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.laws {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.law {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 14px 12px;
  background: #fff;
  border-left: 4px solid transparent;
}

.law:hover {
  border-color: #d2e2fb;
  background: var(--surface2);
  border-left-color: rgba(31, 92, 255, .14);
}

.lawmeta {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 8px;
}

.pill {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid rgba(31, 92, 255, .14);
  border-radius: 999px;
  font-size: 12px;
  color: #1e3a8a;
  background: rgba(31, 92, 255, .05);
}

.lawtext {
  margin: 0;
  font-size: 14px;
  color: #17233c;
  line-height: 1.6;
  word-break: break-word;
}

.lawactions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

/* link buttons (also for <button> if used) */
.linkbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--btnBorder);
  background: var(--btnFill);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  color: #1e3a8a;
  text-decoration: none;
  line-height: 1;
  position: relative;

  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  cursor: pointer;
}

.linkbtn:hover {
  background: var(--btnFillHover);
  border-color: var(--btnBorderHover);
  text-decoration: none
}

/* badge: round, no colored border */
.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  /* circle */
  height: 18px;
  padding: 0;
  /* no pill padding */
  border-radius: 50%;
  background: #fff;
  border: none;
  /* no border */
  outline: none;
  /* no focus outline ring */
  box-shadow: none;
  /* no glow/shadow border */
  color: #000;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
}

/* media */
.media-thumb {
  display: block;
  margin: 10px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.media-thumb img {
  display: block;
  width: 100%;
  height: auto
}

.embed-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin: 10px 0;
}

.embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* forms */
label {
  display: block;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  margin: 0 0 6px;
}

.field {
  margin: 10px 0
}

input[type="url"],
input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--borderStrong);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  outline: 0;
}

textarea {
  min-height: 120px;
  resize: vertical
}

input:hover,
select:hover,
textarea:hover {
  border-color: #cfe0fb
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(31, 92, 255, .16);
  outline-offset: 2px;
  border-color: rgba(31, 92, 255, .30);
}

.btn {
  width: 100%;
  border: 1px solid rgba(31, 92, 255, .22);
  background: rgba(31, 92, 255, .10);
  color: #1e3a8a;
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 900;
  cursor: pointer;
}

.btn:hover {
  background: rgba(31, 92, 255, .14);
  border-color: rgba(31, 92, 255, .28)
}

.btn:active {
  transform: translateY(1px)
}

.tiny {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted)
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden
}

/* comments */
.comment {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin: 10px 0;
  background: #fff;
}

.comment .cm {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 6px
}

.comment p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6
}

/* footer */
footer {
  margin-top: 16px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

footer .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 14px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

/* mobile: edge-to-edge + feed posts edge-to-edge */
@media (max-width:980px) {
  .topbar .inner {
    max-width: 100%;
    padding: 0 10px;
    gap: 10px
  }

  .wrap {
    max-width: 100%;
    padding: calc(var(--header-h) + 10px) 0 0
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px
  }

  .col {
    border: 0;
    border-radius: 0;
    background: #fff
  }

  .col.main {
    border-top: 0
  }

  .col.left,
  .col.right {
    position: static
  }

  .pad {
    padding: 16px 14px
  }

  .menu-panel {
    display: none !important
  }

  footer {
    margin-top: 0;
    padding-top: 0
  }

  footer .inner {
    max-width: 100%;
    padding: 14px 14px 18px
  }

  .site-title,
  .card-title,
  .lawtitle {
    font-size: var(--title-size-mobile);
    line-height: var(--title-lh-mobile);
    font-weight: 900;
  }

  .list-head .title {
    font-size: var(--title-size-sm-mobile);
    line-height: var(--title-lh-mobile);
    font-weight: 900;
  }

  .col.right .card-title {
    font-size: var(--title-size-sm-mobile)
  }

  /* feed posts edge-to-edge */
  .col.main .laws {
    gap: 0;
    margin: 0 -14px
  }

  .col.main .law {
    border: 0;
    border-radius: 0;
    padding: 14px 14px;
    border-bottom: 1px solid var(--border);
    background: #fff;
  }

  .col.main .law:last-child {
    border-bottom: 0
  }
}