:root {
  color-scheme:light;
  --orange:#995e2e;
  --ink:#181d24;
  --muted:#68717d;
  --line:#e4e1dc;
  --paper:#fff;
--soft:#f7f5f1}

* {
box-sizing:border-box}

html,body {
  margin:0;
  min-height:100%;
  font-family:Manrope,Inter,ui-sans-serif,system-ui,-apple-system,sans-serif;
  color:var(--ink);
background:var(--paper)}

body {
padding-top:64px}

button,input,select {
font:inherit}

button,a {
-webkit-tap-highlight-color:transparent}

.topbar {
  position:fixed;
  z-index:30;
  inset:0 0 auto;
  height:64px;
  display:flex;
  align-items:center;
  gap:14px;
  padding:0 22px;
  border-bottom:1px solid var(--line);
background:var(--paper)}

.brand {
  display:flex;
  align-items:center;
  color:var(--ink);
  text-decoration:none;
font-weight:800}

.brand img {
  border-radius:8px;
margin-right:9px}

.brand b {
  margin-left:5px;
  color:var(--orange);
font-weight:700}

.topbar nav {
  display:flex;
  gap:3px;
margin-left:auto}

.topbar nav button {
  width:40px;
  height:40px;
  border:0;
  background:transparent;
  border-radius:50%;
  color:var(--muted);
  padding:0;
  font-size:0;
cursor:pointer}

.topbar nav button span {
font-size:20px}

.topbar nav button:hover {
  background:var(--soft);
color:var(--ink)}

.account {
  position:relative;
  display: flex;
}

.login,.account-button {
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--paper);
  padding:3px 8px;
  color:var(--ink);
  text-decoration:none;
  font-weight:700;
cursor:pointer}

.login:hover,.account-button:hover {
border-color:#c5b7aa}

.account-button>span:first-child {
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--orange);
  color:#fff;
font-size:12px}

.account-menu {
  position:absolute;
  z-index:20;
  right:0;
  top:46px;
  width:245px;
  padding:16px;
  border:1px solid var(--line);
  border-radius:12px;
background:var(--paper)}

.account-menu>* {
display:block}

.account-menu small {
  color:var(--muted);
margin:4px 0 12px}

.account-menu>span {
  border-radius:7px;
  background:var(--soft);
  color:#28643e;
  padding:8px;
font-size:12px}

.account-menu a,.account-menu button {
  width:100%;
  margin-top:8px;
  padding:9px;
  border:0;
  background:transparent;
  text-align:left;
  color:var(--ink);
  text-decoration:none;
cursor:pointer}

.search-home {
  min-height:calc(100vh - 122px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:30px 20px 13vh;
text-align:center}

.search-logo img {
border-radius:18px}

h1 {
  margin:18px 0 3px;
  font-size:clamp(38px,6vw,62px);
letter-spacing:-.05em}

h1 span {
color:var(--orange)}

.search-home>p {
color:var(--muted)}

.search-box {
  width:min(650px,100%);
  height:58px;
  display:flex;
  align-items:center;
  margin-top:24px;
  border:1px solid #d2cdc6;
  border-radius:29px;
  background:var(--paper);
padding:6px}

.search-box:focus-within {
border-color:var(--orange)}

.search-box svg {
  width:21px;
  margin:0 11px;
  fill:none;
  stroke:var(--muted);
stroke-width:2}

.search-box input {
  min-width:0;
  flex:1;
  border:0;
  outline:0;
  background:transparent;
  color:var(--ink);
font-size:16px}

.search-box button {
  border:0;
cursor:pointer}

.search-box .clear {
  background:transparent;
  font-size:22px;
color:var(--muted)}

.search-box .submit {
  height:44px;
  border-radius:22px;
  background:var(--orange);
  padding:0 18px;
  color:#fff;
font-weight:700}

.results-view {
  max-width:880px;
  margin:0 auto;
padding:24px 28px 60px}

.results-search {
  display:flex;
  align-items:center;
  gap:16px;
max-width:780px}

.mini-brand img {
  display:block;
border-radius:8px}

.results-search>div {
  height:46px;
  display:flex;
  flex:1;
  border:1px solid var(--line);
  border-radius:23px;
overflow:hidden}

.results-search>div:focus-within {
border-color:var(--orange)}

.results-search input {
  min-width:0;
  flex:1;
  border:0;
  outline:0;
  background:transparent;
  padding:0 18px;
color:var(--ink)}

.results-search button {
  width:50px;
  border:0;
  background:transparent;
  color:var(--orange);
  font-size:24px;
cursor:pointer}

.categories {
  display:flex;
  gap:22px;
  margin:18px 0 0 48px;
border-bottom:1px solid var(--line)}

.categories button {
  border:0;
  border-bottom:2px solid transparent;
  background:transparent;
  padding:11px 2px;
  color:var(--muted);
cursor:pointer}

.categories button.active {
  border-color:var(--orange);
  color:var(--orange);
font-weight:700}

.results-layout {
margin:24px 0 0 48px}

.result-meta {
  min-height:20px;
  color:var(--muted);
font-size:12px}

.result {
  position:relative;
  margin:0 0 30px;
padding-right:42px}

.result-source {
  display:flex;
  align-items:center;
  gap:9px;
  color:var(--muted);
font-size:12px}

.result-source span:first-child {
  width:27px;
  height:27px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--soft);
  color:var(--orange);
font-weight:800}

.result h2 {
  margin:7px 0 6px;
  font-size:19px;
font-weight:650}

.result h2 a {
  color:#72441f;
text-decoration:none}

.result h2 a:hover {
text-decoration:underline}

.result p {
  margin:0;
  color:#4f5864;
  font-size:14px;
line-height:1.6}

.favorite-toggle {
  position:absolute;
  right:2px;
  top:22px;
  border:0;
  background:transparent;
  color:#9b948b;
  font-size:24px;
cursor:pointer}

.favorite-toggle.saved {
color:var(--orange)}

.image-results {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
gap:14px}

.image-result {
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:10px;
background:var(--soft)}

.image-result img {
  width:100%;
  height:150px;
  display:block;
object-fit:cover}

.image-result a {
  display:block;
  padding:10px;
  color:var(--ink);
  font-size:13px;
text-decoration:none}

.pagination {
  display:flex;
  gap:8px;
margin-top:36px}

.pagination button {
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--paper);
  padding:9px 14px;
  color:var(--ink);
cursor:pointer}

.pagination button:disabled {
opacity:.4}

.loading {
  display:grid;
gap:18px}

.skeleton {
  height:88px;
  border-radius:8px;
background:var(--soft)}

.empty {
  padding:45px 0;
color:var(--muted)}

footer {
  height:58px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:25px;
  border-top:1px solid var(--line);
  color:var(--muted);
font-size:12px}

footer a {
color:var(--muted)}

dialog {
  width:min(520px,calc(100% - 30px));
  max-height:80vh;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--paper);
  color:var(--ink);
padding:0}

dialog::backdrop {
background:rgb(24 29 36/.32)}

dialog header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 20px;
border-bottom:1px solid var(--line)}

dialog h2 {
  margin:0;
font-size:20px}

dialog header button {
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:26px;
cursor:pointer}

.panel-actions {
  padding:12px 18px;
text-align:right}

.panel-actions button {
  border:0;
  background:transparent;
  color:var(--orange);
cursor:pointer}

.saved-list {
  padding:0 18px 18px;
overflow:auto}

.saved-item {
  display:flex;
  align-items:center;
  gap:12px;
  border-top:1px solid var(--line);
padding:13px 0}

.saved-item:first-child {
border-top:0}

.saved-item div {
  min-width:0;
flex:1}

.saved-item strong,.saved-item small {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
white-space:nowrap}

.saved-item small {
  margin-top:3px;
color:var(--muted)}

.saved-item button {
  border:0;
  background:transparent;
  color:var(--muted);
cursor:pointer}

.saved-empty {
  padding:36px 10px;
  text-align:center;
color:var(--muted)}

.settings-form {
  display:grid;
  gap:18px;
padding:22px}

.settings-form label {
  display:grid;
  gap:8px;
font-weight:650}

.settings-form select {
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--paper);
  color:var(--ink);
padding:11px}

.settings-form .check {
  display:flex;
  align-items:center;
font-weight:500}

.save-settings {
  border:0;
  border-radius:9px;
  background:var(--orange);
  padding:12px;
  color:#fff;
  font-weight:700;
cursor:pointer}

.toast {
  position:fixed;
  z-index:50;
  left:50%;
  bottom:25px;
  transform:translate(-50%,20px);
  border-radius:9px;
  background:var(--ink);
  padding:11px 16px;
  color:#fff;
  font-size:13px;
  opacity:0;
  pointer-events:none;
transition:.2s}

.toast.show {
  opacity:1;
transform:translate(-50%,0)}

.account-menu {
  width:218px;
padding:10px}

.account-menu-identity {
padding:3px 5px 8px}

.account-menu .account-menu-identity strong {
  display:block;
font-size:13px}

.account-menu .account-menu-identity small {
  display:block;
  margin:2px 0 0;
font-size:10.5px}

.account-menu .sync-status {
  display:flex;
  align-items:center;
  gap:6px;
  border-radius:6px;
  padding:6px 8px;
font-size:10.5px}

.sync-status i {
  width:6px;
  height:6px;
  border-radius:50%;
background:#3b8a59}

.account-menu .account-menu-actions {
  display:flex;
  gap:6px;
margin-top:8px}

.account-menu .account-menu-actions button {
  display:flex;
  width:auto;
  height:34px;
  flex:1;
  align-items:center;
  justify-content:center;
  gap:5px;
  margin:0;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--paper);
  padding:0 7px;
  color:var(--ink);
  font-size:11.5px;
  font-weight:650;
text-align:center}

.account-menu .account-menu-actions button:hover {
  background:var(--soft);
border-color:#c9c3ba}

.account-menu .account-menu-actions .logout-action {
color:#9b3f3f}

.account-menu .account-menu-actions .logout-action:hover {
  border-color:#ddbaba;
background:#fbf3f3}

.account-menu-actions svg {
  width:14px;
  height:14px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
stroke-linejoin:round}

.results-page-main {
  min-height:calc(100vh - 64px);
padding-top:8px}

.results-page .results-view {
padding-top:20px}

.profile-card {
  display:flex;
  align-items:center;
  gap:14px;
padding:22px}

.profile-card>span {
  width:52px;
  height:52px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--orange);
  color:#fff;
  font-size:20px;
font-weight:800}

.profile-card div {
min-width:0}

.profile-card strong,.profile-card small {
  display:block;
  overflow:hidden;
text-overflow:ellipsis}

.profile-card small {
  margin-top:4px;
color:var(--muted)}

.profile-sync {
  display:flex;
  gap:12px;
  margin:0 22px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:10px;
background:var(--soft)}

.profile-sync>span {
  color:#287146;
font-weight:800}

.profile-sync strong,.profile-sync small {
display:block}

.profile-sync small {
  margin-top:4px;
  color:var(--muted);
line-height:1.5}

.profile-dashboard {
  display:block;
  margin:18px 22px 22px;
  border:1px solid var(--line);
  border-radius:9px;
  padding:11px;
  text-align:center;
  color:var(--ink);
  font-weight:700;
text-decoration:none}

@media(prefers-color-scheme:dark) {
  html[data-theme=system] {
    --ink:#f1eee9;
    --muted:#a9afb8;
    --line:#353a41;
    --paper:#171a1f;
    --soft:#20242a;
  color-scheme:dark}

}

html[data-theme=dark] {
  --ink:#f1eee9;
  --muted:#a9afb8;
  --line:#353a41;
  --paper:#171a1f;
  --soft:#20242a;
color-scheme:dark}

html[data-theme=dark] .account-menu>span,html[data-theme=system] .account-menu>span {
color:#55a873}

html[data-theme=dark] .result h2 a {
color:#d7a275}

html[data-theme=dark] .result p {
color:#bdc2c9}

@media(prefers-color-scheme:dark) {
  html[data-theme=system] .result h2 a {
  color:#d7a275}

  html[data-theme=system] .result p {
  color:#bdc2c9}

}

@media(max-width:760px) {
  body {
  padding-top:58px}

  .topbar {
    height:58px;
    width:100%;
    gap:6px;
  padding:0 10px}

  .brand {
  flex:0 0 34px}

  .brand img {
    width:34px;
    height:34px;
  margin:0}

  .brand span,.brand b {
  display:none}

  .topbar nav {
    flex:0 0 auto;
    gap:0;
  margin-left:auto}

  .topbar nav button {
    width:34px;
    height:34px;
    padding:0;
  font-size:0}

  .topbar nav button span {
  font-size:18px}

  .account {
  flex:0 0 auto}

  .login {
    height:34px;
    padding:0 9px;
    font-size:11.5px;
  white-space:nowrap}

  .account-button {
    width:34px;
    height:34px;
    justify-content:center;
  padding:0}

  .account-button>span:first-child {
    width:24px;
  height:24px}

  .account-button #accountName {
  display:none}

  .account-menu {
    top:calc(100% + 8px);
    right:0;
  width:min(218px,calc(100vw - 20px))}

  .search-home {
    min-height:calc(100vh - 108px);
  padding-bottom:17vh}

  .search-box {
  height:58px}

  .search-box .submit {
    width:46px;
    padding:0;
  font-size:0}

  .search-box .submit::after {
    content:'⌕';
  font-size:22px}

  .results-view {
  padding:15px 16px 45px}

  .categories {
    margin-left:0;
    gap:18px;
  overflow:auto}

  .results-layout {
  margin-left:0}

  .image-results {
  grid-template-columns:repeat(2,minmax(0,1fr))}

  .result h2 {
  font-size:18px}

  footer span {
  display:none}

}

@media(max-width:350px) {
  .topbar nav button {
  width:31px}

  .login {
    padding-inline:7px;
  font-size:11px}

  .topbar {
    padding-inline:8px;
  gap:4px}

}
