/* ================= Finder ================= */

.finder-side { width: 190px; padding: 8px 8px 8px; overflow-y: auto; }
.fs-group { margin-bottom: 14px; }
.fs-group-title { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 0 8px 3px; }
.fs-item {
  display: flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 8px; border-radius: 6px;
  font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden;
}
.fs-item svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.fs-item.tag-dot svg { width: 11px; height: 11px; margin: 0 2.5px; }
.fs-item.sel { background: var(--sel-bg); }
.window.blurred .fs-item.sel { background: var(--hover-fill); }

.finder-main { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.finder-content { flex: 1; min-height: 0; position: relative; overflow: hidden; display: flex; }

/* icon view */
.fv-icons { flex: 1; overflow-y: auto; padding: 10px; align-content: start;
  display: grid; grid-template-columns: repeat(auto-fill, 96px); gap: 14px 6px; justify-content: start; position: relative; }
.fi {
  width: 96px; display: flex; flex-direction: column; align-items: center;
  padding: 5px 2px; border-radius: 6px; position: relative;
}
.fi .fi-img { width: 56px; height: 56px; padding: 3px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.fi .fi-img svg { width: 50px; height: 50px; }
.fi .fi-label {
  margin-top: 3px; font-size: 12px; line-height: 15px; text-align: center;
  color: var(--text); max-width: 92px; padding: 0 4px; border-radius: 3px;
  word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fi.sel .fi-img { background: var(--sel-bg); }
.fi.sel .fi-label { background: var(--accent); color: #fff; }
.window.blurred .fi.sel .fi-label { background: rgba(120,120,128,0.4); }
.fi input.fi-rename {
  margin-top: 3px; width: 92px; font-size: 12px; text-align: center;
  border: none; outline: none; border-radius: 3px;
  background: var(--field-bg); color: var(--text);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent);
}

/* list view */
.fv-list { flex: 1; overflow: auto; font-size: 13px; }
.fv-list table { width: 100%; border-collapse: collapse; }
.fv-list thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--window-bg);
  font-size: 11px; font-weight: 500; text-align: left; color: var(--text-2);
  padding: 4px 8px; border-bottom: 1px solid var(--window-border);
  white-space: nowrap;
}
.fv-list thead th.sorted { color: var(--text); font-weight: 700; }
.fv-list tbody td { padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.fv-list tbody tr:nth-child(even) { background: var(--hover-fill); }
.fv-list tbody tr.sel { background: var(--accent) !important; color: #fff; }
.fv-list tbody tr.sel .dim { color: rgba(255,255,255,0.7) !important; }
.window.blurred .fv-list tbody tr.sel { background: rgba(120,120,128,0.4) !important; }
.fv-list .cell-name { display: flex; align-items: center; gap: 6px; }
.fv-list .cell-name svg { width: 16px; height: 16px; flex: none; }
.fv-list .dim { color: var(--text-2); }

/* column view */
.fv-cols { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; }
.fv-col { width: 200px; flex: none; border-right: 1px solid var(--window-border); overflow-y: auto; padding: 4px; }
.fv-col .fc-row {
  display: flex; align-items: center; gap: 6px;
  padding: 2.5px 6px; border-radius: 5px; font-size: 13px;
  white-space: nowrap; overflow: hidden;
}
.fv-col .fc-row svg { width: 16px; height: 16px; flex: none; }
.fv-col .fc-row .fc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.fv-col .fc-row .fc-arrow { color: var(--text-3); font-size: 10px; }
.fv-col .fc-row.sel { background: var(--accent); color: #fff; }
.fv-col .fc-row.sel .fc-arrow { color: rgba(255,255,255,0.8); }
.fv-preview { width: 240px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 26px 16px; gap: 4px; }
.fv-preview svg { width: 110px; height: 110px; }
.fv-preview .pv-name { font-size: 14px; font-weight: 600; text-align: center; word-break: break-word; }
.fv-preview .pv-kind { font-size: 11px; color: var(--text-2); margin-bottom: 8px; }
.fv-preview .pv-rows { width: 100%; font-size: 11px; }
.fv-preview .pv-rows > div { display: flex; justify-content: space-between; padding: 2px 0; }
.fv-preview .pv-rows span:first-child { color: var(--text-2); }

.finder-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 17px; font-weight: 600; }

/* path bar + status */
.finder-pathbar {
  flex: none; height: 24px; display: flex; align-items: center;
  padding: 0 8px; gap: 2px;
  border-top: 1px solid var(--window-border);
  font-size: 11px; color: var(--text-2);
  overflow: hidden; white-space: nowrap;
}
.finder-pathbar .pb-item { display: flex; align-items: center; gap: 4px; padding: 1px 3px; border-radius: 3px; }
.finder-pathbar .pb-item:hover { background: var(--hover-fill); }
.finder-pathbar .pb-item svg { width: 13px; height: 13px; }
.finder-pathbar .pb-sep { color: var(--text-3); font-size: 9px; }

.finder-search { position: relative; margin-left: auto; }
.finder-search input {
  width: 150px; height: 22px; border-radius: 6px;
  border: 0.5px solid var(--control-border);
  background: var(--field-bg); color: var(--text);
  font-size: 12px; padding: 0 6px 0 22px; outline: none;
  transition: width 0.2s;
}
.finder-search input:focus { width: 190px; box-shadow: 0 0 0 3px var(--accent-ring); border-color: var(--accent); }
.finder-search svg { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; color: var(--text-3); pointer-events: none; }

/* Get info */
.getinfo-body { padding: 0; font-size: 12px; }
.gi-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.gi-head svg { width: 34px; height: 34px; flex: none; }
.gi-head .gi-name { font-size: 13px; font-weight: 700; }
.gi-head .gi-sub { font-size: 11px; color: var(--text-2); }
.gi-sec { border-top: 1px solid var(--window-border); padding: 8px 14px; }
.gi-sec-title { font-weight: 700; font-size: 12px; margin-bottom: 5px; }
.gi-row { display: flex; padding: 1.5px 0; }
.gi-row span:first-child { width: 84px; color: var(--text-2); text-align: right; padding-right: 8px; flex: none; }
.gi-row span:last-child { word-break: break-word; }

/* Quick Look */
.ql-body { display: flex; flex-direction: column; align-items: stretch; }
.ql-content { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; }
.ql-text { align-items: stretch; justify-content: flex-start; padding: 22px 26px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; user-select: text; background: #fff; color: #1d1d1f; display: block; }
body.dark .ql-text { background: #1e1e1e; color: #eee; }
.ql-imgwrap { padding: 10px; } .ql-imgwrap img { max-width: 100%; max-height: 100%; border-radius: 4px; }
.ql-generic { flex-direction: column; gap: 10px; color: var(--text-2); }
.ql-generic svg { width: 120px; height: 120px; }

/* ================= TextEdit ================= */
.te-ruler { flex: none; height: 18px; border-bottom: 1px solid var(--window-border); background: var(--titlebar-bg);
  background-image: repeating-linear-gradient(90deg, var(--text-3) 0 1px, transparent 1px 24px); background-position: 8px bottom; background-size: auto 5px; background-repeat: repeat-x; }
.te-area {
  flex: 1; overflow-y: auto; outline: none;
  background: #fff; color: #000;
  padding: 12px 16px; font-size: 14px; line-height: 1.45;
}
body.dark .te-area { background: #1e1e1e; color: #ddd; }

/* ================= Notes ================= */
.notes-list { width: 210px; flex: none; border-right: 1px solid var(--window-border); overflow-y: auto; background: var(--window-bg); }
.note-cell { padding: 9px 14px 9px 22px; border-radius: 8px; margin: 2px 6px; position: relative; }
.note-cell .nc-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-cell .nc-sub { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.note-cell .nc-sub b { color: var(--text); font-weight: 400; margin-right: 6px; }
.note-cell.sel { background: #ffd60a33; }
.note-cell.sel::before { content: ""; position: absolute; left: 8px; top: 12px; bottom: 12px; width: 3px; }
.notes-editor { flex: 1; display: flex; flex-direction: column; background: #fff; }
body.dark .notes-editor { background: #1e1e1e; }
.notes-date { text-align: center; font-size: 11px; color: var(--text-3); padding: 10px 0 0; background: inherit; }
.notes-area { flex: 1; overflow-y: auto; outline: none; padding: 8px 22px 20px; font-size: 14px; line-height: 1.5; color: #1d1d1f; }
body.dark .notes-area { color: #e8e8e8; }
.notes-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 15px; }

/* ================= Calculator ================= */
.calc-body { display: flex; flex-direction: column; background: rgba(41, 41, 46, 0.94); border-radius: 0 0 11px 11px; }
.calc-display {
  flex: none; color: #fff; text-align: right;
  padding: 8px 16px 4px; font-weight: 300;
  white-space: nowrap; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: flex-end;
  height: 74px; font-variant-numeric: tabular-nums;
}
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; padding: 1px; flex: 1; }
.calc-btn {
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff;
  background: #5c5c60; border-radius: 0;
  min-height: 47px;
}
.calc-btn.fn { background: #47474b; font-size: 17px; }
.calc-btn.op { background: #ff9f0a; font-size: 23px; }
.calc-btn.op.active-op { background: #fff; color: #ff9f0a; }
.calc-btn.zero { grid-column: span 2; }
.calc-btn:active { filter: brightness(1.35); }
.calc-btn.op:active { filter: brightness(1.15); }

/* ================= Safari ================= */
.saf-nav { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; padding-right: 8px; }
.saf-url-wrap { flex: 1; display: flex; justify-content: center; min-width: 0; padding: 0 6px; }
.saf-url {
  width: 100%; max-width: 460px; height: 28px;
  border-radius: 8px; border: none; outline: none;
  background: var(--hover-fill);
  color: var(--text); font-size: 13px; text-align: center;
  position: relative; padding: 0 26px;
}
.saf-url:focus { background: var(--field-bg); box-shadow: 0 0 0 3px var(--accent-ring), 0 0 0 0.5px var(--control-border); text-align: left; }
.saf-url-box { position: relative; width: 100%; max-width: 460px; }
.saf-url-box .su-lock { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 11px; height: 11px; color: var(--text-2); pointer-events: none; }
.saf-url-box .su-refresh { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--text-2); }
.saf-url-box .su-refresh:hover { background: var(--hover-fill); }
.saf-url-box .su-refresh svg { width: 12px; height: 12px; }
.saf-url-box .su-progress { position: absolute; left: 0; bottom: 0; height: 2.5px; background: var(--accent); width: 0%; border-radius: 2px; transition: width 0.24s ease; }

.saf-tabs { flex: none; display: flex; align-items: stretch; height: 28px; border-top: 1px solid var(--window-border); background: var(--titlebar-bg); }
.saf-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; color: var(--text-2); border-right: 1px solid var(--window-border);
  min-width: 0; padding: 0 22px; position: relative;
}
.saf-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saf-tab.on { background: var(--window-bg); color: var(--text); }
.saf-tab .st-close { position: absolute; left: 5px; width: 16px; height: 16px; border-radius: 4px; display: none; align-items: center; justify-content: center; font-size: 11px; }
.saf-tab:hover .st-close { display: flex; }
.saf-tab .st-close:hover { background: var(--hover-fill); }

.saf-page { flex: 1; overflow-y: auto; background: #fff; position: relative; }
body.dark .saf-page { background: #1c1c1e; }
.saf-page * { cursor: default; }
.saf-page a, .saf-page .link { cursor: pointer; }

/* Safari start page */
.saf-start { min-height: 100%; padding: 46px 60px; background: linear-gradient(180deg, #f3f4f8, #e9ebf2); }
body.dark .saf-start { background: linear-gradient(180deg, #232326, #1b1b1e); }
.saf-start h2 { font-size: 21px; color: var(--text); margin: 18px 0 14px; }
.saf-favs { display: grid; grid-template-columns: repeat(auto-fill, 76px); gap: 18px 14px; }
.saf-fav { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.saf-fav .sf-tile {
  width: 64px; height: 64px; border-radius: 14px;
  background: #fff; box-shadow: 0 2px 9px rgba(0,0,0,0.12), 0 0 0 0.5px rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 25px; font-weight: 700;
}
body.dark .saf-fav .sf-tile { background: #333336; }
.saf-fav:hover .sf-tile { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0,0,0,0.18); }
.saf-fav span { font-size: 11px; color: var(--text-2); max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saf-privacy {
  margin-top: 34px; border-radius: 12px; padding: 14px 16px;
  background: rgba(255,255,255,0.65); box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  display: flex; gap: 12px; align-items: center; max-width: 560px;
  font-size: 12px; color: var(--text-2);
}
body.dark .saf-privacy { background: rgba(255,255,255,0.07); }
.saf-privacy b { color: var(--text); display: block; font-size: 13px; margin-bottom: 2px; }
.saf-privacy .shield { width: 34px; height: 34px; flex: none; color: var(--accent); }

/* Safari internal pages */
.web-page { padding: 0; min-height: 100%; user-select: text; }
.web-err { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; }
.web-err h1 { font-size: 21px; color: var(--text); margin-bottom: 10px; font-weight: 700; }
.web-err p { font-size: 13px; color: var(--text-2); max-width: 420px; line-height: 1.5; }

/* ================= Terminal ================= */
.term-body {
  flex: 1; overflow-y: auto;
  background: rgba(24, 24, 27, 0.86);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  font-family: var(--mono); font-size: 12px; line-height: 1.45;
  color: #e8e8e8; padding: 6px 8px;
  border-radius: 0 0 11px 11px;
  user-select: text; cursor: text;
}
.term-body .t-line { white-space: pre-wrap; word-break: break-all; min-height: 17px; }
.term-body .t-prompt { color: #e8e8e8; }
.term-body .t-in { display: inline; }
.term-caret {
  display: inline-block; width: 7px; height: 14px; vertical-align: -2px;
  background: #b7b7b9;
}
.window.focused .term-caret { animation: caret-blink 1.1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.window.blurred .term-caret { background: transparent; box-shadow: inset 0 0 0 1px #8a8a8c; }
.term-green { color: #78d95e; } .term-cyan { color: #6ac8f0; } .term-yellow { color: #e5c07b; } .term-red { color: #ef6b73; } .term-dim { color: #9a9a9e; }

/* ================= System Settings ================= */
.st-side { width: 216px; padding: 8px; overflow-y: auto; }
.st-search { position: relative; margin: 2px 4px 10px; }
.st-search input {
  width: 100%; height: 24px; border-radius: 7px; border: 0.5px solid var(--control-border);
  background: var(--field-bg); font-size: 12px; padding: 0 8px 0 24px; outline: none; color: var(--text);
}
.st-search svg { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; color: var(--text-3); }
.st-profile { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; margin-bottom: 8px; }
.st-profile .avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(160deg, #6ab1f7, #2d63d8); position: relative; overflow: hidden; flex: none; }
.st-profile .avatar::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 34%, #fff 7px, transparent 7.4px), radial-gradient(ellipse 13px 8px at 50% 76%, #fff 98%, transparent 100%); }
.st-profile b { font-size: 13px; display: block; }
.st-profile span { font-size: 11px; color: var(--text-2); }
.st-item {
  display: flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 8px; border-radius: 6px; font-size: 13px;
}
.st-item .st-ic {
  width: 19px; height: 19px; border-radius: 5px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 0.5px 1px rgba(0,0,0,0.25);
}
.st-item .st-ic svg { width: 12px; height: 12px; }
.st-item.sel { background: var(--accent); color: #fff; }
.st-gap { height: 12px; }

.st-pane { flex: 1; overflow-y: auto; padding: 14px 22px 30px; }
.st-pane h1 { font-size: 21px; font-weight: 700; margin: 4px 0 16px; }
.st-card {
  background: var(--control-bg);
  border-radius: 10px; margin-bottom: 16px;
  box-shadow: 0 0 0 0.5px var(--control-border), 0 1px 2px rgba(0,0,0,0.05);
  overflow: hidden;
}
body.dark .st-card { background: rgba(255,255,255,0.06); }
.st-row {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 40px; padding: 8px 14px; gap: 14px;
  font-size: 13px;
}
.st-row + .st-row { border-top: 0.5px solid var(--control-border); }
.st-row .st-lab b { font-weight: 400; display: block; }
.st-row .st-lab span { font-size: 11px; color: var(--text-2); display: block; margin-top: 1px; max-width: 330px; }
.st-row .st-val { color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.st-note { font-size: 11px; color: var(--text-2); margin: -8px 4px 16px; line-height: 1.4; }

.appear-opts { display: flex; gap: 14px; }
.appear-opt { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; color: var(--text-2); }
.appear-opt .ao-prev {
  width: 66px; height: 44px; border-radius: 8px; overflow: hidden; position: relative;
  box-shadow: 0 0 0 0.5px var(--control-border), 0 1px 4px rgba(0,0,0,0.15);
}
.appear-opt.sel .ao-prev { box-shadow: 0 0 0 3px var(--accent); }
.ao-prev .ao-bg { position: absolute; inset: 0; }
.ao-prev .ao-win { position: absolute; left: 10px; top: 12px; right: 10px; bottom: 0; border-radius: 5px 5px 0 0; }
.ao-prev .ao-dots { position: absolute; left: 14px; top: 16px; display: flex; gap: 2.5px; }
.ao-prev .ao-dots i { width: 3.5px; height: 3.5px; border-radius: 50%; display: block; }

.accent-dots { display: flex; gap: 9px; }
.accent-dot { width: 17px; height: 17px; border-radius: 50%; position: relative; box-shadow: inset 0 0 1.5px rgba(0,0,0,0.3); }
.accent-dot.sel::after { content: ""; position: absolute; inset: 4.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 2px rgba(0,0,0,0.4); }

.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, 128px); gap: 14px; }
.wall-thumb { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-2); text-align: center; }
.wall-thumb .wt-img { width: 128px; height: 80px; border-radius: 8px; background-size: cover; background-position: center; box-shadow: 0 0 0 0.5px var(--control-border), 0 2px 6px rgba(0,0,0,0.15); }
.wall-thumb.sel .wt-img { box-shadow: 0 0 0 3px var(--accent), 0 2px 6px rgba(0,0,0,0.15); }

.st-slider-row { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 300px; }
.st-slider-row svg { width: 15px; height: 15px; color: var(--text-2); flex: none; }
.st-slider-row .mac-slider { flex: 1; }

.batt-chart { display: flex; align-items: flex-end; gap: 3px; height: 70px; padding: 10px 14px 6px; }
.batt-chart i { flex: 1; background: #34c75988; border-radius: 2px 2px 0 0; display: block; }
.wifi-net { display: flex; align-items: center; gap: 8px; }
.wifi-net svg { width: 15px; height: 15px; }

/* ================= About This Mac ================= */
.about-body {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 30px 22px; gap: 2px;
  background: var(--window-bg);
  border-radius: 0 0 11px 11px;
}
.about-laptop { width: 140px; height: 84px; margin-bottom: 14px; position: relative; }
.about-laptop .al-screen {
  position: absolute; left: 18px; right: 18px; top: 0; height: 68px;
  border-radius: 6px 6px 0 0; background: #1a1a1c;
  border: 3px solid #b8bcc4; border-bottom: none;
  background-clip: padding-box; overflow: hidden;
}
.about-laptop .al-wall { position: absolute; inset: 0; background-size: cover; background-position: center; }
.about-laptop .al-base { position: absolute; left: 0; right: 0; top: 68px; height: 7px; background: linear-gradient(#d4d8de, #a9adb5); border-radius: 2px 2px 8px 8px; }
.about-laptop .al-notch { position: absolute; top: 68px; left: 50%; transform: translateX(-50%); width: 26px; height: 3px; background: #90949c; border-radius: 0 0 5px 5px; }
.about-title { font-size: 19px; font-weight: 700; margin-top: 4px; }
.about-sub { font-size: 12px; color: var(--text-2); margin-bottom: 12px; }
.about-rows { font-size: 12px; width: 100%; margin-bottom: 14px; }
.about-rows > div { display: flex; justify-content: center; gap: 6px; padding: 2px 0; }
.about-rows span:first-child { color: var(--text-2); text-align: right; width: 46%; }
.about-rows span:last-child { text-align: left; width: 54%; }
.about-foot { font-size: 10px; color: var(--text-3); margin-top: 12px; text-align: center; line-height: 1.5; }
