dialog,
.adminbox {
  border: 1px solid #c6d9df;
  border-radius: 22px;
  background: #f9fcfd;
  color: #17394b;
  padding: 1.5rem;
  box-shadow: 0 15px 65px #16384633;
}
dialog {
  width: min(450px, 96vw);
  max-height: 90dvh;
}
dialog::backdrop {
  background: #12324966;
  backdrop-filter: blur(4px);
}
.panelhead {
  justify-content: space-between;
}
.panelhead h2 {
  font-size: 1.55rem;
}
.panelhead button {
  padding: 0.15rem 0.75rem;
  font-size: 1.5rem;
}
.messages {
  height: min(32dvh, 300px);
  overflow: auto;
  padding: 10px;
  background: #eaf2f5;
  border-radius: 14px;
  margin: 12px 0;
}
.msg {
  width: fit-content;
  max-width: 85%;
  border-radius: 12px;
  padding: 7px 12px;
  margin: 6px 0;
  background: white;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.msg.mine {
  margin-left: auto;
  background: #d4e7ee;
}
.msg small {
  display: block;
  font-size: 0.72rem;
}
.hint,
#status {
  font-size: 0.85rem;
  margin: 0.4rem 0;
}
textarea,
input {
  display: block;
  width: 100%;
  padding: 0.65rem;
  font: inherit;
  border: 1px solid #a2bcc8;
  border-radius: 8px;
}
textarea {
  resize: vertical;
}
form label {
  font-weight: bold;
}
#error {
  color: #92391c;
}
.adminbox {
  margin: 2rem auto;
  max-width: 900px;
}
.adminbox button {
  margin: 0.5rem 0;
}
.inbox {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}
#rooms button {
  display: block;
  max-width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
:root {
  font-family: "Thonburi", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  font-size: clamp(18px, 1.35vw, 21px);
  line-height: 1.65;
  color: #102d44;
  background: #f7f8f5;
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}
* {
  box-sizing: border-box;
}
body,
figure,
h1,
h2,
h3,
p {
  margin: 0;
}
header,
main,
footer {
  width: min(1340px, 91%);
  margin-inline: auto;
}
a {
  color: inherit;
}
button,
.primary {
  font: inherit;
  cursor: pointer;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  background: #12384d;
  color: white;
  padding: 0.65rem 1.15rem;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.primary:hover {
  background: #205979;
}
a:focus-visible,
button:focus-visible,
summary:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ef8a31;
  outline-offset: 3px;
}
header,
nav,
.brand,
footer,
.music,
.signature,
.panelhead {
  display: flex;
  align-items: center;
}
header {
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #bbc8c9;
  padding: 0.85rem 0;
}
nav {
  gap: 1.65rem;
}
nav a,
.brand {
  text-decoration: none;
  font-weight: 650;
}
nav a:hover {
  text-decoration: underline;
}
.brand {
  gap: 0.7rem;
}
.brand img,
footer img {
  width: 76px;
}
.brand span {
  font: 650 0.9rem system-ui;
  border-left: 1px solid #b4c4c9;
  padding-left: 0.7rem;
}
.hero {
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  gap: 4%;
  align-items: center;
  padding: clamp(32px, 4.2vw, 75px) 0;
}
.lead {
  max-width: 670px;
}
.word,
small {
  font-size: 0.83rem;
  font-weight: 700;
}
.word {
  display: flex;
  align-items: center;
  gap: 10px;
}
.word i {
  display: inline-block;
  width: 28px;
  height: 4px;
  background: #e88032;
}
.lead h1 {
  font-family: "Arial", system-ui, sans-serif;
  font-size: clamp(3.4rem, 6.3vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.075em;
  margin: 0.24em 0;
}
.lead em {
  color: #236a8d;
  font-family: Georgia, serif;
  font-weight: normal;
  letter-spacing: -0.065em;
}
.lead h1 span {
  color: #e57d30;
}
.lead p {
  max-width: 32em;
  margin-bottom: 1rem;
}
p {
  color: #405769;
}
.cover {
  position: relative;
  isolation: isolate;
  display: grid;
  background: linear-gradient(145deg, #f0f8f6, #b7dce7 70%, #87bbd2);
  border: 1px solid #bad1d6;
  box-shadow:
    inset 0 1px white,
    0 17px 45px -33px #28516a;
  border-radius: 30px;
  overflow: hidden;
}
.cover:before,
.cover:after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 114%;
  aspect-ratio: 1;
  border: 1px solid #fff9;
  border-radius: 50%;
  left: -20%;
  top: 9%;
  box-shadow:
    0 0 0 1.5rem #ffffff26,
    0 0 0 3rem #ffffff1a;
}
.cover:after {
  left: 55%;
  top: -35%;
}
.cover figure {
  display: grid;
  place-items: center;
  overflow: hidden;
  min-width: 0;
}
.cover img {
  width: 124%;
  max-width: none;
  mix-blend-mode: multiply;
  margin: -1.5% 0;
}
.music {
  gap: 0.65rem;
  background: #12384df5;
  color: white;
  padding: 0.65rem 0.85rem;
  margin: 0.85rem;
  border-radius: 16px;
  z-index: 1;
}
.music small,
.music strong {
  display: block;
}
.music small {
  font-size: 0.78rem;
  color: #d1e2e6;
}
.music button {
  font-size: 0.85rem;
  background: #eef6f7;
  color: #14374a;
  white-space: nowrap;
  margin-left: auto;
}
.record {
  flex: none;
  width: 2.5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #263846 5%, #ffa14c 6% 28%, transparent 29%),
    repeating-radial-gradient(#244450 0 2px, #5c7984 3px, #1b3744 4px);
}
.record.playing {
  outline: 2px solid #ffad67;
}
.signature {
  justify-content: space-between;
  padding: 0.5rem 1.2rem 1rem;
  font: 600 0.8rem system-ui;
}
.signature span:first-child {
  font-weight: 900;
  letter-spacing: 0.13em;
}
#musicError:empty {
  display: none;
}
h2 {
  font-size: clamp(2rem, 3.5vw, 3.4rem);
  line-height: 1.28;
  letter-spacing: -0.04em;
  margin: 0.2em 0 0.35em;
}
h3 {
  font-size: 1.45rem;
  line-height: 1.4;
}
main > section:not(.hero) {
  padding: clamp(1.7rem, 4vw, 3.5rem) 0;
}
.services,
.about,
.brief {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 7%;
  border-top: 1px solid #bbc8c9;
}
.service-list {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #c3d5db;
}
.service-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  padding: 1rem 1.3rem;
  background: linear-gradient(110deg, #fff, #edf3f6);
}
.service-list a + a {
  border-top: 1px solid #c3d5db;
}
.service-list a:hover {
  background: #e2eff3;
}
.service-list strong,
.service-list span span {
  display: block;
}
.service-list strong {
  font-size: 1.35rem;
}
.service-list span span {
  font-size: 0.95rem;
  color: #405769;
}
.service-list b {
  font-size: 1.45rem;
}
.about {
  background: #13354a;
  color: white;
  border: 0;
  border-radius: 24px;
  padding-inline: clamp(1rem, 4vw, 3rem) !important;
}
.about p {
  color: #dce9ed;
}
.team ul {
  padding-left: 1.3rem;
}
.team details {
  border-top: 1px solid #75929f;
  padding-top: 0.7rem;
}
summary {
  cursor: pointer;
  font-weight: 700;
}
.brief {
  margin-top: 2rem;
}
.brief form {
  display: grid;
  gap: 0.5rem;
}
.brief form button {
  justify-self: start;
}
.brief textarea {
  min-height: 5rem;
}
select,
textarea,
input {
  font: inherit;
  padding: 0.65rem;
  border: 1px solid #9baeb6;
  border-radius: 9px;
  color: #18384c;
  background: white;
  width: 100%;
}
footer {
  border-top: 1px solid #b6c6cb;
  padding: 1.2rem 0;
  gap: 1rem;
  font-size: 0.9rem;
}
footer a {
  margin-left: auto;
}
dialog {
  width: min(540px, 95vw);
  padding: 1.3rem;
}
.panelhead {
  justify-content: space-between;
  gap: 0.5rem;
}
dialog .messages {
  min-height: 150px;
}
.adminbox {
  width: min(1100px, 94%);
  padding: clamp(1rem, 3.5vw, 3rem);
}
.adminbox h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0.4rem 0 1rem;
}
.adminbox #login {
  max-width: 26rem;
}
.adminbox .inbox {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
}
#rooms {
  max-height: 55vh;
  overflow: auto;
}
#rooms button {
  width: 100%;
  background: #e5eff2;
  color: #163b50;
  border-radius: 8px;
}
#rooms button:hover {
  background: #cddfe7;
}
.messages:empty:before {
  content: "ข้อความจะแสดงที่นี่";
  color: #536b77;
}
.hint,
#status {
  font-size: 0.9rem;
}
@media (max-width: 760px) {
  :root {
    font-size: 18px;
  }
  .hero,
  .services,
  .about,
  .brief,
  .adminbox .inbox {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .brand span,
  header nav {
    display: none;
  }
  .hero {
    padding: 1rem 0 1.8rem;
    gap: 1rem;
  }
  .lead h1 {
    font-size: clamp(3.5rem, 14vw, 5rem);
  }
  .cover {
    display: contents;
  }
  .cover:before,
  .cover:after,
  .signature {
    display: none;
  }
  .cover .music {
    grid-row: 1;
    margin: 0;
  }
  .cover figure {
    background: linear-gradient(135deg, #edf6f6, #bddfea);
    border-radius: 20px;
    aspect-ratio: 1.9;
  }
  .cover figure img {
    width: 95%;
    height: 100%;
    object-fit: contain;
  }
  .about {
    padding: 1.5rem !important;
  }
  .brief {
    margin-top: 1rem;
  }
  .music small {
    font-size: 0.8rem;
  }
  footer {
    flex-wrap: wrap;
  }
  footer a {
    margin-left: 0;
  }
  .adminbox {
    margin: 1rem auto;
  }
  .adminbox .messages {
    height: 33vh;
  }
}
@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
}
.team ul {
  list-style: none;
  padding: 0;
}
.team li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  border-top: 1px solid #66818e;
  padding: 0.6rem 0;
  flex-wrap: wrap;
}
.team li button {
  font-size: 0.86rem;
  background: #e7f2f5;
  color: #16394b;
  padding: 0.4rem 0.7rem;
}
