:root {
  color-scheme: light;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: #34251b;
  background: #f7e8cf;
  --ink: #34251b;
  --muted: #6a503b;
  --line: #a36e3a2c;
  --rim: #fffbef;
  --accent: #825630;
  --light-face: linear-gradient(145deg, #fffaf0e3 0%, #fff6e4b8 56%, #f7e2b9c4 100%);
  --dark-face: linear-gradient(173deg, #4b3529 0%, #2f211b 100%);
  --rim-shadow: 0 0 0 1px #ab793326, inset 0 1px 1px #fff, inset 0 0 12px #fffbede0;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 280px;
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(ellipse at 12% 6%, #fffcf2 0%, #fff7e3aa 31%, transparent 62%),
    radial-gradient(ellipse at 91% 22%, #eed2a2 0%, transparent 60%),
    radial-gradient(ellipse at 59% 105%, #fff9e9 0%, transparent 58%),
    linear-gradient(158deg, #f9eedb, #f0d6aa 72%, #f4e6cb);
}

:is(h1, h2, h3, p) { margin: 0; }
:is(button, select, input) { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; }
:is(a, button, select, input):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.workspace {
  width: min(1210px, calc(100% - 70px));
  margin-inline: auto;
  padding-block: clamp(20px, 5vh, 50px) 30px;
}

.glass {
  min-width: 0;
  position: relative;
  isolation: isolate;
  border: 1px solid var(--rim);
  background: var(--light-face);
  box-shadow: var(--rim-shadow), 0 12px 28px -18px #85552755;
}

.mast {
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 15px;
  padding: 6px clamp(11px, 1.75vw, 20px);
  background: linear-gradient(107deg, #fffaf0d9, #ffeed195 59%, #fff5e0b5);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  font-size: 1.085rem;
  font-weight: 690;
  letter-spacing: -.035em;
  text-decoration: none;
}

.mark {
  width: 29px;
  height: 29px;
  display: inline-grid;
  flex: none;
  place-items: center;
  border: 1px solid #fff9e3;
  border-radius: 9px;
  background: linear-gradient(147deg, #dab17b, #a67347);
  box-shadow: inset 0 1px 1px #ffeac7, 0 3px 8px #80552a29;
}

.mark:empty::before {
  content: "";
  width: 12px;
  height: 15px;
  transform: translateY(1px) rotate(40deg);
  border: 1px solid #fff9df;
  border-radius: 75% 0 63% 59%;
  background: linear-gradient(129deg, #fff8e6, #fdd391a3 80%);
  box-shadow: inset 1px 1px 2px #fffff4, 0 2px 3px #8b5e3766;
}

.back-link {
  min-height: 39px;
  display: inline-flex;
  flex: none;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid #fff7e6;
  border-radius: 10px;
  background: #fff9ed99;
  box-shadow: inset 0 1px 2px #fff9eb, 0 2px 5px #96663c16;
  color: #644731;
  font-weight: 620;
  font-size: .875rem;
  line-height: 1.25;
  text-decoration: none;
}

.back-link:hover { background: #fffbf1; }

.panel {
  margin-top: 13px;
  padding: clamp(17px, 2.7vw, 35px);
  border-radius: clamp(24px, 3vw, 34px);
  background:
    radial-gradient(ellipse at 10% 0%, #fffcf2ec, transparent 70%),
    linear-gradient(142deg, #fff5e4bb, #f8e5c2b8 67%, #fff2d8b0);
  box-shadow: var(--rim-shadow), 0 23px 55px -30px #8f5e2c75;
}

.panel-intro { padding: 3px clamp(0px, 1.1vw, 14px) clamp(22px, 3vw, 34px); }
.headline { display: flex; align-items: center; gap: clamp(12px, 2vw, 21px); }
.headline .network-icon { width: clamp(40px, 5.5vw, 61px); height: clamp(40px, 5.5vw, 61px); border-radius: 16px; }

h1 {
  color: #322118;
  font-size: clamp(2.35rem, 5.45vw, 4.65rem);
  font-weight: 640;
  letter-spacing: -.068em;
  line-height: .99;
  overflow-wrap: anywhere;
}

.subtitle {
  max-width: 62ch;
  margin-top: 13px;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.145rem);
  line-height: 1.5;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(9px, 1.15vw, 15px);
}

.account-card {
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 1.35vw, 21px);
  border-radius: 19px;
  background: linear-gradient(146deg, #fffdf5ea, #fff4ddcf 53%, #f8e6c4);
  box-shadow: var(--rim-shadow), 0 10px 23px -17px #8453236e;
}

.card-top {
  min-width: 0;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.network-icon {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-grid;
  flex: none;
  place-items: center;
  border: 1px solid #bc8d5840;
  border-radius: 12px;
  background: linear-gradient(152deg, #fff8e7, #f0d8af 87%);
  box-shadow: inset 0 1px 1px #fffdf3, 0 3px 8px #80552a1a;
  color: #7b502d;
  font-weight: 770;
  line-height: 1;
}

.network-icon[data-network="vk"] { letter-spacing: -.08em; }
.network-icon[data-network="vk"]:empty::before { content: "ВК"; }
.network-icon:is([data-network="telegram"], [data-network="instagram"], [data-network="youtube"]) { font-size: 0; }
.network-icon[data-network="telegram"]::before {
  content: "";
  width: 21px;
  height: 19px;
  clip-path: polygon(0 40%, 100% 0, 80% 100%, 52% 73%, 36% 90%, 31% 62%, 77% 22%, 20% 52%);
  background: currentColor;
}

.network-icon[data-network="instagram"]::before {
  content: "";
  width: 19px;
  height: 19px;
  border: 2px solid currentColor;
  border-radius: 6px;
}

.network-icon[data-network="instagram"]::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  box-shadow: 5px -5px 0 -2.75px currentColor;
}

.network-icon[data-network="threads"] { font-size: 1.35rem; }
.network-icon[data-network="threads"]:empty::before { content: "@"; }
.network-icon[data-network="youtube"]::before {
  content: "";
  width: 21px;
  height: 15px;
  border-radius: 4px;
  background: currentColor;
}

.network-icon[data-network="youtube"]::after {
  content: "";
  position: absolute;
  margin-left: 2px;
  border: solid transparent;
  border-width: 4px 0 4px 6px;
  border-left-color: #ffedce;
}

.status {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf0c1;
  color: #64472f;
  font-size: .77rem;
  font-weight: 630;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.status:is([data-ready="true"], [data-state="connected"], .connected, .ready) {
  border-color: #83936963;
  background: #ecf1e2;
  color: #465a3e;
}

.account-card h2 {
  margin-bottom: 7px;
  font-size: clamp(1.12rem, 1.8vw, 1.44rem);
  font-weight: 660;
  letter-spacing: -.043em;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.account-card p:not(.status) {
  margin-bottom: 19px;
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.43;
  overflow-wrap: anywhere;
}

.enter-link,
.auth-actions :is(a, button):not(.text-link) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid #493024;
  border-radius: 99px;
  background: var(--dark-face);
  box-shadow: 0 7px 13px -7px #6a452b83, inset 0 1px 0 #ffe9c538;
  color: #fff8eb;
  font-size: .935rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.account-card .enter-link { margin-top: auto; }
.enter-link:hover,
.auth-actions :is(a, button):not(.text-link):enabled:hover,
.auth-actions a:not(.text-link):hover { background: #523a2c; }

.auth-actions button:disabled, .enter-link[aria-disabled="true"] {
  border-color: #af926e67;
  background: #e2d1b3;
  box-shadow: inset 0 1px 0 #fff7df89;
  color: #685342;
  cursor: not-allowed;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  align-items: stretch;
  gap: clamp(13px, 2.15vw, 29px);
}

.auth-details {
  min-width: 0;
  padding: clamp(16px, 2.6vw, 31px);
  border-radius: clamp(17px, 2.35vw, 25px);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.auth-details > .status { margin-bottom: 13px; }

.auth-details h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.3vw, 1.9rem);
  font-weight: 650;
  letter-spacing: -.044em;
  line-height: 1.16;
}

.auth-details h3 {
  margin-block: 15px 6px;
  color: var(--ink);
  font-size: 1.035rem;
  font-weight: 670;
}

.auth-details :is(p, ol, ul) { margin-block: 0 14px; line-height: 1.55; }
.auth-details :is(ol, ul) { padding-inline-start: 1.4em; }
.auth-details li + li { margin-top: .3em; }
.auth-details form { min-width: 0; display: grid; gap: 8px; margin-top: 16px; }
.auth-details label { color: var(--ink); font-weight: 620; }
.target-field { display: block; margin: 17px 0 7px; }

.auth-details select {
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 45px;
  padding: 9px 36px 9px 13px;
  border: 1px solid #baa17e98;
  border-radius: 10px;
  background-color: #fffaf1;
  background-image:
    linear-gradient(45deg, transparent 50%, #765338 50%),
    linear-gradient(135deg, #765338 50%, transparent 50%);
  background-repeat: no-repeat;
  background-size: 6px 6px;
  background-position: calc(100% - 19px) 53%, calc(100% - 13px) 53%;
  color: var(--ink);
  box-shadow: inset 0 1px 2px #fff, 0 3px 7px #865a320e;
}

.auth-details select:disabled { opacity: .67; }
.auth-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; margin-top: 19px; }
.auth-actions :is(a, button):not(.text-link) { min-width: 150px; min-height: 46px; }
.auth-details .auth-note {
  margin-block: 16px 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: .92rem;
}

.text-link {
  color: #714b2d;
  font-weight: 650;
  text-decoration-line: underline;
  text-underline-offset: .2em;
}

.text-link:hover { color: #34251b; }

.media {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: clamp(260px, 31vw, 395px);
  overflow: hidden;
  border: 2px solid #fff9e8;
  border-radius: clamp(17px, 2.35vw, 25px);
  background:
    radial-gradient(ellipse at 29% 31%, #fffbde 0%, transparent 58%),
    linear-gradient(149deg, #fff5db, #eac38b 66%, #f8e5bc);
  box-shadow: 0 0 0 1px #b788554d, 0 10px 27px -16px #986334b3, inset 0 0 18px #fff0ce;
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 5px #fffef3, inset 0 0 16px #fff6db9c;
  pointer-events: none;
}

.media canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.overview-art.media {
  min-height: clamp(145px, 19vw, 234px);
  margin-top: clamp(12px, 1.9vw, 22px);
}

.media-tab {
  position: absolute;
  bottom: -1px;
  left: clamp(12px, 4%, 35px);
  z-index: 1;
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid #fffdf0;
  border-bottom: 0;
  border-radius: 13px 13px 0 0;
  background: linear-gradient(149deg, #fff8e6f2, #f5dbaee8);
  box-shadow: inset 0 1px 2px white, 0 -4px 17px #fff7dc96;
  color: #5f412d;
  backdrop-filter: blur(8px);
  font-size: .875rem;
  font-weight: 650;
}

.media-tab::before, .media-tab::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.media-tab::before { right: 100%; background: radial-gradient(circle at 0 0, transparent 8px, #fff8e8 8.4px 9.4px, #fae7bf 10px); }
.media-tab::after { left: 100%; background: radial-gradient(circle at 100% 0, transparent 8px, #fff8e8 8.4px 9.4px, #f6dda9 10px); }
.media-tab:hover { background: #fff8e7; }
.media-tab:focus-visible { outline-offset: -4px; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 15px 2px 0;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.45;
}

@media (max-width: 1050px) {
  .account-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .account-card { grid-column: span 2; }
  .account-card:nth-last-child(-n + 2) { grid-column: span 3; }
}

@media (max-width: 760px) {
  .workspace { width: calc(100% - 36px); }
  .auth-grid { grid-template-columns: minmax(0, 1fr); }
  .media { min-height: clamp(228px, 54vw, 345px); }
  .overview-art.media { min-height: clamp(157px, 31vw, 219px); }
}

@media (max-width: 600px) {
  .workspace { width: calc(100% - 25px); padding-top: 14px; }
  .mast { min-height: 50px; }
  .brand { font-size: 1rem; }
  .mark { width: 25px; height: 25px; }
  .panel { margin-top: 10px; }
  .panel-intro { padding-bottom: 20px; }
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-card, .account-card:nth-last-child(-n + 2) { grid-column: auto; }
  .account-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 440px) {
  .account-grid { grid-template-columns: minmax(0, 1fr); }
  .account-card { padding: 14px; }
  .card-top { margin-bottom: 10px; }
  .account-card p:not(.status) { margin-bottom: 12px; }
  .account-card .enter-link { align-self: flex-start; min-width: 128px; }
}

@media (forced-colors: active) {
  .media, .glass, .enter-link, .auth-actions :is(button, a) { border-color: ButtonText; }
  .auth-details select { appearance: auto; }
}
