:root {
  --panel-bg: #f5f7f4;
  --panel-card: #ffffff;
  --panel-border: #d8e0d8;
  --accent: #0b8f6a;
  --accent-2: #086b50;
  --text-main: #16231c;
  --mine: #d9fdd3;
  --theirs: #ffffff;
  --chat-bg: #e3ded7;
  --header-bg: #075e54;
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

body {
  margin: 0;
  font-family: "Nunito", sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at 20% 0%, #f2fff7 0%, #edf2ec 45%, #dce5d8 100%);
  overflow: hidden;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  overflow: hidden;
}

.panel {
  padding: 1rem;
  border-right: 1px solid #ccd8cc;
  background: linear-gradient(160deg, #f4f8f3 0%, #e8efe5 100%);
  overflow-y: auto;
  height: 100vh;
}

.panel h1 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

.card {
  background: var(--panel-card);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  box-shadow: 0 4px 14px rgba(20, 48, 32, 0.05);
}

.card h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.55rem;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0.22rem;
  border: 1px solid #c8d3c8;
  border-radius: 10px;
  padding: 0.42rem 0.55rem;
  font: inherit;
  background: #fff;
}

textarea {
  min-height: 2.2rem;
  resize: vertical;
}

.row {
  display: flex;
  gap: 0.45rem;
}

.row > * {
  flex: 1;
}

.row-colors label {
  font-size: 0.75rem;
}

.btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 11px;
  padding: 0.5rem 0.66rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn.secondary {
  background: #dce8df;
  color: #173326;
}

.btn.export {
  width: 100%;
  background: linear-gradient(130deg, #0b8f6a, #096047);
}

.messages-editor {
  display: grid;
  gap: 0.65rem;
  max-height: 270px;
  overflow: auto;
  margin-bottom: 0.55rem;
}

.message-item {
  border: 1px solid #dae3da;
  border-radius: 10px;
  padding: 0.45rem;
  background: #f9fcf9;
}

.message-item .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.message-item .delete-msg {
  width: 100%;
  margin-top: 0.35rem;
}

.progress-wrap {
  width: 100%;
  height: 9px;
  border-radius: 99px;
  background: #d8e3da;
  overflow: hidden;
  margin-top: 0.35rem;
}

.progress {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0e9f74, #6ad7b0);
}

.time-label,
.export-status {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #315341;
}

.preview {
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: linear-gradient(130deg, #dce5dc 0%, #c9d8c9 30%, #9db79f 100%);
  height: 100vh;
  overflow: hidden;
}

.phone {
  width: min(390px, 95vw);
  height: min(780px, 86vh);
  border-radius: 28px;
  border: 8px solid #1a1f1d;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px rgba(15, 23, 17, 0.32);
  background: #000;
}

.device-status-bar {
  height: 24px;
  background: var(--header-bg);
  color: #f3fffb;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 0.88rem;
  font-size: 0.56rem;
  font-weight: 700;
}

.device-time {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  letter-spacing: 0.01em;
}

.time-message-icon {
  width: 10px;
  height: 10px;
  display: block;
  fill: currentColor;
  transform: translateY(-1px);
}

.status-pill {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.device-icons {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.top-icon {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.chat-header {
  background: var(--header-bg);
  color: #fff;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 0.8rem;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #dce;
}

.name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.status {
  margin: 0;
  font-size: 0.72rem;
  opacity: 0.88;
}

.chat-body {
  flex: 1;
  overflow: auto;
  scrollbar-width: none;
  padding: 0.85rem;
  background-color: var(--chat-bg);
  background-image: url("assets/chat-background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.chat-body::-webkit-scrollbar {
  display: none;
}

body.is-exporting-video,
body.is-exporting-video * {
  cursor: none !important;
}

.message {
  width: -moz-fit-content;
  width: fit-content;
  max-width: 72%;
  margin-bottom: 0.45rem;
  padding: 0.48rem 0.58rem 0.32rem;
  border-radius: 9px;
  animation: popin 220ms cubic-bezier(0.22, 0.78, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14);
}

.message.them {
  margin-right: auto;
  border-top-left-radius: 2px;
  background: var(--theirs);
}

.message.me {
  margin-left: auto;
  border-top-right-radius: 2px;
  background: var(--mine);
}

.msg-text {
  margin: 0;
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-text strong {
  font-weight: 800;
}

.meta {
  margin-top: 0.22rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.24rem;
  font-size: 0.65rem;
  opacity: 0.7;
}

.checks {
  font-weight: 700;
  letter-spacing: -1px;
}

.checks.read {
  color: #3da6ff;
}

.typing {
  width: fit-content;
  background: #fff;
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  margin-bottom: 0.45rem;
  display: flex;
  gap: 0.18rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.typing.them {
  margin-right: auto;
}

.typing.me {
  margin-left: auto;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9db3a8;
  animation: blink 1s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.typing span:nth-child(3) {
  animation-delay: 0.28s;
}

.composer {
  background: #f7f6f2;
  border-top: 1px solid #d9d9d5;
  padding: 0.52rem 0.62rem;
  display: flex;
  align-items: center;
  gap: 0.38rem;
}

.composer-bar {
  min-height: 34px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.24rem 0.48rem;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #ececea;
}

.composer-placeholder {
  flex: 1;
  font-size: 0.94rem;
  color: #65746c;
}

.icon-circle,
.icon-btn,
.mic-btn {
  border: 0;
  cursor: default;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.icon-circle.plus {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #65746c;
  background: #f2f3f3;
}

.icon-circle svg,
.icon-btn svg,
.mic-btn svg {
  width: 16px;
  height: 16px;
}

.composer-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.icon-btn {
  width: 22px;
  height: 22px;
  color: #74827b;
}

.mic-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #ffffff;
  background: #12a954;
  box-shadow: 0 2px 4px rgba(14, 65, 37, 0.25);
}

@keyframes popin {
  from {
    transform: translateY(6px) scale(0.985);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes blink {
  0%,
  70%,
  100% {
    opacity: 0.35;
  }

  35% {
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid #ccd8cc;
    max-height: 56vh;
    height: auto;
  }

  .preview {
    padding: 0.8rem;
    height: 44vh;
  }

  .phone {
    height: min(720px, 80vh);
  }
}
