:root{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif;
  color:#1d1d1f;
  background:#f5f5f7;
  color-scheme:light dark;
  --tolf-blue:#0c3f85;
  --tolf-blue-hover:#0a3673;
  --tolf-blue-pressed:#082d61;
  --tolf-success-bg:#edf7f0;
  --tolf-success-hover:#e3f1e8;
  --tolf-success-pressed:#d8ebdf;
  --tolf-success-text:#0f5132;
  --tolf-success-border:#cadfd1;
}
*{box-sizing:border-box}
body{margin:0;background:#f5f5f7;color:#1d1d1f}
button,input,select,textarea{font:inherit}
main{width:min(720px,calc(100% - 32px));margin:0 auto;padding:0 0 48px}

.page-header{padding:16px 0 18px}
.header-navigation{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:42px}
.back{display:inline-flex;align-items:center;gap:7px;color:#1d1d1f;text-decoration:none;font-weight:650;line-height:1}
.back-chevron{font-size:28px;font-weight:400;line-height:1;transform:translateY(-1px)}
.tolf-wordmark{display:inline-flex;align-items:center;letter-spacing:.04em;font-size:18px}
.tolf-wordmark::before{
  content:"";
  width:22px;height:22px;flex:0 0 22px;margin-right:8px;
  background:url("../tolf-logo-star.svg") center/contain no-repeat;
}
.header-right{display:flex;align-items:center;gap:10px}
.language{display:inline-flex;padding:4px;border:1px solid rgba(0,0,0,.08);border-radius:11px;background:#fff}
.language button{min-width:42px;height:32px;padding:0 10px;border:0;border-radius:8px;background:transparent;color:#6e6e73;cursor:pointer}
.language button.active{background:#ececf0;color:#1d1d1f}
.help-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 4px;border:0;border-radius:6px;color:var(--tolf-blue);text-decoration:none;background:transparent;font-size:14px;font-weight:500;white-space:nowrap}
.brand-copy{margin-top:22px}
h1{margin:0 0 8px;font-size:36px;line-height:1.08;font-weight:650;letter-spacing:-.02em}
.subtitle{margin:0;color:#5f5f63;font-size:17px;line-height:1.45}

.header-switchers{margin:0 0 18px}
.platform-switcher{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  width:100%;
  height:44px;
  min-height:44px;
  max-height:44px;
  padding:4px;
  gap:4px;
  border:1px solid #d2d2d7;
  border-radius:11px;
  background:#e9e9ed;
}
.platform-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  width:100%;
  min-width:0;
  height:34px;
  min-height:34px;
  max-height:34px;
  padding:0 4px;
  font-size:14px;
  font-weight:500;
  line-height:1.2;
  border:1px solid transparent;
  border-radius:7px;
  color:#6e6e73;
  background:transparent;
  cursor:pointer;
}
.platform-button.active{
  color:#1d1d1f;
  background:#fff;
  border-color:#d2d2d7;
  box-shadow:none;
}
.platform-icon{
  width:16px;
  height:16px;
  flex:0 0 16px;
  fill:currentColor;
}

.card{background:#fff;border:1px solid #d8d8dc;border-radius:16px;padding:22px}
.mode-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin-bottom:20px;background:#e9e9ed;border:1px solid #d2d2d7;border-radius:14px}
.mode{min-height:42px;border:1px solid transparent;border-radius:10px;background:transparent;color:#5f5f63;font:inherit;font-weight:600;cursor:pointer}
.mode.active{background:#fff;color:#1d1d1f;border-color:#d2d2d7;box-shadow:0 1px 3px rgba(0,0,0,.08)}
label{display:block;margin:0 0 7px;color:#6e6e73;font-size:14px}
input,select,textarea{width:100%;min-height:46px;border:1px solid #c9c9ce;border-radius:11px;background:#fff;color:#1d1d1f;padding:10px 12px}
textarea{resize:vertical}
.field{margin-top:18px}.first-field{margin-top:0}
.provider-info{margin-top:16px;border-top:1px solid #eeeeef}
.provider-info>div{padding:12px 0;border-bottom:1px solid #eeeeef}
.provider-info span{display:block;color:#6e6e73;font-size:13px;margin-bottom:4px}
.provider-info strong,.provider-info code{font-size:15px;overflow-wrap:anywhere}
.hint{margin:7px 2px 0;color:#77777c;font-size:13px}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:22px}
.actions button{
  min-height:50px;
  padding:13px 14px;
  border-radius:12px;
  font-size:16px;
  line-height:1.3;
  font-weight:600;
  cursor:pointer;
}
.primary{border:1px solid var(--tolf-blue);background:var(--tolf-blue);color:#fff;font-weight:600}
.primary:hover{background:var(--tolf-blue-hover);border-color:var(--tolf-blue-hover)}
.primary:active{background:var(--tolf-blue-pressed);border-color:var(--tolf-blue-pressed)}
.secondary{border:1px solid #c9c9ce;background:#fff;color:#1d1d1f;font-weight:600}
.constructive{
  border:1px solid var(--tolf-success-border);
  background:var(--tolf-success-bg);
  color:var(--tolf-success-text);
  font-weight:600;
}
.constructive:hover{background:var(--tolf-success-hover)}
.constructive:active{background:var(--tolf-success-pressed)}
.error{color:#b42318;margin:14px 0 0}
.privacy{margin:18px 4px 0;color:#6e6e73;font-size:14px}
.privacy summary{cursor:pointer;font-weight:600}
.privacy p{margin:8px 0 0;line-height:1.45}
.dns-help{margin:22px 0 0;padding:18px 20px;border:1px solid #d8d8dc;border-radius:14px;background:#fff;scroll-margin-top:16px}
.dns-help summary{color:var(--tolf-blue);font-size:16px;font-weight:600;cursor:pointer}
.dns-help-content{padding-top:8px;font-size:15px;line-height:1.5}
.dns-help-content h2{margin:18px 0 4px;font-size:16px}
.dns-help-content p{margin:0 0 10px}
.dns-help-note{color:#5f5f63}
.hidden{display:none!important}

@media(max-width:620px){
  main{width:min(100% - 24px,720px)}
  .page-header{padding-top:10px}
  .header-navigation{gap:8px}
  .header-right{gap:6px}
  .language button{min-width:36px;padding:0 7px}
  .help-link{padding:0 4px}
  h1{font-size:30px}
  .card{padding:18px}
  .actions{grid-template-columns:1fr}
}
@media(max-width:390px){
  .tolf-wordmark{font-size:17px}
  .tolf-wordmark::before{width:20px;height:20px;flex-basis:20px;margin-right:6px}
  .back-chevron{font-size:25px}
  .language button{min-width:32px;padding:0 5px}
  .help-link{min-height:44px;padding:0 4px;font-size:14px}
}

@media(prefers-color-scheme:dark){
  :root{
    --tolf-success-bg:#24362f;
    --tolf-success-hover:#2b4438;
    --tolf-success-pressed:#345240;
    --tolf-success-text:#b8dfc8;
    --tolf-success-border:#526d5e;
  }
  :root,body{background:#000;color:#f5f5f7}
  .back,.help-link{color:#f5f5f7}
  .language,.card,input,select,textarea{background:#1c1c1e;color:#f5f5f7;border-color:#38383a}
  .language button{color:#a1a1a6}
  .language button.active,.platform-button.active{background:#3a3a3c;color:#fff;border-color:#48484a}
  .platform-switcher{background:#1c1c1e;border-color:#38383a}
  .platform-button{color:#a1a1a6}
  .mode-tabs{background:#1c1c1e;border-color:#38383a}
  .mode.active{background:#3a3a3c;color:#fff;border-color:#48484a}
  .subtitle,.privacy,label,.hint,.provider-info span,.platform-label{color:#a1a1a6}
  .provider-info,.provider-info>div{border-color:#38383a}
  .secondary{background:#2c2c2e;color:#f5f5f7;border-color:#48484a}
  .primary{background:var(--tolf-blue);color:#fff;border-color:var(--tolf-blue)}
  .constructive{background:var(--tolf-success-bg);color:var(--tolf-success-text);border-color:var(--tolf-success-border)}
  .dns-help{background:#1c1c1e;border-color:#38383a}
  .dns-help summary{color:#7fb0ef}
  .dns-help-note{color:#a1a1a6}
}
.profile-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(min-width:621px){
  .profile-actions:has(#preview.hidden){
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .profile-actions:has(#preview.hidden) > button:not(.hidden){
    min-height:44px;
    height:44px;
    padding:0 12px;
    line-height:1.2;
  }
}
.profile-actions .preview-button{
  width:100%;
  min-height:50px;
  margin:0;
  font-size:16px;
  cursor:pointer;
}
.profile-preview{
  margin-top:18px;
  padding:18px;
  border:1px solid #d8d8dc;
  border-radius:14px;
  background:#f8f8fa;
}
.preview-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.preview-kicker{color:#6e6e73;font-size:14px;margin-bottom:5px}
.profile-preview h2{margin:0;font-size:22px;line-height:1.2;font-weight:650}
.preview-close{
  width:32px;height:32px;min-width:32px;padding:0;
  border:1px solid #d2d2d7;border-radius:9px;
  background:#fff;color:#6e6e73;font-size:22px;line-height:1;cursor:pointer;
}
.preview-grid{
  display:grid;grid-template-columns:1fr 1fr;
  gap:0 20px;margin-top:16px;
  border-top:1px solid #dedee2;
}
.preview-grid>div{padding:11px 0;border-bottom:1px solid #dedee2}
.preview-grid span{display:block;color:#6e6e73;font-size:14px;margin-bottom:4px}
.preview-grid strong,.preview-grid code{font-size:16px;overflow-wrap:anywhere}
.preview-wide{grid-column:1/-1}
.preview-scope{margin-top:18px;font-size:16px;line-height:1.5}
.preview-scope-title{font-weight:650;margin-bottom:5px}
.preview-scope p{margin:6px 0}
.preview-scope ul{margin:7px 0 10px;padding-left:20px}
.preview-scope li{margin:4px 0}
.raw-profile{margin-top:14px;border-top:1px solid #dedee2;padding-top:12px}
.raw-profile summary{cursor:pointer;color:#5f5f63;font-size:13px;font-weight:600}
.raw-profile pre{
  max-height:320px;overflow:auto;margin:12px 0 0;padding:12px;
  border:1px solid #dedee2;border-radius:10px;
  background:#fff;color:#1d1d1f;
  font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  white-space:pre-wrap;overflow-wrap:anywhere;
}
@media(max-width:620px){
  .profile-actions{
    grid-template-columns:1fr 1fr;
  }
  .profile-actions #install{
    grid-column:1/-1;
  }
  .profile-actions #preview,
  .profile-actions #share{
    width:100%;
  }
}
@media(max-width:520px){
  .preview-grid{grid-template-columns:1fr}
  .preview-wide{grid-column:auto}
  .profile-preview{padding:16px}
}
@media(prefers-color-scheme:dark){
  .preview-button,.preview-kicker,.preview-grid span,.raw-profile summary{color:#a1a1a6}
  .profile-preview{background:#151517;border-color:#38383a}
  .preview-close,.raw-profile pre{background:#1c1c1e;color:#f5f5f7;border-color:#38383a}
  .preview-grid,.preview-grid>div,.raw-profile{border-color:#38383a}
}

.raw-profile-box{position:relative;margin-top:12px}
.raw-profile-box pre{margin-top:0;padding-top:44px}
.copy-raw-button{
  position:absolute;top:8px;right:8px;z-index:2;
  width:34px;height:34px;min-width:34px;min-height:34px;
  padding:7px;border:0;border-radius:8px;
  background:transparent;color:#5f5f63;cursor:pointer;
}
.copy-raw-button:hover{background:rgba(0,0,0,.05)}
.copy-raw-button:active{background:rgba(0,0,0,.09)}
.copy-raw-button svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8}
.copy-raw-status{
  position:absolute;top:13px;right:48px;z-index:2;
  color:#5f5f63;font-size:12px;line-height:1.2;
}
@media(prefers-color-scheme:dark){
  .copy-raw-button,.copy-raw-status{color:#a1a1a6}
  .copy-raw-button:hover{background:rgba(255,255,255,.07)}
  .copy-raw-button:active{background:rgba(255,255,255,.12)}
}

/* TOLF configurator wordmark: spaced brand lettering. */
.tolf-wordmark {
  letter-spacing: .14em;
}

/* DNS page title: spaced TOLF wordmark with normal readable product-name gap. */
.dns-configurator-title {
  display: flex;
  align-items: baseline;
  gap: .42em;
}
.dns-configurator-title .dns-title-tolf {
  letter-spacing: .14em;
}
.dns-configurator-title .dns-title-rest {
  letter-spacing: normal;
}

/* DNS configurator back wordmark: same compact treatment as the configurator navigation. */
.page-header .back .tolf-wordmark {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: normal;
}

/* Back navigation: match the main Configurator TOLF wordmark exactly. */
.page-header .back {
  gap: 8px;
}
.page-header .back .tolf-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.47;
  letter-spacing: .16em;
}
.page-header .back .tolf-wordmark::before {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  margin-right: 0;
}
.page-header .back .back-product {
  margin-left: 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.47;
  letter-spacing: normal;
  color: inherit;
}
@media (max-width:520px) {
  .page-header .back .tolf-wordmark { font-size:19px; }
}

/* DNS header: one unified back label and VPN-style Help link. */
.page-header .back{
  gap:8px;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Segoe UI",Helvetica,Arial,sans-serif;
  text-decoration:none;
}
.page-header .back-label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#1d1d1f;
  font-size:16px;
  font-weight:600;
  line-height:1.35;
  letter-spacing:normal;
  white-space:nowrap;
}
.page-header .back-label::before{
  content:"";
  display:block;
  flex:0 0 22px;
  width:22px;
  height:22px;
  background:url("../tolf-logo-star.svg") center/contain no-repeat;
}
.page-header .help-link{
  color:var(--tolf-blue);
  font-size:14px;
  font-weight:500;
}
.page-header .help-link:visited{
  color:var(--tolf-blue);
}
@media(max-width:520px){
  .page-header .back-label{
    font-size:15px;
  }
  .page-header .back-label::before{
    width:20px;
    height:20px;
    flex-basis:20px;
  }
}
@media(prefers-color-scheme:dark){
  .page-header .back-label{color:#f5f5f7}
  .page-header .help-link,
  .page-header .help-link:visited{color:#7fb0ef}
}

/* Match the account and Configurator header on wide screens. */
.page-header { padding:0 0 18px; }
.page-header .header-navigation {
  position:relative;
  box-sizing:border-box;
  width:100vw;
  min-height:58px;
  margin-left:calc(50% - 50vw);
  margin-right:calc(50% - 50vw);
  padding:8px max(16px,calc((100vw - 720px) / 2));
  background:rgba(245,245,247,.86);
  border-bottom:1px solid rgba(0,0,0,.08);
  backdrop-filter:saturate(180%) blur(20px);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
}
.page-header .back {
  flex:none;
  gap:8px;
}
.page-header .back-chevron {
  color:#5f5f63;
  font-size:22px;
}
.page-header .back-label {
  gap:8px;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Segoe UI",sans-serif;
}
.page-header .back-label::before { display:none; }
.page-header .back-wordmark {
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:20px;
  font-weight:650;
  line-height:1.47;
  letter-spacing:.16em;
  -webkit-font-smoothing:antialiased;
}
.page-header .back-wordmark::before {
  content:"";
  display:block;
  flex:0 0 22px;
  width:22px;
  height:22px;
  background:url("../tolf-logo-star.svg") center/contain no-repeat;
}
.page-header .back-product {
  color:inherit;
  font-size:16px;
  font-weight:650;
  line-height:1.47;
  letter-spacing:normal;
}
.page-header .header-title {
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  max-width:calc(100% - 420px);
  margin:0;
  overflow:hidden;
  color:inherit;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Segoe UI",sans-serif;
  font-size:24px;
  font-weight:650;
  line-height:1.2;
  letter-spacing:-.015em;
  text-align:center;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.page-header .brand-copy { margin-top:12px; }
.page-header .mobile-title { display:none; }
.page-header .header-right { flex:none; gap:12px; }
.page-header .help-link,
.page-header .help-link:visited {
  box-sizing:border-box;
  display:inline-flex;
  flex:0 0 42px;
  align-items:center;
  justify-content:center;
  width:42px;
  min-width:42px;
  height:42px;
  min-height:42px;
  padding:0;
  color:#0c3f85;
  border:1px solid #d8d8dc;
  border-radius:10px;
  background:#fff;
}
.page-header .help-link svg {
  display:block;
  flex:none;
  width:27px;
  height:27px;
}
@media(max-width:699px) {
  .page-header .header-title { display:none; }
  .page-header .mobile-title { display:block; }
  .page-header .brand-copy { margin-top:20px; }
}
@media(max-width:620px) {
  .page-header .header-navigation {
    flex-wrap:wrap;
    row-gap:6px;
  }
  .page-header .back { min-width:0; }
  .page-header .back-label { min-width:0; }
  .page-header .header-right { margin-left:auto; }
}
@media(max-width:520px) {
  .page-header .back-wordmark { font-size:19px; }
  .page-header .back-product { font-size:14px; }
  .page-header .back-wordmark::before { flex-basis:20px; width:20px; height:20px; }
}
@media(prefers-color-scheme:dark) {
  .page-header .header-navigation {
    background:rgba(0,0,0,.84);
    border-bottom-color:rgba(255,255,255,.09);
  }
  .page-header .back-chevron { color:#a1a1a6; }
  .page-header .help-link,
  .page-header .help-link:visited {
    color:#7fb0ef;
    background:#1e2934;
    border-color:#42505e;
  }
}

/* On narrow screens the DNS title shares the language and help row. */
@media (max-width: 699px) {
  .page-header .header-navigation {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
  }
  .page-header .back { grid-column: 1 / -1; grid-row: 1; }
  .page-header .header-title {
    position: static;
    display: block;
    grid-column: 1;
    grid-row: 2;
    transform: none;
    max-width: none;
    text-align: left;
  }
  .page-header .header-right { grid-column: 2; grid-row: 2; margin-left: 0; }
  .page-header .mobile-title { display: none; }
  .page-header .brand-copy { margin-top: 12px; }
}
